app.js 4.3 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853121854121855121856121857121858121859121860121861121862121863121864121865121866121867121868121869121870121871121872121873121874121875121876121877121878121879121880121881121882121883121884121885121886121887121888121889121890121891121892121893121894121895121896121897121898121899121900121901121902121903121904121905121906121907121908121909121910121911121912121913121914121915121916121917121918121919121920121921121922121923121924121925121926121927121928121929121930121931121932121933121934121935121936121937121938121939121940121941121942121943121944121945121946121947121948121949121950121951121952121953121954121955121956121957121958121959121960121961121962121963121964121965121966121967121968121969121970121971121972121973121974121975121976121977121978121979121980121981121982121983121984121985121986121987121988121989121990121991121992121993121994121995121996121997121998121999122000122001122002122003122004122005122006122007122008122009122010122011122012122013122014122015122016122017122018122019122020122021122022122023122024122025122026122027122028122029122030122031122032122033122034122035122036122037122038122039122040122041122042122043122044122045122046122047122048122049122050122051122052122053122054122055122056122057122058122059122060122061122062122063122064122065122066122067122068122069122070122071122072122073122074122075122076122077122078122079122080122081122082122083122084122085122086122087122088122089122090122091122092122093122094122095122096122097122098122099122100122101122102122103122104122105122106122107122108122109122110122111122112122113122114122115122116122117122118122119122120122121122122122123122124122125122126122127122128122129122130122131122132122133122134122135122136122137122138122139122140122141122142122143122144122145122146122147122148122149122150122151122152122153122154122155122156122157122158122159122160122161122162122163122164122165122166122167122168122169122170122171122172122173122174122175122176122177122178122179122180122181122182122183122184122185122186122187122188122189122190122191122192122193122194122195122196122197122198122199122200122201122202122203122204122205122206122207122208122209122210122211122212122213122214122215122216122217122218122219122220122221122222122223122224122225122226122227122228122229122230122231122232122233122234122235122236122237122238122239122240122241122242122243122244122245122246122247122248122249122250122251122252122253122254122255122256122257122258122259122260122261122262122263122264122265122266122267122268122269122270122271122272122273122274122275122276122277122278122279122280122281122282122283122284122285122286122287122288122289122290122291122292122293122294122295122296122297122298122299122300122301122302122303122304122305122306122307122308122309122310122311122312122313122314122315122316122317122318122319122320122321122322122323122324122325122326122327122328122329122330122331122332122333122334122335122336122337122338122339122340122341122342122343122344122345122346122347122348122349122350122351122352122353122354122355122356122357122358122359122360122361122362122363122364122365122366122367122368122369122370122371122372122373122374122375122376122377122378122379122380122381122382122383122384122385122386122387122388122389122390122391122392122393122394122395122396122397122398122399122400122401122402122403122404122405122406122407122408122409122410122411122412122413122414122415122416122417122418122419122420122421122422122423122424122425122426122427122428122429122430122431122432122433122434122435122436122437122438122439122440122441122442122443122444122445122446122447122448122449122450122451122452122453122454122455122456122457122458122459122460122461122462122463122464122465122466122467122468122469122470122471122472122473122474122475122476122477122478122479122480122481122482122483122484122485122486122487122488122489122490122491122492122493122494122495122496122497122498122499122500122501122502122503122504122505122506122507122508122509122510122511122512122513122514122515122516122517122518122519122520122521122522122523122524122525122526122527122528122529122530122531122532122533122534122535122536122537122538122539122540122541122542122543122544122545122546122547122548122549122550122551122552122553122554122555122556122557122558122559122560122561122562122563122564122565122566122567122568122569122570122571122572122573122574122575122576122577122578122579122580122581122582122583122584122585122586122587122588122589122590122591122592122593122594122595122596122597122598122599122600122601122602122603122604122605122606122607122608122609122610122611122612122613122614122615122616122617122618122619122620122621122622122623122624122625122626122627122628122629122630122631122632122633122634122635122636122637122638122639122640122641122642122643122644122645122646122647122648122649122650122651122652122653122654122655122656122657122658122659122660122661122662122663122664122665122666122667122668122669122670122671122672122673122674122675122676122677122678122679122680122681122682122683122684122685122686122687122688122689122690122691122692122693122694122695122696122697122698122699122700122701122702122703122704122705122706122707122708122709122710122711122712122713122714122715122716122717122718122719122720122721122722122723122724122725122726122727122728122729122730122731122732122733122734122735122736122737122738122739122740122741122742122743122744122745122746122747122748122749122750122751122752122753122754122755122756122757122758122759122760122761122762122763122764122765122766122767122768122769122770122771122772122773122774122775122776122777122778122779122780122781122782122783122784122785122786122787122788122789122790122791122792122793122794122795122796122797122798122799122800122801122802122803122804122805122806122807122808122809122810122811122812122813122814122815122816122817122818122819122820122821122822122823122824122825122826122827122828122829122830122831122832122833122834122835122836122837122838122839122840122841122842122843122844122845122846122847122848122849122850122851122852122853122854122855122856122857122858122859122860122861122862122863122864122865122866122867122868122869122870122871122872122873122874122875122876122877122878122879122880122881122882122883122884122885122886122887122888122889122890122891122892122893122894122895122896122897122898122899122900122901122902122903122904122905122906122907122908122909122910122911122912122913122914122915122916122917122918122919122920122921122922122923122924122925122926122927122928122929122930122931122932122933122934122935122936122937122938122939122940122941122942122943122944122945122946122947122948122949122950122951122952122953122954122955122956122957122958122959122960122961122962122963122964122965122966122967122968122969122970122971122972122973122974122975122976122977122978122979122980122981122982122983122984122985122986122987122988122989122990122991122992122993122994122995122996122997122998122999123000123001123002123003123004123005123006123007123008123009123010123011123012123013123014123015123016123017123018123019123020123021123022123023123024123025123026123027123028123029123030123031123032123033123034123035123036123037123038123039123040123041123042123043123044123045123046123047123048123049123050123051123052123053123054123055123056123057123058123059123060123061123062123063123064123065123066123067123068123069123070123071123072123073123074123075123076123077123078123079123080123081123082123083123084123085123086123087123088123089123090123091123092123093123094123095123096123097123098123099123100123101123102123103123104123105123106123107123108123109123110123111123112123113123114123115123116123117123118123119123120123121123122123123123124123125123126123127123128123129123130123131123132123133123134123135123136123137123138123139123140123141123142123143123144123145123146123147123148123149123150123151123152123153123154123155123156123157123158123159123160123161123162123163123164123165123166123167123168123169123170123171123172123173123174123175123176123177123178123179123180123181123182123183123184123185123186123187123188123189123190123191123192123193123194123195123196123197123198123199123200123201123202123203123204123205123206123207123208123209123210123211123212123213123214123215123216123217123218123219123220123221123222123223123224123225123226123227123228123229123230123231123232123233123234123235123236123237123238123239123240123241123242123243123244123245123246123247123248123249123250123251123252123253123254123255123256123257123258123259123260123261123262123263123264123265123266123267123268123269123270123271123272123273123274123275123276123277123278123279123280123281123282123283123284123285123286123287123288123289123290123291123292123293123294123295123296123297123298123299123300123301123302123303123304123305123306123307123308123309123310123311123312123313123314123315123316123317123318123319123320123321123322123323123324123325123326123327123328123329123330123331123332123333123334123335123336123337123338123339123340123341123342123343123344123345123346123347123348123349123350123351123352123353123354123355123356123357123358123359123360123361123362123363123364123365123366123367123368123369123370123371123372123373123374123375123376123377123378123379123380123381123382123383123384123385123386123387123388123389123390123391123392123393123394123395123396123397123398123399123400123401123402123403123404123405123406123407123408123409123410123411123412123413123414123415123416123417123418123419123420123421123422123423123424123425123426123427123428123429123430123431123432123433123434123435123436123437123438123439123440123441123442123443123444123445123446123447123448123449123450123451123452123453123454123455123456123457123458123459123460123461123462123463123464123465123466123467123468123469123470123471123472123473123474123475123476123477123478123479123480123481123482123483123484123485123486123487123488123489123490123491123492123493123494123495123496123497123498123499123500123501123502123503123504123505123506123507123508123509123510123511123512123513123514123515123516123517123518123519123520123521123522123523123524123525123526123527123528123529123530123531123532123533123534123535123536123537123538123539123540123541123542123543123544123545123546123547123548123549123550123551123552123553123554123555123556123557123558123559123560123561123562123563123564123565123566123567123568123569123570123571123572123573123574123575123576123577123578123579123580123581123582123583123584123585123586123587123588123589123590123591123592123593123594123595123596123597123598123599123600123601123602123603123604123605123606123607123608123609123610123611123612123613123614123615123616123617123618123619123620123621123622123623123624123625123626123627123628123629123630123631123632123633123634123635123636123637123638123639123640123641123642123643123644123645123646123647123648123649123650123651123652123653123654123655123656123657123658123659123660123661123662123663123664123665123666123667123668123669123670123671123672123673123674123675123676123677123678123679123680123681123682123683123684123685123686123687123688123689123690123691123692123693123694123695123696123697123698123699123700123701123702123703123704123705123706123707123708123709123710123711123712123713123714123715123716123717123718123719123720123721123722123723123724123725123726123727123728123729123730123731123732123733123734123735123736123737123738123739123740123741123742123743123744123745123746123747123748123749123750123751123752123753123754123755123756123757123758123759123760123761123762123763123764123765123766123767123768123769123770123771123772123773123774123775123776123777123778123779123780123781123782123783123784123785123786123787123788123789123790123791123792123793123794123795123796123797123798123799123800123801123802123803123804123805123806123807123808123809123810123811123812123813123814123815123816123817123818123819123820123821123822123823123824123825123826123827123828123829123830123831123832123833123834123835123836123837123838123839123840123841123842123843123844123845123846123847123848123849123850123851123852123853123854123855123856123857123858123859123860123861123862123863123864123865123866123867123868123869123870123871123872123873123874123875123876123877123878123879123880123881123882123883123884123885123886123887123888123889123890123891123892123893123894123895123896123897123898123899123900123901123902123903123904123905123906123907123908123909123910123911123912123913123914123915123916123917123918123919123920123921123922123923123924123925123926123927123928123929123930123931123932123933123934123935123936123937123938123939123940123941123942123943123944123945123946123947123948123949123950123951123952123953123954123955123956123957123958123959123960123961123962123963123964123965123966123967123968123969123970123971123972123973123974123975123976123977123978123979123980123981123982123983123984123985123986123987123988123989123990123991123992123993123994123995123996123997123998123999124000124001124002124003124004124005124006124007124008124009124010124011124012124013124014124015124016124017124018124019124020124021124022124023124024124025124026124027124028124029124030124031124032124033124034124035124036124037124038124039124040124041124042124043124044124045124046124047124048124049124050124051124052124053124054124055124056124057124058124059124060124061124062124063124064124065124066124067124068124069124070124071124072124073124074124075124076124077124078124079124080124081124082124083124084124085124086124087124088124089124090124091124092124093124094124095124096124097124098124099124100124101124102124103124104124105124106124107124108124109124110124111124112124113124114124115124116124117124118124119124120124121124122124123124124124125124126124127124128124129124130124131124132124133124134124135124136124137124138124139124140124141124142124143124144124145124146124147124148124149124150124151124152124153124154124155124156124157124158124159124160124161124162124163124164124165124166124167124168124169124170124171124172124173124174124175124176124177124178124179124180124181124182124183124184124185124186124187124188124189124190124191124192124193124194124195124196124197124198124199124200124201124202124203124204124205124206124207124208124209124210124211124212124213124214124215124216124217124218124219124220124221124222124223124224124225124226124227124228124229124230124231124232124233124234124235124236124237124238124239124240124241124242124243124244124245124246124247124248124249124250124251124252124253124254124255124256124257124258124259124260124261124262124263124264124265124266124267124268124269124270124271124272124273124274124275124276124277124278124279124280124281124282124283124284124285124286124287124288124289124290124291124292124293124294124295124296124297124298124299124300124301124302124303124304124305124306124307124308124309124310124311124312124313124314124315124316124317124318124319124320124321124322124323124324124325124326124327124328124329124330124331124332124333124334124335124336124337124338124339124340124341124342124343124344124345124346124347124348124349124350124351124352124353124354124355124356124357124358124359124360124361124362124363124364124365124366124367124368124369124370124371124372124373124374124375124376124377124378124379124380124381124382124383124384124385124386124387124388124389124390124391124392124393124394124395124396124397124398124399124400124401124402124403124404124405124406124407124408124409124410124411124412124413124414124415124416124417124418124419124420124421124422124423124424124425124426124427124428124429124430124431124432124433124434124435124436124437124438124439124440124441124442124443124444124445124446124447124448124449124450124451124452124453124454124455124456124457124458124459124460124461124462124463124464124465124466124467124468124469124470124471124472124473124474124475124476124477124478124479124480124481124482124483124484124485124486124487124488124489124490124491124492124493124494124495124496124497124498124499124500124501124502124503124504124505124506124507124508124509124510124511124512124513124514124515124516124517124518124519124520124521124522124523124524124525124526124527124528124529124530124531124532124533124534124535124536124537124538124539124540124541124542124543124544124545124546124547124548124549124550124551124552124553124554124555124556124557124558124559124560124561124562124563124564124565124566124567124568124569124570124571124572124573124574124575124576124577124578124579124580124581124582124583124584124585124586124587124588124589124590124591124592124593124594124595124596124597124598124599124600124601124602124603124604124605124606124607124608124609124610124611124612124613124614124615124616124617124618124619124620124621124622124623124624124625124626124627124628124629124630124631124632124633124634124635124636124637124638124639124640124641124642124643124644124645124646124647124648124649124650124651124652124653124654124655124656124657124658124659124660124661124662124663124664124665124666124667124668124669124670124671124672124673124674124675124676124677124678124679124680124681124682124683124684124685124686124687124688124689124690124691124692124693124694124695124696124697124698124699124700124701124702124703124704124705124706124707124708124709124710124711124712124713124714124715124716124717124718124719124720124721124722124723124724124725124726124727124728124729124730124731124732124733124734124735124736124737124738124739124740124741124742124743124744124745124746124747124748124749124750124751124752124753124754124755124756124757124758124759124760124761124762124763124764124765124766124767124768124769124770124771124772124773124774124775124776124777124778124779124780124781124782124783124784124785124786124787124788124789124790124791124792124793124794124795124796124797124798124799124800124801124802124803124804124805124806124807124808124809124810124811124812124813124814124815124816124817124818124819124820124821124822124823124824124825124826124827124828124829124830124831124832124833124834124835124836124837124838124839124840124841124842124843124844124845124846124847124848124849124850124851124852124853124854124855124856124857124858124859124860124861124862124863124864124865124866124867124868124869124870124871124872124873124874124875124876124877124878124879124880124881124882124883124884124885124886124887124888124889124890124891124892124893124894124895124896124897124898124899124900124901124902124903124904124905124906124907124908124909124910124911124912124913124914124915124916124917124918124919124920124921124922124923124924124925124926124927124928124929124930124931124932124933124934124935124936124937124938124939124940124941124942124943124944124945124946124947124948124949124950124951124952124953124954124955124956124957124958124959124960124961124962124963124964124965124966124967124968124969124970124971124972124973124974124975124976124977124978124979124980124981124982124983124984124985124986124987124988124989124990124991124992124993124994124995124996124997124998124999125000125001125002125003125004125005125006125007125008125009125010125011125012125013125014125015125016125017125018125019125020125021125022125023125024125025125026125027125028125029125030125031125032125033125034125035125036125037125038125039125040125041125042125043125044125045125046125047125048125049125050125051125052125053125054125055125056125057125058125059125060125061125062125063125064125065125066125067125068125069125070125071125072125073125074125075125076125077125078125079125080125081125082125083125084125085125086125087125088125089125090125091125092125093125094125095125096125097125098125099125100125101125102125103125104125105125106125107125108125109125110125111125112125113125114125115125116125117125118125119125120125121125122125123125124125125125126125127125128125129125130125131125132125133125134125135125136125137125138125139125140125141125142125143125144125145125146125147125148125149125150125151125152125153125154125155125156125157125158125159125160125161125162125163125164125165125166125167125168125169125170125171125172125173125174125175125176125177125178125179125180125181125182125183125184125185125186125187125188125189125190125191125192125193125194125195125196125197125198125199125200125201125202125203125204125205125206125207125208125209125210125211125212125213125214125215125216125217125218125219125220125221125222125223125224125225125226125227125228125229125230125231125232125233125234125235125236125237125238125239125240125241125242125243125244125245125246125247125248125249125250125251125252125253125254125255125256125257125258125259125260125261125262125263125264125265125266125267125268125269125270125271125272125273125274125275125276125277125278125279125280125281125282125283125284125285125286125287125288125289125290125291125292125293125294125295125296125297125298125299125300125301125302125303125304125305125306125307125308125309125310125311125312125313125314125315125316125317125318125319125320125321125322125323125324125325125326125327125328125329125330125331125332125333125334125335125336125337125338125339125340125341125342125343125344125345125346125347125348125349125350125351125352125353125354125355125356125357125358125359125360125361125362125363125364125365125366125367125368125369125370125371125372125373125374125375125376125377125378125379125380125381125382125383125384125385125386125387125388125389125390125391125392125393125394125395125396125397125398125399125400125401125402125403125404125405125406125407125408125409125410125411125412125413125414125415125416125417125418125419125420125421125422125423125424125425125426125427125428125429125430125431125432125433125434125435125436125437125438125439125440125441125442125443125444125445125446125447125448125449125450125451125452125453125454125455125456125457125458125459125460125461125462125463125464125465125466125467125468125469125470125471125472125473125474125475125476125477125478125479125480125481125482125483125484125485125486125487125488125489125490125491125492125493125494125495125496125497125498125499125500125501125502125503125504125505125506125507125508125509125510125511125512125513125514125515125516125517125518125519125520125521125522125523125524125525125526125527125528125529125530125531125532125533125534125535125536125537125538125539125540125541125542125543125544125545125546125547125548125549125550125551125552125553125554125555125556125557125558125559125560125561125562125563125564125565125566125567125568125569125570125571125572125573125574125575125576125577125578125579125580125581125582125583125584125585125586125587125588125589125590125591125592125593125594125595125596125597125598125599125600125601125602125603125604125605125606125607125608125609125610125611125612125613125614125615125616125617125618125619125620125621125622125623125624125625125626125627125628125629125630125631125632125633125634125635125636125637125638125639125640125641125642125643125644125645125646125647125648125649125650125651125652125653125654125655125656125657125658125659125660125661125662125663125664125665125666125667125668125669125670125671125672125673125674125675125676125677125678125679125680125681125682125683125684125685125686125687125688125689125690125691125692125693125694125695125696125697125698125699125700125701125702125703125704125705125706125707125708125709125710125711125712125713125714125715125716125717125718125719125720125721125722125723125724125725125726125727125728125729125730125731125732125733125734125735125736125737125738125739125740125741125742125743125744125745125746125747125748125749125750125751125752125753125754125755125756125757125758125759125760125761125762125763125764125765125766125767125768125769125770125771125772125773125774125775125776125777125778125779125780125781125782125783125784125785125786125787125788125789125790125791125792125793125794125795125796125797125798125799125800125801125802125803125804125805125806125807125808125809125810125811125812125813125814125815125816125817125818125819125820125821125822125823125824125825125826125827125828125829125830125831125832125833125834125835125836125837125838125839125840125841125842125843125844125845125846125847125848125849125850125851125852125853125854125855125856125857125858125859125860125861125862125863125864125865125866125867125868125869125870125871125872125873125874125875125876125877125878125879125880125881125882125883125884125885125886125887125888125889125890125891125892125893125894125895125896125897125898125899125900125901125902125903125904125905125906125907125908125909125910125911125912125913125914125915125916125917125918125919125920125921125922125923125924125925125926125927125928125929125930125931125932125933125934125935125936125937125938125939125940125941125942125943125944125945125946125947125948125949125950125951125952125953125954125955125956125957125958125959125960125961125962125963125964125965125966125967125968125969125970125971125972125973125974125975125976125977125978125979125980125981125982125983125984125985125986125987125988125989125990125991125992125993125994125995125996125997125998125999126000126001126002126003126004126005126006126007126008126009126010126011126012126013126014126015126016126017126018126019126020126021126022126023126024126025126026126027126028126029126030126031126032126033126034126035126036126037126038126039126040126041126042126043126044126045126046126047126048126049126050126051126052126053126054126055126056126057126058126059126060126061126062126063126064126065126066126067126068126069126070126071126072126073126074126075126076126077126078126079126080126081126082126083126084126085126086126087126088126089126090126091126092126093126094126095126096126097126098126099126100126101126102126103126104126105126106126107126108126109126110126111126112126113126114126115126116126117126118126119126120126121126122126123126124126125126126126127126128126129126130126131126132126133126134126135126136126137126138126139126140126141126142126143126144126145126146126147126148126149126150126151126152126153126154126155126156126157126158126159126160126161126162126163126164126165126166126167126168126169126170126171126172126173126174126175126176126177126178126179126180126181126182126183126184126185126186126187126188126189126190126191126192126193126194126195126196126197126198126199126200126201126202126203126204126205126206126207126208126209126210126211126212126213126214126215126216126217126218126219126220126221126222126223126224126225126226126227126228126229126230126231126232126233126234126235126236126237126238126239126240126241126242126243126244126245126246126247126248126249126250126251126252126253126254126255126256126257126258126259126260126261126262126263126264126265126266126267126268126269126270126271126272126273126274126275126276126277126278126279126280126281126282126283126284126285126286126287126288126289126290126291126292126293126294126295126296126297126298126299126300126301126302126303126304126305126306126307126308126309126310126311126312126313126314126315126316126317126318126319126320126321126322126323126324126325126326126327126328126329126330126331126332126333126334126335126336126337126338126339126340126341126342126343126344126345126346126347126348126349126350126351126352126353126354126355126356126357126358126359126360126361126362126363126364126365126366126367126368126369126370126371126372126373126374126375126376126377126378126379126380126381126382126383126384126385126386126387126388126389126390126391126392126393126394126395126396126397126398126399126400126401126402126403126404126405126406126407126408126409126410126411126412126413126414126415126416126417126418126419126420126421126422126423126424126425126426126427126428126429126430126431126432126433126434126435126436126437126438126439126440126441126442126443126444126445126446126447126448126449126450126451126452126453126454126455126456126457126458126459126460126461126462126463126464126465126466126467126468126469126470126471126472126473126474126475126476126477126478126479126480126481126482126483126484126485126486126487126488126489126490126491126492126493126494126495126496126497126498126499126500126501126502126503126504126505126506126507126508126509126510126511126512126513126514126515126516126517126518126519126520126521126522126523126524126525126526126527126528126529126530126531126532126533126534126535126536126537126538126539126540126541126542126543126544126545126546126547126548126549126550126551126552126553126554126555126556126557126558126559126560126561126562126563126564126565126566126567126568126569126570126571126572126573126574126575126576126577126578126579126580126581126582126583126584126585126586126587126588126589126590126591126592126593126594126595126596126597126598126599126600126601126602126603126604126605126606126607126608126609126610126611126612126613126614126615126616126617126618126619126620126621126622126623126624126625126626126627126628126629126630126631126632126633126634126635126636126637126638126639126640126641126642126643126644126645126646126647126648126649126650126651126652126653126654126655126656126657126658126659126660126661126662126663126664126665126666126667126668126669126670126671126672126673126674126675126676126677126678126679126680126681126682126683126684126685126686126687126688126689126690126691126692126693126694126695126696126697126698126699126700126701126702126703126704126705126706126707126708126709126710126711126712126713126714126715126716126717126718126719126720126721126722126723126724126725126726126727126728126729126730126731126732126733126734126735126736126737126738126739126740126741126742126743126744126745126746126747126748126749126750126751126752126753126754126755126756126757126758126759126760126761126762126763126764126765126766126767126768126769126770126771126772126773126774126775126776126777126778126779126780126781126782126783126784126785126786126787126788126789126790126791126792126793126794126795126796126797126798126799126800126801126802126803126804126805126806126807126808126809126810126811126812126813126814126815126816126817126818126819126820126821126822126823126824126825126826126827126828126829126830126831126832126833126834126835126836126837126838126839126840126841126842126843126844126845126846126847126848126849126850126851126852126853126854126855126856126857126858126859126860126861126862126863126864126865126866126867126868126869126870126871126872126873126874126875126876126877126878126879126880126881126882126883126884126885126886126887126888126889126890126891126892126893126894126895126896126897126898126899126900126901126902126903126904126905126906126907126908126909126910126911126912126913126914126915126916126917126918126919126920126921126922126923126924126925126926126927126928126929126930126931126932126933126934126935126936126937126938126939126940126941126942126943126944126945126946126947126948126949126950126951126952126953126954126955126956126957126958126959126960126961126962126963126964126965126966126967126968126969126970126971126972126973126974126975126976126977126978126979126980126981126982126983126984126985126986126987126988126989126990126991126992126993126994126995126996126997126998126999127000127001127002127003127004127005127006127007127008127009127010127011127012127013127014127015127016127017127018127019127020127021127022127023127024127025127026127027127028127029127030127031127032127033127034127035127036127037127038127039127040127041127042127043127044127045127046127047127048127049127050127051127052127053127054127055127056127057127058127059127060127061127062127063127064127065127066127067127068127069127070127071127072127073127074127075127076127077127078127079127080127081127082127083127084127085127086127087127088127089127090127091127092127093127094127095127096127097127098127099127100127101127102127103127104127105127106127107127108127109127110127111127112127113127114127115127116127117127118127119127120127121127122127123127124127125127126127127127128127129127130127131127132127133127134127135127136127137127138127139127140127141127142127143127144127145127146127147127148127149127150127151127152127153127154127155127156127157127158127159127160127161127162127163127164127165127166127167127168127169127170127171127172127173127174127175127176127177127178127179127180127181127182127183127184127185127186127187127188127189127190127191127192127193127194127195127196127197127198127199127200127201127202127203127204127205127206127207127208127209127210127211127212127213127214127215127216127217127218127219127220127221127222127223127224127225127226127227127228127229127230127231127232127233127234127235127236127237127238127239127240127241127242127243127244127245127246127247127248127249127250127251127252127253127254127255127256127257127258127259127260127261127262127263127264127265127266127267127268127269127270127271127272127273127274127275127276127277127278127279127280127281127282127283127284127285127286127287127288127289127290127291127292127293127294127295127296127297127298127299127300127301127302127303127304127305127306127307127308127309127310127311127312127313127314127315127316127317127318127319127320127321127322127323127324127325127326127327127328127329127330127331127332127333127334127335127336127337127338127339127340127341127342127343127344127345127346127347127348127349127350127351127352127353127354127355127356127357127358127359127360127361127362127363127364127365127366127367127368127369127370127371127372127373127374127375127376127377127378127379127380127381127382127383127384127385127386127387127388127389127390127391127392127393127394127395127396127397127398127399127400127401127402127403127404127405127406127407127408127409127410127411127412127413127414127415127416127417127418127419127420127421127422127423127424127425127426127427127428127429127430127431127432127433127434127435127436127437127438127439127440127441127442127443127444127445127446127447127448127449127450127451127452127453127454127455127456127457127458127459127460127461127462127463127464127465127466127467127468127469127470127471127472127473127474127475127476127477127478127479127480127481127482127483127484127485127486127487127488127489127490127491127492127493127494127495127496127497127498127499127500127501127502127503127504127505127506127507127508127509127510127511127512127513127514127515127516127517127518127519127520127521127522127523127524127525127526127527127528127529127530127531127532127533127534127535127536127537127538127539127540127541127542127543127544127545127546127547127548127549127550127551127552127553127554127555127556127557127558127559127560127561127562127563127564127565127566127567127568127569127570127571127572127573127574127575127576127577127578127579127580127581127582127583127584127585127586127587127588127589127590127591127592127593127594127595127596127597127598127599127600127601127602127603127604127605127606127607127608127609127610127611127612127613127614127615127616127617127618127619127620127621127622127623127624127625127626127627127628127629127630127631127632127633127634127635127636127637127638127639127640127641127642127643127644127645127646127647127648127649127650127651127652127653127654127655127656127657127658127659127660127661127662127663127664127665127666127667127668127669127670127671127672127673127674127675127676127677127678127679127680127681127682127683127684127685127686127687127688127689127690127691127692127693127694127695127696127697127698127699127700127701127702127703127704127705127706127707127708127709127710127711127712127713127714127715127716127717127718127719127720127721127722127723127724127725127726127727127728127729127730127731127732127733127734127735127736127737127738127739127740127741127742127743127744127745127746127747127748127749127750127751127752127753127754127755127756127757127758127759127760127761127762127763127764127765127766127767127768127769127770127771127772127773127774127775127776127777127778127779127780127781127782127783127784127785127786127787127788127789127790127791127792127793127794127795127796127797127798127799127800127801127802127803127804127805127806127807127808127809127810127811127812127813127814127815127816127817127818127819127820
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // install a JSONP callback for chunk loading
  3. /******/ var parentJsonpFunction = window["webpackJsonp"];
  4. /******/ window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
  5. /******/ // add "moreModules" to the modules object,
  6. /******/ // then flag all "chunkIds" as loaded and fire callback
  7. /******/ var moduleId, chunkId, i = 0, resolves = [], result;
  8. /******/ for(;i < chunkIds.length; i++) {
  9. /******/ chunkId = chunkIds[i];
  10. /******/ if(installedChunks[chunkId]) {
  11. /******/ resolves.push(installedChunks[chunkId][0]);
  12. /******/ }
  13. /******/ installedChunks[chunkId] = 0;
  14. /******/ }
  15. /******/ for(moduleId in moreModules) {
  16. /******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
  17. /******/ modules[moduleId] = moreModules[moduleId];
  18. /******/ }
  19. /******/ }
  20. /******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
  21. /******/ while(resolves.length) {
  22. /******/ resolves.shift()();
  23. /******/ }
  24. /******/
  25. /******/ };
  26. /******/
  27. /******/ // The module cache
  28. /******/ var installedModules = {};
  29. /******/
  30. /******/ // objects to store loaded and loading chunks
  31. /******/ var installedChunks = {
  32. /******/ 16: 0
  33. /******/ };
  34. /******/
  35. /******/ // The require function
  36. /******/ function __webpack_require__(moduleId) {
  37. /******/
  38. /******/ // Check if module is in cache
  39. /******/ if(installedModules[moduleId]) {
  40. /******/ return installedModules[moduleId].exports;
  41. /******/ }
  42. /******/ // Create a new module (and put it into the cache)
  43. /******/ var module = installedModules[moduleId] = {
  44. /******/ i: moduleId,
  45. /******/ l: false,
  46. /******/ exports: {}
  47. /******/ };
  48. /******/
  49. /******/ // Execute the module function
  50. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  51. /******/
  52. /******/ // Flag the module as loaded
  53. /******/ module.l = true;
  54. /******/
  55. /******/ // Return the exports of the module
  56. /******/ return module.exports;
  57. /******/ }
  58. /******/
  59. /******/ // This file contains only the entry chunk.
  60. /******/ // The chunk loading function for additional chunks
  61. /******/ __webpack_require__.e = function requireEnsure(chunkId) {
  62. /******/ var installedChunkData = installedChunks[chunkId];
  63. /******/ if(installedChunkData === 0) {
  64. /******/ return new Promise(function(resolve) { resolve(); });
  65. /******/ }
  66. /******/
  67. /******/ // a Promise means "currently loading".
  68. /******/ if(installedChunkData) {
  69. /******/ return installedChunkData[2];
  70. /******/ }
  71. /******/
  72. /******/ // setup Promise in chunk cache
  73. /******/ var promise = new Promise(function(resolve, reject) {
  74. /******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
  75. /******/ });
  76. /******/ installedChunkData[2] = promise;
  77. /******/
  78. /******/ // start chunk loading
  79. /******/ var head = document.getElementsByTagName('head')[0];
  80. /******/ var script = document.createElement('script');
  81. /******/ script.type = "text/javascript";
  82. /******/ script.charset = 'utf-8';
  83. /******/ script.async = true;
  84. /******/ script.timeout = 120000;
  85. /******/
  86. /******/ if (__webpack_require__.nc) {
  87. /******/ script.setAttribute("nonce", __webpack_require__.nc);
  88. /******/ }
  89. /******/ script.src = __webpack_require__.p + "js/build/" + ({}[chunkId]||chunkId) + ".js?" + "bab8c234" + "";
  90. /******/ var timeout = setTimeout(onScriptComplete, 120000);
  91. /******/ script.onerror = script.onload = onScriptComplete;
  92. /******/ function onScriptComplete() {
  93. /******/ // avoid mem leaks in IE.
  94. /******/ script.onerror = script.onload = null;
  95. /******/ clearTimeout(timeout);
  96. /******/ var chunk = installedChunks[chunkId];
  97. /******/ if(chunk !== 0) {
  98. /******/ if(chunk) {
  99. /******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
  100. /******/ }
  101. /******/ installedChunks[chunkId] = undefined;
  102. /******/ }
  103. /******/ };
  104. /******/ head.appendChild(script);
  105. /******/
  106. /******/ return promise;
  107. /******/ };
  108. /******/
  109. /******/ // expose the modules object (__webpack_modules__)
  110. /******/ __webpack_require__.m = modules;
  111. /******/
  112. /******/ // expose the module cache
  113. /******/ __webpack_require__.c = installedModules;
  114. /******/
  115. /******/ // define getter function for harmony exports
  116. /******/ __webpack_require__.d = function(exports, name, getter) {
  117. /******/ if(!__webpack_require__.o(exports, name)) {
  118. /******/ Object.defineProperty(exports, name, {
  119. /******/ configurable: false,
  120. /******/ enumerable: true,
  121. /******/ get: getter
  122. /******/ });
  123. /******/ }
  124. /******/ };
  125. /******/
  126. /******/ // getDefaultExport function for compatibility with non-harmony modules
  127. /******/ __webpack_require__.n = function(module) {
  128. /******/ var getter = module && module.__esModule ?
  129. /******/ function getDefault() { return module['default']; } :
  130. /******/ function getModuleExports() { return module; };
  131. /******/ __webpack_require__.d(getter, 'a', getter);
  132. /******/ return getter;
  133. /******/ };
  134. /******/
  135. /******/ // Object.prototype.hasOwnProperty.call
  136. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  137. /******/
  138. /******/ // __webpack_public_path__
  139. /******/ __webpack_require__.p = "/";
  140. /******/
  141. /******/ // on error function for async loading
  142. /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
  143. /******/
  144. /******/ // Load entry module and return exports
  145. /******/ return __webpack_require__(__webpack_require__.s = 66);
  146. /******/ })
  147. /************************************************************************/
  148. /******/ ([
  149. /* 0 */
  150. /***/ (function(module, exports) {
  151. /*
  152. MIT License http://www.opensource.org/licenses/mit-license.php
  153. Author Tobias Koppers @sokra
  154. */
  155. // css base code, injected by the css-loader
  156. module.exports = function(useSourceMap) {
  157. var list = [];
  158. // return the list of modules as css string
  159. list.toString = function toString() {
  160. return this.map(function (item) {
  161. var content = cssWithMappingToString(item, useSourceMap);
  162. if(item[2]) {
  163. return "@media " + item[2] + "{" + content + "}";
  164. } else {
  165. return content;
  166. }
  167. }).join("");
  168. };
  169. // import a list of modules into the list
  170. list.i = function(modules, mediaQuery) {
  171. if(typeof modules === "string")
  172. modules = [[null, modules, ""]];
  173. var alreadyImportedModules = {};
  174. for(var i = 0; i < this.length; i++) {
  175. var id = this[i][0];
  176. if(typeof id === "number")
  177. alreadyImportedModules[id] = true;
  178. }
  179. for(i = 0; i < modules.length; i++) {
  180. var item = modules[i];
  181. // skip already imported module
  182. // this implementation is not 100% perfect for weird media query combinations
  183. // when a module is imported multiple times with different media queries.
  184. // I hope this will never occur (Hey this way we have smaller bundles)
  185. if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
  186. if(mediaQuery && !item[2]) {
  187. item[2] = mediaQuery;
  188. } else if(mediaQuery) {
  189. item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
  190. }
  191. list.push(item);
  192. }
  193. }
  194. };
  195. return list;
  196. };
  197. function cssWithMappingToString(item, useSourceMap) {
  198. var content = item[1] || '';
  199. var cssMapping = item[3];
  200. if (!cssMapping) {
  201. return content;
  202. }
  203. if (useSourceMap && typeof btoa === 'function') {
  204. var sourceMapping = toComment(cssMapping);
  205. var sourceURLs = cssMapping.sources.map(function (source) {
  206. return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'
  207. });
  208. return [content].concat(sourceURLs).concat([sourceMapping]).join('\n');
  209. }
  210. return [content].join('\n');
  211. }
  212. // Adapted from convert-source-map (MIT)
  213. function toComment(sourceMap) {
  214. // eslint-disable-next-line no-undef
  215. var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));
  216. var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64;
  217. return '/*# ' + data + ' */';
  218. }
  219. /***/ }),
  220. /* 1 */
  221. /***/ (function(module, exports, __webpack_require__) {
  222. /*
  223. MIT License http://www.opensource.org/licenses/mit-license.php
  224. Author Tobias Koppers @sokra
  225. Modified by Evan You @yyx990803
  226. */
  227. var hasDocument = typeof document !== 'undefined'
  228. if (typeof DEBUG !== 'undefined' && DEBUG) {
  229. if (!hasDocument) {
  230. throw new Error(
  231. 'vue-style-loader cannot be used in a non-browser environment. ' +
  232. "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
  233. ) }
  234. }
  235. var listToStyles = __webpack_require__(73)
  236. /*
  237. type StyleObject = {
  238. id: number;
  239. parts: Array<StyleObjectPart>
  240. }
  241. type StyleObjectPart = {
  242. css: string;
  243. media: string;
  244. sourceMap: ?string
  245. }
  246. */
  247. var stylesInDom = {/*
  248. [id: number]: {
  249. id: number,
  250. refs: number,
  251. parts: Array<(obj?: StyleObjectPart) => void>
  252. }
  253. */}
  254. var head = hasDocument && (document.head || document.getElementsByTagName('head')[0])
  255. var singletonElement = null
  256. var singletonCounter = 0
  257. var isProduction = false
  258. var noop = function () {}
  259. var options = null
  260. var ssrIdKey = 'data-vue-ssr-id'
  261. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  262. // tags it will allow on a page
  263. var isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\b/.test(navigator.userAgent.toLowerCase())
  264. module.exports = function (parentId, list, _isProduction, _options) {
  265. isProduction = _isProduction
  266. options = _options || {}
  267. var styles = listToStyles(parentId, list)
  268. addStylesToDom(styles)
  269. return function update (newList) {
  270. var mayRemove = []
  271. for (var i = 0; i < styles.length; i++) {
  272. var item = styles[i]
  273. var domStyle = stylesInDom[item.id]
  274. domStyle.refs--
  275. mayRemove.push(domStyle)
  276. }
  277. if (newList) {
  278. styles = listToStyles(parentId, newList)
  279. addStylesToDom(styles)
  280. } else {
  281. styles = []
  282. }
  283. for (var i = 0; i < mayRemove.length; i++) {
  284. var domStyle = mayRemove[i]
  285. if (domStyle.refs === 0) {
  286. for (var j = 0; j < domStyle.parts.length; j++) {
  287. domStyle.parts[j]()
  288. }
  289. delete stylesInDom[domStyle.id]
  290. }
  291. }
  292. }
  293. }
  294. function addStylesToDom (styles /* Array<StyleObject> */) {
  295. for (var i = 0; i < styles.length; i++) {
  296. var item = styles[i]
  297. var domStyle = stylesInDom[item.id]
  298. if (domStyle) {
  299. domStyle.refs++
  300. for (var j = 0; j < domStyle.parts.length; j++) {
  301. domStyle.parts[j](item.parts[j])
  302. }
  303. for (; j < item.parts.length; j++) {
  304. domStyle.parts.push(addStyle(item.parts[j]))
  305. }
  306. if (domStyle.parts.length > item.parts.length) {
  307. domStyle.parts.length = item.parts.length
  308. }
  309. } else {
  310. var parts = []
  311. for (var j = 0; j < item.parts.length; j++) {
  312. parts.push(addStyle(item.parts[j]))
  313. }
  314. stylesInDom[item.id] = { id: item.id, refs: 1, parts: parts }
  315. }
  316. }
  317. }
  318. function createStyleElement () {
  319. var styleElement = document.createElement('style')
  320. styleElement.type = 'text/css'
  321. head.appendChild(styleElement)
  322. return styleElement
  323. }
  324. function addStyle (obj /* StyleObjectPart */) {
  325. var update, remove
  326. var styleElement = document.querySelector('style[' + ssrIdKey + '~="' + obj.id + '"]')
  327. if (styleElement) {
  328. if (isProduction) {
  329. // has SSR styles and in production mode.
  330. // simply do nothing.
  331. return noop
  332. } else {
  333. // has SSR styles but in dev mode.
  334. // for some reason Chrome can't handle source map in server-rendered
  335. // style tags - source maps in <style> only works if the style tag is
  336. // created and inserted dynamically. So we remove the server rendered
  337. // styles and inject new ones.
  338. styleElement.parentNode.removeChild(styleElement)
  339. }
  340. }
  341. if (isOldIE) {
  342. // use singleton mode for IE9.
  343. var styleIndex = singletonCounter++
  344. styleElement = singletonElement || (singletonElement = createStyleElement())
  345. update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
  346. remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  347. } else {
  348. // use multi-style-tag mode in all other cases
  349. styleElement = createStyleElement()
  350. update = applyToTag.bind(null, styleElement)
  351. remove = function () {
  352. styleElement.parentNode.removeChild(styleElement)
  353. }
  354. }
  355. update(obj)
  356. return function updateStyle (newObj /* StyleObjectPart */) {
  357. if (newObj) {
  358. if (newObj.css === obj.css &&
  359. newObj.media === obj.media &&
  360. newObj.sourceMap === obj.sourceMap) {
  361. return
  362. }
  363. update(obj = newObj)
  364. } else {
  365. remove()
  366. }
  367. }
  368. }
  369. var replaceText = (function () {
  370. var textStore = []
  371. return function (index, replacement) {
  372. textStore[index] = replacement
  373. return textStore.filter(Boolean).join('\n')
  374. }
  375. })()
  376. function applyToSingletonTag (styleElement, index, remove, obj) {
  377. var css = remove ? '' : obj.css
  378. if (styleElement.styleSheet) {
  379. styleElement.styleSheet.cssText = replaceText(index, css)
  380. } else {
  381. var cssNode = document.createTextNode(css)
  382. var childNodes = styleElement.childNodes
  383. if (childNodes[index]) styleElement.removeChild(childNodes[index])
  384. if (childNodes.length) {
  385. styleElement.insertBefore(cssNode, childNodes[index])
  386. } else {
  387. styleElement.appendChild(cssNode)
  388. }
  389. }
  390. }
  391. function applyToTag (styleElement, obj) {
  392. var css = obj.css
  393. var media = obj.media
  394. var sourceMap = obj.sourceMap
  395. if (media) {
  396. styleElement.setAttribute('media', media)
  397. }
  398. if (options.ssrId) {
  399. styleElement.setAttribute(ssrIdKey, obj.id)
  400. }
  401. if (sourceMap) {
  402. // https://developer.chrome.com/devtools/docs/javascript-debugging
  403. // this makes source maps inside style tags work properly in Chrome
  404. css += '\n/*# sourceURL=' + sourceMap.sources[0] + ' */'
  405. // http://stackoverflow.com/a/26603875
  406. css += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + ' */'
  407. }
  408. if (styleElement.styleSheet) {
  409. styleElement.styleSheet.cssText = css
  410. } else {
  411. while (styleElement.firstChild) {
  412. styleElement.removeChild(styleElement.firstChild)
  413. }
  414. styleElement.appendChild(document.createTextNode(css))
  415. }
  416. }
  417. /***/ }),
  418. /* 2 */
  419. /***/ (function(module, exports) {
  420. /* globals __VUE_SSR_CONTEXT__ */
  421. // IMPORTANT: Do NOT use ES2015 features in this file.
  422. // This module is a runtime utility for cleaner component module output and will
  423. // be included in the final webpack user bundle.
  424. module.exports = function normalizeComponent (
  425. rawScriptExports,
  426. compiledTemplate,
  427. functionalTemplate,
  428. injectStyles,
  429. scopeId,
  430. moduleIdentifier /* server only */
  431. ) {
  432. var esModule
  433. var scriptExports = rawScriptExports = rawScriptExports || {}
  434. // ES6 modules interop
  435. var type = typeof rawScriptExports.default
  436. if (type === 'object' || type === 'function') {
  437. esModule = rawScriptExports
  438. scriptExports = rawScriptExports.default
  439. }
  440. // Vue.extend constructor export interop
  441. var options = typeof scriptExports === 'function'
  442. ? scriptExports.options
  443. : scriptExports
  444. // render functions
  445. if (compiledTemplate) {
  446. options.render = compiledTemplate.render
  447. options.staticRenderFns = compiledTemplate.staticRenderFns
  448. options._compiled = true
  449. }
  450. // functional template
  451. if (functionalTemplate) {
  452. options.functional = true
  453. }
  454. // scopedId
  455. if (scopeId) {
  456. options._scopeId = scopeId
  457. }
  458. var hook
  459. if (moduleIdentifier) { // server build
  460. hook = function (context) {
  461. // 2.3 injection
  462. context =
  463. context || // cached call
  464. (this.$vnode && this.$vnode.ssrContext) || // stateful
  465. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  466. // 2.2 with runInNewContext: true
  467. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  468. context = __VUE_SSR_CONTEXT__
  469. }
  470. // inject component styles
  471. if (injectStyles) {
  472. injectStyles.call(this, context)
  473. }
  474. // register component module identifier for async chunk inferrence
  475. if (context && context._registeredComponents) {
  476. context._registeredComponents.add(moduleIdentifier)
  477. }
  478. }
  479. // used by ssr in case component is cached and beforeCreate
  480. // never gets called
  481. options._ssrRegister = hook
  482. } else if (injectStyles) {
  483. hook = injectStyles
  484. }
  485. if (hook) {
  486. var functional = options.functional
  487. var existing = functional
  488. ? options.render
  489. : options.beforeCreate
  490. if (!functional) {
  491. // inject component registration as beforeCreate hook
  492. options.beforeCreate = existing
  493. ? [].concat(existing, hook)
  494. : [hook]
  495. } else {
  496. // for template-only hot-reload because in that case the render fn doesn't
  497. // go through the normalizer
  498. options._injectStyles = hook
  499. // register for functioal component in vue file
  500. options.render = function renderWithStyleInjection (h, context) {
  501. hook.call(context)
  502. return existing(h, context)
  503. }
  504. }
  505. }
  506. return {
  507. esModule: esModule,
  508. exports: scriptExports,
  509. options: options
  510. }
  511. }
  512. /***/ }),
  513. /* 3 */
  514. /***/ (function(module, exports, __webpack_require__) {
  515. var freeGlobal = __webpack_require__(37);
  516. /** Detect free variable `self`. */
  517. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  518. /** Used as a reference to the global object. */
  519. var root = freeGlobal || freeSelf || Function('return this')();
  520. module.exports = root;
  521. /***/ }),
  522. /* 4 */
  523. /***/ (function(module, exports, __webpack_require__) {
  524. if (false) {
  525. module.exports = require('./vue.common.prod.js')
  526. } else {
  527. module.exports = __webpack_require__(68)
  528. }
  529. /***/ }),
  530. /* 5 */
  531. /***/ (function(module, exports, __webpack_require__) {
  532. var baseIsNative = __webpack_require__(154),
  533. getValue = __webpack_require__(157);
  534. /**
  535. * Gets the native function at `key` of `object`.
  536. *
  537. * @private
  538. * @param {Object} object The object to query.
  539. * @param {string} key The key of the method to get.
  540. * @returns {*} Returns the function if it's native, else `undefined`.
  541. */
  542. function getNative(object, key) {
  543. var value = getValue(object, key);
  544. return baseIsNative(value) ? value : undefined;
  545. }
  546. module.exports = getNative;
  547. /***/ }),
  548. /* 6 */
  549. /***/ (function(module, exports) {
  550. var g;
  551. // This works in non-strict mode
  552. g = (function() {
  553. return this;
  554. })();
  555. try {
  556. // This works if eval is allowed (see CSP)
  557. g = g || Function("return this")() || (1,eval)("this");
  558. } catch(e) {
  559. // This works if the window reference is available
  560. if(typeof window === "object")
  561. g = window;
  562. }
  563. // g can still be undefined, but nothing to do about it...
  564. // We return undefined, instead of nothing here, so it's
  565. // easier to handle this case. if(!global) { ...}
  566. module.exports = g;
  567. /***/ }),
  568. /* 7 */
  569. /***/ (function(module, exports, __webpack_require__) {
  570. var disposed = false
  571. function injectStyle (ssrContext) {
  572. if (disposed) return
  573. __webpack_require__(96)
  574. }
  575. var normalizeComponent = __webpack_require__(2)
  576. /* script */
  577. var __vue_script__ = __webpack_require__(98)
  578. /* template */
  579. var __vue_template__ = __webpack_require__(99)
  580. /* template functional */
  581. var __vue_template_functional__ = false
  582. /* styles */
  583. var __vue_styles__ = injectStyle
  584. /* scopeId */
  585. var __vue_scopeId__ = "data-v-329e9aed"
  586. /* moduleIdentifier (server only) */
  587. var __vue_module_identifier__ = null
  588. var Component = normalizeComponent(
  589. __vue_script__,
  590. __vue_template__,
  591. __vue_template_functional__,
  592. __vue_styles__,
  593. __vue_scopeId__,
  594. __vue_module_identifier__
  595. )
  596. Component.options.__file = "resources/assets/js/main/components/DrawerTabsContainer.vue"
  597. /* hot reload */
  598. if (false) {(function () {
  599. var hotAPI = require("vue-hot-reload-api")
  600. hotAPI.install(require("vue"), false)
  601. if (!hotAPI.compatible) return
  602. module.hot.accept()
  603. if (!module.hot.data) {
  604. hotAPI.createRecord("data-v-329e9aed", Component.options)
  605. } else {
  606. hotAPI.reload("data-v-329e9aed", Component.options)
  607. }
  608. module.hot.dispose(function (data) {
  609. disposed = true
  610. })
  611. })()}
  612. module.exports = Component.exports
  613. /***/ }),
  614. /* 8 */
  615. /***/ (function(module, exports) {
  616. /**
  617. * Checks if `value` is object-like. A value is object-like if it's not `null`
  618. * and has a `typeof` result of "object".
  619. *
  620. * @static
  621. * @memberOf _
  622. * @since 4.0.0
  623. * @category Lang
  624. * @param {*} value The value to check.
  625. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  626. * @example
  627. *
  628. * _.isObjectLike({});
  629. * // => true
  630. *
  631. * _.isObjectLike([1, 2, 3]);
  632. * // => true
  633. *
  634. * _.isObjectLike(_.noop);
  635. * // => false
  636. *
  637. * _.isObjectLike(null);
  638. * // => false
  639. */
  640. function isObjectLike(value) {
  641. return value != null && typeof value == 'object';
  642. }
  643. module.exports = isObjectLike;
  644. /***/ }),
  645. /* 9 */
  646. /***/ (function(module, exports) {
  647. /**
  648. * Checks if `value` is the
  649. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  650. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  651. *
  652. * @static
  653. * @memberOf _
  654. * @since 0.1.0
  655. * @category Lang
  656. * @param {*} value The value to check.
  657. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  658. * @example
  659. *
  660. * _.isObject({});
  661. * // => true
  662. *
  663. * _.isObject([1, 2, 3]);
  664. * // => true
  665. *
  666. * _.isObject(_.noop);
  667. * // => true
  668. *
  669. * _.isObject(null);
  670. * // => false
  671. */
  672. function isObject(value) {
  673. var type = typeof value;
  674. return value != null && (type == 'object' || type == 'function');
  675. }
  676. module.exports = isObject;
  677. /***/ }),
  678. /* 10 */
  679. /***/ (function(module, exports, __webpack_require__) {
  680. var Symbol = __webpack_require__(18),
  681. getRawTag = __webpack_require__(149),
  682. objectToString = __webpack_require__(150);
  683. /** `Object#toString` result references. */
  684. var nullTag = '[object Null]',
  685. undefinedTag = '[object Undefined]';
  686. /** Built-in value references. */
  687. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  688. /**
  689. * The base implementation of `getTag` without fallbacks for buggy environments.
  690. *
  691. * @private
  692. * @param {*} value The value to query.
  693. * @returns {string} Returns the `toStringTag`.
  694. */
  695. function baseGetTag(value) {
  696. if (value == null) {
  697. return value === undefined ? undefinedTag : nullTag;
  698. }
  699. return (symToStringTag && symToStringTag in Object(value))
  700. ? getRawTag(value)
  701. : objectToString(value);
  702. }
  703. module.exports = baseGetTag;
  704. /***/ }),
  705. /* 11 */
  706. /***/ (function(module, exports, __webpack_require__) {
  707. var getNative = __webpack_require__(5);
  708. /* Built-in method references that are verified to be native. */
  709. var nativeCreate = getNative(Object, 'create');
  710. module.exports = nativeCreate;
  711. /***/ }),
  712. /* 12 */
  713. /***/ (function(module, exports, __webpack_require__) {
  714. var listCacheClear = __webpack_require__(162),
  715. listCacheDelete = __webpack_require__(163),
  716. listCacheGet = __webpack_require__(164),
  717. listCacheHas = __webpack_require__(165),
  718. listCacheSet = __webpack_require__(166);
  719. /**
  720. * Creates an list cache object.
  721. *
  722. * @private
  723. * @constructor
  724. * @param {Array} [entries] The key-value pairs to cache.
  725. */
  726. function ListCache(entries) {
  727. var index = -1,
  728. length = entries == null ? 0 : entries.length;
  729. this.clear();
  730. while (++index < length) {
  731. var entry = entries[index];
  732. this.set(entry[0], entry[1]);
  733. }
  734. }
  735. // Add methods to `ListCache`.
  736. ListCache.prototype.clear = listCacheClear;
  737. ListCache.prototype['delete'] = listCacheDelete;
  738. ListCache.prototype.get = listCacheGet;
  739. ListCache.prototype.has = listCacheHas;
  740. ListCache.prototype.set = listCacheSet;
  741. module.exports = ListCache;
  742. /***/ }),
  743. /* 13 */
  744. /***/ (function(module, exports, __webpack_require__) {
  745. var eq = __webpack_require__(33);
  746. /**
  747. * Gets the index at which the `key` is found in `array` of key-value pairs.
  748. *
  749. * @private
  750. * @param {Array} array The array to inspect.
  751. * @param {*} key The key to search for.
  752. * @returns {number} Returns the index of the matched value, else `-1`.
  753. */
  754. function assocIndexOf(array, key) {
  755. var length = array.length;
  756. while (length--) {
  757. if (eq(array[length][0], key)) {
  758. return length;
  759. }
  760. }
  761. return -1;
  762. }
  763. module.exports = assocIndexOf;
  764. /***/ }),
  765. /* 14 */
  766. /***/ (function(module, exports, __webpack_require__) {
  767. var isKeyable = __webpack_require__(168);
  768. /**
  769. * Gets the data for `map`.
  770. *
  771. * @private
  772. * @param {Object} map The map to query.
  773. * @param {string} key The reference key.
  774. * @returns {*} Returns the map data.
  775. */
  776. function getMapData(map, key) {
  777. var data = map.__data__;
  778. return isKeyable(key)
  779. ? data[typeof key == 'string' ? 'string' : 'hash']
  780. : data.map;
  781. }
  782. module.exports = getMapData;
  783. /***/ }),
  784. /* 15 */
  785. /***/ (function(module, exports, __webpack_require__) {
  786. var assignValue = __webpack_require__(45),
  787. baseAssignValue = __webpack_require__(46);
  788. /**
  789. * Copies properties of `source` to `object`.
  790. *
  791. * @private
  792. * @param {Object} source The object to copy properties from.
  793. * @param {Array} props The property identifiers to copy.
  794. * @param {Object} [object={}] The object to copy properties to.
  795. * @param {Function} [customizer] The function to customize copied values.
  796. * @returns {Object} Returns `object`.
  797. */
  798. function copyObject(source, props, object, customizer) {
  799. var isNew = !object;
  800. object || (object = {});
  801. var index = -1,
  802. length = props.length;
  803. while (++index < length) {
  804. var key = props[index];
  805. var newValue = customizer
  806. ? customizer(object[key], source[key], key, object, source)
  807. : undefined;
  808. if (newValue === undefined) {
  809. newValue = source[key];
  810. }
  811. if (isNew) {
  812. baseAssignValue(object, key, newValue);
  813. } else {
  814. assignValue(object, key, newValue);
  815. }
  816. }
  817. return object;
  818. }
  819. module.exports = copyObject;
  820. /***/ }),
  821. /* 16 */
  822. /***/ (function(module, exports) {
  823. /**
  824. * Checks if `value` is classified as an `Array` object.
  825. *
  826. * @static
  827. * @memberOf _
  828. * @since 0.1.0
  829. * @category Lang
  830. * @param {*} value The value to check.
  831. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  832. * @example
  833. *
  834. * _.isArray([1, 2, 3]);
  835. * // => true
  836. *
  837. * _.isArray(document.body.children);
  838. * // => false
  839. *
  840. * _.isArray('abc');
  841. * // => false
  842. *
  843. * _.isArray(_.noop);
  844. * // => false
  845. */
  846. var isArray = Array.isArray;
  847. module.exports = isArray;
  848. /***/ }),
  849. /* 17 */
  850. /***/ (function(module, exports, __webpack_require__) {
  851. var disposed = false
  852. function injectStyle (ssrContext) {
  853. if (disposed) return
  854. __webpack_require__(88)
  855. }
  856. var normalizeComponent = __webpack_require__(2)
  857. /* script */
  858. var __vue_script__ = __webpack_require__(90)
  859. /* template */
  860. var __vue_template__ = __webpack_require__(91)
  861. /* template functional */
  862. var __vue_template_functional__ = false
  863. /* styles */
  864. var __vue_styles__ = injectStyle
  865. /* scopeId */
  866. var __vue_scopeId__ = null
  867. /* moduleIdentifier (server only) */
  868. var __vue_module_identifier__ = null
  869. var Component = normalizeComponent(
  870. __vue_script__,
  871. __vue_template__,
  872. __vue_template_functional__,
  873. __vue_styles__,
  874. __vue_scopeId__,
  875. __vue_module_identifier__
  876. )
  877. Component.options.__file = "resources/assets/js/main/components/ImgUpload.vue"
  878. /* hot reload */
  879. if (false) {(function () {
  880. var hotAPI = require("vue-hot-reload-api")
  881. hotAPI.install(require("vue"), false)
  882. if (!hotAPI.compatible) return
  883. module.hot.accept()
  884. if (!module.hot.data) {
  885. hotAPI.createRecord("data-v-55c90fc2", Component.options)
  886. } else {
  887. hotAPI.reload("data-v-55c90fc2", Component.options)
  888. }
  889. module.hot.dispose(function (data) {
  890. disposed = true
  891. })
  892. })()}
  893. module.exports = Component.exports
  894. /***/ }),
  895. /* 18 */
  896. /***/ (function(module, exports, __webpack_require__) {
  897. var root = __webpack_require__(3);
  898. /** Built-in value references. */
  899. var Symbol = root.Symbol;
  900. module.exports = Symbol;
  901. /***/ }),
  902. /* 19 */
  903. /***/ (function(module, exports, __webpack_require__) {
  904. var arrayLikeKeys = __webpack_require__(43),
  905. baseKeys = __webpack_require__(182),
  906. isArrayLike = __webpack_require__(32);
  907. /**
  908. * Creates an array of the own enumerable property names of `object`.
  909. *
  910. * **Note:** Non-object values are coerced to objects. See the
  911. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  912. * for more details.
  913. *
  914. * @static
  915. * @since 0.1.0
  916. * @memberOf _
  917. * @category Object
  918. * @param {Object} object The object to query.
  919. * @returns {Array} Returns the array of property names.
  920. * @example
  921. *
  922. * function Foo() {
  923. * this.a = 1;
  924. * this.b = 2;
  925. * }
  926. *
  927. * Foo.prototype.c = 3;
  928. *
  929. * _.keys(new Foo);
  930. * // => ['a', 'b'] (iteration order is not guaranteed)
  931. *
  932. * _.keys('hi');
  933. * // => ['0', '1']
  934. */
  935. function keys(object) {
  936. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  937. }
  938. module.exports = keys;
  939. /***/ }),
  940. /* 20 */
  941. /***/ (function(module, exports) {
  942. /**
  943. * The base implementation of `_.unary` without support for storing metadata.
  944. *
  945. * @private
  946. * @param {Function} func The function to cap arguments for.
  947. * @returns {Function} Returns the new capped function.
  948. */
  949. function baseUnary(func) {
  950. return function(value) {
  951. return func(value);
  952. };
  953. }
  954. module.exports = baseUnary;
  955. /***/ }),
  956. /* 21 */
  957. /***/ (function(module, exports, __webpack_require__) {
  958. var DataView = __webpack_require__(184),
  959. Map = __webpack_require__(23),
  960. Promise = __webpack_require__(185),
  961. Set = __webpack_require__(186),
  962. WeakMap = __webpack_require__(187),
  963. baseGetTag = __webpack_require__(10),
  964. toSource = __webpack_require__(39);
  965. /** `Object#toString` result references. */
  966. var mapTag = '[object Map]',
  967. objectTag = '[object Object]',
  968. promiseTag = '[object Promise]',
  969. setTag = '[object Set]',
  970. weakMapTag = '[object WeakMap]';
  971. var dataViewTag = '[object DataView]';
  972. /** Used to detect maps, sets, and weakmaps. */
  973. var dataViewCtorString = toSource(DataView),
  974. mapCtorString = toSource(Map),
  975. promiseCtorString = toSource(Promise),
  976. setCtorString = toSource(Set),
  977. weakMapCtorString = toSource(WeakMap);
  978. /**
  979. * Gets the `toStringTag` of `value`.
  980. *
  981. * @private
  982. * @param {*} value The value to query.
  983. * @returns {string} Returns the `toStringTag`.
  984. */
  985. var getTag = baseGetTag;
  986. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  987. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  988. (Map && getTag(new Map) != mapTag) ||
  989. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  990. (Set && getTag(new Set) != setTag) ||
  991. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  992. getTag = function(value) {
  993. var result = baseGetTag(value),
  994. Ctor = result == objectTag ? value.constructor : undefined,
  995. ctorString = Ctor ? toSource(Ctor) : '';
  996. if (ctorString) {
  997. switch (ctorString) {
  998. case dataViewCtorString: return dataViewTag;
  999. case mapCtorString: return mapTag;
  1000. case promiseCtorString: return promiseTag;
  1001. case setCtorString: return setTag;
  1002. case weakMapCtorString: return weakMapTag;
  1003. }
  1004. }
  1005. return result;
  1006. };
  1007. }
  1008. module.exports = getTag;
  1009. /***/ }),
  1010. /* 22 */
  1011. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1012. "use strict";
  1013. /* harmony export (immutable) */ __webpack_exports__["e"] = oneOf;
  1014. /* unused harmony export camelcaseToHyphen */
  1015. /* harmony export (immutable) */ __webpack_exports__["d"] = getScrollBarSize;
  1016. /* unused harmony export getStyle */
  1017. /* unused harmony export firstUpperCase */
  1018. /* unused harmony export warnProp */
  1019. /* unused harmony export deepCopy */
  1020. /* unused harmony export scrollTop */
  1021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return findComponentUpward; });
  1022. /* unused harmony export findComponentDownward */
  1023. /* unused harmony export findComponentsDownward */
  1024. /* harmony export (immutable) */ __webpack_exports__["c"] = findComponentsUpward;
  1025. /* harmony export (immutable) */ __webpack_exports__["a"] = findBrothersComponents;
  1026. /* unused harmony export hasClass */
  1027. /* unused harmony export addClass */
  1028. /* unused harmony export removeClass */
  1029. /* unused harmony export setMatchMedia */
  1030. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  1031. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  1032. const isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
  1033. // 判断参数是否是其中之一
  1034. function oneOf (value, validList) {
  1035. for (let i = 0; i < validList.length; i++) {
  1036. if (value === validList[i]) {
  1037. return true;
  1038. }
  1039. }
  1040. return false;
  1041. }
  1042. function camelcaseToHyphen (str) {
  1043. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  1044. }
  1045. // For Modal scrollBar hidden
  1046. let cached;
  1047. function getScrollBarSize (fresh) {
  1048. if (isServer) return 0;
  1049. if (fresh || cached === undefined) {
  1050. const inner = document.createElement('div');
  1051. inner.style.width = '100%';
  1052. inner.style.height = '200px';
  1053. const outer = document.createElement('div');
  1054. const outerStyle = outer.style;
  1055. outerStyle.position = 'absolute';
  1056. outerStyle.top = 0;
  1057. outerStyle.left = 0;
  1058. outerStyle.pointerEvents = 'none';
  1059. outerStyle.visibility = 'hidden';
  1060. outerStyle.width = '200px';
  1061. outerStyle.height = '150px';
  1062. outerStyle.overflow = 'hidden';
  1063. outer.appendChild(inner);
  1064. document.body.appendChild(outer);
  1065. const widthContained = inner.offsetWidth;
  1066. outer.style.overflow = 'scroll';
  1067. let widthScroll = inner.offsetWidth;
  1068. if (widthContained === widthScroll) {
  1069. widthScroll = outer.clientWidth;
  1070. }
  1071. document.body.removeChild(outer);
  1072. cached = widthContained - widthScroll;
  1073. }
  1074. return cached;
  1075. }
  1076. // watch DOM change
  1077. const MutationObserver = isServer ? false : window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
  1078. /* unused harmony export MutationObserver */
  1079. const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
  1080. const MOZ_HACK_REGEXP = /^moz([A-Z])/;
  1081. function camelCase(name) {
  1082. return name.replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
  1083. return offset ? letter.toUpperCase() : letter;
  1084. }).replace(MOZ_HACK_REGEXP, 'Moz$1');
  1085. }
  1086. // getStyle
  1087. function getStyle (element, styleName) {
  1088. if (!element || !styleName) return null;
  1089. styleName = camelCase(styleName);
  1090. if (styleName === 'float') {
  1091. styleName = 'cssFloat';
  1092. }
  1093. try {
  1094. const computed = document.defaultView.getComputedStyle(element, '');
  1095. return element.style[styleName] || computed ? computed[styleName] : null;
  1096. } catch(e) {
  1097. return element.style[styleName];
  1098. }
  1099. }
  1100. // firstUpperCase
  1101. function firstUpperCase(str) {
  1102. return str.toString()[0].toUpperCase() + str.toString().slice(1);
  1103. }
  1104. // Warn
  1105. function warnProp(component, prop, correctType, wrongType) {
  1106. correctType = firstUpperCase(correctType);
  1107. wrongType = firstUpperCase(wrongType);
  1108. console.error(`[iView warn]: Invalid prop: type check failed for prop ${prop}. Expected ${correctType}, got ${wrongType}. (found in component: ${component})`); // eslint-disable-line
  1109. }
  1110. function typeOf(obj) {
  1111. const toString = Object.prototype.toString;
  1112. const map = {
  1113. '[object Boolean]' : 'boolean',
  1114. '[object Number]' : 'number',
  1115. '[object String]' : 'string',
  1116. '[object Function]' : 'function',
  1117. '[object Array]' : 'array',
  1118. '[object Date]' : 'date',
  1119. '[object RegExp]' : 'regExp',
  1120. '[object Undefined]': 'undefined',
  1121. '[object Null]' : 'null',
  1122. '[object Object]' : 'object'
  1123. };
  1124. return map[toString.call(obj)];
  1125. }
  1126. // deepCopy
  1127. function deepCopy(data) {
  1128. const t = typeOf(data);
  1129. let o;
  1130. if (t === 'array') {
  1131. o = [];
  1132. } else if ( t === 'object') {
  1133. o = {};
  1134. } else {
  1135. return data;
  1136. }
  1137. if (t === 'array') {
  1138. for (let i = 0; i < data.length; i++) {
  1139. o.push(deepCopy(data[i]));
  1140. }
  1141. } else if ( t === 'object') {
  1142. for (let i in data) {
  1143. o[i] = deepCopy(data[i]);
  1144. }
  1145. }
  1146. return o;
  1147. }
  1148. // scrollTop animation
  1149. function scrollTop(el, from = 0, to, duration = 500, endCallback) {
  1150. if (!window.requestAnimationFrame) {
  1151. window.requestAnimationFrame = (
  1152. window.webkitRequestAnimationFrame ||
  1153. window.mozRequestAnimationFrame ||
  1154. window.msRequestAnimationFrame ||
  1155. function (callback) {
  1156. return window.setTimeout(callback, 1000/60);
  1157. }
  1158. );
  1159. }
  1160. const difference = Math.abs(from - to);
  1161. const step = Math.ceil(difference / duration * 50);
  1162. function scroll(start, end, step) {
  1163. if (start === end) {
  1164. endCallback && endCallback();
  1165. return;
  1166. }
  1167. let d = (start + step > end) ? end : start + step;
  1168. if (start > end) {
  1169. d = (start - step < end) ? end : start - step;
  1170. }
  1171. if (el === window) {
  1172. window.scrollTo(d, d);
  1173. } else {
  1174. el.scrollTop = d;
  1175. }
  1176. window.requestAnimationFrame(() => scroll(d, end, step));
  1177. }
  1178. scroll(from, to, step);
  1179. }
  1180. // Find components upward
  1181. function findComponentUpward (context, componentName, componentNames) {
  1182. if (typeof componentName === 'string') {
  1183. componentNames = [componentName];
  1184. } else {
  1185. componentNames = componentName;
  1186. }
  1187. let parent = context.$parent;
  1188. let name = parent.$options.name;
  1189. while (parent && (!name || componentNames.indexOf(name) < 0)) {
  1190. parent = parent.$parent;
  1191. if (parent) name = parent.$options.name;
  1192. }
  1193. return parent;
  1194. }
  1195. // Find component downward
  1196. function findComponentDownward (context, componentName) {
  1197. const $children = context.$children;
  1198. let children = null;
  1199. if ($children.length) {
  1200. for (const child of $children) {
  1201. const name = child.$options.name;
  1202. if (name === componentName) {
  1203. children = child;
  1204. break;
  1205. } else {
  1206. children = findComponentDownward(child, componentName);
  1207. if (children) break;
  1208. }
  1209. }
  1210. }
  1211. return children;
  1212. }
  1213. // Find components downward
  1214. function findComponentsDownward (context, componentName) {
  1215. return context.$children.reduce((components, child) => {
  1216. if (child.$options.name === componentName) components.push(child);
  1217. const foundChilds = findComponentsDownward(child, componentName);
  1218. return components.concat(foundChilds);
  1219. }, []);
  1220. }
  1221. // Find components upward
  1222. function findComponentsUpward (context, componentName) {
  1223. let parents = [];
  1224. const parent = context.$parent;
  1225. if (parent) {
  1226. if (parent.$options.name === componentName) parents.push(parent);
  1227. return parents.concat(findComponentsUpward(parent, componentName));
  1228. } else {
  1229. return [];
  1230. }
  1231. }
  1232. // Find brothers components
  1233. function findBrothersComponents (context, componentName, exceptMe = true) {
  1234. let res = context.$parent.$children.filter(item => {
  1235. return item.$options.name === componentName;
  1236. });
  1237. let index = res.findIndex(item => item._uid === context._uid);
  1238. if (exceptMe) res.splice(index, 1);
  1239. return res;
  1240. }
  1241. /* istanbul ignore next */
  1242. const trim = function(string) {
  1243. return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
  1244. };
  1245. /* istanbul ignore next */
  1246. function hasClass(el, cls) {
  1247. if (!el || !cls) return false;
  1248. if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
  1249. if (el.classList) {
  1250. return el.classList.contains(cls);
  1251. } else {
  1252. return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
  1253. }
  1254. }
  1255. /* istanbul ignore next */
  1256. function addClass(el, cls) {
  1257. if (!el) return;
  1258. let curClass = el.className;
  1259. const classes = (cls || '').split(' ');
  1260. for (let i = 0, j = classes.length; i < j; i++) {
  1261. const clsName = classes[i];
  1262. if (!clsName) continue;
  1263. if (el.classList) {
  1264. el.classList.add(clsName);
  1265. } else {
  1266. if (!hasClass(el, clsName)) {
  1267. curClass += ' ' + clsName;
  1268. }
  1269. }
  1270. }
  1271. if (!el.classList) {
  1272. el.className = curClass;
  1273. }
  1274. }
  1275. /* istanbul ignore next */
  1276. function removeClass(el, cls) {
  1277. if (!el || !cls) return;
  1278. const classes = cls.split(' ');
  1279. let curClass = ' ' + el.className + ' ';
  1280. for (let i = 0, j = classes.length; i < j; i++) {
  1281. const clsName = classes[i];
  1282. if (!clsName) continue;
  1283. if (el.classList) {
  1284. el.classList.remove(clsName);
  1285. } else {
  1286. if (hasClass(el, clsName)) {
  1287. curClass = curClass.replace(' ' + clsName + ' ', ' ');
  1288. }
  1289. }
  1290. }
  1291. if (!el.classList) {
  1292. el.className = trim(curClass);
  1293. }
  1294. }
  1295. const dimensionMap = {
  1296. xs: '480px',
  1297. sm: '576px',
  1298. md: '768px',
  1299. lg: '992px',
  1300. xl: '1200px',
  1301. xxl: '1600px',
  1302. };
  1303. /* unused harmony export dimensionMap */
  1304. function setMatchMedia () {
  1305. if (typeof window !== 'undefined') {
  1306. const matchMediaPolyfill = mediaQuery => {
  1307. return {
  1308. media: mediaQuery,
  1309. matches: false,
  1310. on() {},
  1311. off() {},
  1312. };
  1313. };
  1314. window.matchMedia = window.matchMedia || matchMediaPolyfill;
  1315. }
  1316. }
  1317. const sharpMatcherRegx = /#([^#]+)$/;
  1318. /* unused harmony export sharpMatcherRegx */
  1319. /***/ }),
  1320. /* 23 */
  1321. /***/ (function(module, exports, __webpack_require__) {
  1322. var getNative = __webpack_require__(5),
  1323. root = __webpack_require__(3);
  1324. /* Built-in method references that are verified to be native. */
  1325. var Map = getNative(root, 'Map');
  1326. module.exports = Map;
  1327. /***/ }),
  1328. /* 24 */
  1329. /***/ (function(module, exports, __webpack_require__) {
  1330. var arrayFilter = __webpack_require__(177),
  1331. stubArray = __webpack_require__(42);
  1332. /** Used for built-in method references. */
  1333. var objectProto = Object.prototype;
  1334. /** Built-in value references. */
  1335. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  1336. /* Built-in method references for those with the same name as other `lodash` methods. */
  1337. var nativeGetSymbols = Object.getOwnPropertySymbols;
  1338. /**
  1339. * Creates an array of the own enumerable symbols of `object`.
  1340. *
  1341. * @private
  1342. * @param {Object} object The object to query.
  1343. * @returns {Array} Returns the array of symbols.
  1344. */
  1345. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  1346. if (object == null) {
  1347. return [];
  1348. }
  1349. object = Object(object);
  1350. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  1351. return propertyIsEnumerable.call(object, symbol);
  1352. });
  1353. };
  1354. module.exports = getSymbols;
  1355. /***/ }),
  1356. /* 25 */
  1357. /***/ (function(module, exports) {
  1358. module.exports = function(module) {
  1359. if(!module.webpackPolyfill) {
  1360. module.deprecate = function() {};
  1361. module.paths = [];
  1362. // module.parent = undefined by default
  1363. if(!module.children) module.children = [];
  1364. Object.defineProperty(module, "loaded", {
  1365. enumerable: true,
  1366. get: function() {
  1367. return module.l;
  1368. }
  1369. });
  1370. Object.defineProperty(module, "id", {
  1371. enumerable: true,
  1372. get: function() {
  1373. return module.i;
  1374. }
  1375. });
  1376. module.webpackPolyfill = 1;
  1377. }
  1378. return module;
  1379. };
  1380. /***/ }),
  1381. /* 26 */
  1382. /***/ (function(module, exports, __webpack_require__) {
  1383. /* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(37);
  1384. /** Detect free variable `exports`. */
  1385. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  1386. /** Detect free variable `module`. */
  1387. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  1388. /** Detect the popular CommonJS extension `module.exports`. */
  1389. var moduleExports = freeModule && freeModule.exports === freeExports;
  1390. /** Detect free variable `process` from Node.js. */
  1391. var freeProcess = moduleExports && freeGlobal.process;
  1392. /** Used to access faster Node.js helpers. */
  1393. var nodeUtil = (function() {
  1394. try {
  1395. // Use `util.types` for Node.js 10+.
  1396. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1397. if (types) {
  1398. return types;
  1399. }
  1400. // Legacy `process.binding('util')` for Node.js < 10.
  1401. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1402. } catch (e) {}
  1403. }());
  1404. module.exports = nodeUtil;
  1405. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
  1406. /***/ }),
  1407. /* 27 */
  1408. /***/ (function(module, exports) {
  1409. /** Used for built-in method references. */
  1410. var objectProto = Object.prototype;
  1411. /**
  1412. * Checks if `value` is likely a prototype object.
  1413. *
  1414. * @private
  1415. * @param {*} value The value to check.
  1416. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  1417. */
  1418. function isPrototype(value) {
  1419. var Ctor = value && value.constructor,
  1420. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  1421. return value === proto;
  1422. }
  1423. module.exports = isPrototype;
  1424. /***/ }),
  1425. /* 28 */
  1426. /***/ (function(module, exports, __webpack_require__) {
  1427. var arrayLikeKeys = __webpack_require__(43),
  1428. baseKeysIn = __webpack_require__(250),
  1429. isArrayLike = __webpack_require__(32);
  1430. /**
  1431. * Creates an array of the own and inherited enumerable property names of `object`.
  1432. *
  1433. * **Note:** Non-object values are coerced to objects.
  1434. *
  1435. * @static
  1436. * @memberOf _
  1437. * @since 3.0.0
  1438. * @category Object
  1439. * @param {Object} object The object to query.
  1440. * @returns {Array} Returns the array of property names.
  1441. * @example
  1442. *
  1443. * function Foo() {
  1444. * this.a = 1;
  1445. * this.b = 2;
  1446. * }
  1447. *
  1448. * Foo.prototype.c = 3;
  1449. *
  1450. * _.keysIn(new Foo);
  1451. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  1452. */
  1453. function keysIn(object) {
  1454. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  1455. }
  1456. module.exports = keysIn;
  1457. /***/ }),
  1458. /* 29 */
  1459. /***/ (function(module, exports, __webpack_require__) {
  1460. var Uint8Array = __webpack_require__(60);
  1461. /**
  1462. * Creates a clone of `arrayBuffer`.
  1463. *
  1464. * @private
  1465. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  1466. * @returns {ArrayBuffer} Returns the cloned array buffer.
  1467. */
  1468. function cloneArrayBuffer(arrayBuffer) {
  1469. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  1470. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  1471. return result;
  1472. }
  1473. module.exports = cloneArrayBuffer;
  1474. /***/ }),
  1475. /* 30 */
  1476. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1477. "use strict";
  1478. /* harmony default export */ __webpack_exports__["a"] = ({
  1479. methods: {
  1480. taskComplete: function taskComplete(taskDetail) {
  1481. var _this = this;
  1482. var complete = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  1483. if (taskDetail['loadIng'] === true) {
  1484. return;
  1485. }
  1486. this.$set(taskDetail, 'loadIng', true);
  1487. this.$set(taskDetail, 'complete', !!complete);
  1488. $A.apiAjax({
  1489. url: 'project/task/edit',
  1490. method: 'post',
  1491. data: {
  1492. act: complete ? 'complete' : 'unfinished',
  1493. taskid: taskDetail.id
  1494. },
  1495. complete: function complete() {
  1496. _this.$set(taskDetail, 'loadIng', false);
  1497. },
  1498. error: function error() {
  1499. _this.$set(taskDetail, 'complete', !complete);
  1500. alert(_this.$L('网络繁忙,请稍后再试!'));
  1501. },
  1502. success: function success(res) {
  1503. if (res.ret === 1) {
  1504. _this.$Message.success(res.msg);
  1505. $A.triggerTaskInfoListener(complete ? 'complete' : 'unfinished', res.data);
  1506. $A.triggerTaskInfoChange(taskDetail.id);
  1507. } else {
  1508. _this.$set(taskDetail, 'complete', !complete);
  1509. _this.$Modal.error({ title: _this.$L('温馨提示'), content: res.msg });
  1510. }
  1511. }
  1512. });
  1513. },
  1514. renderTaskTitle: function renderTaskTitle(h, params) {
  1515. var _this2 = this;
  1516. return h('div', [h('Icon', {
  1517. props: { type: params.row.complete ? 'md-checkbox-outline' : 'md-square-outline' },
  1518. style: { marginRight: '4px', cursor: 'pointer', fontSize: '15px' },
  1519. on: {
  1520. click: function click() {
  1521. _this2.taskComplete(params.row, !params.row.complete);
  1522. }
  1523. }
  1524. }), h('span', {
  1525. style: { cursor: 'pointer', textDecoration: params.row.complete ? 'line-through' : '' },
  1526. on: {
  1527. click: function click() {
  1528. _this2.taskDetail(params.row);
  1529. }
  1530. }
  1531. }, params.row.title)]);
  1532. }
  1533. }
  1534. });
  1535. /***/ }),
  1536. /* 31 */
  1537. /***/ (function(module, exports, __webpack_require__) {
  1538. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  1539. (typeof self !== "undefined" && self) ||
  1540. window;
  1541. var apply = Function.prototype.apply;
  1542. // DOM APIs, for completeness
  1543. exports.setTimeout = function() {
  1544. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  1545. };
  1546. exports.setInterval = function() {
  1547. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  1548. };
  1549. exports.clearTimeout =
  1550. exports.clearInterval = function(timeout) {
  1551. if (timeout) {
  1552. timeout.close();
  1553. }
  1554. };
  1555. function Timeout(id, clearFn) {
  1556. this._id = id;
  1557. this._clearFn = clearFn;
  1558. }
  1559. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  1560. Timeout.prototype.close = function() {
  1561. this._clearFn.call(scope, this._id);
  1562. };
  1563. // Does not start the time, just sets up the members needed.
  1564. exports.enroll = function(item, msecs) {
  1565. clearTimeout(item._idleTimeoutId);
  1566. item._idleTimeout = msecs;
  1567. };
  1568. exports.unenroll = function(item) {
  1569. clearTimeout(item._idleTimeoutId);
  1570. item._idleTimeout = -1;
  1571. };
  1572. exports._unrefActive = exports.active = function(item) {
  1573. clearTimeout(item._idleTimeoutId);
  1574. var msecs = item._idleTimeout;
  1575. if (msecs >= 0) {
  1576. item._idleTimeoutId = setTimeout(function onTimeout() {
  1577. if (item._onTimeout)
  1578. item._onTimeout();
  1579. }, msecs);
  1580. }
  1581. };
  1582. // setimmediate attaches itself to the global object
  1583. __webpack_require__(69);
  1584. // On some exotic environments, it's not clear which object `setimmediate` was
  1585. // able to install onto. Search each possibility in the same order as the
  1586. // `setimmediate` library.
  1587. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  1588. (typeof global !== "undefined" && global.setImmediate) ||
  1589. (this && this.setImmediate);
  1590. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  1591. (typeof global !== "undefined" && global.clearImmediate) ||
  1592. (this && this.clearImmediate);
  1593. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  1594. /***/ }),
  1595. /* 32 */
  1596. /***/ (function(module, exports, __webpack_require__) {
  1597. var isFunction = __webpack_require__(38),
  1598. isLength = __webpack_require__(35);
  1599. /**
  1600. * Checks if `value` is array-like. A value is considered array-like if it's
  1601. * not a function and has a `value.length` that's an integer greater than or
  1602. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  1603. *
  1604. * @static
  1605. * @memberOf _
  1606. * @since 4.0.0
  1607. * @category Lang
  1608. * @param {*} value The value to check.
  1609. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  1610. * @example
  1611. *
  1612. * _.isArrayLike([1, 2, 3]);
  1613. * // => true
  1614. *
  1615. * _.isArrayLike(document.body.children);
  1616. * // => true
  1617. *
  1618. * _.isArrayLike('abc');
  1619. * // => true
  1620. *
  1621. * _.isArrayLike(_.noop);
  1622. * // => false
  1623. */
  1624. function isArrayLike(value) {
  1625. return value != null && isLength(value.length) && !isFunction(value);
  1626. }
  1627. module.exports = isArrayLike;
  1628. /***/ }),
  1629. /* 33 */
  1630. /***/ (function(module, exports) {
  1631. /**
  1632. * Performs a
  1633. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1634. * comparison between two values to determine if they are equivalent.
  1635. *
  1636. * @static
  1637. * @memberOf _
  1638. * @since 4.0.0
  1639. * @category Lang
  1640. * @param {*} value The value to compare.
  1641. * @param {*} other The other value to compare.
  1642. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1643. * @example
  1644. *
  1645. * var object = { 'a': 1 };
  1646. * var other = { 'a': 1 };
  1647. *
  1648. * _.eq(object, object);
  1649. * // => true
  1650. *
  1651. * _.eq(object, other);
  1652. * // => false
  1653. *
  1654. * _.eq('a', 'a');
  1655. * // => true
  1656. *
  1657. * _.eq('a', Object('a'));
  1658. * // => false
  1659. *
  1660. * _.eq(NaN, NaN);
  1661. * // => true
  1662. */
  1663. function eq(value, other) {
  1664. return value === other || (value !== value && other !== other);
  1665. }
  1666. module.exports = eq;
  1667. /***/ }),
  1668. /* 34 */
  1669. /***/ (function(module, exports, __webpack_require__) {
  1670. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3),
  1671. stubFalse = __webpack_require__(180);
  1672. /** Detect free variable `exports`. */
  1673. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  1674. /** Detect free variable `module`. */
  1675. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  1676. /** Detect the popular CommonJS extension `module.exports`. */
  1677. var moduleExports = freeModule && freeModule.exports === freeExports;
  1678. /** Built-in value references. */
  1679. var Buffer = moduleExports ? root.Buffer : undefined;
  1680. /* Built-in method references for those with the same name as other `lodash` methods. */
  1681. var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
  1682. /**
  1683. * Checks if `value` is a buffer.
  1684. *
  1685. * @static
  1686. * @memberOf _
  1687. * @since 4.3.0
  1688. * @category Lang
  1689. * @param {*} value The value to check.
  1690. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  1691. * @example
  1692. *
  1693. * _.isBuffer(new Buffer(2));
  1694. * // => true
  1695. *
  1696. * _.isBuffer(new Uint8Array(2));
  1697. * // => false
  1698. */
  1699. var isBuffer = nativeIsBuffer || stubFalse;
  1700. module.exports = isBuffer;
  1701. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
  1702. /***/ }),
  1703. /* 35 */
  1704. /***/ (function(module, exports) {
  1705. /** Used as references for various `Number` constants. */
  1706. var MAX_SAFE_INTEGER = 9007199254740991;
  1707. /**
  1708. * Checks if `value` is a valid array-like length.
  1709. *
  1710. * **Note:** This method is loosely based on
  1711. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  1712. *
  1713. * @static
  1714. * @memberOf _
  1715. * @since 4.0.0
  1716. * @category Lang
  1717. * @param {*} value The value to check.
  1718. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  1719. * @example
  1720. *
  1721. * _.isLength(3);
  1722. * // => true
  1723. *
  1724. * _.isLength(Number.MIN_VALUE);
  1725. * // => false
  1726. *
  1727. * _.isLength(Infinity);
  1728. * // => false
  1729. *
  1730. * _.isLength('3');
  1731. * // => false
  1732. */
  1733. function isLength(value) {
  1734. return typeof value == 'number' &&
  1735. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  1736. }
  1737. module.exports = isLength;
  1738. /***/ }),
  1739. /* 36 */
  1740. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1741. "use strict";
  1742. function broadcast(componentName, eventName, params) {
  1743. this.$children.forEach(child => {
  1744. const name = child.$options.name;
  1745. if (name === componentName) {
  1746. child.$emit.apply(child, [eventName].concat(params));
  1747. } else {
  1748. // todo 如果 params 是空数组,接收到的会是 undefined
  1749. broadcast.apply(child, [componentName, eventName].concat([params]));
  1750. }
  1751. });
  1752. }
  1753. /* harmony default export */ __webpack_exports__["a"] = ({
  1754. methods: {
  1755. dispatch(componentName, eventName, params) {
  1756. let parent = this.$parent || this.$root;
  1757. let name = parent.$options.name;
  1758. while (parent && (!name || name !== componentName)) {
  1759. parent = parent.$parent;
  1760. if (parent) {
  1761. name = parent.$options.name;
  1762. }
  1763. }
  1764. if (parent) {
  1765. parent.$emit.apply(parent, [eventName].concat(params));
  1766. }
  1767. },
  1768. broadcast(componentName, eventName, params) {
  1769. broadcast.call(this, componentName, eventName, params);
  1770. }
  1771. }
  1772. });
  1773. /***/ }),
  1774. /* 37 */
  1775. /***/ (function(module, exports, __webpack_require__) {
  1776. /* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */
  1777. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1778. module.exports = freeGlobal;
  1779. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  1780. /***/ }),
  1781. /* 38 */
  1782. /***/ (function(module, exports, __webpack_require__) {
  1783. var baseGetTag = __webpack_require__(10),
  1784. isObject = __webpack_require__(9);
  1785. /** `Object#toString` result references. */
  1786. var asyncTag = '[object AsyncFunction]',
  1787. funcTag = '[object Function]',
  1788. genTag = '[object GeneratorFunction]',
  1789. proxyTag = '[object Proxy]';
  1790. /**
  1791. * Checks if `value` is classified as a `Function` object.
  1792. *
  1793. * @static
  1794. * @memberOf _
  1795. * @since 0.1.0
  1796. * @category Lang
  1797. * @param {*} value The value to check.
  1798. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1799. * @example
  1800. *
  1801. * _.isFunction(_);
  1802. * // => true
  1803. *
  1804. * _.isFunction(/abc/);
  1805. * // => false
  1806. */
  1807. function isFunction(value) {
  1808. if (!isObject(value)) {
  1809. return false;
  1810. }
  1811. // The use of `Object#toString` avoids issues with the `typeof` operator
  1812. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  1813. var tag = baseGetTag(value);
  1814. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  1815. }
  1816. module.exports = isFunction;
  1817. /***/ }),
  1818. /* 39 */
  1819. /***/ (function(module, exports) {
  1820. /** Used for built-in method references. */
  1821. var funcProto = Function.prototype;
  1822. /** Used to resolve the decompiled source of functions. */
  1823. var funcToString = funcProto.toString;
  1824. /**
  1825. * Converts `func` to its source code.
  1826. *
  1827. * @private
  1828. * @param {Function} func The function to convert.
  1829. * @returns {string} Returns the source code.
  1830. */
  1831. function toSource(func) {
  1832. if (func != null) {
  1833. try {
  1834. return funcToString.call(func);
  1835. } catch (e) {}
  1836. try {
  1837. return (func + '');
  1838. } catch (e) {}
  1839. }
  1840. return '';
  1841. }
  1842. module.exports = toSource;
  1843. /***/ }),
  1844. /* 40 */
  1845. /***/ (function(module, exports, __webpack_require__) {
  1846. var arrayPush = __webpack_require__(41),
  1847. isArray = __webpack_require__(16);
  1848. /**
  1849. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  1850. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  1851. * symbols of `object`.
  1852. *
  1853. * @private
  1854. * @param {Object} object The object to query.
  1855. * @param {Function} keysFunc The function to get the keys of `object`.
  1856. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  1857. * @returns {Array} Returns the array of property names and symbols.
  1858. */
  1859. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  1860. var result = keysFunc(object);
  1861. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  1862. }
  1863. module.exports = baseGetAllKeys;
  1864. /***/ }),
  1865. /* 41 */
  1866. /***/ (function(module, exports) {
  1867. /**
  1868. * Appends the elements of `values` to `array`.
  1869. *
  1870. * @private
  1871. * @param {Array} array The array to modify.
  1872. * @param {Array} values The values to append.
  1873. * @returns {Array} Returns `array`.
  1874. */
  1875. function arrayPush(array, values) {
  1876. var index = -1,
  1877. length = values.length,
  1878. offset = array.length;
  1879. while (++index < length) {
  1880. array[offset + index] = values[index];
  1881. }
  1882. return array;
  1883. }
  1884. module.exports = arrayPush;
  1885. /***/ }),
  1886. /* 42 */
  1887. /***/ (function(module, exports) {
  1888. /**
  1889. * This method returns a new empty array.
  1890. *
  1891. * @static
  1892. * @memberOf _
  1893. * @since 4.13.0
  1894. * @category Util
  1895. * @returns {Array} Returns the new empty array.
  1896. * @example
  1897. *
  1898. * var arrays = _.times(2, _.stubArray);
  1899. *
  1900. * console.log(arrays);
  1901. * // => [[], []]
  1902. *
  1903. * console.log(arrays[0] === arrays[1]);
  1904. * // => false
  1905. */
  1906. function stubArray() {
  1907. return [];
  1908. }
  1909. module.exports = stubArray;
  1910. /***/ }),
  1911. /* 43 */
  1912. /***/ (function(module, exports, __webpack_require__) {
  1913. var baseTimes = __webpack_require__(178),
  1914. isArguments = __webpack_require__(62),
  1915. isArray = __webpack_require__(16),
  1916. isBuffer = __webpack_require__(34),
  1917. isIndex = __webpack_require__(63),
  1918. isTypedArray = __webpack_require__(64);
  1919. /** Used for built-in method references. */
  1920. var objectProto = Object.prototype;
  1921. /** Used to check objects for own properties. */
  1922. var hasOwnProperty = objectProto.hasOwnProperty;
  1923. /**
  1924. * Creates an array of the enumerable property names of the array-like `value`.
  1925. *
  1926. * @private
  1927. * @param {*} value The value to query.
  1928. * @param {boolean} inherited Specify returning inherited property names.
  1929. * @returns {Array} Returns the array of property names.
  1930. */
  1931. function arrayLikeKeys(value, inherited) {
  1932. var isArr = isArray(value),
  1933. isArg = !isArr && isArguments(value),
  1934. isBuff = !isArr && !isArg && isBuffer(value),
  1935. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  1936. skipIndexes = isArr || isArg || isBuff || isType,
  1937. result = skipIndexes ? baseTimes(value.length, String) : [],
  1938. length = result.length;
  1939. for (var key in value) {
  1940. if ((inherited || hasOwnProperty.call(value, key)) &&
  1941. !(skipIndexes && (
  1942. // Safari 9 has enumerable `arguments.length` in strict mode.
  1943. key == 'length' ||
  1944. // Node.js 0.10 has enumerable non-index properties on buffers.
  1945. (isBuff && (key == 'offset' || key == 'parent')) ||
  1946. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  1947. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  1948. // Skip index properties.
  1949. isIndex(key, length)
  1950. ))) {
  1951. result.push(key);
  1952. }
  1953. }
  1954. return result;
  1955. }
  1956. module.exports = arrayLikeKeys;
  1957. /***/ }),
  1958. /* 44 */
  1959. /***/ (function(module, exports) {
  1960. /**
  1961. * Creates a unary function that invokes `func` with its argument transformed.
  1962. *
  1963. * @private
  1964. * @param {Function} func The function to wrap.
  1965. * @param {Function} transform The argument transform.
  1966. * @returns {Function} Returns the new function.
  1967. */
  1968. function overArg(func, transform) {
  1969. return function(arg) {
  1970. return func(transform(arg));
  1971. };
  1972. }
  1973. module.exports = overArg;
  1974. /***/ }),
  1975. /* 45 */
  1976. /***/ (function(module, exports, __webpack_require__) {
  1977. var baseAssignValue = __webpack_require__(46),
  1978. eq = __webpack_require__(33);
  1979. /** Used for built-in method references. */
  1980. var objectProto = Object.prototype;
  1981. /** Used to check objects for own properties. */
  1982. var hasOwnProperty = objectProto.hasOwnProperty;
  1983. /**
  1984. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  1985. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1986. * for equality comparisons.
  1987. *
  1988. * @private
  1989. * @param {Object} object The object to modify.
  1990. * @param {string} key The key of the property to assign.
  1991. * @param {*} value The value to assign.
  1992. */
  1993. function assignValue(object, key, value) {
  1994. var objValue = object[key];
  1995. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  1996. (value === undefined && !(key in object))) {
  1997. baseAssignValue(object, key, value);
  1998. }
  1999. }
  2000. module.exports = assignValue;
  2001. /***/ }),
  2002. /* 46 */
  2003. /***/ (function(module, exports, __webpack_require__) {
  2004. var defineProperty = __webpack_require__(247);
  2005. /**
  2006. * The base implementation of `assignValue` and `assignMergeValue` without
  2007. * value checks.
  2008. *
  2009. * @private
  2010. * @param {Object} object The object to modify.
  2011. * @param {string} key The key of the property to assign.
  2012. * @param {*} value The value to assign.
  2013. */
  2014. function baseAssignValue(object, key, value) {
  2015. if (key == '__proto__' && defineProperty) {
  2016. defineProperty(object, key, {
  2017. 'configurable': true,
  2018. 'enumerable': true,
  2019. 'value': value,
  2020. 'writable': true
  2021. });
  2022. } else {
  2023. object[key] = value;
  2024. }
  2025. }
  2026. module.exports = baseAssignValue;
  2027. /***/ }),
  2028. /* 47 */
  2029. /***/ (function(module, exports, __webpack_require__) {
  2030. var arrayPush = __webpack_require__(41),
  2031. getPrototype = __webpack_require__(48),
  2032. getSymbols = __webpack_require__(24),
  2033. stubArray = __webpack_require__(42);
  2034. /* Built-in method references for those with the same name as other `lodash` methods. */
  2035. var nativeGetSymbols = Object.getOwnPropertySymbols;
  2036. /**
  2037. * Creates an array of the own and inherited enumerable symbols of `object`.
  2038. *
  2039. * @private
  2040. * @param {Object} object The object to query.
  2041. * @returns {Array} Returns the array of symbols.
  2042. */
  2043. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  2044. var result = [];
  2045. while (object) {
  2046. arrayPush(result, getSymbols(object));
  2047. object = getPrototype(object);
  2048. }
  2049. return result;
  2050. };
  2051. module.exports = getSymbolsIn;
  2052. /***/ }),
  2053. /* 48 */
  2054. /***/ (function(module, exports, __webpack_require__) {
  2055. var overArg = __webpack_require__(44);
  2056. /** Built-in value references. */
  2057. var getPrototype = overArg(Object.getPrototypeOf, Object);
  2058. module.exports = getPrototype;
  2059. /***/ }),
  2060. /* 49 */
  2061. /***/ (function(module, exports, __webpack_require__) {
  2062. var disposed = false
  2063. var normalizeComponent = __webpack_require__(2)
  2064. /* script */
  2065. var __vue_script__ = __webpack_require__(126)
  2066. /* template */
  2067. var __vue_template__ = __webpack_require__(134)
  2068. /* template functional */
  2069. var __vue_template_functional__ = false
  2070. /* styles */
  2071. var __vue_styles__ = null
  2072. /* scopeId */
  2073. var __vue_scopeId__ = null
  2074. /* moduleIdentifier (server only) */
  2075. var __vue_module_identifier__ = null
  2076. var Component = normalizeComponent(
  2077. __vue_script__,
  2078. __vue_template__,
  2079. __vue_template_functional__,
  2080. __vue_styles__,
  2081. __vue_scopeId__,
  2082. __vue_module_identifier__
  2083. )
  2084. Component.options.__file = "resources/assets/js/main/components/iview/WDrawer.vue"
  2085. /* hot reload */
  2086. if (false) {(function () {
  2087. var hotAPI = require("vue-hot-reload-api")
  2088. hotAPI.install(require("vue"), false)
  2089. if (!hotAPI.compatible) return
  2090. module.hot.accept()
  2091. if (!module.hot.data) {
  2092. hotAPI.createRecord("data-v-37c31742", Component.options)
  2093. } else {
  2094. hotAPI.reload("data-v-37c31742", Component.options)
  2095. }
  2096. module.hot.dispose(function (data) {
  2097. disposed = true
  2098. })
  2099. })()}
  2100. module.exports = Component.exports
  2101. /***/ }),
  2102. /* 50 */
  2103. /***/ (function(module, exports, __webpack_require__) {
  2104. /*
  2105. MIT License http://www.opensource.org/licenses/mit-license.php
  2106. Author Tobias Koppers @sokra
  2107. */
  2108. var stylesInDom = {};
  2109. var memoize = function (fn) {
  2110. var memo;
  2111. return function () {
  2112. if (typeof memo === "undefined") memo = fn.apply(this, arguments);
  2113. return memo;
  2114. };
  2115. };
  2116. var isOldIE = memoize(function () {
  2117. // Test for IE <= 9 as proposed by Browserhacks
  2118. // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
  2119. // Tests for existence of standard globals is to allow style-loader
  2120. // to operate correctly into non-standard environments
  2121. // @see https://github.com/webpack-contrib/style-loader/issues/177
  2122. return window && document && document.all && !window.atob;
  2123. });
  2124. var getElement = (function (fn) {
  2125. var memo = {};
  2126. return function(selector) {
  2127. if (typeof memo[selector] === "undefined") {
  2128. memo[selector] = fn.call(this, selector);
  2129. }
  2130. return memo[selector]
  2131. };
  2132. })(function (target) {
  2133. return document.querySelector(target)
  2134. });
  2135. var singleton = null;
  2136. var singletonCounter = 0;
  2137. var stylesInsertedAtTop = [];
  2138. var fixUrls = __webpack_require__(188);
  2139. module.exports = function(list, options) {
  2140. if (typeof DEBUG !== "undefined" && DEBUG) {
  2141. if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
  2142. }
  2143. options = options || {};
  2144. options.attrs = typeof options.attrs === "object" ? options.attrs : {};
  2145. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  2146. // tags it will allow on a page
  2147. if (!options.singleton) options.singleton = isOldIE();
  2148. // By default, add <style> tags to the <head> element
  2149. if (!options.insertInto) options.insertInto = "head";
  2150. // By default, add <style> tags to the bottom of the target
  2151. if (!options.insertAt) options.insertAt = "bottom";
  2152. var styles = listToStyles(list, options);
  2153. addStylesToDom(styles, options);
  2154. return function update (newList) {
  2155. var mayRemove = [];
  2156. for (var i = 0; i < styles.length; i++) {
  2157. var item = styles[i];
  2158. var domStyle = stylesInDom[item.id];
  2159. domStyle.refs--;
  2160. mayRemove.push(domStyle);
  2161. }
  2162. if(newList) {
  2163. var newStyles = listToStyles(newList, options);
  2164. addStylesToDom(newStyles, options);
  2165. }
  2166. for (var i = 0; i < mayRemove.length; i++) {
  2167. var domStyle = mayRemove[i];
  2168. if(domStyle.refs === 0) {
  2169. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  2170. delete stylesInDom[domStyle.id];
  2171. }
  2172. }
  2173. };
  2174. };
  2175. function addStylesToDom (styles, options) {
  2176. for (var i = 0; i < styles.length; i++) {
  2177. var item = styles[i];
  2178. var domStyle = stylesInDom[item.id];
  2179. if(domStyle) {
  2180. domStyle.refs++;
  2181. for(var j = 0; j < domStyle.parts.length; j++) {
  2182. domStyle.parts[j](item.parts[j]);
  2183. }
  2184. for(; j < item.parts.length; j++) {
  2185. domStyle.parts.push(addStyle(item.parts[j], options));
  2186. }
  2187. } else {
  2188. var parts = [];
  2189. for(var j = 0; j < item.parts.length; j++) {
  2190. parts.push(addStyle(item.parts[j], options));
  2191. }
  2192. stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
  2193. }
  2194. }
  2195. }
  2196. function listToStyles (list, options) {
  2197. var styles = [];
  2198. var newStyles = {};
  2199. for (var i = 0; i < list.length; i++) {
  2200. var item = list[i];
  2201. var id = options.base ? item[0] + options.base : item[0];
  2202. var css = item[1];
  2203. var media = item[2];
  2204. var sourceMap = item[3];
  2205. var part = {css: css, media: media, sourceMap: sourceMap};
  2206. if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
  2207. else newStyles[id].parts.push(part);
  2208. }
  2209. return styles;
  2210. }
  2211. function insertStyleElement (options, style) {
  2212. var target = getElement(options.insertInto)
  2213. if (!target) {
  2214. throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  2215. }
  2216. var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
  2217. if (options.insertAt === "top") {
  2218. if (!lastStyleElementInsertedAtTop) {
  2219. target.insertBefore(style, target.firstChild);
  2220. } else if (lastStyleElementInsertedAtTop.nextSibling) {
  2221. target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
  2222. } else {
  2223. target.appendChild(style);
  2224. }
  2225. stylesInsertedAtTop.push(style);
  2226. } else if (options.insertAt === "bottom") {
  2227. target.appendChild(style);
  2228. } else {
  2229. throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  2230. }
  2231. }
  2232. function removeStyleElement (style) {
  2233. if (style.parentNode === null) return false;
  2234. style.parentNode.removeChild(style);
  2235. var idx = stylesInsertedAtTop.indexOf(style);
  2236. if(idx >= 0) {
  2237. stylesInsertedAtTop.splice(idx, 1);
  2238. }
  2239. }
  2240. function createStyleElement (options) {
  2241. var style = document.createElement("style");
  2242. options.attrs.type = "text/css";
  2243. addAttrs(style, options.attrs);
  2244. insertStyleElement(options, style);
  2245. return style;
  2246. }
  2247. function createLinkElement (options) {
  2248. var link = document.createElement("link");
  2249. options.attrs.type = "text/css";
  2250. options.attrs.rel = "stylesheet";
  2251. addAttrs(link, options.attrs);
  2252. insertStyleElement(options, link);
  2253. return link;
  2254. }
  2255. function addAttrs (el, attrs) {
  2256. Object.keys(attrs).forEach(function (key) {
  2257. el.setAttribute(key, attrs[key]);
  2258. });
  2259. }
  2260. function addStyle (obj, options) {
  2261. var style, update, remove, result;
  2262. // If a transform function was defined, run it on the css
  2263. if (options.transform && obj.css) {
  2264. result = options.transform(obj.css);
  2265. if (result) {
  2266. // If transform returns a value, use that instead of the original css.
  2267. // This allows running runtime transformations on the css.
  2268. obj.css = result;
  2269. } else {
  2270. // If the transform function returns a falsy value, don't add this css.
  2271. // This allows conditional loading of css
  2272. return function() {
  2273. // noop
  2274. };
  2275. }
  2276. }
  2277. if (options.singleton) {
  2278. var styleIndex = singletonCounter++;
  2279. style = singleton || (singleton = createStyleElement(options));
  2280. update = applyToSingletonTag.bind(null, style, styleIndex, false);
  2281. remove = applyToSingletonTag.bind(null, style, styleIndex, true);
  2282. } else if (
  2283. obj.sourceMap &&
  2284. typeof URL === "function" &&
  2285. typeof URL.createObjectURL === "function" &&
  2286. typeof URL.revokeObjectURL === "function" &&
  2287. typeof Blob === "function" &&
  2288. typeof btoa === "function"
  2289. ) {
  2290. style = createLinkElement(options);
  2291. update = updateLink.bind(null, style, options);
  2292. remove = function () {
  2293. removeStyleElement(style);
  2294. if(style.href) URL.revokeObjectURL(style.href);
  2295. };
  2296. } else {
  2297. style = createStyleElement(options);
  2298. update = applyToTag.bind(null, style);
  2299. remove = function () {
  2300. removeStyleElement(style);
  2301. };
  2302. }
  2303. update(obj);
  2304. return function updateStyle (newObj) {
  2305. if (newObj) {
  2306. if (
  2307. newObj.css === obj.css &&
  2308. newObj.media === obj.media &&
  2309. newObj.sourceMap === obj.sourceMap
  2310. ) {
  2311. return;
  2312. }
  2313. update(obj = newObj);
  2314. } else {
  2315. remove();
  2316. }
  2317. };
  2318. }
  2319. var replaceText = (function () {
  2320. var textStore = [];
  2321. return function (index, replacement) {
  2322. textStore[index] = replacement;
  2323. return textStore.filter(Boolean).join('\n');
  2324. };
  2325. })();
  2326. function applyToSingletonTag (style, index, remove, obj) {
  2327. var css = remove ? "" : obj.css;
  2328. if (style.styleSheet) {
  2329. style.styleSheet.cssText = replaceText(index, css);
  2330. } else {
  2331. var cssNode = document.createTextNode(css);
  2332. var childNodes = style.childNodes;
  2333. if (childNodes[index]) style.removeChild(childNodes[index]);
  2334. if (childNodes.length) {
  2335. style.insertBefore(cssNode, childNodes[index]);
  2336. } else {
  2337. style.appendChild(cssNode);
  2338. }
  2339. }
  2340. }
  2341. function applyToTag (style, obj) {
  2342. var css = obj.css;
  2343. var media = obj.media;
  2344. if(media) {
  2345. style.setAttribute("media", media)
  2346. }
  2347. if(style.styleSheet) {
  2348. style.styleSheet.cssText = css;
  2349. } else {
  2350. while(style.firstChild) {
  2351. style.removeChild(style.firstChild);
  2352. }
  2353. style.appendChild(document.createTextNode(css));
  2354. }
  2355. }
  2356. function updateLink (link, options, obj) {
  2357. var css = obj.css;
  2358. var sourceMap = obj.sourceMap;
  2359. /*
  2360. If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
  2361. and there is no publicPath defined then lets turn convertToAbsoluteUrls
  2362. on by default. Otherwise default to the convertToAbsoluteUrls option
  2363. directly
  2364. */
  2365. var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
  2366. if (options.convertToAbsoluteUrls || autoFixUrls) {
  2367. css = fixUrls(css);
  2368. }
  2369. if (sourceMap) {
  2370. // http://stackoverflow.com/a/26603875
  2371. css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
  2372. }
  2373. var blob = new Blob([css], { type: "text/css" });
  2374. var oldSrc = link.href;
  2375. link.href = URL.createObjectURL(blob);
  2376. if(oldSrc) URL.revokeObjectURL(oldSrc);
  2377. }
  2378. /***/ }),
  2379. /* 51 */
  2380. /***/ (function(module, exports, __webpack_require__) {
  2381. (function webpackUniversalModuleDefinition(root, factory) {
  2382. if(true)
  2383. module.exports = factory(__webpack_require__(138));
  2384. else if(typeof define === 'function' && define.amd)
  2385. define(["sortablejs"], factory);
  2386. else if(typeof exports === 'object')
  2387. exports["vuedraggable"] = factory(require("sortablejs"));
  2388. else
  2389. root["vuedraggable"] = factory(root["Sortable"]);
  2390. })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE_a352__) {
  2391. return /******/ (function(modules) { // webpackBootstrap
  2392. /******/ // The module cache
  2393. /******/ var installedModules = {};
  2394. /******/
  2395. /******/ // The require function
  2396. /******/ function __webpack_require__(moduleId) {
  2397. /******/
  2398. /******/ // Check if module is in cache
  2399. /******/ if(installedModules[moduleId]) {
  2400. /******/ return installedModules[moduleId].exports;
  2401. /******/ }
  2402. /******/ // Create a new module (and put it into the cache)
  2403. /******/ var module = installedModules[moduleId] = {
  2404. /******/ i: moduleId,
  2405. /******/ l: false,
  2406. /******/ exports: {}
  2407. /******/ };
  2408. /******/
  2409. /******/ // Execute the module function
  2410. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  2411. /******/
  2412. /******/ // Flag the module as loaded
  2413. /******/ module.l = true;
  2414. /******/
  2415. /******/ // Return the exports of the module
  2416. /******/ return module.exports;
  2417. /******/ }
  2418. /******/
  2419. /******/
  2420. /******/ // expose the modules object (__webpack_modules__)
  2421. /******/ __webpack_require__.m = modules;
  2422. /******/
  2423. /******/ // expose the module cache
  2424. /******/ __webpack_require__.c = installedModules;
  2425. /******/
  2426. /******/ // define getter function for harmony exports
  2427. /******/ __webpack_require__.d = function(exports, name, getter) {
  2428. /******/ if(!__webpack_require__.o(exports, name)) {
  2429. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  2430. /******/ }
  2431. /******/ };
  2432. /******/
  2433. /******/ // define __esModule on exports
  2434. /******/ __webpack_require__.r = function(exports) {
  2435. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  2436. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  2437. /******/ }
  2438. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  2439. /******/ };
  2440. /******/
  2441. /******/ // create a fake namespace object
  2442. /******/ // mode & 1: value is a module id, require it
  2443. /******/ // mode & 2: merge all properties of value into the ns
  2444. /******/ // mode & 4: return value when already ns object
  2445. /******/ // mode & 8|1: behave like require
  2446. /******/ __webpack_require__.t = function(value, mode) {
  2447. /******/ if(mode & 1) value = __webpack_require__(value);
  2448. /******/ if(mode & 8) return value;
  2449. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  2450. /******/ var ns = Object.create(null);
  2451. /******/ __webpack_require__.r(ns);
  2452. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  2453. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  2454. /******/ return ns;
  2455. /******/ };
  2456. /******/
  2457. /******/ // getDefaultExport function for compatibility with non-harmony modules
  2458. /******/ __webpack_require__.n = function(module) {
  2459. /******/ var getter = module && module.__esModule ?
  2460. /******/ function getDefault() { return module['default']; } :
  2461. /******/ function getModuleExports() { return module; };
  2462. /******/ __webpack_require__.d(getter, 'a', getter);
  2463. /******/ return getter;
  2464. /******/ };
  2465. /******/
  2466. /******/ // Object.prototype.hasOwnProperty.call
  2467. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  2468. /******/
  2469. /******/ // __webpack_public_path__
  2470. /******/ __webpack_require__.p = "";
  2471. /******/
  2472. /******/
  2473. /******/ // Load entry module and return exports
  2474. /******/ return __webpack_require__(__webpack_require__.s = "fb15");
  2475. /******/ })
  2476. /************************************************************************/
  2477. /******/ ({
  2478. /***/ "01f9":
  2479. /***/ (function(module, exports, __webpack_require__) {
  2480. "use strict";
  2481. var LIBRARY = __webpack_require__("2d00");
  2482. var $export = __webpack_require__("5ca1");
  2483. var redefine = __webpack_require__("2aba");
  2484. var hide = __webpack_require__("32e9");
  2485. var Iterators = __webpack_require__("84f2");
  2486. var $iterCreate = __webpack_require__("41a0");
  2487. var setToStringTag = __webpack_require__("7f20");
  2488. var getPrototypeOf = __webpack_require__("38fd");
  2489. var ITERATOR = __webpack_require__("2b4c")('iterator');
  2490. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  2491. var FF_ITERATOR = '@@iterator';
  2492. var KEYS = 'keys';
  2493. var VALUES = 'values';
  2494. var returnThis = function () { return this; };
  2495. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  2496. $iterCreate(Constructor, NAME, next);
  2497. var getMethod = function (kind) {
  2498. if (!BUGGY && kind in proto) return proto[kind];
  2499. switch (kind) {
  2500. case KEYS: return function keys() { return new Constructor(this, kind); };
  2501. case VALUES: return function values() { return new Constructor(this, kind); };
  2502. } return function entries() { return new Constructor(this, kind); };
  2503. };
  2504. var TAG = NAME + ' Iterator';
  2505. var DEF_VALUES = DEFAULT == VALUES;
  2506. var VALUES_BUG = false;
  2507. var proto = Base.prototype;
  2508. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  2509. var $default = $native || getMethod(DEFAULT);
  2510. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  2511. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  2512. var methods, key, IteratorPrototype;
  2513. // Fix native
  2514. if ($anyNative) {
  2515. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  2516. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  2517. // Set @@toStringTag to native iterators
  2518. setToStringTag(IteratorPrototype, TAG, true);
  2519. // fix for some old engines
  2520. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  2521. }
  2522. }
  2523. // fix Array#{values, @@iterator}.name in V8 / FF
  2524. if (DEF_VALUES && $native && $native.name !== VALUES) {
  2525. VALUES_BUG = true;
  2526. $default = function values() { return $native.call(this); };
  2527. }
  2528. // Define iterator
  2529. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  2530. hide(proto, ITERATOR, $default);
  2531. }
  2532. // Plug for library
  2533. Iterators[NAME] = $default;
  2534. Iterators[TAG] = returnThis;
  2535. if (DEFAULT) {
  2536. methods = {
  2537. values: DEF_VALUES ? $default : getMethod(VALUES),
  2538. keys: IS_SET ? $default : getMethod(KEYS),
  2539. entries: $entries
  2540. };
  2541. if (FORCED) for (key in methods) {
  2542. if (!(key in proto)) redefine(proto, key, methods[key]);
  2543. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  2544. }
  2545. return methods;
  2546. };
  2547. /***/ }),
  2548. /***/ "02f4":
  2549. /***/ (function(module, exports, __webpack_require__) {
  2550. var toInteger = __webpack_require__("4588");
  2551. var defined = __webpack_require__("be13");
  2552. // true -> String#at
  2553. // false -> String#codePointAt
  2554. module.exports = function (TO_STRING) {
  2555. return function (that, pos) {
  2556. var s = String(defined(that));
  2557. var i = toInteger(pos);
  2558. var l = s.length;
  2559. var a, b;
  2560. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  2561. a = s.charCodeAt(i);
  2562. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  2563. ? TO_STRING ? s.charAt(i) : a
  2564. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  2565. };
  2566. };
  2567. /***/ }),
  2568. /***/ "0390":
  2569. /***/ (function(module, exports, __webpack_require__) {
  2570. "use strict";
  2571. var at = __webpack_require__("02f4")(true);
  2572. // `AdvanceStringIndex` abstract operation
  2573. // https://tc39.github.io/ecma262/#sec-advancestringindex
  2574. module.exports = function (S, index, unicode) {
  2575. return index + (unicode ? at(S, index).length : 1);
  2576. };
  2577. /***/ }),
  2578. /***/ "0bfb":
  2579. /***/ (function(module, exports, __webpack_require__) {
  2580. "use strict";
  2581. // 21.2.5.3 get RegExp.prototype.flags
  2582. var anObject = __webpack_require__("cb7c");
  2583. module.exports = function () {
  2584. var that = anObject(this);
  2585. var result = '';
  2586. if (that.global) result += 'g';
  2587. if (that.ignoreCase) result += 'i';
  2588. if (that.multiline) result += 'm';
  2589. if (that.unicode) result += 'u';
  2590. if (that.sticky) result += 'y';
  2591. return result;
  2592. };
  2593. /***/ }),
  2594. /***/ "0d58":
  2595. /***/ (function(module, exports, __webpack_require__) {
  2596. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  2597. var $keys = __webpack_require__("ce10");
  2598. var enumBugKeys = __webpack_require__("e11e");
  2599. module.exports = Object.keys || function keys(O) {
  2600. return $keys(O, enumBugKeys);
  2601. };
  2602. /***/ }),
  2603. /***/ "1495":
  2604. /***/ (function(module, exports, __webpack_require__) {
  2605. var dP = __webpack_require__("86cc");
  2606. var anObject = __webpack_require__("cb7c");
  2607. var getKeys = __webpack_require__("0d58");
  2608. module.exports = __webpack_require__("9e1e") ? Object.defineProperties : function defineProperties(O, Properties) {
  2609. anObject(O);
  2610. var keys = getKeys(Properties);
  2611. var length = keys.length;
  2612. var i = 0;
  2613. var P;
  2614. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  2615. return O;
  2616. };
  2617. /***/ }),
  2618. /***/ "214f":
  2619. /***/ (function(module, exports, __webpack_require__) {
  2620. "use strict";
  2621. __webpack_require__("b0c5");
  2622. var redefine = __webpack_require__("2aba");
  2623. var hide = __webpack_require__("32e9");
  2624. var fails = __webpack_require__("79e5");
  2625. var defined = __webpack_require__("be13");
  2626. var wks = __webpack_require__("2b4c");
  2627. var regexpExec = __webpack_require__("520a");
  2628. var SPECIES = wks('species');
  2629. var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
  2630. // #replace needs built-in support for named groups.
  2631. // #match works fine because it just return the exec results, even if it has
  2632. // a "grops" property.
  2633. var re = /./;
  2634. re.exec = function () {
  2635. var result = [];
  2636. result.groups = { a: '7' };
  2637. return result;
  2638. };
  2639. return ''.replace(re, '$<a>') !== '7';
  2640. });
  2641. var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
  2642. // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
  2643. var re = /(?:)/;
  2644. var originalExec = re.exec;
  2645. re.exec = function () { return originalExec.apply(this, arguments); };
  2646. var result = 'ab'.split(re);
  2647. return result.length === 2 && result[0] === 'a' && result[1] === 'b';
  2648. })();
  2649. module.exports = function (KEY, length, exec) {
  2650. var SYMBOL = wks(KEY);
  2651. var DELEGATES_TO_SYMBOL = !fails(function () {
  2652. // String methods call symbol-named RegEp methods
  2653. var O = {};
  2654. O[SYMBOL] = function () { return 7; };
  2655. return ''[KEY](O) != 7;
  2656. });
  2657. var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
  2658. // Symbol-named RegExp methods call .exec
  2659. var execCalled = false;
  2660. var re = /a/;
  2661. re.exec = function () { execCalled = true; return null; };
  2662. if (KEY === 'split') {
  2663. // RegExp[@@split] doesn't call the regex's exec method, but first creates
  2664. // a new one. We need to return the patched regex when creating the new one.
  2665. re.constructor = {};
  2666. re.constructor[SPECIES] = function () { return re; };
  2667. }
  2668. re[SYMBOL]('');
  2669. return !execCalled;
  2670. }) : undefined;
  2671. if (
  2672. !DELEGATES_TO_SYMBOL ||
  2673. !DELEGATES_TO_EXEC ||
  2674. (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
  2675. (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
  2676. ) {
  2677. var nativeRegExpMethod = /./[SYMBOL];
  2678. var fns = exec(
  2679. defined,
  2680. SYMBOL,
  2681. ''[KEY],
  2682. function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
  2683. if (regexp.exec === regexpExec) {
  2684. if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
  2685. // The native String method already delegates to @@method (this
  2686. // polyfilled function), leasing to infinite recursion.
  2687. // We avoid it by directly calling the native @@method method.
  2688. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
  2689. }
  2690. return { done: true, value: nativeMethod.call(str, regexp, arg2) };
  2691. }
  2692. return { done: false };
  2693. }
  2694. );
  2695. var strfn = fns[0];
  2696. var rxfn = fns[1];
  2697. redefine(String.prototype, KEY, strfn);
  2698. hide(RegExp.prototype, SYMBOL, length == 2
  2699. // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
  2700. // 21.2.5.11 RegExp.prototype[@@split](string, limit)
  2701. ? function (string, arg) { return rxfn.call(string, this, arg); }
  2702. // 21.2.5.6 RegExp.prototype[@@match](string)
  2703. // 21.2.5.9 RegExp.prototype[@@search](string)
  2704. : function (string) { return rxfn.call(string, this); }
  2705. );
  2706. }
  2707. };
  2708. /***/ }),
  2709. /***/ "230e":
  2710. /***/ (function(module, exports, __webpack_require__) {
  2711. var isObject = __webpack_require__("d3f4");
  2712. var document = __webpack_require__("7726").document;
  2713. // typeof document.createElement is 'object' in old IE
  2714. var is = isObject(document) && isObject(document.createElement);
  2715. module.exports = function (it) {
  2716. return is ? document.createElement(it) : {};
  2717. };
  2718. /***/ }),
  2719. /***/ "23c6":
  2720. /***/ (function(module, exports, __webpack_require__) {
  2721. // getting tag from 19.1.3.6 Object.prototype.toString()
  2722. var cof = __webpack_require__("2d95");
  2723. var TAG = __webpack_require__("2b4c")('toStringTag');
  2724. // ES3 wrong here
  2725. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  2726. // fallback for IE11 Script Access Denied error
  2727. var tryGet = function (it, key) {
  2728. try {
  2729. return it[key];
  2730. } catch (e) { /* empty */ }
  2731. };
  2732. module.exports = function (it) {
  2733. var O, T, B;
  2734. return it === undefined ? 'Undefined' : it === null ? 'Null'
  2735. // @@toStringTag case
  2736. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  2737. // builtinTag case
  2738. : ARG ? cof(O)
  2739. // ES3 arguments fallback
  2740. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  2741. };
  2742. /***/ }),
  2743. /***/ "2621":
  2744. /***/ (function(module, exports) {
  2745. exports.f = Object.getOwnPropertySymbols;
  2746. /***/ }),
  2747. /***/ "2aba":
  2748. /***/ (function(module, exports, __webpack_require__) {
  2749. var global = __webpack_require__("7726");
  2750. var hide = __webpack_require__("32e9");
  2751. var has = __webpack_require__("69a8");
  2752. var SRC = __webpack_require__("ca5a")('src');
  2753. var $toString = __webpack_require__("fa5b");
  2754. var TO_STRING = 'toString';
  2755. var TPL = ('' + $toString).split(TO_STRING);
  2756. __webpack_require__("8378").inspectSource = function (it) {
  2757. return $toString.call(it);
  2758. };
  2759. (module.exports = function (O, key, val, safe) {
  2760. var isFunction = typeof val == 'function';
  2761. if (isFunction) has(val, 'name') || hide(val, 'name', key);
  2762. if (O[key] === val) return;
  2763. if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
  2764. if (O === global) {
  2765. O[key] = val;
  2766. } else if (!safe) {
  2767. delete O[key];
  2768. hide(O, key, val);
  2769. } else if (O[key]) {
  2770. O[key] = val;
  2771. } else {
  2772. hide(O, key, val);
  2773. }
  2774. // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  2775. })(Function.prototype, TO_STRING, function toString() {
  2776. return typeof this == 'function' && this[SRC] || $toString.call(this);
  2777. });
  2778. /***/ }),
  2779. /***/ "2aeb":
  2780. /***/ (function(module, exports, __webpack_require__) {
  2781. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  2782. var anObject = __webpack_require__("cb7c");
  2783. var dPs = __webpack_require__("1495");
  2784. var enumBugKeys = __webpack_require__("e11e");
  2785. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  2786. var Empty = function () { /* empty */ };
  2787. var PROTOTYPE = 'prototype';
  2788. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  2789. var createDict = function () {
  2790. // Thrash, waste and sodomy: IE GC bug
  2791. var iframe = __webpack_require__("230e")('iframe');
  2792. var i = enumBugKeys.length;
  2793. var lt = '<';
  2794. var gt = '>';
  2795. var iframeDocument;
  2796. iframe.style.display = 'none';
  2797. __webpack_require__("fab2").appendChild(iframe);
  2798. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  2799. // createDict = iframe.contentWindow.Object;
  2800. // html.removeChild(iframe);
  2801. iframeDocument = iframe.contentWindow.document;
  2802. iframeDocument.open();
  2803. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  2804. iframeDocument.close();
  2805. createDict = iframeDocument.F;
  2806. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  2807. return createDict();
  2808. };
  2809. module.exports = Object.create || function create(O, Properties) {
  2810. var result;
  2811. if (O !== null) {
  2812. Empty[PROTOTYPE] = anObject(O);
  2813. result = new Empty();
  2814. Empty[PROTOTYPE] = null;
  2815. // add "__proto__" for Object.getPrototypeOf polyfill
  2816. result[IE_PROTO] = O;
  2817. } else result = createDict();
  2818. return Properties === undefined ? result : dPs(result, Properties);
  2819. };
  2820. /***/ }),
  2821. /***/ "2b4c":
  2822. /***/ (function(module, exports, __webpack_require__) {
  2823. var store = __webpack_require__("5537")('wks');
  2824. var uid = __webpack_require__("ca5a");
  2825. var Symbol = __webpack_require__("7726").Symbol;
  2826. var USE_SYMBOL = typeof Symbol == 'function';
  2827. var $exports = module.exports = function (name) {
  2828. return store[name] || (store[name] =
  2829. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  2830. };
  2831. $exports.store = store;
  2832. /***/ }),
  2833. /***/ "2d00":
  2834. /***/ (function(module, exports) {
  2835. module.exports = false;
  2836. /***/ }),
  2837. /***/ "2d95":
  2838. /***/ (function(module, exports) {
  2839. var toString = {}.toString;
  2840. module.exports = function (it) {
  2841. return toString.call(it).slice(8, -1);
  2842. };
  2843. /***/ }),
  2844. /***/ "2fdb":
  2845. /***/ (function(module, exports, __webpack_require__) {
  2846. "use strict";
  2847. // 21.1.3.7 String.prototype.includes(searchString, position = 0)
  2848. var $export = __webpack_require__("5ca1");
  2849. var context = __webpack_require__("d2c8");
  2850. var INCLUDES = 'includes';
  2851. $export($export.P + $export.F * __webpack_require__("5147")(INCLUDES), 'String', {
  2852. includes: function includes(searchString /* , position = 0 */) {
  2853. return !!~context(this, searchString, INCLUDES)
  2854. .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
  2855. }
  2856. });
  2857. /***/ }),
  2858. /***/ "32e9":
  2859. /***/ (function(module, exports, __webpack_require__) {
  2860. var dP = __webpack_require__("86cc");
  2861. var createDesc = __webpack_require__("4630");
  2862. module.exports = __webpack_require__("9e1e") ? function (object, key, value) {
  2863. return dP.f(object, key, createDesc(1, value));
  2864. } : function (object, key, value) {
  2865. object[key] = value;
  2866. return object;
  2867. };
  2868. /***/ }),
  2869. /***/ "38fd":
  2870. /***/ (function(module, exports, __webpack_require__) {
  2871. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  2872. var has = __webpack_require__("69a8");
  2873. var toObject = __webpack_require__("4bf8");
  2874. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  2875. var ObjectProto = Object.prototype;
  2876. module.exports = Object.getPrototypeOf || function (O) {
  2877. O = toObject(O);
  2878. if (has(O, IE_PROTO)) return O[IE_PROTO];
  2879. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  2880. return O.constructor.prototype;
  2881. } return O instanceof Object ? ObjectProto : null;
  2882. };
  2883. /***/ }),
  2884. /***/ "41a0":
  2885. /***/ (function(module, exports, __webpack_require__) {
  2886. "use strict";
  2887. var create = __webpack_require__("2aeb");
  2888. var descriptor = __webpack_require__("4630");
  2889. var setToStringTag = __webpack_require__("7f20");
  2890. var IteratorPrototype = {};
  2891. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  2892. __webpack_require__("32e9")(IteratorPrototype, __webpack_require__("2b4c")('iterator'), function () { return this; });
  2893. module.exports = function (Constructor, NAME, next) {
  2894. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  2895. setToStringTag(Constructor, NAME + ' Iterator');
  2896. };
  2897. /***/ }),
  2898. /***/ "456d":
  2899. /***/ (function(module, exports, __webpack_require__) {
  2900. // 19.1.2.14 Object.keys(O)
  2901. var toObject = __webpack_require__("4bf8");
  2902. var $keys = __webpack_require__("0d58");
  2903. __webpack_require__("5eda")('keys', function () {
  2904. return function keys(it) {
  2905. return $keys(toObject(it));
  2906. };
  2907. });
  2908. /***/ }),
  2909. /***/ "4588":
  2910. /***/ (function(module, exports) {
  2911. // 7.1.4 ToInteger
  2912. var ceil = Math.ceil;
  2913. var floor = Math.floor;
  2914. module.exports = function (it) {
  2915. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  2916. };
  2917. /***/ }),
  2918. /***/ "4630":
  2919. /***/ (function(module, exports) {
  2920. module.exports = function (bitmap, value) {
  2921. return {
  2922. enumerable: !(bitmap & 1),
  2923. configurable: !(bitmap & 2),
  2924. writable: !(bitmap & 4),
  2925. value: value
  2926. };
  2927. };
  2928. /***/ }),
  2929. /***/ "4bf8":
  2930. /***/ (function(module, exports, __webpack_require__) {
  2931. // 7.1.13 ToObject(argument)
  2932. var defined = __webpack_require__("be13");
  2933. module.exports = function (it) {
  2934. return Object(defined(it));
  2935. };
  2936. /***/ }),
  2937. /***/ "5147":
  2938. /***/ (function(module, exports, __webpack_require__) {
  2939. var MATCH = __webpack_require__("2b4c")('match');
  2940. module.exports = function (KEY) {
  2941. var re = /./;
  2942. try {
  2943. '/./'[KEY](re);
  2944. } catch (e) {
  2945. try {
  2946. re[MATCH] = false;
  2947. return !'/./'[KEY](re);
  2948. } catch (f) { /* empty */ }
  2949. } return true;
  2950. };
  2951. /***/ }),
  2952. /***/ "520a":
  2953. /***/ (function(module, exports, __webpack_require__) {
  2954. "use strict";
  2955. var regexpFlags = __webpack_require__("0bfb");
  2956. var nativeExec = RegExp.prototype.exec;
  2957. // This always refers to the native implementation, because the
  2958. // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  2959. // which loads this file before patching the method.
  2960. var nativeReplace = String.prototype.replace;
  2961. var patchedExec = nativeExec;
  2962. var LAST_INDEX = 'lastIndex';
  2963. var UPDATES_LAST_INDEX_WRONG = (function () {
  2964. var re1 = /a/,
  2965. re2 = /b*/g;
  2966. nativeExec.call(re1, 'a');
  2967. nativeExec.call(re2, 'a');
  2968. return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  2969. })();
  2970. // nonparticipating capturing group, copied from es5-shim's String#split patch.
  2971. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
  2972. var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
  2973. if (PATCH) {
  2974. patchedExec = function exec(str) {
  2975. var re = this;
  2976. var lastIndex, reCopy, match, i;
  2977. if (NPCG_INCLUDED) {
  2978. reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
  2979. }
  2980. if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
  2981. match = nativeExec.call(re, str);
  2982. if (UPDATES_LAST_INDEX_WRONG && match) {
  2983. re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
  2984. }
  2985. if (NPCG_INCLUDED && match && match.length > 1) {
  2986. // Fix browsers whose `exec` methods don't consistently return `undefined`
  2987. // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
  2988. // eslint-disable-next-line no-loop-func
  2989. nativeReplace.call(match[0], reCopy, function () {
  2990. for (i = 1; i < arguments.length - 2; i++) {
  2991. if (arguments[i] === undefined) match[i] = undefined;
  2992. }
  2993. });
  2994. }
  2995. return match;
  2996. };
  2997. }
  2998. module.exports = patchedExec;
  2999. /***/ }),
  3000. /***/ "52a7":
  3001. /***/ (function(module, exports) {
  3002. exports.f = {}.propertyIsEnumerable;
  3003. /***/ }),
  3004. /***/ "5537":
  3005. /***/ (function(module, exports, __webpack_require__) {
  3006. var core = __webpack_require__("8378");
  3007. var global = __webpack_require__("7726");
  3008. var SHARED = '__core-js_shared__';
  3009. var store = global[SHARED] || (global[SHARED] = {});
  3010. (module.exports = function (key, value) {
  3011. return store[key] || (store[key] = value !== undefined ? value : {});
  3012. })('versions', []).push({
  3013. version: core.version,
  3014. mode: __webpack_require__("2d00") ? 'pure' : 'global',
  3015. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  3016. });
  3017. /***/ }),
  3018. /***/ "5ca1":
  3019. /***/ (function(module, exports, __webpack_require__) {
  3020. var global = __webpack_require__("7726");
  3021. var core = __webpack_require__("8378");
  3022. var hide = __webpack_require__("32e9");
  3023. var redefine = __webpack_require__("2aba");
  3024. var ctx = __webpack_require__("9b43");
  3025. var PROTOTYPE = 'prototype';
  3026. var $export = function (type, name, source) {
  3027. var IS_FORCED = type & $export.F;
  3028. var IS_GLOBAL = type & $export.G;
  3029. var IS_STATIC = type & $export.S;
  3030. var IS_PROTO = type & $export.P;
  3031. var IS_BIND = type & $export.B;
  3032. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
  3033. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  3034. var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
  3035. var key, own, out, exp;
  3036. if (IS_GLOBAL) source = name;
  3037. for (key in source) {
  3038. // contains in native
  3039. own = !IS_FORCED && target && target[key] !== undefined;
  3040. // export native or passed
  3041. out = (own ? target : source)[key];
  3042. // bind timers to global for call from export context
  3043. exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  3044. // extend global
  3045. if (target) redefine(target, key, out, type & $export.U);
  3046. // export
  3047. if (exports[key] != out) hide(exports, key, exp);
  3048. if (IS_PROTO && expProto[key] != out) expProto[key] = out;
  3049. }
  3050. };
  3051. global.core = core;
  3052. // type bitmap
  3053. $export.F = 1; // forced
  3054. $export.G = 2; // global
  3055. $export.S = 4; // static
  3056. $export.P = 8; // proto
  3057. $export.B = 16; // bind
  3058. $export.W = 32; // wrap
  3059. $export.U = 64; // safe
  3060. $export.R = 128; // real proto method for `library`
  3061. module.exports = $export;
  3062. /***/ }),
  3063. /***/ "5eda":
  3064. /***/ (function(module, exports, __webpack_require__) {
  3065. // most Object methods by ES6 should accept primitives
  3066. var $export = __webpack_require__("5ca1");
  3067. var core = __webpack_require__("8378");
  3068. var fails = __webpack_require__("79e5");
  3069. module.exports = function (KEY, exec) {
  3070. var fn = (core.Object || {})[KEY] || Object[KEY];
  3071. var exp = {};
  3072. exp[KEY] = exec(fn);
  3073. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  3074. };
  3075. /***/ }),
  3076. /***/ "5f1b":
  3077. /***/ (function(module, exports, __webpack_require__) {
  3078. "use strict";
  3079. var classof = __webpack_require__("23c6");
  3080. var builtinExec = RegExp.prototype.exec;
  3081. // `RegExpExec` abstract operation
  3082. // https://tc39.github.io/ecma262/#sec-regexpexec
  3083. module.exports = function (R, S) {
  3084. var exec = R.exec;
  3085. if (typeof exec === 'function') {
  3086. var result = exec.call(R, S);
  3087. if (typeof result !== 'object') {
  3088. throw new TypeError('RegExp exec method returned something other than an Object or null');
  3089. }
  3090. return result;
  3091. }
  3092. if (classof(R) !== 'RegExp') {
  3093. throw new TypeError('RegExp#exec called on incompatible receiver');
  3094. }
  3095. return builtinExec.call(R, S);
  3096. };
  3097. /***/ }),
  3098. /***/ "613b":
  3099. /***/ (function(module, exports, __webpack_require__) {
  3100. var shared = __webpack_require__("5537")('keys');
  3101. var uid = __webpack_require__("ca5a");
  3102. module.exports = function (key) {
  3103. return shared[key] || (shared[key] = uid(key));
  3104. };
  3105. /***/ }),
  3106. /***/ "626a":
  3107. /***/ (function(module, exports, __webpack_require__) {
  3108. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  3109. var cof = __webpack_require__("2d95");
  3110. // eslint-disable-next-line no-prototype-builtins
  3111. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  3112. return cof(it) == 'String' ? it.split('') : Object(it);
  3113. };
  3114. /***/ }),
  3115. /***/ "6762":
  3116. /***/ (function(module, exports, __webpack_require__) {
  3117. "use strict";
  3118. // https://github.com/tc39/Array.prototype.includes
  3119. var $export = __webpack_require__("5ca1");
  3120. var $includes = __webpack_require__("c366")(true);
  3121. $export($export.P, 'Array', {
  3122. includes: function includes(el /* , fromIndex = 0 */) {
  3123. return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
  3124. }
  3125. });
  3126. __webpack_require__("9c6c")('includes');
  3127. /***/ }),
  3128. /***/ "6821":
  3129. /***/ (function(module, exports, __webpack_require__) {
  3130. // to indexed object, toObject with fallback for non-array-like ES3 strings
  3131. var IObject = __webpack_require__("626a");
  3132. var defined = __webpack_require__("be13");
  3133. module.exports = function (it) {
  3134. return IObject(defined(it));
  3135. };
  3136. /***/ }),
  3137. /***/ "69a8":
  3138. /***/ (function(module, exports) {
  3139. var hasOwnProperty = {}.hasOwnProperty;
  3140. module.exports = function (it, key) {
  3141. return hasOwnProperty.call(it, key);
  3142. };
  3143. /***/ }),
  3144. /***/ "6a99":
  3145. /***/ (function(module, exports, __webpack_require__) {
  3146. // 7.1.1 ToPrimitive(input [, PreferredType])
  3147. var isObject = __webpack_require__("d3f4");
  3148. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  3149. // and the second argument - flag - preferred type is a string
  3150. module.exports = function (it, S) {
  3151. if (!isObject(it)) return it;
  3152. var fn, val;
  3153. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  3154. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  3155. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  3156. throw TypeError("Can't convert object to primitive value");
  3157. };
  3158. /***/ }),
  3159. /***/ "7333":
  3160. /***/ (function(module, exports, __webpack_require__) {
  3161. "use strict";
  3162. // 19.1.2.1 Object.assign(target, source, ...)
  3163. var getKeys = __webpack_require__("0d58");
  3164. var gOPS = __webpack_require__("2621");
  3165. var pIE = __webpack_require__("52a7");
  3166. var toObject = __webpack_require__("4bf8");
  3167. var IObject = __webpack_require__("626a");
  3168. var $assign = Object.assign;
  3169. // should work with symbols and should have deterministic property order (V8 bug)
  3170. module.exports = !$assign || __webpack_require__("79e5")(function () {
  3171. var A = {};
  3172. var B = {};
  3173. // eslint-disable-next-line no-undef
  3174. var S = Symbol();
  3175. var K = 'abcdefghijklmnopqrst';
  3176. A[S] = 7;
  3177. K.split('').forEach(function (k) { B[k] = k; });
  3178. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  3179. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  3180. var T = toObject(target);
  3181. var aLen = arguments.length;
  3182. var index = 1;
  3183. var getSymbols = gOPS.f;
  3184. var isEnum = pIE.f;
  3185. while (aLen > index) {
  3186. var S = IObject(arguments[index++]);
  3187. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  3188. var length = keys.length;
  3189. var j = 0;
  3190. var key;
  3191. while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  3192. } return T;
  3193. } : $assign;
  3194. /***/ }),
  3195. /***/ "7726":
  3196. /***/ (function(module, exports) {
  3197. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  3198. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  3199. ? window : typeof self != 'undefined' && self.Math == Math ? self
  3200. // eslint-disable-next-line no-new-func
  3201. : Function('return this')();
  3202. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  3203. /***/ }),
  3204. /***/ "77f1":
  3205. /***/ (function(module, exports, __webpack_require__) {
  3206. var toInteger = __webpack_require__("4588");
  3207. var max = Math.max;
  3208. var min = Math.min;
  3209. module.exports = function (index, length) {
  3210. index = toInteger(index);
  3211. return index < 0 ? max(index + length, 0) : min(index, length);
  3212. };
  3213. /***/ }),
  3214. /***/ "79e5":
  3215. /***/ (function(module, exports) {
  3216. module.exports = function (exec) {
  3217. try {
  3218. return !!exec();
  3219. } catch (e) {
  3220. return true;
  3221. }
  3222. };
  3223. /***/ }),
  3224. /***/ "7f20":
  3225. /***/ (function(module, exports, __webpack_require__) {
  3226. var def = __webpack_require__("86cc").f;
  3227. var has = __webpack_require__("69a8");
  3228. var TAG = __webpack_require__("2b4c")('toStringTag');
  3229. module.exports = function (it, tag, stat) {
  3230. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  3231. };
  3232. /***/ }),
  3233. /***/ "8378":
  3234. /***/ (function(module, exports) {
  3235. var core = module.exports = { version: '2.6.5' };
  3236. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  3237. /***/ }),
  3238. /***/ "84f2":
  3239. /***/ (function(module, exports) {
  3240. module.exports = {};
  3241. /***/ }),
  3242. /***/ "86cc":
  3243. /***/ (function(module, exports, __webpack_require__) {
  3244. var anObject = __webpack_require__("cb7c");
  3245. var IE8_DOM_DEFINE = __webpack_require__("c69a");
  3246. var toPrimitive = __webpack_require__("6a99");
  3247. var dP = Object.defineProperty;
  3248. exports.f = __webpack_require__("9e1e") ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  3249. anObject(O);
  3250. P = toPrimitive(P, true);
  3251. anObject(Attributes);
  3252. if (IE8_DOM_DEFINE) try {
  3253. return dP(O, P, Attributes);
  3254. } catch (e) { /* empty */ }
  3255. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  3256. if ('value' in Attributes) O[P] = Attributes.value;
  3257. return O;
  3258. };
  3259. /***/ }),
  3260. /***/ "9b43":
  3261. /***/ (function(module, exports, __webpack_require__) {
  3262. // optional / simple context binding
  3263. var aFunction = __webpack_require__("d8e8");
  3264. module.exports = function (fn, that, length) {
  3265. aFunction(fn);
  3266. if (that === undefined) return fn;
  3267. switch (length) {
  3268. case 1: return function (a) {
  3269. return fn.call(that, a);
  3270. };
  3271. case 2: return function (a, b) {
  3272. return fn.call(that, a, b);
  3273. };
  3274. case 3: return function (a, b, c) {
  3275. return fn.call(that, a, b, c);
  3276. };
  3277. }
  3278. return function (/* ...args */) {
  3279. return fn.apply(that, arguments);
  3280. };
  3281. };
  3282. /***/ }),
  3283. /***/ "9c6c":
  3284. /***/ (function(module, exports, __webpack_require__) {
  3285. // 22.1.3.31 Array.prototype[@@unscopables]
  3286. var UNSCOPABLES = __webpack_require__("2b4c")('unscopables');
  3287. var ArrayProto = Array.prototype;
  3288. if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__("32e9")(ArrayProto, UNSCOPABLES, {});
  3289. module.exports = function (key) {
  3290. ArrayProto[UNSCOPABLES][key] = true;
  3291. };
  3292. /***/ }),
  3293. /***/ "9def":
  3294. /***/ (function(module, exports, __webpack_require__) {
  3295. // 7.1.15 ToLength
  3296. var toInteger = __webpack_require__("4588");
  3297. var min = Math.min;
  3298. module.exports = function (it) {
  3299. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  3300. };
  3301. /***/ }),
  3302. /***/ "9e1e":
  3303. /***/ (function(module, exports, __webpack_require__) {
  3304. // Thank's IE8 for his funny defineProperty
  3305. module.exports = !__webpack_require__("79e5")(function () {
  3306. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  3307. });
  3308. /***/ }),
  3309. /***/ "a352":
  3310. /***/ (function(module, exports) {
  3311. module.exports = __WEBPACK_EXTERNAL_MODULE_a352__;
  3312. /***/ }),
  3313. /***/ "a481":
  3314. /***/ (function(module, exports, __webpack_require__) {
  3315. "use strict";
  3316. var anObject = __webpack_require__("cb7c");
  3317. var toObject = __webpack_require__("4bf8");
  3318. var toLength = __webpack_require__("9def");
  3319. var toInteger = __webpack_require__("4588");
  3320. var advanceStringIndex = __webpack_require__("0390");
  3321. var regExpExec = __webpack_require__("5f1b");
  3322. var max = Math.max;
  3323. var min = Math.min;
  3324. var floor = Math.floor;
  3325. var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  3326. var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
  3327. var maybeToString = function (it) {
  3328. return it === undefined ? it : String(it);
  3329. };
  3330. // @@replace logic
  3331. __webpack_require__("214f")('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
  3332. return [
  3333. // `String.prototype.replace` method
  3334. // https://tc39.github.io/ecma262/#sec-string.prototype.replace
  3335. function replace(searchValue, replaceValue) {
  3336. var O = defined(this);
  3337. var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
  3338. return fn !== undefined
  3339. ? fn.call(searchValue, O, replaceValue)
  3340. : $replace.call(String(O), searchValue, replaceValue);
  3341. },
  3342. // `RegExp.prototype[@@replace]` method
  3343. // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
  3344. function (regexp, replaceValue) {
  3345. var res = maybeCallNative($replace, regexp, this, replaceValue);
  3346. if (res.done) return res.value;
  3347. var rx = anObject(regexp);
  3348. var S = String(this);
  3349. var functionalReplace = typeof replaceValue === 'function';
  3350. if (!functionalReplace) replaceValue = String(replaceValue);
  3351. var global = rx.global;
  3352. if (global) {
  3353. var fullUnicode = rx.unicode;
  3354. rx.lastIndex = 0;
  3355. }
  3356. var results = [];
  3357. while (true) {
  3358. var result = regExpExec(rx, S);
  3359. if (result === null) break;
  3360. results.push(result);
  3361. if (!global) break;
  3362. var matchStr = String(result[0]);
  3363. if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
  3364. }
  3365. var accumulatedResult = '';
  3366. var nextSourcePosition = 0;
  3367. for (var i = 0; i < results.length; i++) {
  3368. result = results[i];
  3369. var matched = String(result[0]);
  3370. var position = max(min(toInteger(result.index), S.length), 0);
  3371. var captures = [];
  3372. // NOTE: This is equivalent to
  3373. // captures = result.slice(1).map(maybeToString)
  3374. // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
  3375. // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
  3376. // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
  3377. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
  3378. var namedCaptures = result.groups;
  3379. if (functionalReplace) {
  3380. var replacerArgs = [matched].concat(captures, position, S);
  3381. if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
  3382. var replacement = String(replaceValue.apply(undefined, replacerArgs));
  3383. } else {
  3384. replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
  3385. }
  3386. if (position >= nextSourcePosition) {
  3387. accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
  3388. nextSourcePosition = position + matched.length;
  3389. }
  3390. }
  3391. return accumulatedResult + S.slice(nextSourcePosition);
  3392. }
  3393. ];
  3394. // https://tc39.github.io/ecma262/#sec-getsubstitution
  3395. function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
  3396. var tailPos = position + matched.length;
  3397. var m = captures.length;
  3398. var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
  3399. if (namedCaptures !== undefined) {
  3400. namedCaptures = toObject(namedCaptures);
  3401. symbols = SUBSTITUTION_SYMBOLS;
  3402. }
  3403. return $replace.call(replacement, symbols, function (match, ch) {
  3404. var capture;
  3405. switch (ch.charAt(0)) {
  3406. case '$': return '$';
  3407. case '&': return matched;
  3408. case '`': return str.slice(0, position);
  3409. case "'": return str.slice(tailPos);
  3410. case '<':
  3411. capture = namedCaptures[ch.slice(1, -1)];
  3412. break;
  3413. default: // \d\d?
  3414. var n = +ch;
  3415. if (n === 0) return match;
  3416. if (n > m) {
  3417. var f = floor(n / 10);
  3418. if (f === 0) return match;
  3419. if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
  3420. return match;
  3421. }
  3422. capture = captures[n - 1];
  3423. }
  3424. return capture === undefined ? '' : capture;
  3425. });
  3426. }
  3427. });
  3428. /***/ }),
  3429. /***/ "aae3":
  3430. /***/ (function(module, exports, __webpack_require__) {
  3431. // 7.2.8 IsRegExp(argument)
  3432. var isObject = __webpack_require__("d3f4");
  3433. var cof = __webpack_require__("2d95");
  3434. var MATCH = __webpack_require__("2b4c")('match');
  3435. module.exports = function (it) {
  3436. var isRegExp;
  3437. return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
  3438. };
  3439. /***/ }),
  3440. /***/ "ac6a":
  3441. /***/ (function(module, exports, __webpack_require__) {
  3442. var $iterators = __webpack_require__("cadf");
  3443. var getKeys = __webpack_require__("0d58");
  3444. var redefine = __webpack_require__("2aba");
  3445. var global = __webpack_require__("7726");
  3446. var hide = __webpack_require__("32e9");
  3447. var Iterators = __webpack_require__("84f2");
  3448. var wks = __webpack_require__("2b4c");
  3449. var ITERATOR = wks('iterator');
  3450. var TO_STRING_TAG = wks('toStringTag');
  3451. var ArrayValues = Iterators.Array;
  3452. var DOMIterables = {
  3453. CSSRuleList: true, // TODO: Not spec compliant, should be false.
  3454. CSSStyleDeclaration: false,
  3455. CSSValueList: false,
  3456. ClientRectList: false,
  3457. DOMRectList: false,
  3458. DOMStringList: false,
  3459. DOMTokenList: true,
  3460. DataTransferItemList: false,
  3461. FileList: false,
  3462. HTMLAllCollection: false,
  3463. HTMLCollection: false,
  3464. HTMLFormElement: false,
  3465. HTMLSelectElement: false,
  3466. MediaList: true, // TODO: Not spec compliant, should be false.
  3467. MimeTypeArray: false,
  3468. NamedNodeMap: false,
  3469. NodeList: true,
  3470. PaintRequestList: false,
  3471. Plugin: false,
  3472. PluginArray: false,
  3473. SVGLengthList: false,
  3474. SVGNumberList: false,
  3475. SVGPathSegList: false,
  3476. SVGPointList: false,
  3477. SVGStringList: false,
  3478. SVGTransformList: false,
  3479. SourceBufferList: false,
  3480. StyleSheetList: true, // TODO: Not spec compliant, should be false.
  3481. TextTrackCueList: false,
  3482. TextTrackList: false,
  3483. TouchList: false
  3484. };
  3485. for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
  3486. var NAME = collections[i];
  3487. var explicit = DOMIterables[NAME];
  3488. var Collection = global[NAME];
  3489. var proto = Collection && Collection.prototype;
  3490. var key;
  3491. if (proto) {
  3492. if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
  3493. if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  3494. Iterators[NAME] = ArrayValues;
  3495. if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
  3496. }
  3497. }
  3498. /***/ }),
  3499. /***/ "b0c5":
  3500. /***/ (function(module, exports, __webpack_require__) {
  3501. "use strict";
  3502. var regexpExec = __webpack_require__("520a");
  3503. __webpack_require__("5ca1")({
  3504. target: 'RegExp',
  3505. proto: true,
  3506. forced: regexpExec !== /./.exec
  3507. }, {
  3508. exec: regexpExec
  3509. });
  3510. /***/ }),
  3511. /***/ "be13":
  3512. /***/ (function(module, exports) {
  3513. // 7.2.1 RequireObjectCoercible(argument)
  3514. module.exports = function (it) {
  3515. if (it == undefined) throw TypeError("Can't call method on " + it);
  3516. return it;
  3517. };
  3518. /***/ }),
  3519. /***/ "c366":
  3520. /***/ (function(module, exports, __webpack_require__) {
  3521. // false -> Array#indexOf
  3522. // true -> Array#includes
  3523. var toIObject = __webpack_require__("6821");
  3524. var toLength = __webpack_require__("9def");
  3525. var toAbsoluteIndex = __webpack_require__("77f1");
  3526. module.exports = function (IS_INCLUDES) {
  3527. return function ($this, el, fromIndex) {
  3528. var O = toIObject($this);
  3529. var length = toLength(O.length);
  3530. var index = toAbsoluteIndex(fromIndex, length);
  3531. var value;
  3532. // Array#includes uses SameValueZero equality algorithm
  3533. // eslint-disable-next-line no-self-compare
  3534. if (IS_INCLUDES && el != el) while (length > index) {
  3535. value = O[index++];
  3536. // eslint-disable-next-line no-self-compare
  3537. if (value != value) return true;
  3538. // Array#indexOf ignores holes, Array#includes - not
  3539. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  3540. if (O[index] === el) return IS_INCLUDES || index || 0;
  3541. } return !IS_INCLUDES && -1;
  3542. };
  3543. };
  3544. /***/ }),
  3545. /***/ "c649":
  3546. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3547. "use strict";
  3548. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return insertNodeAt; });
  3549. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return camelize; });
  3550. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return console; });
  3551. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeNode; });
  3552. /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a481");
  3553. /* harmony import */ var core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_regexp_replace__WEBPACK_IMPORTED_MODULE_0__);
  3554. function getConsole() {
  3555. if (typeof window !== "undefined") {
  3556. return window.console;
  3557. }
  3558. return global.console;
  3559. }
  3560. var console = getConsole();
  3561. function cached(fn) {
  3562. var cache = Object.create(null);
  3563. return function cachedFn(str) {
  3564. var hit = cache[str];
  3565. return hit || (cache[str] = fn(str));
  3566. };
  3567. }
  3568. var regex = /-(\w)/g;
  3569. var camelize = cached(function (str) {
  3570. return str.replace(regex, function (_, c) {
  3571. return c ? c.toUpperCase() : "";
  3572. });
  3573. });
  3574. function removeNode(node) {
  3575. if (node.parentElement !== null) {
  3576. node.parentElement.removeChild(node);
  3577. }
  3578. }
  3579. function insertNodeAt(fatherNode, node, position) {
  3580. var refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling;
  3581. fatherNode.insertBefore(node, refNode);
  3582. }
  3583. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__("c8ba")))
  3584. /***/ }),
  3585. /***/ "c69a":
  3586. /***/ (function(module, exports, __webpack_require__) {
  3587. module.exports = !__webpack_require__("9e1e") && !__webpack_require__("79e5")(function () {
  3588. return Object.defineProperty(__webpack_require__("230e")('div'), 'a', { get: function () { return 7; } }).a != 7;
  3589. });
  3590. /***/ }),
  3591. /***/ "c8ba":
  3592. /***/ (function(module, exports) {
  3593. var g;
  3594. // This works in non-strict mode
  3595. g = (function() {
  3596. return this;
  3597. })();
  3598. try {
  3599. // This works if eval is allowed (see CSP)
  3600. g = g || new Function("return this")();
  3601. } catch (e) {
  3602. // This works if the window reference is available
  3603. if (typeof window === "object") g = window;
  3604. }
  3605. // g can still be undefined, but nothing to do about it...
  3606. // We return undefined, instead of nothing here, so it's
  3607. // easier to handle this case. if(!global) { ...}
  3608. module.exports = g;
  3609. /***/ }),
  3610. /***/ "ca5a":
  3611. /***/ (function(module, exports) {
  3612. var id = 0;
  3613. var px = Math.random();
  3614. module.exports = function (key) {
  3615. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  3616. };
  3617. /***/ }),
  3618. /***/ "cadf":
  3619. /***/ (function(module, exports, __webpack_require__) {
  3620. "use strict";
  3621. var addToUnscopables = __webpack_require__("9c6c");
  3622. var step = __webpack_require__("d53b");
  3623. var Iterators = __webpack_require__("84f2");
  3624. var toIObject = __webpack_require__("6821");
  3625. // 22.1.3.4 Array.prototype.entries()
  3626. // 22.1.3.13 Array.prototype.keys()
  3627. // 22.1.3.29 Array.prototype.values()
  3628. // 22.1.3.30 Array.prototype[@@iterator]()
  3629. module.exports = __webpack_require__("01f9")(Array, 'Array', function (iterated, kind) {
  3630. this._t = toIObject(iterated); // target
  3631. this._i = 0; // next index
  3632. this._k = kind; // kind
  3633. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  3634. }, function () {
  3635. var O = this._t;
  3636. var kind = this._k;
  3637. var index = this._i++;
  3638. if (!O || index >= O.length) {
  3639. this._t = undefined;
  3640. return step(1);
  3641. }
  3642. if (kind == 'keys') return step(0, index);
  3643. if (kind == 'values') return step(0, O[index]);
  3644. return step(0, [index, O[index]]);
  3645. }, 'values');
  3646. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  3647. Iterators.Arguments = Iterators.Array;
  3648. addToUnscopables('keys');
  3649. addToUnscopables('values');
  3650. addToUnscopables('entries');
  3651. /***/ }),
  3652. /***/ "cb7c":
  3653. /***/ (function(module, exports, __webpack_require__) {
  3654. var isObject = __webpack_require__("d3f4");
  3655. module.exports = function (it) {
  3656. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  3657. return it;
  3658. };
  3659. /***/ }),
  3660. /***/ "ce10":
  3661. /***/ (function(module, exports, __webpack_require__) {
  3662. var has = __webpack_require__("69a8");
  3663. var toIObject = __webpack_require__("6821");
  3664. var arrayIndexOf = __webpack_require__("c366")(false);
  3665. var IE_PROTO = __webpack_require__("613b")('IE_PROTO');
  3666. module.exports = function (object, names) {
  3667. var O = toIObject(object);
  3668. var i = 0;
  3669. var result = [];
  3670. var key;
  3671. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  3672. // Don't enum bug & hidden keys
  3673. while (names.length > i) if (has(O, key = names[i++])) {
  3674. ~arrayIndexOf(result, key) || result.push(key);
  3675. }
  3676. return result;
  3677. };
  3678. /***/ }),
  3679. /***/ "d2c8":
  3680. /***/ (function(module, exports, __webpack_require__) {
  3681. // helper for String#{startsWith, endsWith, includes}
  3682. var isRegExp = __webpack_require__("aae3");
  3683. var defined = __webpack_require__("be13");
  3684. module.exports = function (that, searchString, NAME) {
  3685. if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
  3686. return String(defined(that));
  3687. };
  3688. /***/ }),
  3689. /***/ "d3f4":
  3690. /***/ (function(module, exports) {
  3691. module.exports = function (it) {
  3692. return typeof it === 'object' ? it !== null : typeof it === 'function';
  3693. };
  3694. /***/ }),
  3695. /***/ "d53b":
  3696. /***/ (function(module, exports) {
  3697. module.exports = function (done, value) {
  3698. return { value: value, done: !!done };
  3699. };
  3700. /***/ }),
  3701. /***/ "d8e8":
  3702. /***/ (function(module, exports) {
  3703. module.exports = function (it) {
  3704. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  3705. return it;
  3706. };
  3707. /***/ }),
  3708. /***/ "e11e":
  3709. /***/ (function(module, exports) {
  3710. // IE 8- don't enum bug keys
  3711. module.exports = (
  3712. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  3713. ).split(',');
  3714. /***/ }),
  3715. /***/ "f559":
  3716. /***/ (function(module, exports, __webpack_require__) {
  3717. "use strict";
  3718. // 21.1.3.18 String.prototype.startsWith(searchString [, position ])
  3719. var $export = __webpack_require__("5ca1");
  3720. var toLength = __webpack_require__("9def");
  3721. var context = __webpack_require__("d2c8");
  3722. var STARTS_WITH = 'startsWith';
  3723. var $startsWith = ''[STARTS_WITH];
  3724. $export($export.P + $export.F * __webpack_require__("5147")(STARTS_WITH), 'String', {
  3725. startsWith: function startsWith(searchString /* , position = 0 */) {
  3726. var that = context(this, searchString, STARTS_WITH);
  3727. var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
  3728. var search = String(searchString);
  3729. return $startsWith
  3730. ? $startsWith.call(that, search, index)
  3731. : that.slice(index, index + search.length) === search;
  3732. }
  3733. });
  3734. /***/ }),
  3735. /***/ "f6fd":
  3736. /***/ (function(module, exports) {
  3737. // document.currentScript polyfill by Adam Miller
  3738. // MIT license
  3739. (function(document){
  3740. var currentScript = "currentScript",
  3741. scripts = document.getElementsByTagName('script'); // Live NodeList collection
  3742. // If browser needs currentScript polyfill, add get currentScript() to the document object
  3743. if (!(currentScript in document)) {
  3744. Object.defineProperty(document, currentScript, {
  3745. get: function(){
  3746. // IE 6-10 supports script readyState
  3747. // IE 10+ support stack trace
  3748. try { throw new Error(); }
  3749. catch (err) {
  3750. // Find the second match for the "at" string to get file src url from stack.
  3751. // Specifically works with the format of stack traces in IE.
  3752. var i, res = ((/.*at [^\(]*\((.*):.+:.+\)$/ig).exec(err.stack) || [false])[1];
  3753. // For all scripts on the page, if src matches or if ready state is interactive, return the script tag
  3754. for(i in scripts){
  3755. if(scripts[i].src == res || scripts[i].readyState == "interactive"){
  3756. return scripts[i];
  3757. }
  3758. }
  3759. // If no match, return null
  3760. return null;
  3761. }
  3762. }
  3763. });
  3764. }
  3765. })(document);
  3766. /***/ }),
  3767. /***/ "f751":
  3768. /***/ (function(module, exports, __webpack_require__) {
  3769. // 19.1.3.1 Object.assign(target, source)
  3770. var $export = __webpack_require__("5ca1");
  3771. $export($export.S + $export.F, 'Object', { assign: __webpack_require__("7333") });
  3772. /***/ }),
  3773. /***/ "fa5b":
  3774. /***/ (function(module, exports, __webpack_require__) {
  3775. module.exports = __webpack_require__("5537")('native-function-to-string', Function.toString);
  3776. /***/ }),
  3777. /***/ "fab2":
  3778. /***/ (function(module, exports, __webpack_require__) {
  3779. var document = __webpack_require__("7726").document;
  3780. module.exports = document && document.documentElement;
  3781. /***/ }),
  3782. /***/ "fb15":
  3783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3784. "use strict";
  3785. // ESM COMPAT FLAG
  3786. __webpack_require__.r(__webpack_exports__);
  3787. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
  3788. // This file is imported into lib/wc client bundles.
  3789. if (typeof window !== 'undefined') {
  3790. if (true) {
  3791. __webpack_require__("f6fd")
  3792. }
  3793. var setPublicPath_i
  3794. if ((setPublicPath_i = window.document.currentScript) && (setPublicPath_i = setPublicPath_i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))) {
  3795. __webpack_require__.p = setPublicPath_i[1] // eslint-disable-line
  3796. }
  3797. }
  3798. // Indicate to webpack that this file can be concatenated
  3799. /* harmony default export */ var setPublicPath = (null);
  3800. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
  3801. var es6_object_assign = __webpack_require__("f751");
  3802. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.starts-with.js
  3803. var es6_string_starts_with = __webpack_require__("f559");
  3804. // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
  3805. var web_dom_iterable = __webpack_require__("ac6a");
  3806. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
  3807. var es6_array_iterator = __webpack_require__("cadf");
  3808. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
  3809. var es6_object_keys = __webpack_require__("456d");
  3810. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
  3811. function _arrayWithHoles(arr) {
  3812. if (Array.isArray(arr)) return arr;
  3813. }
  3814. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
  3815. function _iterableToArrayLimit(arr, i) {
  3816. if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
  3817. var _arr = [];
  3818. var _n = true;
  3819. var _d = false;
  3820. var _e = undefined;
  3821. try {
  3822. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  3823. _arr.push(_s.value);
  3824. if (i && _arr.length === i) break;
  3825. }
  3826. } catch (err) {
  3827. _d = true;
  3828. _e = err;
  3829. } finally {
  3830. try {
  3831. if (!_n && _i["return"] != null) _i["return"]();
  3832. } finally {
  3833. if (_d) throw _e;
  3834. }
  3835. }
  3836. return _arr;
  3837. }
  3838. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
  3839. function _arrayLikeToArray(arr, len) {
  3840. if (len == null || len > arr.length) len = arr.length;
  3841. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  3842. arr2[i] = arr[i];
  3843. }
  3844. return arr2;
  3845. }
  3846. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
  3847. function _unsupportedIterableToArray(o, minLen) {
  3848. if (!o) return;
  3849. if (typeof o === "string") return _arrayLikeToArray(o, minLen);
  3850. var n = Object.prototype.toString.call(o).slice(8, -1);
  3851. if (n === "Object" && o.constructor) n = o.constructor.name;
  3852. if (n === "Map" || n === "Set") return Array.from(o);
  3853. if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  3854. }
  3855. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
  3856. function _nonIterableRest() {
  3857. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3858. }
  3859. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
  3860. function _slicedToArray(arr, i) {
  3861. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
  3862. }
  3863. // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.array.includes.js
  3864. var es7_array_includes = __webpack_require__("6762");
  3865. // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.includes.js
  3866. var es6_string_includes = __webpack_require__("2fdb");
  3867. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
  3868. function _arrayWithoutHoles(arr) {
  3869. if (Array.isArray(arr)) return _arrayLikeToArray(arr);
  3870. }
  3871. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
  3872. function _iterableToArray(iter) {
  3873. if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
  3874. }
  3875. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
  3876. function _nonIterableSpread() {
  3877. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  3878. }
  3879. // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
  3880. function _toConsumableArray(arr) {
  3881. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
  3882. }
  3883. // EXTERNAL MODULE: external {"commonjs":"sortablejs","commonjs2":"sortablejs","amd":"sortablejs","root":"Sortable"}
  3884. var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
  3885. var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /*#__PURE__*/__webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
  3886. // EXTERNAL MODULE: ./src/util/helper.js
  3887. var helper = __webpack_require__("c649");
  3888. // CONCATENATED MODULE: ./src/vuedraggable.js
  3889. function buildAttribute(object, propName, value) {
  3890. if (value === undefined) {
  3891. return object;
  3892. }
  3893. object = object || {};
  3894. object[propName] = value;
  3895. return object;
  3896. }
  3897. function computeVmIndex(vnodes, element) {
  3898. return vnodes.map(function (elt) {
  3899. return elt.elm;
  3900. }).indexOf(element);
  3901. }
  3902. function _computeIndexes(slots, children, isTransition, footerOffset) {
  3903. if (!slots) {
  3904. return [];
  3905. }
  3906. var elmFromNodes = slots.map(function (elt) {
  3907. return elt.elm;
  3908. });
  3909. var footerIndex = children.length - footerOffset;
  3910. var rawIndexes = _toConsumableArray(children).map(function (elt, idx) {
  3911. return idx >= footerIndex ? elmFromNodes.length : elmFromNodes.indexOf(elt);
  3912. });
  3913. return isTransition ? rawIndexes.filter(function (ind) {
  3914. return ind !== -1;
  3915. }) : rawIndexes;
  3916. }
  3917. function emit(evtName, evtData) {
  3918. var _this = this;
  3919. this.$nextTick(function () {
  3920. return _this.$emit(evtName.toLowerCase(), evtData);
  3921. });
  3922. }
  3923. function delegateAndEmit(evtName) {
  3924. var _this2 = this;
  3925. return function (evtData) {
  3926. if (_this2.realList !== null) {
  3927. _this2["onDrag" + evtName](evtData);
  3928. }
  3929. emit.call(_this2, evtName, evtData);
  3930. };
  3931. }
  3932. function isTransitionName(name) {
  3933. return ["transition-group", "TransitionGroup"].includes(name);
  3934. }
  3935. function vuedraggable_isTransition(slots) {
  3936. if (!slots || slots.length !== 1) {
  3937. return false;
  3938. }
  3939. var _slots = _slicedToArray(slots, 1),
  3940. componentOptions = _slots[0].componentOptions;
  3941. if (!componentOptions) {
  3942. return false;
  3943. }
  3944. return isTransitionName(componentOptions.tag);
  3945. }
  3946. function getSlot(slot, scopedSlot, key) {
  3947. return slot[key] || (scopedSlot[key] ? scopedSlot[key]() : undefined);
  3948. }
  3949. function computeChildrenAndOffsets(children, slot, scopedSlot) {
  3950. var headerOffset = 0;
  3951. var footerOffset = 0;
  3952. var header = getSlot(slot, scopedSlot, "header");
  3953. if (header) {
  3954. headerOffset = header.length;
  3955. children = children ? [].concat(_toConsumableArray(header), _toConsumableArray(children)) : _toConsumableArray(header);
  3956. }
  3957. var footer = getSlot(slot, scopedSlot, "footer");
  3958. if (footer) {
  3959. footerOffset = footer.length;
  3960. children = children ? [].concat(_toConsumableArray(children), _toConsumableArray(footer)) : _toConsumableArray(footer);
  3961. }
  3962. return {
  3963. children: children,
  3964. headerOffset: headerOffset,
  3965. footerOffset: footerOffset
  3966. };
  3967. }
  3968. function getComponentAttributes($attrs, componentData) {
  3969. var attributes = null;
  3970. var update = function update(name, value) {
  3971. attributes = buildAttribute(attributes, name, value);
  3972. };
  3973. var attrs = Object.keys($attrs).filter(function (key) {
  3974. return key === "id" || key.startsWith("data-");
  3975. }).reduce(function (res, key) {
  3976. res[key] = $attrs[key];
  3977. return res;
  3978. }, {});
  3979. update("attrs", attrs);
  3980. if (!componentData) {
  3981. return attributes;
  3982. }
  3983. var on = componentData.on,
  3984. props = componentData.props,
  3985. componentDataAttrs = componentData.attrs;
  3986. update("on", on);
  3987. update("props", props);
  3988. Object.assign(attributes.attrs, componentDataAttrs);
  3989. return attributes;
  3990. }
  3991. var eventsListened = ["Start", "Add", "Remove", "Update", "End"];
  3992. var eventsToEmit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
  3993. var readonlyProperties = ["Move"].concat(eventsListened, eventsToEmit).map(function (evt) {
  3994. return "on" + evt;
  3995. });
  3996. var draggingElement = null;
  3997. var props = {
  3998. options: Object,
  3999. list: {
  4000. type: Array,
  4001. required: false,
  4002. default: null
  4003. },
  4004. value: {
  4005. type: Array,
  4006. required: false,
  4007. default: null
  4008. },
  4009. noTransitionOnDrag: {
  4010. type: Boolean,
  4011. default: false
  4012. },
  4013. clone: {
  4014. type: Function,
  4015. default: function _default(original) {
  4016. return original;
  4017. }
  4018. },
  4019. element: {
  4020. type: String,
  4021. default: "div"
  4022. },
  4023. tag: {
  4024. type: String,
  4025. default: null
  4026. },
  4027. move: {
  4028. type: Function,
  4029. default: null
  4030. },
  4031. componentData: {
  4032. type: Object,
  4033. required: false,
  4034. default: null
  4035. }
  4036. };
  4037. var draggableComponent = {
  4038. name: "draggable",
  4039. inheritAttrs: false,
  4040. props: props,
  4041. data: function data() {
  4042. return {
  4043. transitionMode: false,
  4044. noneFunctionalComponentMode: false
  4045. };
  4046. },
  4047. render: function render(h) {
  4048. var slots = this.$slots.default;
  4049. this.transitionMode = vuedraggable_isTransition(slots);
  4050. var _computeChildrenAndOf = computeChildrenAndOffsets(slots, this.$slots, this.$scopedSlots),
  4051. children = _computeChildrenAndOf.children,
  4052. headerOffset = _computeChildrenAndOf.headerOffset,
  4053. footerOffset = _computeChildrenAndOf.footerOffset;
  4054. this.headerOffset = headerOffset;
  4055. this.footerOffset = footerOffset;
  4056. var attributes = getComponentAttributes(this.$attrs, this.componentData);
  4057. return h(this.getTag(), attributes, children);
  4058. },
  4059. created: function created() {
  4060. if (this.list !== null && this.value !== null) {
  4061. helper["b" /* console */].error("Value and list props are mutually exclusive! Please set one or another.");
  4062. }
  4063. if (this.element !== "div") {
  4064. helper["b" /* console */].warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props");
  4065. }
  4066. if (this.options !== undefined) {
  4067. helper["b" /* console */].warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props");
  4068. }
  4069. },
  4070. mounted: function mounted() {
  4071. var _this3 = this;
  4072. this.noneFunctionalComponentMode = this.getTag().toLowerCase() !== this.$el.nodeName.toLowerCase() && !this.getIsFunctional();
  4073. if (this.noneFunctionalComponentMode && this.transitionMode) {
  4074. throw new Error("Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ".concat(this.getTag()));
  4075. }
  4076. var optionsAdded = {};
  4077. eventsListened.forEach(function (elt) {
  4078. optionsAdded["on" + elt] = delegateAndEmit.call(_this3, elt);
  4079. });
  4080. eventsToEmit.forEach(function (elt) {
  4081. optionsAdded["on" + elt] = emit.bind(_this3, elt);
  4082. });
  4083. var attributes = Object.keys(this.$attrs).reduce(function (res, key) {
  4084. res[Object(helper["a" /* camelize */])(key)] = _this3.$attrs[key];
  4085. return res;
  4086. }, {});
  4087. var options = Object.assign({}, this.options, attributes, optionsAdded, {
  4088. onMove: function onMove(evt, originalEvent) {
  4089. return _this3.onDragMove(evt, originalEvent);
  4090. }
  4091. });
  4092. !("draggable" in options) && (options.draggable = ">*");
  4093. this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(this.rootContainer, options);
  4094. this.computeIndexes();
  4095. },
  4096. beforeDestroy: function beforeDestroy() {
  4097. if (this._sortable !== undefined) this._sortable.destroy();
  4098. },
  4099. computed: {
  4100. rootContainer: function rootContainer() {
  4101. return this.transitionMode ? this.$el.children[0] : this.$el;
  4102. },
  4103. realList: function realList() {
  4104. return this.list ? this.list : this.value;
  4105. }
  4106. },
  4107. watch: {
  4108. options: {
  4109. handler: function handler(newOptionValue) {
  4110. this.updateOptions(newOptionValue);
  4111. },
  4112. deep: true
  4113. },
  4114. $attrs: {
  4115. handler: function handler(newOptionValue) {
  4116. this.updateOptions(newOptionValue);
  4117. },
  4118. deep: true
  4119. },
  4120. realList: function realList() {
  4121. this.computeIndexes();
  4122. }
  4123. },
  4124. methods: {
  4125. getIsFunctional: function getIsFunctional() {
  4126. var fnOptions = this._vnode.fnOptions;
  4127. return fnOptions && fnOptions.functional;
  4128. },
  4129. getTag: function getTag() {
  4130. return this.tag || this.element;
  4131. },
  4132. updateOptions: function updateOptions(newOptionValue) {
  4133. for (var property in newOptionValue) {
  4134. var value = Object(helper["a" /* camelize */])(property);
  4135. if (readonlyProperties.indexOf(value) === -1) {
  4136. this._sortable.option(value, newOptionValue[property]);
  4137. }
  4138. }
  4139. },
  4140. getChildrenNodes: function getChildrenNodes() {
  4141. if (this.noneFunctionalComponentMode) {
  4142. return this.$children[0].$slots.default;
  4143. }
  4144. var rawNodes = this.$slots.default;
  4145. return this.transitionMode ? rawNodes[0].child.$slots.default : rawNodes;
  4146. },
  4147. computeIndexes: function computeIndexes() {
  4148. var _this4 = this;
  4149. this.$nextTick(function () {
  4150. _this4.visibleIndexes = _computeIndexes(_this4.getChildrenNodes(), _this4.rootContainer.children, _this4.transitionMode, _this4.footerOffset);
  4151. });
  4152. },
  4153. getUnderlyingVm: function getUnderlyingVm(htmlElt) {
  4154. var index = computeVmIndex(this.getChildrenNodes() || [], htmlElt);
  4155. if (index === -1) {
  4156. //Edge case during move callback: related element might be
  4157. //an element different from collection
  4158. return null;
  4159. }
  4160. var element = this.realList[index];
  4161. return {
  4162. index: index,
  4163. element: element
  4164. };
  4165. },
  4166. getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(_ref) {
  4167. var vue = _ref.__vue__;
  4168. if (!vue || !vue.$options || !isTransitionName(vue.$options._componentTag)) {
  4169. if (!("realList" in vue) && vue.$children.length === 1 && "realList" in vue.$children[0]) return vue.$children[0];
  4170. return vue;
  4171. }
  4172. return vue.$parent;
  4173. },
  4174. emitChanges: function emitChanges(evt) {
  4175. var _this5 = this;
  4176. this.$nextTick(function () {
  4177. _this5.$emit("change", evt);
  4178. });
  4179. },
  4180. alterList: function alterList(onList) {
  4181. if (this.list) {
  4182. onList(this.list);
  4183. return;
  4184. }
  4185. var newList = _toConsumableArray(this.value);
  4186. onList(newList);
  4187. this.$emit("input", newList);
  4188. },
  4189. spliceList: function spliceList() {
  4190. var _arguments = arguments;
  4191. var spliceList = function spliceList(list) {
  4192. return list.splice.apply(list, _toConsumableArray(_arguments));
  4193. };
  4194. this.alterList(spliceList);
  4195. },
  4196. updatePosition: function updatePosition(oldIndex, newIndex) {
  4197. var updatePosition = function updatePosition(list) {
  4198. return list.splice(newIndex, 0, list.splice(oldIndex, 1)[0]);
  4199. };
  4200. this.alterList(updatePosition);
  4201. },
  4202. getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref2) {
  4203. var to = _ref2.to,
  4204. related = _ref2.related;
  4205. var component = this.getUnderlyingPotencialDraggableComponent(to);
  4206. if (!component) {
  4207. return {
  4208. component: component
  4209. };
  4210. }
  4211. var list = component.realList;
  4212. var context = {
  4213. list: list,
  4214. component: component
  4215. };
  4216. if (to !== related && list && component.getUnderlyingVm) {
  4217. var destination = component.getUnderlyingVm(related);
  4218. if (destination) {
  4219. return Object.assign(destination, context);
  4220. }
  4221. }
  4222. return context;
  4223. },
  4224. getVmIndex: function getVmIndex(domIndex) {
  4225. var indexes = this.visibleIndexes;
  4226. var numberIndexes = indexes.length;
  4227. return domIndex > numberIndexes - 1 ? numberIndexes : indexes[domIndex];
  4228. },
  4229. getComponent: function getComponent() {
  4230. return this.$slots.default[0].componentInstance;
  4231. },
  4232. resetTransitionData: function resetTransitionData(index) {
  4233. if (!this.noTransitionOnDrag || !this.transitionMode) {
  4234. return;
  4235. }
  4236. var nodes = this.getChildrenNodes();
  4237. nodes[index].data = null;
  4238. var transitionContainer = this.getComponent();
  4239. transitionContainer.children = [];
  4240. transitionContainer.kept = undefined;
  4241. },
  4242. onDragStart: function onDragStart(evt) {
  4243. this.context = this.getUnderlyingVm(evt.item);
  4244. evt.item._underlying_vm_ = this.clone(this.context.element);
  4245. draggingElement = evt.item;
  4246. },
  4247. onDragAdd: function onDragAdd(evt) {
  4248. var element = evt.item._underlying_vm_;
  4249. if (element === undefined) {
  4250. return;
  4251. }
  4252. Object(helper["d" /* removeNode */])(evt.item);
  4253. var newIndex = this.getVmIndex(evt.newIndex);
  4254. this.spliceList(newIndex, 0, element);
  4255. this.computeIndexes();
  4256. var added = {
  4257. element: element,
  4258. newIndex: newIndex
  4259. };
  4260. this.emitChanges({
  4261. added: added
  4262. });
  4263. },
  4264. onDragRemove: function onDragRemove(evt) {
  4265. Object(helper["c" /* insertNodeAt */])(this.rootContainer, evt.item, evt.oldIndex);
  4266. if (evt.pullMode === "clone") {
  4267. Object(helper["d" /* removeNode */])(evt.clone);
  4268. return;
  4269. }
  4270. var oldIndex = this.context.index;
  4271. this.spliceList(oldIndex, 1);
  4272. var removed = {
  4273. element: this.context.element,
  4274. oldIndex: oldIndex
  4275. };
  4276. this.resetTransitionData(oldIndex);
  4277. this.emitChanges({
  4278. removed: removed
  4279. });
  4280. },
  4281. onDragUpdate: function onDragUpdate(evt) {
  4282. Object(helper["d" /* removeNode */])(evt.item);
  4283. Object(helper["c" /* insertNodeAt */])(evt.from, evt.item, evt.oldIndex);
  4284. var oldIndex = this.context.index;
  4285. var newIndex = this.getVmIndex(evt.newIndex);
  4286. this.updatePosition(oldIndex, newIndex);
  4287. var moved = {
  4288. element: this.context.element,
  4289. oldIndex: oldIndex,
  4290. newIndex: newIndex
  4291. };
  4292. this.emitChanges({
  4293. moved: moved
  4294. });
  4295. },
  4296. updateProperty: function updateProperty(evt, propertyName) {
  4297. evt.hasOwnProperty(propertyName) && (evt[propertyName] += this.headerOffset);
  4298. },
  4299. computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
  4300. if (!relatedContext.element) {
  4301. return 0;
  4302. }
  4303. var domChildren = _toConsumableArray(evt.to.children).filter(function (el) {
  4304. return el.style["display"] !== "none";
  4305. });
  4306. var currentDOMIndex = domChildren.indexOf(evt.related);
  4307. var currentIndex = relatedContext.component.getVmIndex(currentDOMIndex);
  4308. var draggedInList = domChildren.indexOf(draggingElement) !== -1;
  4309. return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
  4310. },
  4311. onDragMove: function onDragMove(evt, originalEvent) {
  4312. var onMove = this.move;
  4313. if (!onMove || !this.realList) {
  4314. return true;
  4315. }
  4316. var relatedContext = this.getRelatedContextFromMoveEvent(evt);
  4317. var draggedContext = this.context;
  4318. var futureIndex = this.computeFutureIndex(relatedContext, evt);
  4319. Object.assign(draggedContext, {
  4320. futureIndex: futureIndex
  4321. });
  4322. var sendEvt = Object.assign({}, evt, {
  4323. relatedContext: relatedContext,
  4324. draggedContext: draggedContext
  4325. });
  4326. return onMove(sendEvt, originalEvent);
  4327. },
  4328. onDragEnd: function onDragEnd() {
  4329. this.computeIndexes();
  4330. draggingElement = null;
  4331. }
  4332. }
  4333. };
  4334. if (typeof window !== "undefined" && "Vue" in window) {
  4335. window.Vue.component("draggable", draggableComponent);
  4336. }
  4337. /* harmony default export */ var vuedraggable = (draggableComponent);
  4338. // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
  4339. /* harmony default export */ var entry_lib = __webpack_exports__["default"] = (vuedraggable);
  4340. /***/ })
  4341. /******/ })["default"];
  4342. });
  4343. //# sourceMappingURL=vuedraggable.umd.js.map
  4344. /***/ }),
  4345. /* 52 */
  4346. /***/ (function(module, exports) {
  4347. // shim for using process in browser
  4348. var process = module.exports = {};
  4349. // cached from whatever global is present so that test runners that stub it
  4350. // don't break things. But we need to wrap it in a try catch in case it is
  4351. // wrapped in strict mode code which doesn't define any globals. It's inside a
  4352. // function because try/catches deoptimize in certain engines.
  4353. var cachedSetTimeout;
  4354. var cachedClearTimeout;
  4355. function defaultSetTimout() {
  4356. throw new Error('setTimeout has not been defined');
  4357. }
  4358. function defaultClearTimeout () {
  4359. throw new Error('clearTimeout has not been defined');
  4360. }
  4361. (function () {
  4362. try {
  4363. if (typeof setTimeout === 'function') {
  4364. cachedSetTimeout = setTimeout;
  4365. } else {
  4366. cachedSetTimeout = defaultSetTimout;
  4367. }
  4368. } catch (e) {
  4369. cachedSetTimeout = defaultSetTimout;
  4370. }
  4371. try {
  4372. if (typeof clearTimeout === 'function') {
  4373. cachedClearTimeout = clearTimeout;
  4374. } else {
  4375. cachedClearTimeout = defaultClearTimeout;
  4376. }
  4377. } catch (e) {
  4378. cachedClearTimeout = defaultClearTimeout;
  4379. }
  4380. } ())
  4381. function runTimeout(fun) {
  4382. if (cachedSetTimeout === setTimeout) {
  4383. //normal enviroments in sane situations
  4384. return setTimeout(fun, 0);
  4385. }
  4386. // if setTimeout wasn't available but was latter defined
  4387. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  4388. cachedSetTimeout = setTimeout;
  4389. return setTimeout(fun, 0);
  4390. }
  4391. try {
  4392. // when when somebody has screwed with setTimeout but no I.E. maddness
  4393. return cachedSetTimeout(fun, 0);
  4394. } catch(e){
  4395. try {
  4396. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4397. return cachedSetTimeout.call(null, fun, 0);
  4398. } catch(e){
  4399. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  4400. return cachedSetTimeout.call(this, fun, 0);
  4401. }
  4402. }
  4403. }
  4404. function runClearTimeout(marker) {
  4405. if (cachedClearTimeout === clearTimeout) {
  4406. //normal enviroments in sane situations
  4407. return clearTimeout(marker);
  4408. }
  4409. // if clearTimeout wasn't available but was latter defined
  4410. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  4411. cachedClearTimeout = clearTimeout;
  4412. return clearTimeout(marker);
  4413. }
  4414. try {
  4415. // when when somebody has screwed with setTimeout but no I.E. maddness
  4416. return cachedClearTimeout(marker);
  4417. } catch (e){
  4418. try {
  4419. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  4420. return cachedClearTimeout.call(null, marker);
  4421. } catch (e){
  4422. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  4423. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  4424. return cachedClearTimeout.call(this, marker);
  4425. }
  4426. }
  4427. }
  4428. var queue = [];
  4429. var draining = false;
  4430. var currentQueue;
  4431. var queueIndex = -1;
  4432. function cleanUpNextTick() {
  4433. if (!draining || !currentQueue) {
  4434. return;
  4435. }
  4436. draining = false;
  4437. if (currentQueue.length) {
  4438. queue = currentQueue.concat(queue);
  4439. } else {
  4440. queueIndex = -1;
  4441. }
  4442. if (queue.length) {
  4443. drainQueue();
  4444. }
  4445. }
  4446. function drainQueue() {
  4447. if (draining) {
  4448. return;
  4449. }
  4450. var timeout = runTimeout(cleanUpNextTick);
  4451. draining = true;
  4452. var len = queue.length;
  4453. while(len) {
  4454. currentQueue = queue;
  4455. queue = [];
  4456. while (++queueIndex < len) {
  4457. if (currentQueue) {
  4458. currentQueue[queueIndex].run();
  4459. }
  4460. }
  4461. queueIndex = -1;
  4462. len = queue.length;
  4463. }
  4464. currentQueue = null;
  4465. draining = false;
  4466. runClearTimeout(timeout);
  4467. }
  4468. process.nextTick = function (fun) {
  4469. var args = new Array(arguments.length - 1);
  4470. if (arguments.length > 1) {
  4471. for (var i = 1; i < arguments.length; i++) {
  4472. args[i - 1] = arguments[i];
  4473. }
  4474. }
  4475. queue.push(new Item(fun, args));
  4476. if (queue.length === 1 && !draining) {
  4477. runTimeout(drainQueue);
  4478. }
  4479. };
  4480. // v8 likes predictible objects
  4481. function Item(fun, array) {
  4482. this.fun = fun;
  4483. this.array = array;
  4484. }
  4485. Item.prototype.run = function () {
  4486. this.fun.apply(null, this.array);
  4487. };
  4488. process.title = 'browser';
  4489. process.browser = true;
  4490. process.env = {};
  4491. process.argv = [];
  4492. process.version = ''; // empty string to avoid regexp issues
  4493. process.versions = {};
  4494. function noop() {}
  4495. process.on = noop;
  4496. process.addListener = noop;
  4497. process.once = noop;
  4498. process.off = noop;
  4499. process.removeListener = noop;
  4500. process.removeAllListeners = noop;
  4501. process.emit = noop;
  4502. process.prependListener = noop;
  4503. process.prependOnceListener = noop;
  4504. process.listeners = function (name) { return [] }
  4505. process.binding = function (name) {
  4506. throw new Error('process.binding is not supported');
  4507. };
  4508. process.cwd = function () { return '/' };
  4509. process.chdir = function (dir) {
  4510. throw new Error('process.chdir is not supported');
  4511. };
  4512. process.umask = function() { return 0; };
  4513. /***/ }),
  4514. /* 53 */
  4515. /***/ (function(module, exports, __webpack_require__) {
  4516. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/**
  4517. * Copyright (c) Tiny Technologies, Inc. All rights reserved.
  4518. * Licensed under the LGPL or a commercial license.
  4519. * For LGPL see License.txt in the project root for license information.
  4520. * For commercial licenses see https://www.tiny.cloud/
  4521. *
  4522. * Version: 5.10.3 (2022-02-09)
  4523. */
  4524. (function () {
  4525. 'use strict';
  4526. var typeOf$1 = function (x) {
  4527. if (x === null) {
  4528. return 'null';
  4529. }
  4530. if (x === undefined) {
  4531. return 'undefined';
  4532. }
  4533. var t = typeof x;
  4534. if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
  4535. return 'array';
  4536. }
  4537. if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
  4538. return 'string';
  4539. }
  4540. return t;
  4541. };
  4542. var isEquatableType = function (x) {
  4543. return [
  4544. 'undefined',
  4545. 'boolean',
  4546. 'number',
  4547. 'string',
  4548. 'function',
  4549. 'xml',
  4550. 'null'
  4551. ].indexOf(x) !== -1;
  4552. };
  4553. var sort$1 = function (xs, compareFn) {
  4554. var clone = Array.prototype.slice.call(xs);
  4555. return clone.sort(compareFn);
  4556. };
  4557. var contramap = function (eqa, f) {
  4558. return eq$2(function (x, y) {
  4559. return eqa.eq(f(x), f(y));
  4560. });
  4561. };
  4562. var eq$2 = function (f) {
  4563. return { eq: f };
  4564. };
  4565. var tripleEq = eq$2(function (x, y) {
  4566. return x === y;
  4567. });
  4568. var eqString = tripleEq;
  4569. var eqArray = function (eqa) {
  4570. return eq$2(function (x, y) {
  4571. if (x.length !== y.length) {
  4572. return false;
  4573. }
  4574. var len = x.length;
  4575. for (var i = 0; i < len; i++) {
  4576. if (!eqa.eq(x[i], y[i])) {
  4577. return false;
  4578. }
  4579. }
  4580. return true;
  4581. });
  4582. };
  4583. var eqSortedArray = function (eqa, compareFn) {
  4584. return contramap(eqArray(eqa), function (xs) {
  4585. return sort$1(xs, compareFn);
  4586. });
  4587. };
  4588. var eqRecord = function (eqa) {
  4589. return eq$2(function (x, y) {
  4590. var kx = Object.keys(x);
  4591. var ky = Object.keys(y);
  4592. if (!eqSortedArray(eqString).eq(kx, ky)) {
  4593. return false;
  4594. }
  4595. var len = kx.length;
  4596. for (var i = 0; i < len; i++) {
  4597. var q = kx[i];
  4598. if (!eqa.eq(x[q], y[q])) {
  4599. return false;
  4600. }
  4601. }
  4602. return true;
  4603. });
  4604. };
  4605. var eqAny = eq$2(function (x, y) {
  4606. if (x === y) {
  4607. return true;
  4608. }
  4609. var tx = typeOf$1(x);
  4610. var ty = typeOf$1(y);
  4611. if (tx !== ty) {
  4612. return false;
  4613. }
  4614. if (isEquatableType(tx)) {
  4615. return x === y;
  4616. } else if (tx === 'array') {
  4617. return eqArray(eqAny).eq(x, y);
  4618. } else if (tx === 'object') {
  4619. return eqRecord(eqAny).eq(x, y);
  4620. }
  4621. return false;
  4622. });
  4623. var typeOf = function (x) {
  4624. var t = typeof x;
  4625. if (x === null) {
  4626. return 'null';
  4627. } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
  4628. return 'array';
  4629. } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
  4630. return 'string';
  4631. } else {
  4632. return t;
  4633. }
  4634. };
  4635. var isType$1 = function (type) {
  4636. return function (value) {
  4637. return typeOf(value) === type;
  4638. };
  4639. };
  4640. var isSimpleType = function (type) {
  4641. return function (value) {
  4642. return typeof value === type;
  4643. };
  4644. };
  4645. var eq$1 = function (t) {
  4646. return function (a) {
  4647. return t === a;
  4648. };
  4649. };
  4650. var isString$1 = isType$1('string');
  4651. var isObject = isType$1('object');
  4652. var isArray$1 = isType$1('array');
  4653. var isNull = eq$1(null);
  4654. var isBoolean = isSimpleType('boolean');
  4655. var isUndefined = eq$1(undefined);
  4656. var isNullable = function (a) {
  4657. return a === null || a === undefined;
  4658. };
  4659. var isNonNullable = function (a) {
  4660. return !isNullable(a);
  4661. };
  4662. var isFunction = isSimpleType('function');
  4663. var isNumber = isSimpleType('number');
  4664. var noop = function () {
  4665. };
  4666. var compose = function (fa, fb) {
  4667. return function () {
  4668. var args = [];
  4669. for (var _i = 0; _i < arguments.length; _i++) {
  4670. args[_i] = arguments[_i];
  4671. }
  4672. return fa(fb.apply(null, args));
  4673. };
  4674. };
  4675. var compose1 = function (fbc, fab) {
  4676. return function (a) {
  4677. return fbc(fab(a));
  4678. };
  4679. };
  4680. var constant = function (value) {
  4681. return function () {
  4682. return value;
  4683. };
  4684. };
  4685. var identity = function (x) {
  4686. return x;
  4687. };
  4688. var tripleEquals = function (a, b) {
  4689. return a === b;
  4690. };
  4691. function curry(fn) {
  4692. var initialArgs = [];
  4693. for (var _i = 1; _i < arguments.length; _i++) {
  4694. initialArgs[_i - 1] = arguments[_i];
  4695. }
  4696. return function () {
  4697. var restArgs = [];
  4698. for (var _i = 0; _i < arguments.length; _i++) {
  4699. restArgs[_i] = arguments[_i];
  4700. }
  4701. var all = initialArgs.concat(restArgs);
  4702. return fn.apply(null, all);
  4703. };
  4704. }
  4705. var not = function (f) {
  4706. return function (t) {
  4707. return !f(t);
  4708. };
  4709. };
  4710. var die = function (msg) {
  4711. return function () {
  4712. throw new Error(msg);
  4713. };
  4714. };
  4715. var apply = function (f) {
  4716. return f();
  4717. };
  4718. var call = function (f) {
  4719. f();
  4720. };
  4721. var never = constant(false);
  4722. var always = constant(true);
  4723. var none = function () {
  4724. return NONE;
  4725. };
  4726. var NONE = function () {
  4727. var call = function (thunk) {
  4728. return thunk();
  4729. };
  4730. var id = identity;
  4731. var me = {
  4732. fold: function (n, _s) {
  4733. return n();
  4734. },
  4735. isSome: never,
  4736. isNone: always,
  4737. getOr: id,
  4738. getOrThunk: call,
  4739. getOrDie: function (msg) {
  4740. throw new Error(msg || 'error: getOrDie called on none.');
  4741. },
  4742. getOrNull: constant(null),
  4743. getOrUndefined: constant(undefined),
  4744. or: id,
  4745. orThunk: call,
  4746. map: none,
  4747. each: noop,
  4748. bind: none,
  4749. exists: never,
  4750. forall: always,
  4751. filter: function () {
  4752. return none();
  4753. },
  4754. toArray: function () {
  4755. return [];
  4756. },
  4757. toString: constant('none()')
  4758. };
  4759. return me;
  4760. }();
  4761. var some = function (a) {
  4762. var constant_a = constant(a);
  4763. var self = function () {
  4764. return me;
  4765. };
  4766. var bind = function (f) {
  4767. return f(a);
  4768. };
  4769. var me = {
  4770. fold: function (n, s) {
  4771. return s(a);
  4772. },
  4773. isSome: always,
  4774. isNone: never,
  4775. getOr: constant_a,
  4776. getOrThunk: constant_a,
  4777. getOrDie: constant_a,
  4778. getOrNull: constant_a,
  4779. getOrUndefined: constant_a,
  4780. or: self,
  4781. orThunk: self,
  4782. map: function (f) {
  4783. return some(f(a));
  4784. },
  4785. each: function (f) {
  4786. f(a);
  4787. },
  4788. bind: bind,
  4789. exists: bind,
  4790. forall: bind,
  4791. filter: function (f) {
  4792. return f(a) ? me : NONE;
  4793. },
  4794. toArray: function () {
  4795. return [a];
  4796. },
  4797. toString: function () {
  4798. return 'some(' + a + ')';
  4799. }
  4800. };
  4801. return me;
  4802. };
  4803. var from$1 = function (value) {
  4804. return value === null || value === undefined ? NONE : some(value);
  4805. };
  4806. var Optional = {
  4807. some: some,
  4808. none: none,
  4809. from: from$1
  4810. };
  4811. var nativeSlice = Array.prototype.slice;
  4812. var nativeIndexOf = Array.prototype.indexOf;
  4813. var nativePush = Array.prototype.push;
  4814. var rawIndexOf = function (ts, t) {
  4815. return nativeIndexOf.call(ts, t);
  4816. };
  4817. var indexOf$2 = function (xs, x) {
  4818. var r = rawIndexOf(xs, x);
  4819. return r === -1 ? Optional.none() : Optional.some(r);
  4820. };
  4821. var contains$3 = function (xs, x) {
  4822. return rawIndexOf(xs, x) > -1;
  4823. };
  4824. var exists = function (xs, pred) {
  4825. for (var i = 0, len = xs.length; i < len; i++) {
  4826. var x = xs[i];
  4827. if (pred(x, i)) {
  4828. return true;
  4829. }
  4830. }
  4831. return false;
  4832. };
  4833. var map$3 = function (xs, f) {
  4834. var len = xs.length;
  4835. var r = new Array(len);
  4836. for (var i = 0; i < len; i++) {
  4837. var x = xs[i];
  4838. r[i] = f(x, i);
  4839. }
  4840. return r;
  4841. };
  4842. var each$k = function (xs, f) {
  4843. for (var i = 0, len = xs.length; i < len; i++) {
  4844. var x = xs[i];
  4845. f(x, i);
  4846. }
  4847. };
  4848. var eachr = function (xs, f) {
  4849. for (var i = xs.length - 1; i >= 0; i--) {
  4850. var x = xs[i];
  4851. f(x, i);
  4852. }
  4853. };
  4854. var partition = function (xs, pred) {
  4855. var pass = [];
  4856. var fail = [];
  4857. for (var i = 0, len = xs.length; i < len; i++) {
  4858. var x = xs[i];
  4859. var arr = pred(x, i) ? pass : fail;
  4860. arr.push(x);
  4861. }
  4862. return {
  4863. pass: pass,
  4864. fail: fail
  4865. };
  4866. };
  4867. var filter$4 = function (xs, pred) {
  4868. var r = [];
  4869. for (var i = 0, len = xs.length; i < len; i++) {
  4870. var x = xs[i];
  4871. if (pred(x, i)) {
  4872. r.push(x);
  4873. }
  4874. }
  4875. return r;
  4876. };
  4877. var foldr = function (xs, f, acc) {
  4878. eachr(xs, function (x, i) {
  4879. acc = f(acc, x, i);
  4880. });
  4881. return acc;
  4882. };
  4883. var foldl = function (xs, f, acc) {
  4884. each$k(xs, function (x, i) {
  4885. acc = f(acc, x, i);
  4886. });
  4887. return acc;
  4888. };
  4889. var findUntil$1 = function (xs, pred, until) {
  4890. for (var i = 0, len = xs.length; i < len; i++) {
  4891. var x = xs[i];
  4892. if (pred(x, i)) {
  4893. return Optional.some(x);
  4894. } else if (until(x, i)) {
  4895. break;
  4896. }
  4897. }
  4898. return Optional.none();
  4899. };
  4900. var find$3 = function (xs, pred) {
  4901. return findUntil$1(xs, pred, never);
  4902. };
  4903. var findIndex$2 = function (xs, pred) {
  4904. for (var i = 0, len = xs.length; i < len; i++) {
  4905. var x = xs[i];
  4906. if (pred(x, i)) {
  4907. return Optional.some(i);
  4908. }
  4909. }
  4910. return Optional.none();
  4911. };
  4912. var flatten = function (xs) {
  4913. var r = [];
  4914. for (var i = 0, len = xs.length; i < len; ++i) {
  4915. if (!isArray$1(xs[i])) {
  4916. throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
  4917. }
  4918. nativePush.apply(r, xs[i]);
  4919. }
  4920. return r;
  4921. };
  4922. var bind = function (xs, f) {
  4923. return flatten(map$3(xs, f));
  4924. };
  4925. var forall = function (xs, pred) {
  4926. for (var i = 0, len = xs.length; i < len; ++i) {
  4927. var x = xs[i];
  4928. if (pred(x, i) !== true) {
  4929. return false;
  4930. }
  4931. }
  4932. return true;
  4933. };
  4934. var reverse = function (xs) {
  4935. var r = nativeSlice.call(xs, 0);
  4936. r.reverse();
  4937. return r;
  4938. };
  4939. var difference = function (a1, a2) {
  4940. return filter$4(a1, function (x) {
  4941. return !contains$3(a2, x);
  4942. });
  4943. };
  4944. var mapToObject = function (xs, f) {
  4945. var r = {};
  4946. for (var i = 0, len = xs.length; i < len; i++) {
  4947. var x = xs[i];
  4948. r[String(x)] = f(x, i);
  4949. }
  4950. return r;
  4951. };
  4952. var sort = function (xs, comparator) {
  4953. var copy = nativeSlice.call(xs, 0);
  4954. copy.sort(comparator);
  4955. return copy;
  4956. };
  4957. var get$a = function (xs, i) {
  4958. return i >= 0 && i < xs.length ? Optional.some(xs[i]) : Optional.none();
  4959. };
  4960. var head = function (xs) {
  4961. return get$a(xs, 0);
  4962. };
  4963. var last$2 = function (xs) {
  4964. return get$a(xs, xs.length - 1);
  4965. };
  4966. var from = isFunction(Array.from) ? Array.from : function (x) {
  4967. return nativeSlice.call(x);
  4968. };
  4969. var findMap = function (arr, f) {
  4970. for (var i = 0; i < arr.length; i++) {
  4971. var r = f(arr[i], i);
  4972. if (r.isSome()) {
  4973. return r;
  4974. }
  4975. }
  4976. return Optional.none();
  4977. };
  4978. var keys = Object.keys;
  4979. var hasOwnProperty$1 = Object.hasOwnProperty;
  4980. var each$j = function (obj, f) {
  4981. var props = keys(obj);
  4982. for (var k = 0, len = props.length; k < len; k++) {
  4983. var i = props[k];
  4984. var x = obj[i];
  4985. f(x, i);
  4986. }
  4987. };
  4988. var map$2 = function (obj, f) {
  4989. return tupleMap(obj, function (x, i) {
  4990. return {
  4991. k: i,
  4992. v: f(x, i)
  4993. };
  4994. });
  4995. };
  4996. var tupleMap = function (obj, f) {
  4997. var r = {};
  4998. each$j(obj, function (x, i) {
  4999. var tuple = f(x, i);
  5000. r[tuple.k] = tuple.v;
  5001. });
  5002. return r;
  5003. };
  5004. var objAcc = function (r) {
  5005. return function (x, i) {
  5006. r[i] = x;
  5007. };
  5008. };
  5009. var internalFilter = function (obj, pred, onTrue, onFalse) {
  5010. var r = {};
  5011. each$j(obj, function (x, i) {
  5012. (pred(x, i) ? onTrue : onFalse)(x, i);
  5013. });
  5014. return r;
  5015. };
  5016. var bifilter = function (obj, pred) {
  5017. var t = {};
  5018. var f = {};
  5019. internalFilter(obj, pred, objAcc(t), objAcc(f));
  5020. return {
  5021. t: t,
  5022. f: f
  5023. };
  5024. };
  5025. var filter$3 = function (obj, pred) {
  5026. var t = {};
  5027. internalFilter(obj, pred, objAcc(t), noop);
  5028. return t;
  5029. };
  5030. var mapToArray = function (obj, f) {
  5031. var r = [];
  5032. each$j(obj, function (value, name) {
  5033. r.push(f(value, name));
  5034. });
  5035. return r;
  5036. };
  5037. var values = function (obj) {
  5038. return mapToArray(obj, identity);
  5039. };
  5040. var get$9 = function (obj, key) {
  5041. return has$2(obj, key) ? Optional.from(obj[key]) : Optional.none();
  5042. };
  5043. var has$2 = function (obj, key) {
  5044. return hasOwnProperty$1.call(obj, key);
  5045. };
  5046. var hasNonNullableKey = function (obj, key) {
  5047. return has$2(obj, key) && obj[key] !== undefined && obj[key] !== null;
  5048. };
  5049. var equal$1 = function (a1, a2, eq) {
  5050. if (eq === void 0) {
  5051. eq = eqAny;
  5052. }
  5053. return eqRecord(eq).eq(a1, a2);
  5054. };
  5055. var isArray = Array.isArray;
  5056. var toArray$1 = function (obj) {
  5057. if (!isArray(obj)) {
  5058. var array = [];
  5059. for (var i = 0, l = obj.length; i < l; i++) {
  5060. array[i] = obj[i];
  5061. }
  5062. return array;
  5063. } else {
  5064. return obj;
  5065. }
  5066. };
  5067. var each$i = function (o, cb, s) {
  5068. var n, l;
  5069. if (!o) {
  5070. return false;
  5071. }
  5072. s = s || o;
  5073. if (o.length !== undefined) {
  5074. for (n = 0, l = o.length; n < l; n++) {
  5075. if (cb.call(s, o[n], n, o) === false) {
  5076. return false;
  5077. }
  5078. }
  5079. } else {
  5080. for (n in o) {
  5081. if (has$2(o, n)) {
  5082. if (cb.call(s, o[n], n, o) === false) {
  5083. return false;
  5084. }
  5085. }
  5086. }
  5087. }
  5088. return true;
  5089. };
  5090. var map$1 = function (array, callback) {
  5091. var out = [];
  5092. each$i(array, function (item, index) {
  5093. out.push(callback(item, index, array));
  5094. });
  5095. return out;
  5096. };
  5097. var filter$2 = function (a, f) {
  5098. var o = [];
  5099. each$i(a, function (v, index) {
  5100. if (!f || f(v, index, a)) {
  5101. o.push(v);
  5102. }
  5103. });
  5104. return o;
  5105. };
  5106. var indexOf$1 = function (a, v) {
  5107. if (a) {
  5108. for (var i = 0, l = a.length; i < l; i++) {
  5109. if (a[i] === v) {
  5110. return i;
  5111. }
  5112. }
  5113. }
  5114. return -1;
  5115. };
  5116. var reduce = function (collection, iteratee, accumulator, thisArg) {
  5117. var acc = isUndefined(accumulator) ? collection[0] : accumulator;
  5118. for (var i = 0; i < collection.length; i++) {
  5119. acc = iteratee.call(thisArg, acc, collection[i], i);
  5120. }
  5121. return acc;
  5122. };
  5123. var findIndex$1 = function (array, predicate, thisArg) {
  5124. var i, l;
  5125. for (i = 0, l = array.length; i < l; i++) {
  5126. if (predicate.call(thisArg, array[i], i, array)) {
  5127. return i;
  5128. }
  5129. }
  5130. return -1;
  5131. };
  5132. var last$1 = function (collection) {
  5133. return collection[collection.length - 1];
  5134. };
  5135. var __assign = function () {
  5136. __assign = Object.assign || function __assign(t) {
  5137. for (var s, i = 1, n = arguments.length; i < n; i++) {
  5138. s = arguments[i];
  5139. for (var p in s)
  5140. if (Object.prototype.hasOwnProperty.call(s, p))
  5141. t[p] = s[p];
  5142. }
  5143. return t;
  5144. };
  5145. return __assign.apply(this, arguments);
  5146. };
  5147. function __rest(s, e) {
  5148. var t = {};
  5149. for (var p in s)
  5150. if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  5151. t[p] = s[p];
  5152. if (s != null && typeof Object.getOwnPropertySymbols === 'function')
  5153. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
  5154. if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
  5155. t[p[i]] = s[p[i]];
  5156. }
  5157. return t;
  5158. }
  5159. function __spreadArray(to, from, pack) {
  5160. if (pack || arguments.length === 2)
  5161. for (var i = 0, l = from.length, ar; i < l; i++) {
  5162. if (ar || !(i in from)) {
  5163. if (!ar)
  5164. ar = Array.prototype.slice.call(from, 0, i);
  5165. ar[i] = from[i];
  5166. }
  5167. }
  5168. return to.concat(ar || Array.prototype.slice.call(from));
  5169. }
  5170. var cached = function (f) {
  5171. var called = false;
  5172. var r;
  5173. return function () {
  5174. var args = [];
  5175. for (var _i = 0; _i < arguments.length; _i++) {
  5176. args[_i] = arguments[_i];
  5177. }
  5178. if (!called) {
  5179. called = true;
  5180. r = f.apply(null, args);
  5181. }
  5182. return r;
  5183. };
  5184. };
  5185. var DeviceType = function (os, browser, userAgent, mediaMatch) {
  5186. var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
  5187. var isiPhone = os.isiOS() && !isiPad;
  5188. var isMobile = os.isiOS() || os.isAndroid();
  5189. var isTouch = isMobile || mediaMatch('(pointer:coarse)');
  5190. var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)');
  5191. var isPhone = isiPhone || isMobile && !isTablet;
  5192. var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
  5193. var isDesktop = !isPhone && !isTablet && !iOSwebview;
  5194. return {
  5195. isiPad: constant(isiPad),
  5196. isiPhone: constant(isiPhone),
  5197. isTablet: constant(isTablet),
  5198. isPhone: constant(isPhone),
  5199. isTouch: constant(isTouch),
  5200. isAndroid: os.isAndroid,
  5201. isiOS: os.isiOS,
  5202. isWebView: constant(iOSwebview),
  5203. isDesktop: constant(isDesktop)
  5204. };
  5205. };
  5206. var firstMatch = function (regexes, s) {
  5207. for (var i = 0; i < regexes.length; i++) {
  5208. var x = regexes[i];
  5209. if (x.test(s)) {
  5210. return x;
  5211. }
  5212. }
  5213. return undefined;
  5214. };
  5215. var find$2 = function (regexes, agent) {
  5216. var r = firstMatch(regexes, agent);
  5217. if (!r) {
  5218. return {
  5219. major: 0,
  5220. minor: 0
  5221. };
  5222. }
  5223. var group = function (i) {
  5224. return Number(agent.replace(r, '$' + i));
  5225. };
  5226. return nu$4(group(1), group(2));
  5227. };
  5228. var detect$3 = function (versionRegexes, agent) {
  5229. var cleanedAgent = String(agent).toLowerCase();
  5230. if (versionRegexes.length === 0) {
  5231. return unknown$2();
  5232. }
  5233. return find$2(versionRegexes, cleanedAgent);
  5234. };
  5235. var unknown$2 = function () {
  5236. return nu$4(0, 0);
  5237. };
  5238. var nu$4 = function (major, minor) {
  5239. return {
  5240. major: major,
  5241. minor: minor
  5242. };
  5243. };
  5244. var Version = {
  5245. nu: nu$4,
  5246. detect: detect$3,
  5247. unknown: unknown$2
  5248. };
  5249. var detectBrowser$1 = function (browsers, userAgentData) {
  5250. return findMap(userAgentData.brands, function (uaBrand) {
  5251. var lcBrand = uaBrand.brand.toLowerCase();
  5252. return find$3(browsers, function (browser) {
  5253. var _a;
  5254. return lcBrand === ((_a = browser.brand) === null || _a === void 0 ? void 0 : _a.toLowerCase());
  5255. }).map(function (info) {
  5256. return {
  5257. current: info.name,
  5258. version: Version.nu(parseInt(uaBrand.version, 10), 0)
  5259. };
  5260. });
  5261. });
  5262. };
  5263. var detect$2 = function (candidates, userAgent) {
  5264. var agent = String(userAgent).toLowerCase();
  5265. return find$3(candidates, function (candidate) {
  5266. return candidate.search(agent);
  5267. });
  5268. };
  5269. var detectBrowser = function (browsers, userAgent) {
  5270. return detect$2(browsers, userAgent).map(function (browser) {
  5271. var version = Version.detect(browser.versionRegexes, userAgent);
  5272. return {
  5273. current: browser.name,
  5274. version: version
  5275. };
  5276. });
  5277. };
  5278. var detectOs = function (oses, userAgent) {
  5279. return detect$2(oses, userAgent).map(function (os) {
  5280. var version = Version.detect(os.versionRegexes, userAgent);
  5281. return {
  5282. current: os.name,
  5283. version: version
  5284. };
  5285. });
  5286. };
  5287. var removeFromStart = function (str, numChars) {
  5288. return str.substring(numChars);
  5289. };
  5290. var checkRange = function (str, substr, start) {
  5291. return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
  5292. };
  5293. var removeLeading = function (str, prefix) {
  5294. return startsWith(str, prefix) ? removeFromStart(str, prefix.length) : str;
  5295. };
  5296. var contains$2 = function (str, substr) {
  5297. return str.indexOf(substr) !== -1;
  5298. };
  5299. var startsWith = function (str, prefix) {
  5300. return checkRange(str, prefix, 0);
  5301. };
  5302. var blank = function (r) {
  5303. return function (s) {
  5304. return s.replace(r, '');
  5305. };
  5306. };
  5307. var trim$4 = blank(/^\s+|\s+$/g);
  5308. var lTrim = blank(/^\s+/g);
  5309. var rTrim = blank(/\s+$/g);
  5310. var isNotEmpty = function (s) {
  5311. return s.length > 0;
  5312. };
  5313. var isEmpty$3 = function (s) {
  5314. return !isNotEmpty(s);
  5315. };
  5316. var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
  5317. var checkContains = function (target) {
  5318. return function (uastring) {
  5319. return contains$2(uastring, target);
  5320. };
  5321. };
  5322. var browsers = [
  5323. {
  5324. name: 'Edge',
  5325. versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
  5326. search: function (uastring) {
  5327. return contains$2(uastring, 'edge/') && contains$2(uastring, 'chrome') && contains$2(uastring, 'safari') && contains$2(uastring, 'applewebkit');
  5328. }
  5329. },
  5330. {
  5331. name: 'Chrome',
  5332. brand: 'Chromium',
  5333. versionRegexes: [
  5334. /.*?chrome\/([0-9]+)\.([0-9]+).*/,
  5335. normalVersionRegex
  5336. ],
  5337. search: function (uastring) {
  5338. return contains$2(uastring, 'chrome') && !contains$2(uastring, 'chromeframe');
  5339. }
  5340. },
  5341. {
  5342. name: 'IE',
  5343. versionRegexes: [
  5344. /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
  5345. /.*?rv:([0-9]+)\.([0-9]+).*/
  5346. ],
  5347. search: function (uastring) {
  5348. return contains$2(uastring, 'msie') || contains$2(uastring, 'trident');
  5349. }
  5350. },
  5351. {
  5352. name: 'Opera',
  5353. versionRegexes: [
  5354. normalVersionRegex,
  5355. /.*?opera\/([0-9]+)\.([0-9]+).*/
  5356. ],
  5357. search: checkContains('opera')
  5358. },
  5359. {
  5360. name: 'Firefox',
  5361. versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
  5362. search: checkContains('firefox')
  5363. },
  5364. {
  5365. name: 'Safari',
  5366. versionRegexes: [
  5367. normalVersionRegex,
  5368. /.*?cpu os ([0-9]+)_([0-9]+).*/
  5369. ],
  5370. search: function (uastring) {
  5371. return (contains$2(uastring, 'safari') || contains$2(uastring, 'mobile/')) && contains$2(uastring, 'applewebkit');
  5372. }
  5373. }
  5374. ];
  5375. var oses = [
  5376. {
  5377. name: 'Windows',
  5378. search: checkContains('win'),
  5379. versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
  5380. },
  5381. {
  5382. name: 'iOS',
  5383. search: function (uastring) {
  5384. return contains$2(uastring, 'iphone') || contains$2(uastring, 'ipad');
  5385. },
  5386. versionRegexes: [
  5387. /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
  5388. /.*cpu os ([0-9]+)_([0-9]+).*/,
  5389. /.*cpu iphone os ([0-9]+)_([0-9]+).*/
  5390. ]
  5391. },
  5392. {
  5393. name: 'Android',
  5394. search: checkContains('android'),
  5395. versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
  5396. },
  5397. {
  5398. name: 'OSX',
  5399. search: checkContains('mac os x'),
  5400. versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]
  5401. },
  5402. {
  5403. name: 'Linux',
  5404. search: checkContains('linux'),
  5405. versionRegexes: []
  5406. },
  5407. {
  5408. name: 'Solaris',
  5409. search: checkContains('sunos'),
  5410. versionRegexes: []
  5411. },
  5412. {
  5413. name: 'FreeBSD',
  5414. search: checkContains('freebsd'),
  5415. versionRegexes: []
  5416. },
  5417. {
  5418. name: 'ChromeOS',
  5419. search: checkContains('cros'),
  5420. versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/]
  5421. }
  5422. ];
  5423. var PlatformInfo = {
  5424. browsers: constant(browsers),
  5425. oses: constant(oses)
  5426. };
  5427. var edge = 'Edge';
  5428. var chrome = 'Chrome';
  5429. var ie$1 = 'IE';
  5430. var opera = 'Opera';
  5431. var firefox = 'Firefox';
  5432. var safari = 'Safari';
  5433. var unknown$1 = function () {
  5434. return nu$3({
  5435. current: undefined,
  5436. version: Version.unknown()
  5437. });
  5438. };
  5439. var nu$3 = function (info) {
  5440. var current = info.current;
  5441. var version = info.version;
  5442. var isBrowser = function (name) {
  5443. return function () {
  5444. return current === name;
  5445. };
  5446. };
  5447. return {
  5448. current: current,
  5449. version: version,
  5450. isEdge: isBrowser(edge),
  5451. isChrome: isBrowser(chrome),
  5452. isIE: isBrowser(ie$1),
  5453. isOpera: isBrowser(opera),
  5454. isFirefox: isBrowser(firefox),
  5455. isSafari: isBrowser(safari)
  5456. };
  5457. };
  5458. var Browser = {
  5459. unknown: unknown$1,
  5460. nu: nu$3,
  5461. edge: constant(edge),
  5462. chrome: constant(chrome),
  5463. ie: constant(ie$1),
  5464. opera: constant(opera),
  5465. firefox: constant(firefox),
  5466. safari: constant(safari)
  5467. };
  5468. var windows = 'Windows';
  5469. var ios = 'iOS';
  5470. var android = 'Android';
  5471. var linux = 'Linux';
  5472. var osx = 'OSX';
  5473. var solaris = 'Solaris';
  5474. var freebsd = 'FreeBSD';
  5475. var chromeos = 'ChromeOS';
  5476. var unknown = function () {
  5477. return nu$2({
  5478. current: undefined,
  5479. version: Version.unknown()
  5480. });
  5481. };
  5482. var nu$2 = function (info) {
  5483. var current = info.current;
  5484. var version = info.version;
  5485. var isOS = function (name) {
  5486. return function () {
  5487. return current === name;
  5488. };
  5489. };
  5490. return {
  5491. current: current,
  5492. version: version,
  5493. isWindows: isOS(windows),
  5494. isiOS: isOS(ios),
  5495. isAndroid: isOS(android),
  5496. isOSX: isOS(osx),
  5497. isLinux: isOS(linux),
  5498. isSolaris: isOS(solaris),
  5499. isFreeBSD: isOS(freebsd),
  5500. isChromeOS: isOS(chromeos)
  5501. };
  5502. };
  5503. var OperatingSystem = {
  5504. unknown: unknown,
  5505. nu: nu$2,
  5506. windows: constant(windows),
  5507. ios: constant(ios),
  5508. android: constant(android),
  5509. linux: constant(linux),
  5510. osx: constant(osx),
  5511. solaris: constant(solaris),
  5512. freebsd: constant(freebsd),
  5513. chromeos: constant(chromeos)
  5514. };
  5515. var detect$1 = function (userAgent, userAgentDataOpt, mediaMatch) {
  5516. var browsers = PlatformInfo.browsers();
  5517. var oses = PlatformInfo.oses();
  5518. var browser = userAgentDataOpt.bind(function (userAgentData) {
  5519. return detectBrowser$1(browsers, userAgentData);
  5520. }).orThunk(function () {
  5521. return detectBrowser(browsers, userAgent);
  5522. }).fold(Browser.unknown, Browser.nu);
  5523. var os = detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
  5524. var deviceType = DeviceType(os, browser, userAgent, mediaMatch);
  5525. return {
  5526. browser: browser,
  5527. os: os,
  5528. deviceType: deviceType
  5529. };
  5530. };
  5531. var PlatformDetection = { detect: detect$1 };
  5532. var mediaMatch = function (query) {
  5533. return window.matchMedia(query).matches;
  5534. };
  5535. var platform$2 = cached(function () {
  5536. return PlatformDetection.detect(navigator.userAgent, Optional.from(navigator.userAgentData), mediaMatch);
  5537. });
  5538. var detect = function () {
  5539. return platform$2();
  5540. };
  5541. var userAgent = navigator.userAgent;
  5542. var platform$1 = detect();
  5543. var browser$4 = platform$1.browser;
  5544. var os = platform$1.os;
  5545. var deviceType = platform$1.deviceType;
  5546. var webkit = /WebKit/.test(userAgent) && !browser$4.isEdge();
  5547. var fileApi = 'FormData' in window && 'FileReader' in window && 'URL' in window && !!URL.createObjectURL;
  5548. var windowsPhone = userAgent.indexOf('Windows Phone') !== -1;
  5549. var Env = {
  5550. opera: browser$4.isOpera(),
  5551. webkit: webkit,
  5552. ie: browser$4.isIE() || browser$4.isEdge() ? browser$4.version.major : false,
  5553. gecko: browser$4.isFirefox(),
  5554. mac: os.isOSX() || os.isiOS(),
  5555. iOS: deviceType.isiPad() || deviceType.isiPhone(),
  5556. android: os.isAndroid(),
  5557. contentEditable: true,
  5558. transparentSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
  5559. caretAfter: true,
  5560. range: window.getSelection && 'Range' in window,
  5561. documentMode: browser$4.isIE() ? document.documentMode || 7 : 10,
  5562. fileApi: fileApi,
  5563. ceFalse: true,
  5564. cacheSuffix: null,
  5565. container: null,
  5566. experimentalShadowDom: false,
  5567. canHaveCSP: !browser$4.isIE(),
  5568. desktop: deviceType.isDesktop(),
  5569. windowsPhone: windowsPhone,
  5570. browser: {
  5571. current: browser$4.current,
  5572. version: browser$4.version,
  5573. isChrome: browser$4.isChrome,
  5574. isEdge: browser$4.isEdge,
  5575. isFirefox: browser$4.isFirefox,
  5576. isIE: browser$4.isIE,
  5577. isOpera: browser$4.isOpera,
  5578. isSafari: browser$4.isSafari
  5579. },
  5580. os: {
  5581. current: os.current,
  5582. version: os.version,
  5583. isAndroid: os.isAndroid,
  5584. isChromeOS: os.isChromeOS,
  5585. isFreeBSD: os.isFreeBSD,
  5586. isiOS: os.isiOS,
  5587. isLinux: os.isLinux,
  5588. isOSX: os.isOSX,
  5589. isSolaris: os.isSolaris,
  5590. isWindows: os.isWindows
  5591. },
  5592. deviceType: {
  5593. isDesktop: deviceType.isDesktop,
  5594. isiPad: deviceType.isiPad,
  5595. isiPhone: deviceType.isiPhone,
  5596. isPhone: deviceType.isPhone,
  5597. isTablet: deviceType.isTablet,
  5598. isTouch: deviceType.isTouch,
  5599. isWebView: deviceType.isWebView
  5600. }
  5601. };
  5602. var whiteSpaceRegExp$2 = /^\s*|\s*$/g;
  5603. var trim$3 = function (str) {
  5604. return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$2, '');
  5605. };
  5606. var is$3 = function (obj, type) {
  5607. if (!type) {
  5608. return obj !== undefined;
  5609. }
  5610. if (type === 'array' && isArray(obj)) {
  5611. return true;
  5612. }
  5613. return typeof obj === type;
  5614. };
  5615. var makeMap$4 = function (items, delim, map) {
  5616. var i;
  5617. items = items || [];
  5618. delim = delim || ',';
  5619. if (typeof items === 'string') {
  5620. items = items.split(delim);
  5621. }
  5622. map = map || {};
  5623. i = items.length;
  5624. while (i--) {
  5625. map[items[i]] = {};
  5626. }
  5627. return map;
  5628. };
  5629. var hasOwnProperty = has$2;
  5630. var create$9 = function (s, p, root) {
  5631. var self = this;
  5632. var sp, scn, c, de = 0;
  5633. s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
  5634. var cn = s[3].match(/(^|\.)(\w+)$/i)[2];
  5635. var ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
  5636. if (ns[cn]) {
  5637. return;
  5638. }
  5639. if (s[2] === 'static') {
  5640. ns[cn] = p;
  5641. if (this.onCreate) {
  5642. this.onCreate(s[2], s[3], ns[cn]);
  5643. }
  5644. return;
  5645. }
  5646. if (!p[cn]) {
  5647. p[cn] = function () {
  5648. };
  5649. de = 1;
  5650. }
  5651. ns[cn] = p[cn];
  5652. self.extend(ns[cn].prototype, p);
  5653. if (s[5]) {
  5654. sp = self.resolve(s[5]).prototype;
  5655. scn = s[5].match(/\.(\w+)$/i)[1];
  5656. c = ns[cn];
  5657. if (de) {
  5658. ns[cn] = function () {
  5659. return sp[scn].apply(this, arguments);
  5660. };
  5661. } else {
  5662. ns[cn] = function () {
  5663. this.parent = sp[scn];
  5664. return c.apply(this, arguments);
  5665. };
  5666. }
  5667. ns[cn].prototype[cn] = ns[cn];
  5668. self.each(sp, function (f, n) {
  5669. ns[cn].prototype[n] = sp[n];
  5670. });
  5671. self.each(p, function (f, n) {
  5672. if (sp[n]) {
  5673. ns[cn].prototype[n] = function () {
  5674. this.parent = sp[n];
  5675. return f.apply(this, arguments);
  5676. };
  5677. } else {
  5678. if (n !== cn) {
  5679. ns[cn].prototype[n] = f;
  5680. }
  5681. }
  5682. });
  5683. }
  5684. self.each(p.static, function (f, n) {
  5685. ns[cn][n] = f;
  5686. });
  5687. };
  5688. var extend$6 = function (obj) {
  5689. var exts = [];
  5690. for (var _i = 1; _i < arguments.length; _i++) {
  5691. exts[_i - 1] = arguments[_i];
  5692. }
  5693. for (var i = 0; i < exts.length; i++) {
  5694. var ext = exts[i];
  5695. for (var name_1 in ext) {
  5696. if (has$2(ext, name_1)) {
  5697. var value = ext[name_1];
  5698. if (value !== undefined) {
  5699. obj[name_1] = value;
  5700. }
  5701. }
  5702. }
  5703. }
  5704. return obj;
  5705. };
  5706. var walk$3 = function (o, f, n, s) {
  5707. s = s || this;
  5708. if (o) {
  5709. if (n) {
  5710. o = o[n];
  5711. }
  5712. each$i(o, function (o, i) {
  5713. if (f.call(s, o, i, n) === false) {
  5714. return false;
  5715. }
  5716. walk$3(o, f, n, s);
  5717. });
  5718. }
  5719. };
  5720. var createNS = function (n, o) {
  5721. var i, v;
  5722. o = o || window;
  5723. n = n.split('.');
  5724. for (i = 0; i < n.length; i++) {
  5725. v = n[i];
  5726. if (!o[v]) {
  5727. o[v] = {};
  5728. }
  5729. o = o[v];
  5730. }
  5731. return o;
  5732. };
  5733. var resolve$3 = function (n, o) {
  5734. var i, l;
  5735. o = o || window;
  5736. n = n.split('.');
  5737. for (i = 0, l = n.length; i < l; i++) {
  5738. o = o[n[i]];
  5739. if (!o) {
  5740. break;
  5741. }
  5742. }
  5743. return o;
  5744. };
  5745. var explode$4 = function (s, d) {
  5746. if (!s || is$3(s, 'array')) {
  5747. return s;
  5748. }
  5749. return map$1(s.split(d || ','), trim$3);
  5750. };
  5751. var _addCacheSuffix = function (url) {
  5752. var cacheSuffix = Env.cacheSuffix;
  5753. if (cacheSuffix) {
  5754. url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
  5755. }
  5756. return url;
  5757. };
  5758. var Tools = {
  5759. trim: trim$3,
  5760. isArray: isArray,
  5761. is: is$3,
  5762. toArray: toArray$1,
  5763. makeMap: makeMap$4,
  5764. each: each$i,
  5765. map: map$1,
  5766. grep: filter$2,
  5767. inArray: indexOf$1,
  5768. hasOwn: hasOwnProperty,
  5769. extend: extend$6,
  5770. create: create$9,
  5771. walk: walk$3,
  5772. createNS: createNS,
  5773. resolve: resolve$3,
  5774. explode: explode$4,
  5775. _addCacheSuffix: _addCacheSuffix
  5776. };
  5777. var fromHtml$1 = function (html, scope) {
  5778. var doc = scope || document;
  5779. var div = doc.createElement('div');
  5780. div.innerHTML = html;
  5781. if (!div.hasChildNodes() || div.childNodes.length > 1) {
  5782. console.error('HTML does not have a single root node', html);
  5783. throw new Error('HTML must have a single root node');
  5784. }
  5785. return fromDom$2(div.childNodes[0]);
  5786. };
  5787. var fromTag = function (tag, scope) {
  5788. var doc = scope || document;
  5789. var node = doc.createElement(tag);
  5790. return fromDom$2(node);
  5791. };
  5792. var fromText = function (text, scope) {
  5793. var doc = scope || document;
  5794. var node = doc.createTextNode(text);
  5795. return fromDom$2(node);
  5796. };
  5797. var fromDom$2 = function (node) {
  5798. if (node === null || node === undefined) {
  5799. throw new Error('Node cannot be null or undefined');
  5800. }
  5801. return { dom: node };
  5802. };
  5803. var fromPoint$1 = function (docElm, x, y) {
  5804. return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom$2);
  5805. };
  5806. var SugarElement = {
  5807. fromHtml: fromHtml$1,
  5808. fromTag: fromTag,
  5809. fromText: fromText,
  5810. fromDom: fromDom$2,
  5811. fromPoint: fromPoint$1
  5812. };
  5813. var toArray = function (target, f) {
  5814. var r = [];
  5815. var recurse = function (e) {
  5816. r.push(e);
  5817. return f(e);
  5818. };
  5819. var cur = f(target);
  5820. do {
  5821. cur = cur.bind(recurse);
  5822. } while (cur.isSome());
  5823. return r;
  5824. };
  5825. var compareDocumentPosition = function (a, b, match) {
  5826. return (a.compareDocumentPosition(b) & match) !== 0;
  5827. };
  5828. var documentPositionContainedBy = function (a, b) {
  5829. return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY);
  5830. };
  5831. var COMMENT = 8;
  5832. var DOCUMENT = 9;
  5833. var DOCUMENT_FRAGMENT = 11;
  5834. var ELEMENT = 1;
  5835. var TEXT = 3;
  5836. var is$2 = function (element, selector) {
  5837. var dom = element.dom;
  5838. if (dom.nodeType !== ELEMENT) {
  5839. return false;
  5840. } else {
  5841. var elem = dom;
  5842. if (elem.matches !== undefined) {
  5843. return elem.matches(selector);
  5844. } else if (elem.msMatchesSelector !== undefined) {
  5845. return elem.msMatchesSelector(selector);
  5846. } else if (elem.webkitMatchesSelector !== undefined) {
  5847. return elem.webkitMatchesSelector(selector);
  5848. } else if (elem.mozMatchesSelector !== undefined) {
  5849. return elem.mozMatchesSelector(selector);
  5850. } else {
  5851. throw new Error('Browser lacks native selectors');
  5852. }
  5853. }
  5854. };
  5855. var bypassSelector = function (dom) {
  5856. return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0;
  5857. };
  5858. var all = function (selector, scope) {
  5859. var base = scope === undefined ? document : scope.dom;
  5860. return bypassSelector(base) ? [] : map$3(base.querySelectorAll(selector), SugarElement.fromDom);
  5861. };
  5862. var one = function (selector, scope) {
  5863. var base = scope === undefined ? document : scope.dom;
  5864. return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom);
  5865. };
  5866. var eq = function (e1, e2) {
  5867. return e1.dom === e2.dom;
  5868. };
  5869. var regularContains = function (e1, e2) {
  5870. var d1 = e1.dom;
  5871. var d2 = e2.dom;
  5872. return d1 === d2 ? false : d1.contains(d2);
  5873. };
  5874. var ieContains = function (e1, e2) {
  5875. return documentPositionContainedBy(e1.dom, e2.dom);
  5876. };
  5877. var contains$1 = function (e1, e2) {
  5878. return detect().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2);
  5879. };
  5880. typeof window !== 'undefined' ? window : Function('return this;')();
  5881. var name = function (element) {
  5882. var r = element.dom.nodeName;
  5883. return r.toLowerCase();
  5884. };
  5885. var type = function (element) {
  5886. return element.dom.nodeType;
  5887. };
  5888. var isType = function (t) {
  5889. return function (element) {
  5890. return type(element) === t;
  5891. };
  5892. };
  5893. var isComment$1 = function (element) {
  5894. return type(element) === COMMENT || name(element) === '#comment';
  5895. };
  5896. var isElement$6 = isType(ELEMENT);
  5897. var isText$8 = isType(TEXT);
  5898. var isDocument$2 = isType(DOCUMENT);
  5899. var isDocumentFragment$1 = isType(DOCUMENT_FRAGMENT);
  5900. var isTag = function (tag) {
  5901. return function (e) {
  5902. return isElement$6(e) && name(e) === tag;
  5903. };
  5904. };
  5905. var owner$1 = function (element) {
  5906. return SugarElement.fromDom(element.dom.ownerDocument);
  5907. };
  5908. var documentOrOwner = function (dos) {
  5909. return isDocument$2(dos) ? dos : owner$1(dos);
  5910. };
  5911. var documentElement = function (element) {
  5912. return SugarElement.fromDom(documentOrOwner(element).dom.documentElement);
  5913. };
  5914. var defaultView = function (element) {
  5915. return SugarElement.fromDom(documentOrOwner(element).dom.defaultView);
  5916. };
  5917. var parent = function (element) {
  5918. return Optional.from(element.dom.parentNode).map(SugarElement.fromDom);
  5919. };
  5920. var parents$1 = function (element, isRoot) {
  5921. var stop = isFunction(isRoot) ? isRoot : never;
  5922. var dom = element.dom;
  5923. var ret = [];
  5924. while (dom.parentNode !== null && dom.parentNode !== undefined) {
  5925. var rawParent = dom.parentNode;
  5926. var p = SugarElement.fromDom(rawParent);
  5927. ret.push(p);
  5928. if (stop(p) === true) {
  5929. break;
  5930. } else {
  5931. dom = rawParent;
  5932. }
  5933. }
  5934. return ret;
  5935. };
  5936. var siblings = function (element) {
  5937. var filterSelf = function (elements) {
  5938. return filter$4(elements, function (x) {
  5939. return !eq(element, x);
  5940. });
  5941. };
  5942. return parent(element).map(children).map(filterSelf).getOr([]);
  5943. };
  5944. var prevSibling = function (element) {
  5945. return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom);
  5946. };
  5947. var nextSibling = function (element) {
  5948. return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom);
  5949. };
  5950. var prevSiblings = function (element) {
  5951. return reverse(toArray(element, prevSibling));
  5952. };
  5953. var nextSiblings = function (element) {
  5954. return toArray(element, nextSibling);
  5955. };
  5956. var children = function (element) {
  5957. return map$3(element.dom.childNodes, SugarElement.fromDom);
  5958. };
  5959. var child$1 = function (element, index) {
  5960. var cs = element.dom.childNodes;
  5961. return Optional.from(cs[index]).map(SugarElement.fromDom);
  5962. };
  5963. var firstChild = function (element) {
  5964. return child$1(element, 0);
  5965. };
  5966. var lastChild = function (element) {
  5967. return child$1(element, element.dom.childNodes.length - 1);
  5968. };
  5969. var childNodesCount = function (element) {
  5970. return element.dom.childNodes.length;
  5971. };
  5972. var getHead = function (doc) {
  5973. var b = doc.dom.head;
  5974. if (b === null || b === undefined) {
  5975. throw new Error('Head is not available yet');
  5976. }
  5977. return SugarElement.fromDom(b);
  5978. };
  5979. var isShadowRoot = function (dos) {
  5980. return isDocumentFragment$1(dos) && isNonNullable(dos.dom.host);
  5981. };
  5982. var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode);
  5983. var isSupported$1 = constant(supported);
  5984. var getRootNode = supported ? function (e) {
  5985. return SugarElement.fromDom(e.dom.getRootNode());
  5986. } : documentOrOwner;
  5987. var getStyleContainer = function (dos) {
  5988. return isShadowRoot(dos) ? dos : getHead(documentOrOwner(dos));
  5989. };
  5990. var getShadowRoot = function (e) {
  5991. var r = getRootNode(e);
  5992. return isShadowRoot(r) ? Optional.some(r) : Optional.none();
  5993. };
  5994. var getShadowHost = function (e) {
  5995. return SugarElement.fromDom(e.dom.host);
  5996. };
  5997. var getOriginalEventTarget = function (event) {
  5998. if (isSupported$1() && isNonNullable(event.target)) {
  5999. var el = SugarElement.fromDom(event.target);
  6000. if (isElement$6(el) && isOpenShadowHost(el)) {
  6001. if (event.composed && event.composedPath) {
  6002. var composedPath = event.composedPath();
  6003. if (composedPath) {
  6004. return head(composedPath);
  6005. }
  6006. }
  6007. }
  6008. }
  6009. return Optional.from(event.target);
  6010. };
  6011. var isOpenShadowHost = function (element) {
  6012. return isNonNullable(element.dom.shadowRoot);
  6013. };
  6014. var before$4 = function (marker, element) {
  6015. var parent$1 = parent(marker);
  6016. parent$1.each(function (v) {
  6017. v.dom.insertBefore(element.dom, marker.dom);
  6018. });
  6019. };
  6020. var after$3 = function (marker, element) {
  6021. var sibling = nextSibling(marker);
  6022. sibling.fold(function () {
  6023. var parent$1 = parent(marker);
  6024. parent$1.each(function (v) {
  6025. append$1(v, element);
  6026. });
  6027. }, function (v) {
  6028. before$4(v, element);
  6029. });
  6030. };
  6031. var prepend = function (parent, element) {
  6032. var firstChild$1 = firstChild(parent);
  6033. firstChild$1.fold(function () {
  6034. append$1(parent, element);
  6035. }, function (v) {
  6036. parent.dom.insertBefore(element.dom, v.dom);
  6037. });
  6038. };
  6039. var append$1 = function (parent, element) {
  6040. parent.dom.appendChild(element.dom);
  6041. };
  6042. var wrap$3 = function (element, wrapper) {
  6043. before$4(element, wrapper);
  6044. append$1(wrapper, element);
  6045. };
  6046. var before$3 = function (marker, elements) {
  6047. each$k(elements, function (x) {
  6048. before$4(marker, x);
  6049. });
  6050. };
  6051. var append = function (parent, elements) {
  6052. each$k(elements, function (x) {
  6053. append$1(parent, x);
  6054. });
  6055. };
  6056. var empty = function (element) {
  6057. element.dom.textContent = '';
  6058. each$k(children(element), function (rogue) {
  6059. remove$7(rogue);
  6060. });
  6061. };
  6062. var remove$7 = function (element) {
  6063. var dom = element.dom;
  6064. if (dom.parentNode !== null) {
  6065. dom.parentNode.removeChild(dom);
  6066. }
  6067. };
  6068. var unwrap = function (wrapper) {
  6069. var children$1 = children(wrapper);
  6070. if (children$1.length > 0) {
  6071. before$3(wrapper, children$1);
  6072. }
  6073. remove$7(wrapper);
  6074. };
  6075. var inBody = function (element) {
  6076. var dom = isText$8(element) ? element.dom.parentNode : element.dom;
  6077. if (dom === undefined || dom === null || dom.ownerDocument === null) {
  6078. return false;
  6079. }
  6080. var doc = dom.ownerDocument;
  6081. return getShadowRoot(SugarElement.fromDom(dom)).fold(function () {
  6082. return doc.body.contains(dom);
  6083. }, compose1(inBody, getShadowHost));
  6084. };
  6085. var r = function (left, top) {
  6086. var translate = function (x, y) {
  6087. return r(left + x, top + y);
  6088. };
  6089. return {
  6090. left: left,
  6091. top: top,
  6092. translate: translate
  6093. };
  6094. };
  6095. var SugarPosition = r;
  6096. var boxPosition = function (dom) {
  6097. var box = dom.getBoundingClientRect();
  6098. return SugarPosition(box.left, box.top);
  6099. };
  6100. var firstDefinedOrZero = function (a, b) {
  6101. if (a !== undefined) {
  6102. return a;
  6103. } else {
  6104. return b !== undefined ? b : 0;
  6105. }
  6106. };
  6107. var absolute = function (element) {
  6108. var doc = element.dom.ownerDocument;
  6109. var body = doc.body;
  6110. var win = doc.defaultView;
  6111. var html = doc.documentElement;
  6112. if (body === element.dom) {
  6113. return SugarPosition(body.offsetLeft, body.offsetTop);
  6114. }
  6115. var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop);
  6116. var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft);
  6117. var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop);
  6118. var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft);
  6119. return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop);
  6120. };
  6121. var viewport = function (element) {
  6122. var dom = element.dom;
  6123. var doc = dom.ownerDocument;
  6124. var body = doc.body;
  6125. if (body === dom) {
  6126. return SugarPosition(body.offsetLeft, body.offsetTop);
  6127. }
  6128. if (!inBody(element)) {
  6129. return SugarPosition(0, 0);
  6130. }
  6131. return boxPosition(dom);
  6132. };
  6133. var get$8 = function (_DOC) {
  6134. var doc = _DOC !== undefined ? _DOC.dom : document;
  6135. var x = doc.body.scrollLeft || doc.documentElement.scrollLeft;
  6136. var y = doc.body.scrollTop || doc.documentElement.scrollTop;
  6137. return SugarPosition(x, y);
  6138. };
  6139. var to = function (x, y, _DOC) {
  6140. var doc = _DOC !== undefined ? _DOC.dom : document;
  6141. var win = doc.defaultView;
  6142. if (win) {
  6143. win.scrollTo(x, y);
  6144. }
  6145. };
  6146. var intoView = function (element, alignToTop) {
  6147. var isSafari = detect().browser.isSafari();
  6148. if (isSafari && isFunction(element.dom.scrollIntoViewIfNeeded)) {
  6149. element.dom.scrollIntoViewIfNeeded(false);
  6150. } else {
  6151. element.dom.scrollIntoView(alignToTop);
  6152. }
  6153. };
  6154. var get$7 = function (_win) {
  6155. var win = _win === undefined ? window : _win;
  6156. if (detect().browser.isFirefox()) {
  6157. return Optional.none();
  6158. } else {
  6159. return Optional.from(win['visualViewport']);
  6160. }
  6161. };
  6162. var bounds = function (x, y, width, height) {
  6163. return {
  6164. x: x,
  6165. y: y,
  6166. width: width,
  6167. height: height,
  6168. right: x + width,
  6169. bottom: y + height
  6170. };
  6171. };
  6172. var getBounds = function (_win) {
  6173. var win = _win === undefined ? window : _win;
  6174. var doc = win.document;
  6175. var scroll = get$8(SugarElement.fromDom(doc));
  6176. return get$7(win).fold(function () {
  6177. var html = win.document.documentElement;
  6178. var width = html.clientWidth;
  6179. var height = html.clientHeight;
  6180. return bounds(scroll.left, scroll.top, width, height);
  6181. }, function (visualViewport) {
  6182. return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height);
  6183. });
  6184. };
  6185. var isNodeType = function (type) {
  6186. return function (node) {
  6187. return !!node && node.nodeType === type;
  6188. };
  6189. };
  6190. var isRestrictedNode = function (node) {
  6191. return !!node && !Object.getPrototypeOf(node);
  6192. };
  6193. var isElement$5 = isNodeType(1);
  6194. var matchNodeNames = function (names) {
  6195. var lowercasedNames = names.map(function (s) {
  6196. return s.toLowerCase();
  6197. });
  6198. return function (node) {
  6199. if (node && node.nodeName) {
  6200. var nodeName = node.nodeName.toLowerCase();
  6201. return contains$3(lowercasedNames, nodeName);
  6202. }
  6203. return false;
  6204. };
  6205. };
  6206. var matchStyleValues = function (name, values) {
  6207. var items = values.toLowerCase().split(' ');
  6208. return function (node) {
  6209. if (isElement$5(node)) {
  6210. for (var i = 0; i < items.length; i++) {
  6211. var computed = node.ownerDocument.defaultView.getComputedStyle(node, null);
  6212. var cssValue = computed ? computed.getPropertyValue(name) : null;
  6213. if (cssValue === items[i]) {
  6214. return true;
  6215. }
  6216. }
  6217. }
  6218. return false;
  6219. };
  6220. };
  6221. var hasAttribute = function (attrName) {
  6222. return function (node) {
  6223. return isElement$5(node) && node.hasAttribute(attrName);
  6224. };
  6225. };
  6226. var hasAttributeValue = function (attrName, attrValue) {
  6227. return function (node) {
  6228. return isElement$5(node) && node.getAttribute(attrName) === attrValue;
  6229. };
  6230. };
  6231. var isBogus$2 = function (node) {
  6232. return isElement$5(node) && node.hasAttribute('data-mce-bogus');
  6233. };
  6234. var isBogusAll$1 = function (node) {
  6235. return isElement$5(node) && node.getAttribute('data-mce-bogus') === 'all';
  6236. };
  6237. var isTable$3 = function (node) {
  6238. return isElement$5(node) && node.tagName === 'TABLE';
  6239. };
  6240. var hasContentEditableState = function (value) {
  6241. return function (node) {
  6242. if (isElement$5(node)) {
  6243. if (node.contentEditable === value) {
  6244. return true;
  6245. }
  6246. if (node.getAttribute('data-mce-contenteditable') === value) {
  6247. return true;
  6248. }
  6249. }
  6250. return false;
  6251. };
  6252. };
  6253. var isTextareaOrInput = matchNodeNames([
  6254. 'textarea',
  6255. 'input'
  6256. ]);
  6257. var isText$7 = isNodeType(3);
  6258. var isComment = isNodeType(8);
  6259. var isDocument$1 = isNodeType(9);
  6260. var isDocumentFragment = isNodeType(11);
  6261. var isBr$5 = matchNodeNames(['br']);
  6262. var isImg = matchNodeNames(['img']);
  6263. var isContentEditableTrue$4 = hasContentEditableState('true');
  6264. var isContentEditableFalse$b = hasContentEditableState('false');
  6265. var isTableCell$5 = matchNodeNames([
  6266. 'td',
  6267. 'th'
  6268. ]);
  6269. var isMedia$2 = matchNodeNames([
  6270. 'video',
  6271. 'audio',
  6272. 'object',
  6273. 'embed'
  6274. ]);
  6275. var is$1 = function (lhs, rhs, comparator) {
  6276. if (comparator === void 0) {
  6277. comparator = tripleEquals;
  6278. }
  6279. return lhs.exists(function (left) {
  6280. return comparator(left, rhs);
  6281. });
  6282. };
  6283. var cat = function (arr) {
  6284. var r = [];
  6285. var push = function (x) {
  6286. r.push(x);
  6287. };
  6288. for (var i = 0; i < arr.length; i++) {
  6289. arr[i].each(push);
  6290. }
  6291. return r;
  6292. };
  6293. var lift2 = function (oa, ob, f) {
  6294. return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none();
  6295. };
  6296. var lift3 = function (oa, ob, oc, f) {
  6297. return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none();
  6298. };
  6299. var someIf = function (b, a) {
  6300. return b ? Optional.some(a) : Optional.none();
  6301. };
  6302. var isSupported = function (dom) {
  6303. return dom.style !== undefined && isFunction(dom.style.getPropertyValue);
  6304. };
  6305. var rawSet = function (dom, key, value) {
  6306. if (isString$1(value) || isBoolean(value) || isNumber(value)) {
  6307. dom.setAttribute(key, value + '');
  6308. } else {
  6309. console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom);
  6310. throw new Error('Attribute value was not simple');
  6311. }
  6312. };
  6313. var set$1 = function (element, key, value) {
  6314. rawSet(element.dom, key, value);
  6315. };
  6316. var setAll$1 = function (element, attrs) {
  6317. var dom = element.dom;
  6318. each$j(attrs, function (v, k) {
  6319. rawSet(dom, k, v);
  6320. });
  6321. };
  6322. var get$6 = function (element, key) {
  6323. var v = element.dom.getAttribute(key);
  6324. return v === null ? undefined : v;
  6325. };
  6326. var getOpt = function (element, key) {
  6327. return Optional.from(get$6(element, key));
  6328. };
  6329. var has$1 = function (element, key) {
  6330. var dom = element.dom;
  6331. return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
  6332. };
  6333. var remove$6 = function (element, key) {
  6334. element.dom.removeAttribute(key);
  6335. };
  6336. var clone$3 = function (element) {
  6337. return foldl(element.dom.attributes, function (acc, attr) {
  6338. acc[attr.name] = attr.value;
  6339. return acc;
  6340. }, {});
  6341. };
  6342. var internalSet = function (dom, property, value) {
  6343. if (!isString$1(value)) {
  6344. console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
  6345. throw new Error('CSS value must be a string: ' + value);
  6346. }
  6347. if (isSupported(dom)) {
  6348. dom.style.setProperty(property, value);
  6349. }
  6350. };
  6351. var setAll = function (element, css) {
  6352. var dom = element.dom;
  6353. each$j(css, function (v, k) {
  6354. internalSet(dom, k, v);
  6355. });
  6356. };
  6357. var get$5 = function (element, property) {
  6358. var dom = element.dom;
  6359. var styles = window.getComputedStyle(dom);
  6360. var r = styles.getPropertyValue(property);
  6361. return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
  6362. };
  6363. var getUnsafeProperty = function (dom, property) {
  6364. return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
  6365. };
  6366. var getRaw = function (element, property) {
  6367. var dom = element.dom;
  6368. var raw = getUnsafeProperty(dom, property);
  6369. return Optional.from(raw).filter(function (r) {
  6370. return r.length > 0;
  6371. });
  6372. };
  6373. var getAllRaw = function (element) {
  6374. var css = {};
  6375. var dom = element.dom;
  6376. if (isSupported(dom)) {
  6377. for (var i = 0; i < dom.style.length; i++) {
  6378. var ruleName = dom.style.item(i);
  6379. css[ruleName] = dom.style[ruleName];
  6380. }
  6381. }
  6382. return css;
  6383. };
  6384. var reflow = function (e) {
  6385. return e.dom.offsetWidth;
  6386. };
  6387. var browser$3 = detect().browser;
  6388. var firstElement = function (nodes) {
  6389. return find$3(nodes, isElement$6);
  6390. };
  6391. var getTableCaptionDeltaY = function (elm) {
  6392. if (browser$3.isFirefox() && name(elm) === 'table') {
  6393. return firstElement(children(elm)).filter(function (elm) {
  6394. return name(elm) === 'caption';
  6395. }).bind(function (caption) {
  6396. return firstElement(nextSiblings(caption)).map(function (body) {
  6397. var bodyTop = body.dom.offsetTop;
  6398. var captionTop = caption.dom.offsetTop;
  6399. var captionHeight = caption.dom.offsetHeight;
  6400. return bodyTop <= captionTop ? -captionHeight : 0;
  6401. });
  6402. }).getOr(0);
  6403. } else {
  6404. return 0;
  6405. }
  6406. };
  6407. var hasChild = function (elm, child) {
  6408. return elm.children && contains$3(elm.children, child);
  6409. };
  6410. var getPos = function (body, elm, rootElm) {
  6411. var x = 0, y = 0;
  6412. var doc = body.ownerDocument;
  6413. rootElm = rootElm ? rootElm : body;
  6414. if (elm) {
  6415. if (rootElm === body && elm.getBoundingClientRect && get$5(SugarElement.fromDom(body), 'position') === 'static') {
  6416. var pos = elm.getBoundingClientRect();
  6417. x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft;
  6418. y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop;
  6419. return {
  6420. x: x,
  6421. y: y
  6422. };
  6423. }
  6424. var offsetParent = elm;
  6425. while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) {
  6426. var castOffsetParent = offsetParent;
  6427. x += castOffsetParent.offsetLeft || 0;
  6428. y += castOffsetParent.offsetTop || 0;
  6429. offsetParent = castOffsetParent.offsetParent;
  6430. }
  6431. offsetParent = elm.parentNode;
  6432. while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) {
  6433. x -= offsetParent.scrollLeft || 0;
  6434. y -= offsetParent.scrollTop || 0;
  6435. offsetParent = offsetParent.parentNode;
  6436. }
  6437. y += getTableCaptionDeltaY(SugarElement.fromDom(elm));
  6438. }
  6439. return {
  6440. x: x,
  6441. y: y
  6442. };
  6443. };
  6444. var exports$1 = {}, module$1 = { exports: exports$1 };
  6445. (function (define, exports, module, require) {
  6446. (function (global, factory) {
  6447. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EphoxContactWrapper = factory());
  6448. }(this, function () {
  6449. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  6450. var promise = { exports: {} };
  6451. (function (module) {
  6452. (function (root) {
  6453. var setTimeoutFunc = setTimeout;
  6454. function noop() {
  6455. }
  6456. function bind(fn, thisArg) {
  6457. return function () {
  6458. fn.apply(thisArg, arguments);
  6459. };
  6460. }
  6461. function Promise(fn) {
  6462. if (typeof this !== 'object')
  6463. throw new TypeError('Promises must be constructed via new');
  6464. if (typeof fn !== 'function')
  6465. throw new TypeError('not a function');
  6466. this._state = 0;
  6467. this._handled = false;
  6468. this._value = undefined;
  6469. this._deferreds = [];
  6470. doResolve(fn, this);
  6471. }
  6472. function handle(self, deferred) {
  6473. while (self._state === 3) {
  6474. self = self._value;
  6475. }
  6476. if (self._state === 0) {
  6477. self._deferreds.push(deferred);
  6478. return;
  6479. }
  6480. self._handled = true;
  6481. Promise._immediateFn(function () {
  6482. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  6483. if (cb === null) {
  6484. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  6485. return;
  6486. }
  6487. var ret;
  6488. try {
  6489. ret = cb(self._value);
  6490. } catch (e) {
  6491. reject(deferred.promise, e);
  6492. return;
  6493. }
  6494. resolve(deferred.promise, ret);
  6495. });
  6496. }
  6497. function resolve(self, newValue) {
  6498. try {
  6499. if (newValue === self)
  6500. throw new TypeError('A promise cannot be resolved with itself.');
  6501. if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
  6502. var then = newValue.then;
  6503. if (newValue instanceof Promise) {
  6504. self._state = 3;
  6505. self._value = newValue;
  6506. finale(self);
  6507. return;
  6508. } else if (typeof then === 'function') {
  6509. doResolve(bind(then, newValue), self);
  6510. return;
  6511. }
  6512. }
  6513. self._state = 1;
  6514. self._value = newValue;
  6515. finale(self);
  6516. } catch (e) {
  6517. reject(self, e);
  6518. }
  6519. }
  6520. function reject(self, newValue) {
  6521. self._state = 2;
  6522. self._value = newValue;
  6523. finale(self);
  6524. }
  6525. function finale(self) {
  6526. if (self._state === 2 && self._deferreds.length === 0) {
  6527. Promise._immediateFn(function () {
  6528. if (!self._handled) {
  6529. Promise._unhandledRejectionFn(self._value);
  6530. }
  6531. });
  6532. }
  6533. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  6534. handle(self, self._deferreds[i]);
  6535. }
  6536. self._deferreds = null;
  6537. }
  6538. function Handler(onFulfilled, onRejected, promise) {
  6539. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  6540. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  6541. this.promise = promise;
  6542. }
  6543. function doResolve(fn, self) {
  6544. var done = false;
  6545. try {
  6546. fn(function (value) {
  6547. if (done)
  6548. return;
  6549. done = true;
  6550. resolve(self, value);
  6551. }, function (reason) {
  6552. if (done)
  6553. return;
  6554. done = true;
  6555. reject(self, reason);
  6556. });
  6557. } catch (ex) {
  6558. if (done)
  6559. return;
  6560. done = true;
  6561. reject(self, ex);
  6562. }
  6563. }
  6564. Promise.prototype['catch'] = function (onRejected) {
  6565. return this.then(null, onRejected);
  6566. };
  6567. Promise.prototype.then = function (onFulfilled, onRejected) {
  6568. var prom = new this.constructor(noop);
  6569. handle(this, new Handler(onFulfilled, onRejected, prom));
  6570. return prom;
  6571. };
  6572. Promise.all = function (arr) {
  6573. var args = Array.prototype.slice.call(arr);
  6574. return new Promise(function (resolve, reject) {
  6575. if (args.length === 0)
  6576. return resolve([]);
  6577. var remaining = args.length;
  6578. function res(i, val) {
  6579. try {
  6580. if (val && (typeof val === 'object' || typeof val === 'function')) {
  6581. var then = val.then;
  6582. if (typeof then === 'function') {
  6583. then.call(val, function (val) {
  6584. res(i, val);
  6585. }, reject);
  6586. return;
  6587. }
  6588. }
  6589. args[i] = val;
  6590. if (--remaining === 0) {
  6591. resolve(args);
  6592. }
  6593. } catch (ex) {
  6594. reject(ex);
  6595. }
  6596. }
  6597. for (var i = 0; i < args.length; i++) {
  6598. res(i, args[i]);
  6599. }
  6600. });
  6601. };
  6602. Promise.resolve = function (value) {
  6603. if (value && typeof value === 'object' && value.constructor === Promise) {
  6604. return value;
  6605. }
  6606. return new Promise(function (resolve) {
  6607. resolve(value);
  6608. });
  6609. };
  6610. Promise.reject = function (value) {
  6611. return new Promise(function (resolve, reject) {
  6612. reject(value);
  6613. });
  6614. };
  6615. Promise.race = function (values) {
  6616. return new Promise(function (resolve, reject) {
  6617. for (var i = 0, len = values.length; i < len; i++) {
  6618. values[i].then(resolve, reject);
  6619. }
  6620. });
  6621. };
  6622. Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) {
  6623. setImmediate(fn);
  6624. } : function (fn) {
  6625. setTimeoutFunc(fn, 0);
  6626. };
  6627. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  6628. if (typeof console !== 'undefined' && console) {
  6629. console.warn('Possible Unhandled Promise Rejection:', err);
  6630. }
  6631. };
  6632. Promise._setImmediateFn = function _setImmediateFn(fn) {
  6633. Promise._immediateFn = fn;
  6634. };
  6635. Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
  6636. Promise._unhandledRejectionFn = fn;
  6637. };
  6638. if (module.exports) {
  6639. module.exports = Promise;
  6640. } else if (!root.Promise) {
  6641. root.Promise = Promise;
  6642. }
  6643. }(commonjsGlobal));
  6644. }(promise));
  6645. var promisePolyfill = promise.exports;
  6646. var Global = function () {
  6647. if (typeof window !== 'undefined') {
  6648. return window;
  6649. } else {
  6650. return Function('return this;')();
  6651. }
  6652. }();
  6653. var promisePolyfill_1 = { boltExport: Global.Promise || promisePolyfill };
  6654. return promisePolyfill_1;
  6655. }));
  6656. }(undefined, exports$1, module$1));
  6657. var Promise$1 = module$1.exports.boltExport;
  6658. var nu$1 = function (baseFn) {
  6659. var data = Optional.none();
  6660. var callbacks = [];
  6661. var map = function (f) {
  6662. return nu$1(function (nCallback) {
  6663. get(function (data) {
  6664. nCallback(f(data));
  6665. });
  6666. });
  6667. };
  6668. var get = function (nCallback) {
  6669. if (isReady()) {
  6670. call(nCallback);
  6671. } else {
  6672. callbacks.push(nCallback);
  6673. }
  6674. };
  6675. var set = function (x) {
  6676. if (!isReady()) {
  6677. data = Optional.some(x);
  6678. run(callbacks);
  6679. callbacks = [];
  6680. }
  6681. };
  6682. var isReady = function () {
  6683. return data.isSome();
  6684. };
  6685. var run = function (cbs) {
  6686. each$k(cbs, call);
  6687. };
  6688. var call = function (cb) {
  6689. data.each(function (x) {
  6690. setTimeout(function () {
  6691. cb(x);
  6692. }, 0);
  6693. });
  6694. };
  6695. baseFn(set);
  6696. return {
  6697. get: get,
  6698. map: map,
  6699. isReady: isReady
  6700. };
  6701. };
  6702. var pure$1 = function (a) {
  6703. return nu$1(function (callback) {
  6704. callback(a);
  6705. });
  6706. };
  6707. var LazyValue = {
  6708. nu: nu$1,
  6709. pure: pure$1
  6710. };
  6711. var errorReporter = function (err) {
  6712. setTimeout(function () {
  6713. throw err;
  6714. }, 0);
  6715. };
  6716. var make = function (run) {
  6717. var get = function (callback) {
  6718. run().then(callback, errorReporter);
  6719. };
  6720. var map = function (fab) {
  6721. return make(function () {
  6722. return run().then(fab);
  6723. });
  6724. };
  6725. var bind = function (aFutureB) {
  6726. return make(function () {
  6727. return run().then(function (v) {
  6728. return aFutureB(v).toPromise();
  6729. });
  6730. });
  6731. };
  6732. var anonBind = function (futureB) {
  6733. return make(function () {
  6734. return run().then(function () {
  6735. return futureB.toPromise();
  6736. });
  6737. });
  6738. };
  6739. var toLazy = function () {
  6740. return LazyValue.nu(get);
  6741. };
  6742. var toCached = function () {
  6743. var cache = null;
  6744. return make(function () {
  6745. if (cache === null) {
  6746. cache = run();
  6747. }
  6748. return cache;
  6749. });
  6750. };
  6751. var toPromise = run;
  6752. return {
  6753. map: map,
  6754. bind: bind,
  6755. anonBind: anonBind,
  6756. toLazy: toLazy,
  6757. toCached: toCached,
  6758. toPromise: toPromise,
  6759. get: get
  6760. };
  6761. };
  6762. var nu = function (baseFn) {
  6763. return make(function () {
  6764. return new Promise$1(baseFn);
  6765. });
  6766. };
  6767. var pure = function (a) {
  6768. return make(function () {
  6769. return Promise$1.resolve(a);
  6770. });
  6771. };
  6772. var Future = {
  6773. nu: nu,
  6774. pure: pure
  6775. };
  6776. var par$1 = function (asyncValues, nu) {
  6777. return nu(function (callback) {
  6778. var r = [];
  6779. var count = 0;
  6780. var cb = function (i) {
  6781. return function (value) {
  6782. r[i] = value;
  6783. count++;
  6784. if (count >= asyncValues.length) {
  6785. callback(r);
  6786. }
  6787. };
  6788. };
  6789. if (asyncValues.length === 0) {
  6790. callback([]);
  6791. } else {
  6792. each$k(asyncValues, function (asyncValue, i) {
  6793. asyncValue.get(cb(i));
  6794. });
  6795. }
  6796. });
  6797. };
  6798. var par = function (futures) {
  6799. return par$1(futures, Future.nu);
  6800. };
  6801. var value$1 = function (o) {
  6802. var or = function (_opt) {
  6803. return value$1(o);
  6804. };
  6805. var orThunk = function (_f) {
  6806. return value$1(o);
  6807. };
  6808. var map = function (f) {
  6809. return value$1(f(o));
  6810. };
  6811. var mapError = function (_f) {
  6812. return value$1(o);
  6813. };
  6814. var each = function (f) {
  6815. f(o);
  6816. };
  6817. var bind = function (f) {
  6818. return f(o);
  6819. };
  6820. var fold = function (_, onValue) {
  6821. return onValue(o);
  6822. };
  6823. var exists = function (f) {
  6824. return f(o);
  6825. };
  6826. var forall = function (f) {
  6827. return f(o);
  6828. };
  6829. var toOptional = function () {
  6830. return Optional.some(o);
  6831. };
  6832. return {
  6833. isValue: always,
  6834. isError: never,
  6835. getOr: constant(o),
  6836. getOrThunk: constant(o),
  6837. getOrDie: constant(o),
  6838. or: or,
  6839. orThunk: orThunk,
  6840. fold: fold,
  6841. map: map,
  6842. mapError: mapError,
  6843. each: each,
  6844. bind: bind,
  6845. exists: exists,
  6846. forall: forall,
  6847. toOptional: toOptional
  6848. };
  6849. };
  6850. var error = function (message) {
  6851. var getOrThunk = function (f) {
  6852. return f();
  6853. };
  6854. var getOrDie = function () {
  6855. return die(String(message))();
  6856. };
  6857. var or = identity;
  6858. var orThunk = function (f) {
  6859. return f();
  6860. };
  6861. var map = function (_f) {
  6862. return error(message);
  6863. };
  6864. var mapError = function (f) {
  6865. return error(f(message));
  6866. };
  6867. var bind = function (_f) {
  6868. return error(message);
  6869. };
  6870. var fold = function (onError, _) {
  6871. return onError(message);
  6872. };
  6873. return {
  6874. isValue: never,
  6875. isError: always,
  6876. getOr: identity,
  6877. getOrThunk: getOrThunk,
  6878. getOrDie: getOrDie,
  6879. or: or,
  6880. orThunk: orThunk,
  6881. fold: fold,
  6882. map: map,
  6883. mapError: mapError,
  6884. each: noop,
  6885. bind: bind,
  6886. exists: never,
  6887. forall: always,
  6888. toOptional: Optional.none
  6889. };
  6890. };
  6891. var fromOption = function (opt, err) {
  6892. return opt.fold(function () {
  6893. return error(err);
  6894. }, value$1);
  6895. };
  6896. var Result = {
  6897. value: value$1,
  6898. error: error,
  6899. fromOption: fromOption
  6900. };
  6901. var generate$1 = function (cases) {
  6902. if (!isArray$1(cases)) {
  6903. throw new Error('cases must be an array');
  6904. }
  6905. if (cases.length === 0) {
  6906. throw new Error('there must be at least one case');
  6907. }
  6908. var constructors = [];
  6909. var adt = {};
  6910. each$k(cases, function (acase, count) {
  6911. var keys$1 = keys(acase);
  6912. if (keys$1.length !== 1) {
  6913. throw new Error('one and only one name per case');
  6914. }
  6915. var key = keys$1[0];
  6916. var value = acase[key];
  6917. if (adt[key] !== undefined) {
  6918. throw new Error('duplicate key detected:' + key);
  6919. } else if (key === 'cata') {
  6920. throw new Error('cannot have a case named cata (sorry)');
  6921. } else if (!isArray$1(value)) {
  6922. throw new Error('case arguments must be an array');
  6923. }
  6924. constructors.push(key);
  6925. adt[key] = function () {
  6926. var args = [];
  6927. for (var _i = 0; _i < arguments.length; _i++) {
  6928. args[_i] = arguments[_i];
  6929. }
  6930. var argLength = args.length;
  6931. if (argLength !== value.length) {
  6932. throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
  6933. }
  6934. var match = function (branches) {
  6935. var branchKeys = keys(branches);
  6936. if (constructors.length !== branchKeys.length) {
  6937. throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(','));
  6938. }
  6939. var allReqd = forall(constructors, function (reqKey) {
  6940. return contains$3(branchKeys, reqKey);
  6941. });
  6942. if (!allReqd) {
  6943. throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
  6944. }
  6945. return branches[key].apply(null, args);
  6946. };
  6947. return {
  6948. fold: function () {
  6949. var foldArgs = [];
  6950. for (var _i = 0; _i < arguments.length; _i++) {
  6951. foldArgs[_i] = arguments[_i];
  6952. }
  6953. if (foldArgs.length !== cases.length) {
  6954. throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + foldArgs.length);
  6955. }
  6956. var target = foldArgs[count];
  6957. return target.apply(null, args);
  6958. },
  6959. match: match,
  6960. log: function (label) {
  6961. console.log(label, {
  6962. constructors: constructors,
  6963. constructor: key,
  6964. params: args
  6965. });
  6966. }
  6967. };
  6968. };
  6969. });
  6970. return adt;
  6971. };
  6972. var Adt = { generate: generate$1 };
  6973. Adt.generate([
  6974. {
  6975. bothErrors: [
  6976. 'error1',
  6977. 'error2'
  6978. ]
  6979. },
  6980. {
  6981. firstError: [
  6982. 'error1',
  6983. 'value2'
  6984. ]
  6985. },
  6986. {
  6987. secondError: [
  6988. 'value1',
  6989. 'error2'
  6990. ]
  6991. },
  6992. {
  6993. bothValues: [
  6994. 'value1',
  6995. 'value2'
  6996. ]
  6997. }
  6998. ]);
  6999. var unite = function (result) {
  7000. return result.fold(identity, identity);
  7001. };
  7002. function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
  7003. if (is(scope, a)) {
  7004. return Optional.some(scope);
  7005. } else if (isFunction(isRoot) && isRoot(scope)) {
  7006. return Optional.none();
  7007. } else {
  7008. return ancestor(scope, a, isRoot);
  7009. }
  7010. }
  7011. var ancestor$3 = function (scope, predicate, isRoot) {
  7012. var element = scope.dom;
  7013. var stop = isFunction(isRoot) ? isRoot : never;
  7014. while (element.parentNode) {
  7015. element = element.parentNode;
  7016. var el = SugarElement.fromDom(element);
  7017. if (predicate(el)) {
  7018. return Optional.some(el);
  7019. } else if (stop(el)) {
  7020. break;
  7021. }
  7022. }
  7023. return Optional.none();
  7024. };
  7025. var closest$3 = function (scope, predicate, isRoot) {
  7026. var is = function (s, test) {
  7027. return test(s);
  7028. };
  7029. return ClosestOrAncestor(is, ancestor$3, scope, predicate, isRoot);
  7030. };
  7031. var sibling$2 = function (scope, predicate) {
  7032. var element = scope.dom;
  7033. if (!element.parentNode) {
  7034. return Optional.none();
  7035. }
  7036. return child(SugarElement.fromDom(element.parentNode), function (x) {
  7037. return !eq(scope, x) && predicate(x);
  7038. });
  7039. };
  7040. var child = function (scope, predicate) {
  7041. var pred = function (node) {
  7042. return predicate(SugarElement.fromDom(node));
  7043. };
  7044. var result = find$3(scope.dom.childNodes, pred);
  7045. return result.map(SugarElement.fromDom);
  7046. };
  7047. var ancestor$2 = function (scope, selector, isRoot) {
  7048. return ancestor$3(scope, function (e) {
  7049. return is$2(e, selector);
  7050. }, isRoot);
  7051. };
  7052. var descendant = function (scope, selector) {
  7053. return one(selector, scope);
  7054. };
  7055. var closest$2 = function (scope, selector, isRoot) {
  7056. var is = function (element, selector) {
  7057. return is$2(element, selector);
  7058. };
  7059. return ClosestOrAncestor(is, ancestor$2, scope, selector, isRoot);
  7060. };
  7061. var promiseObj = window.Promise ? window.Promise : Promise$1;
  7062. var requestAnimationFramePromise;
  7063. var requestAnimationFrame = function (callback, element) {
  7064. var requestAnimationFrameFunc = window.requestAnimationFrame;
  7065. var vendors = [
  7066. 'ms',
  7067. 'moz',
  7068. 'webkit'
  7069. ];
  7070. var featurefill = function (cb) {
  7071. window.setTimeout(cb, 0);
  7072. };
  7073. for (var i = 0; i < vendors.length && !requestAnimationFrameFunc; i++) {
  7074. requestAnimationFrameFunc = window[vendors[i] + 'RequestAnimationFrame'];
  7075. }
  7076. if (!requestAnimationFrameFunc) {
  7077. requestAnimationFrameFunc = featurefill;
  7078. }
  7079. requestAnimationFrameFunc(callback, element);
  7080. };
  7081. var wrappedSetTimeout = function (callback, time) {
  7082. if (typeof time !== 'number') {
  7083. time = 0;
  7084. }
  7085. return setTimeout(callback, time);
  7086. };
  7087. var wrappedSetInterval = function (callback, time) {
  7088. if (typeof time !== 'number') {
  7089. time = 1;
  7090. }
  7091. return setInterval(callback, time);
  7092. };
  7093. var wrappedClearTimeout = function (id) {
  7094. return clearTimeout(id);
  7095. };
  7096. var wrappedClearInterval = function (id) {
  7097. return clearInterval(id);
  7098. };
  7099. var debounce = function (callback, time) {
  7100. var timer;
  7101. var func = function () {
  7102. var args = [];
  7103. for (var _i = 0; _i < arguments.length; _i++) {
  7104. args[_i] = arguments[_i];
  7105. }
  7106. clearTimeout(timer);
  7107. timer = wrappedSetTimeout(function () {
  7108. callback.apply(this, args);
  7109. }, time);
  7110. };
  7111. func.stop = function () {
  7112. clearTimeout(timer);
  7113. };
  7114. return func;
  7115. };
  7116. var Delay = {
  7117. requestAnimationFrame: function (callback, element) {
  7118. if (requestAnimationFramePromise) {
  7119. requestAnimationFramePromise.then(callback);
  7120. return;
  7121. }
  7122. requestAnimationFramePromise = new promiseObj(function (resolve) {
  7123. if (!element) {
  7124. element = document.body;
  7125. }
  7126. requestAnimationFrame(resolve, element);
  7127. }).then(callback);
  7128. },
  7129. setTimeout: wrappedSetTimeout,
  7130. setInterval: wrappedSetInterval,
  7131. setEditorTimeout: function (editor, callback, time) {
  7132. return wrappedSetTimeout(function () {
  7133. if (!editor.removed) {
  7134. callback();
  7135. }
  7136. }, time);
  7137. },
  7138. setEditorInterval: function (editor, callback, time) {
  7139. var timer = wrappedSetInterval(function () {
  7140. if (!editor.removed) {
  7141. callback();
  7142. } else {
  7143. clearInterval(timer);
  7144. }
  7145. }, time);
  7146. return timer;
  7147. },
  7148. debounce: debounce,
  7149. throttle: debounce,
  7150. clearInterval: wrappedClearInterval,
  7151. clearTimeout: wrappedClearTimeout
  7152. };
  7153. var StyleSheetLoader = function (documentOrShadowRoot, settings) {
  7154. if (settings === void 0) {
  7155. settings = {};
  7156. }
  7157. var idCount = 0;
  7158. var loadedStates = {};
  7159. var edos = SugarElement.fromDom(documentOrShadowRoot);
  7160. var doc = documentOrOwner(edos);
  7161. var maxLoadTime = settings.maxLoadTime || 5000;
  7162. var _setReferrerPolicy = function (referrerPolicy) {
  7163. settings.referrerPolicy = referrerPolicy;
  7164. };
  7165. var addStyle = function (element) {
  7166. append$1(getStyleContainer(edos), element);
  7167. };
  7168. var removeStyle = function (id) {
  7169. var styleContainer = getStyleContainer(edos);
  7170. descendant(styleContainer, '#' + id).each(remove$7);
  7171. };
  7172. var getOrCreateState = function (url) {
  7173. return get$9(loadedStates, url).getOrThunk(function () {
  7174. return {
  7175. id: 'mce-u' + idCount++,
  7176. passed: [],
  7177. failed: [],
  7178. count: 0
  7179. };
  7180. });
  7181. };
  7182. var load = function (url, success, failure) {
  7183. var link;
  7184. var urlWithSuffix = Tools._addCacheSuffix(url);
  7185. var state = getOrCreateState(urlWithSuffix);
  7186. loadedStates[urlWithSuffix] = state;
  7187. state.count++;
  7188. var resolve = function (callbacks, status) {
  7189. var i = callbacks.length;
  7190. while (i--) {
  7191. callbacks[i]();
  7192. }
  7193. state.status = status;
  7194. state.passed = [];
  7195. state.failed = [];
  7196. if (link) {
  7197. link.onload = null;
  7198. link.onerror = null;
  7199. link = null;
  7200. }
  7201. };
  7202. var passed = function () {
  7203. return resolve(state.passed, 2);
  7204. };
  7205. var failed = function () {
  7206. return resolve(state.failed, 3);
  7207. };
  7208. var wait = function (testCallback, waitCallback) {
  7209. if (!testCallback()) {
  7210. if (Date.now() - startTime < maxLoadTime) {
  7211. Delay.setTimeout(waitCallback);
  7212. } else {
  7213. failed();
  7214. }
  7215. }
  7216. };
  7217. var waitForWebKitLinkLoaded = function () {
  7218. wait(function () {
  7219. var styleSheets = documentOrShadowRoot.styleSheets;
  7220. var i = styleSheets.length;
  7221. while (i--) {
  7222. var styleSheet = styleSheets[i];
  7223. var owner = styleSheet.ownerNode;
  7224. if (owner && owner.id === link.id) {
  7225. passed();
  7226. return true;
  7227. }
  7228. }
  7229. return false;
  7230. }, waitForWebKitLinkLoaded);
  7231. };
  7232. if (success) {
  7233. state.passed.push(success);
  7234. }
  7235. if (failure) {
  7236. state.failed.push(failure);
  7237. }
  7238. if (state.status === 1) {
  7239. return;
  7240. }
  7241. if (state.status === 2) {
  7242. passed();
  7243. return;
  7244. }
  7245. if (state.status === 3) {
  7246. failed();
  7247. return;
  7248. }
  7249. state.status = 1;
  7250. var linkElem = SugarElement.fromTag('link', doc.dom);
  7251. setAll$1(linkElem, {
  7252. rel: 'stylesheet',
  7253. type: 'text/css',
  7254. id: state.id
  7255. });
  7256. var startTime = Date.now();
  7257. if (settings.contentCssCors) {
  7258. set$1(linkElem, 'crossOrigin', 'anonymous');
  7259. }
  7260. if (settings.referrerPolicy) {
  7261. set$1(linkElem, 'referrerpolicy', settings.referrerPolicy);
  7262. }
  7263. link = linkElem.dom;
  7264. link.onload = waitForWebKitLinkLoaded;
  7265. link.onerror = failed;
  7266. addStyle(linkElem);
  7267. set$1(linkElem, 'href', urlWithSuffix);
  7268. };
  7269. var loadF = function (url) {
  7270. return Future.nu(function (resolve) {
  7271. load(url, compose(resolve, constant(Result.value(url))), compose(resolve, constant(Result.error(url))));
  7272. });
  7273. };
  7274. var loadAll = function (urls, success, failure) {
  7275. par(map$3(urls, loadF)).get(function (result) {
  7276. var parts = partition(result, function (r) {
  7277. return r.isValue();
  7278. });
  7279. if (parts.fail.length > 0) {
  7280. failure(parts.fail.map(unite));
  7281. } else {
  7282. success(parts.pass.map(unite));
  7283. }
  7284. });
  7285. };
  7286. var unload = function (url) {
  7287. var urlWithSuffix = Tools._addCacheSuffix(url);
  7288. get$9(loadedStates, urlWithSuffix).each(function (state) {
  7289. var count = --state.count;
  7290. if (count === 0) {
  7291. delete loadedStates[urlWithSuffix];
  7292. removeStyle(state.id);
  7293. }
  7294. });
  7295. };
  7296. var unloadAll = function (urls) {
  7297. each$k(urls, function (url) {
  7298. unload(url);
  7299. });
  7300. };
  7301. return {
  7302. load: load,
  7303. loadAll: loadAll,
  7304. unload: unload,
  7305. unloadAll: unloadAll,
  7306. _setReferrerPolicy: _setReferrerPolicy
  7307. };
  7308. };
  7309. var create$8 = function () {
  7310. var map = new WeakMap();
  7311. var forElement = function (referenceElement, settings) {
  7312. var root = getRootNode(referenceElement);
  7313. var rootDom = root.dom;
  7314. return Optional.from(map.get(rootDom)).getOrThunk(function () {
  7315. var sl = StyleSheetLoader(rootDom, settings);
  7316. map.set(rootDom, sl);
  7317. return sl;
  7318. });
  7319. };
  7320. return { forElement: forElement };
  7321. };
  7322. var instance = create$8();
  7323. var DomTreeWalker = function () {
  7324. function DomTreeWalker(startNode, rootNode) {
  7325. this.node = startNode;
  7326. this.rootNode = rootNode;
  7327. this.current = this.current.bind(this);
  7328. this.next = this.next.bind(this);
  7329. this.prev = this.prev.bind(this);
  7330. this.prev2 = this.prev2.bind(this);
  7331. }
  7332. DomTreeWalker.prototype.current = function () {
  7333. return this.node;
  7334. };
  7335. DomTreeWalker.prototype.next = function (shallow) {
  7336. this.node = this.findSibling(this.node, 'firstChild', 'nextSibling', shallow);
  7337. return this.node;
  7338. };
  7339. DomTreeWalker.prototype.prev = function (shallow) {
  7340. this.node = this.findSibling(this.node, 'lastChild', 'previousSibling', shallow);
  7341. return this.node;
  7342. };
  7343. DomTreeWalker.prototype.prev2 = function (shallow) {
  7344. this.node = this.findPreviousNode(this.node, 'lastChild', 'previousSibling', shallow);
  7345. return this.node;
  7346. };
  7347. DomTreeWalker.prototype.findSibling = function (node, startName, siblingName, shallow) {
  7348. var sibling, parent;
  7349. if (node) {
  7350. if (!shallow && node[startName]) {
  7351. return node[startName];
  7352. }
  7353. if (node !== this.rootNode) {
  7354. sibling = node[siblingName];
  7355. if (sibling) {
  7356. return sibling;
  7357. }
  7358. for (parent = node.parentNode; parent && parent !== this.rootNode; parent = parent.parentNode) {
  7359. sibling = parent[siblingName];
  7360. if (sibling) {
  7361. return sibling;
  7362. }
  7363. }
  7364. }
  7365. }
  7366. };
  7367. DomTreeWalker.prototype.findPreviousNode = function (node, startName, siblingName, shallow) {
  7368. var sibling, parent, child;
  7369. if (node) {
  7370. sibling = node[siblingName];
  7371. if (this.rootNode && sibling === this.rootNode) {
  7372. return;
  7373. }
  7374. if (sibling) {
  7375. if (!shallow) {
  7376. for (child = sibling[startName]; child; child = child[startName]) {
  7377. if (!child[startName]) {
  7378. return child;
  7379. }
  7380. }
  7381. }
  7382. return sibling;
  7383. }
  7384. parent = node.parentNode;
  7385. if (parent && parent !== this.rootNode) {
  7386. return parent;
  7387. }
  7388. }
  7389. };
  7390. return DomTreeWalker;
  7391. }();
  7392. var blocks = [
  7393. 'article',
  7394. 'aside',
  7395. 'details',
  7396. 'div',
  7397. 'dt',
  7398. 'figcaption',
  7399. 'footer',
  7400. 'form',
  7401. 'fieldset',
  7402. 'header',
  7403. 'hgroup',
  7404. 'html',
  7405. 'main',
  7406. 'nav',
  7407. 'section',
  7408. 'summary',
  7409. 'body',
  7410. 'p',
  7411. 'dl',
  7412. 'multicol',
  7413. 'dd',
  7414. 'figure',
  7415. 'address',
  7416. 'center',
  7417. 'blockquote',
  7418. 'h1',
  7419. 'h2',
  7420. 'h3',
  7421. 'h4',
  7422. 'h5',
  7423. 'h6',
  7424. 'listing',
  7425. 'xmp',
  7426. 'pre',
  7427. 'plaintext',
  7428. 'menu',
  7429. 'dir',
  7430. 'ul',
  7431. 'ol',
  7432. 'li',
  7433. 'hr',
  7434. 'table',
  7435. 'tbody',
  7436. 'thead',
  7437. 'tfoot',
  7438. 'th',
  7439. 'tr',
  7440. 'td',
  7441. 'caption'
  7442. ];
  7443. var tableCells = [
  7444. 'td',
  7445. 'th'
  7446. ];
  7447. var tableSections = [
  7448. 'thead',
  7449. 'tbody',
  7450. 'tfoot'
  7451. ];
  7452. var textBlocks = [
  7453. 'h1',
  7454. 'h2',
  7455. 'h3',
  7456. 'h4',
  7457. 'h5',
  7458. 'h6',
  7459. 'p',
  7460. 'div',
  7461. 'address',
  7462. 'pre',
  7463. 'form',
  7464. 'blockquote',
  7465. 'center',
  7466. 'dir',
  7467. 'fieldset',
  7468. 'header',
  7469. 'footer',
  7470. 'article',
  7471. 'section',
  7472. 'hgroup',
  7473. 'aside',
  7474. 'nav',
  7475. 'figure'
  7476. ];
  7477. var headings = [
  7478. 'h1',
  7479. 'h2',
  7480. 'h3',
  7481. 'h4',
  7482. 'h5',
  7483. 'h6'
  7484. ];
  7485. var listItems$1 = [
  7486. 'li',
  7487. 'dd',
  7488. 'dt'
  7489. ];
  7490. var lists = [
  7491. 'ul',
  7492. 'ol',
  7493. 'dl'
  7494. ];
  7495. var wsElements = [
  7496. 'pre',
  7497. 'script',
  7498. 'textarea',
  7499. 'style'
  7500. ];
  7501. var lazyLookup = function (items) {
  7502. var lookup;
  7503. return function (node) {
  7504. lookup = lookup ? lookup : mapToObject(items, always);
  7505. return has$2(lookup, name(node));
  7506. };
  7507. };
  7508. var isHeading = lazyLookup(headings);
  7509. var isBlock$2 = lazyLookup(blocks);
  7510. var isTable$2 = function (node) {
  7511. return name(node) === 'table';
  7512. };
  7513. var isInline$1 = function (node) {
  7514. return isElement$6(node) && !isBlock$2(node);
  7515. };
  7516. var isBr$4 = function (node) {
  7517. return isElement$6(node) && name(node) === 'br';
  7518. };
  7519. var isTextBlock$2 = lazyLookup(textBlocks);
  7520. var isList = lazyLookup(lists);
  7521. var isListItem = lazyLookup(listItems$1);
  7522. var isTableSection = lazyLookup(tableSections);
  7523. var isTableCell$4 = lazyLookup(tableCells);
  7524. var isWsPreserveElement = lazyLookup(wsElements);
  7525. var ancestor$1 = function (scope, selector, isRoot) {
  7526. return ancestor$2(scope, selector, isRoot).isSome();
  7527. };
  7528. var zeroWidth = '\uFEFF';
  7529. var nbsp = '\xA0';
  7530. var isZwsp$1 = function (char) {
  7531. return char === zeroWidth;
  7532. };
  7533. var removeZwsp = function (s) {
  7534. return s.replace(/\uFEFF/g, '');
  7535. };
  7536. var ZWSP$1 = zeroWidth;
  7537. var isZwsp = isZwsp$1;
  7538. var trim$2 = removeZwsp;
  7539. var isElement$4 = isElement$5;
  7540. var isText$6 = isText$7;
  7541. var isCaretContainerBlock$1 = function (node) {
  7542. if (isText$6(node)) {
  7543. node = node.parentNode;
  7544. }
  7545. return isElement$4(node) && node.hasAttribute('data-mce-caret');
  7546. };
  7547. var isCaretContainerInline = function (node) {
  7548. return isText$6(node) && isZwsp(node.data);
  7549. };
  7550. var isCaretContainer$2 = function (node) {
  7551. return isCaretContainerBlock$1(node) || isCaretContainerInline(node);
  7552. };
  7553. var hasContent = function (node) {
  7554. return node.firstChild !== node.lastChild || !isBr$5(node.firstChild);
  7555. };
  7556. var insertInline$1 = function (node, before) {
  7557. var doc = node.ownerDocument;
  7558. var textNode = doc.createTextNode(ZWSP$1);
  7559. var parentNode = node.parentNode;
  7560. if (!before) {
  7561. var sibling = node.nextSibling;
  7562. if (isText$6(sibling)) {
  7563. if (isCaretContainer$2(sibling)) {
  7564. return sibling;
  7565. }
  7566. if (startsWithCaretContainer$1(sibling)) {
  7567. sibling.splitText(1);
  7568. return sibling;
  7569. }
  7570. }
  7571. if (node.nextSibling) {
  7572. parentNode.insertBefore(textNode, node.nextSibling);
  7573. } else {
  7574. parentNode.appendChild(textNode);
  7575. }
  7576. } else {
  7577. var sibling = node.previousSibling;
  7578. if (isText$6(sibling)) {
  7579. if (isCaretContainer$2(sibling)) {
  7580. return sibling;
  7581. }
  7582. if (endsWithCaretContainer$1(sibling)) {
  7583. return sibling.splitText(sibling.data.length - 1);
  7584. }
  7585. }
  7586. parentNode.insertBefore(textNode, node);
  7587. }
  7588. return textNode;
  7589. };
  7590. var isBeforeInline = function (pos) {
  7591. var container = pos.container();
  7592. if (!isText$7(container)) {
  7593. return false;
  7594. }
  7595. return container.data.charAt(pos.offset()) === ZWSP$1 || pos.isAtStart() && isCaretContainerInline(container.previousSibling);
  7596. };
  7597. var isAfterInline = function (pos) {
  7598. var container = pos.container();
  7599. if (!isText$7(container)) {
  7600. return false;
  7601. }
  7602. return container.data.charAt(pos.offset() - 1) === ZWSP$1 || pos.isAtEnd() && isCaretContainerInline(container.nextSibling);
  7603. };
  7604. var createBogusBr = function () {
  7605. var br = document.createElement('br');
  7606. br.setAttribute('data-mce-bogus', '1');
  7607. return br;
  7608. };
  7609. var insertBlock$1 = function (blockName, node, before) {
  7610. var doc = node.ownerDocument;
  7611. var blockNode = doc.createElement(blockName);
  7612. blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after');
  7613. blockNode.setAttribute('data-mce-bogus', 'all');
  7614. blockNode.appendChild(createBogusBr());
  7615. var parentNode = node.parentNode;
  7616. if (!before) {
  7617. if (node.nextSibling) {
  7618. parentNode.insertBefore(blockNode, node.nextSibling);
  7619. } else {
  7620. parentNode.appendChild(blockNode);
  7621. }
  7622. } else {
  7623. parentNode.insertBefore(blockNode, node);
  7624. }
  7625. return blockNode;
  7626. };
  7627. var startsWithCaretContainer$1 = function (node) {
  7628. return isText$6(node) && node.data[0] === ZWSP$1;
  7629. };
  7630. var endsWithCaretContainer$1 = function (node) {
  7631. return isText$6(node) && node.data[node.data.length - 1] === ZWSP$1;
  7632. };
  7633. var trimBogusBr = function (elm) {
  7634. var brs = elm.getElementsByTagName('br');
  7635. var lastBr = brs[brs.length - 1];
  7636. if (isBogus$2(lastBr)) {
  7637. lastBr.parentNode.removeChild(lastBr);
  7638. }
  7639. };
  7640. var showCaretContainerBlock = function (caretContainer) {
  7641. if (caretContainer && caretContainer.hasAttribute('data-mce-caret')) {
  7642. trimBogusBr(caretContainer);
  7643. caretContainer.removeAttribute('data-mce-caret');
  7644. caretContainer.removeAttribute('data-mce-bogus');
  7645. caretContainer.removeAttribute('style');
  7646. caretContainer.removeAttribute('_moz_abspos');
  7647. return caretContainer;
  7648. }
  7649. return null;
  7650. };
  7651. var isRangeInCaretContainerBlock = function (range) {
  7652. return isCaretContainerBlock$1(range.startContainer);
  7653. };
  7654. var isContentEditableTrue$3 = isContentEditableTrue$4;
  7655. var isContentEditableFalse$a = isContentEditableFalse$b;
  7656. var isBr$3 = isBr$5;
  7657. var isText$5 = isText$7;
  7658. var isInvalidTextElement = matchNodeNames([
  7659. 'script',
  7660. 'style',
  7661. 'textarea'
  7662. ]);
  7663. var isAtomicInline = matchNodeNames([
  7664. 'img',
  7665. 'input',
  7666. 'textarea',
  7667. 'hr',
  7668. 'iframe',
  7669. 'video',
  7670. 'audio',
  7671. 'object',
  7672. 'embed'
  7673. ]);
  7674. var isTable$1 = matchNodeNames(['table']);
  7675. var isCaretContainer$1 = isCaretContainer$2;
  7676. var isCaretCandidate$3 = function (node) {
  7677. if (isCaretContainer$1(node)) {
  7678. return false;
  7679. }
  7680. if (isText$5(node)) {
  7681. return !isInvalidTextElement(node.parentNode);
  7682. }
  7683. return isAtomicInline(node) || isBr$3(node) || isTable$1(node) || isNonUiContentEditableFalse(node);
  7684. };
  7685. var isUnselectable = function (node) {
  7686. return isElement$5(node) && node.getAttribute('unselectable') === 'true';
  7687. };
  7688. var isNonUiContentEditableFalse = function (node) {
  7689. return isUnselectable(node) === false && isContentEditableFalse$a(node);
  7690. };
  7691. var isInEditable = function (node, root) {
  7692. for (node = node.parentNode; node && node !== root; node = node.parentNode) {
  7693. if (isNonUiContentEditableFalse(node)) {
  7694. return false;
  7695. }
  7696. if (isContentEditableTrue$3(node)) {
  7697. return true;
  7698. }
  7699. }
  7700. return true;
  7701. };
  7702. var isAtomicContentEditableFalse = function (node) {
  7703. if (!isNonUiContentEditableFalse(node)) {
  7704. return false;
  7705. }
  7706. return foldl(from(node.getElementsByTagName('*')), function (result, elm) {
  7707. return result || isContentEditableTrue$3(elm);
  7708. }, false) !== true;
  7709. };
  7710. var isAtomic$1 = function (node) {
  7711. return isAtomicInline(node) || isAtomicContentEditableFalse(node);
  7712. };
  7713. var isEditableCaretCandidate$1 = function (node, root) {
  7714. return isCaretCandidate$3(node) && isInEditable(node, root);
  7715. };
  7716. var whiteSpaceRegExp$1 = /^[ \t\r\n]*$/;
  7717. var isWhitespaceText = function (text) {
  7718. return whiteSpaceRegExp$1.test(text);
  7719. };
  7720. var hasWhitespacePreserveParent = function (node, rootNode) {
  7721. var rootElement = SugarElement.fromDom(rootNode);
  7722. var startNode = SugarElement.fromDom(node);
  7723. return ancestor$1(startNode, 'pre,code', curry(eq, rootElement));
  7724. };
  7725. var isWhitespace = function (node, rootNode) {
  7726. return isText$7(node) && isWhitespaceText(node.data) && hasWhitespacePreserveParent(node, rootNode) === false;
  7727. };
  7728. var isNamedAnchor = function (node) {
  7729. return isElement$5(node) && node.nodeName === 'A' && !node.hasAttribute('href') && (node.hasAttribute('name') || node.hasAttribute('id'));
  7730. };
  7731. var isContent$1 = function (node, rootNode) {
  7732. return isCaretCandidate$3(node) && isWhitespace(node, rootNode) === false || isNamedAnchor(node) || isBookmark(node);
  7733. };
  7734. var isBookmark = hasAttribute('data-mce-bookmark');
  7735. var isBogus$1 = hasAttribute('data-mce-bogus');
  7736. var isBogusAll = hasAttributeValue('data-mce-bogus', 'all');
  7737. var isEmptyNode = function (targetNode, skipBogus) {
  7738. var brCount = 0;
  7739. if (isContent$1(targetNode, targetNode)) {
  7740. return false;
  7741. } else {
  7742. var node = targetNode.firstChild;
  7743. if (!node) {
  7744. return true;
  7745. }
  7746. var walker = new DomTreeWalker(node, targetNode);
  7747. do {
  7748. if (skipBogus) {
  7749. if (isBogusAll(node)) {
  7750. node = walker.next(true);
  7751. continue;
  7752. }
  7753. if (isBogus$1(node)) {
  7754. node = walker.next();
  7755. continue;
  7756. }
  7757. }
  7758. if (isBr$5(node)) {
  7759. brCount++;
  7760. node = walker.next();
  7761. continue;
  7762. }
  7763. if (isContent$1(node, targetNode)) {
  7764. return false;
  7765. }
  7766. node = walker.next();
  7767. } while (node);
  7768. return brCount <= 1;
  7769. }
  7770. };
  7771. var isEmpty$2 = function (elm, skipBogus) {
  7772. if (skipBogus === void 0) {
  7773. skipBogus = true;
  7774. }
  7775. return isEmptyNode(elm.dom, skipBogus);
  7776. };
  7777. var isSpan = function (node) {
  7778. return node.nodeName.toLowerCase() === 'span';
  7779. };
  7780. var isInlineContent = function (node, root) {
  7781. return isNonNullable(node) && (isContent$1(node, root) || isInline$1(SugarElement.fromDom(node)));
  7782. };
  7783. var surroundedByInlineContent = function (node, root) {
  7784. var prev = new DomTreeWalker(node, root).prev(false);
  7785. var next = new DomTreeWalker(node, root).next(false);
  7786. var prevIsInline = isUndefined(prev) || isInlineContent(prev, root);
  7787. var nextIsInline = isUndefined(next) || isInlineContent(next, root);
  7788. return prevIsInline && nextIsInline;
  7789. };
  7790. var isBookmarkNode$2 = function (node) {
  7791. return isSpan(node) && node.getAttribute('data-mce-type') === 'bookmark';
  7792. };
  7793. var isKeepTextNode = function (node, root) {
  7794. return isText$7(node) && node.data.length > 0 && surroundedByInlineContent(node, root);
  7795. };
  7796. var isKeepElement = function (node) {
  7797. return isElement$5(node) ? node.childNodes.length > 0 : false;
  7798. };
  7799. var isDocument = function (node) {
  7800. return isDocumentFragment(node) || isDocument$1(node);
  7801. };
  7802. var trimNode = function (dom, node, root) {
  7803. var rootNode = root || node;
  7804. if (isElement$5(node) && isBookmarkNode$2(node)) {
  7805. return node;
  7806. }
  7807. var children = node.childNodes;
  7808. for (var i = children.length - 1; i >= 0; i--) {
  7809. trimNode(dom, children[i], rootNode);
  7810. }
  7811. if (isElement$5(node)) {
  7812. var currentChildren = node.childNodes;
  7813. if (currentChildren.length === 1 && isBookmarkNode$2(currentChildren[0])) {
  7814. node.parentNode.insertBefore(currentChildren[0], node);
  7815. }
  7816. }
  7817. if (!isDocument(node) && !isContent$1(node, rootNode) && !isKeepElement(node) && !isKeepTextNode(node, rootNode)) {
  7818. dom.remove(node);
  7819. }
  7820. return node;
  7821. };
  7822. var makeMap$3 = Tools.makeMap;
  7823. var attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  7824. var textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  7825. var rawCharsRegExp = /[<>&\"\']/g;
  7826. var entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi;
  7827. var asciiMap = {
  7828. 128: '\u20AC',
  7829. 130: '\u201A',
  7830. 131: '\u0192',
  7831. 132: '\u201E',
  7832. 133: '\u2026',
  7833. 134: '\u2020',
  7834. 135: '\u2021',
  7835. 136: '\u02c6',
  7836. 137: '\u2030',
  7837. 138: '\u0160',
  7838. 139: '\u2039',
  7839. 140: '\u0152',
  7840. 142: '\u017d',
  7841. 145: '\u2018',
  7842. 146: '\u2019',
  7843. 147: '\u201C',
  7844. 148: '\u201D',
  7845. 149: '\u2022',
  7846. 150: '\u2013',
  7847. 151: '\u2014',
  7848. 152: '\u02DC',
  7849. 153: '\u2122',
  7850. 154: '\u0161',
  7851. 155: '\u203A',
  7852. 156: '\u0153',
  7853. 158: '\u017e',
  7854. 159: '\u0178'
  7855. };
  7856. var baseEntities = {
  7857. '"': '&quot;',
  7858. '\'': '&#39;',
  7859. '<': '&lt;',
  7860. '>': '&gt;',
  7861. '&': '&amp;',
  7862. '`': '&#96;'
  7863. };
  7864. var reverseEntities = {
  7865. '&lt;': '<',
  7866. '&gt;': '>',
  7867. '&amp;': '&',
  7868. '&quot;': '"',
  7869. '&apos;': '\''
  7870. };
  7871. var nativeDecode = function (text) {
  7872. var elm = SugarElement.fromTag('div').dom;
  7873. elm.innerHTML = text;
  7874. return elm.textContent || elm.innerText || text;
  7875. };
  7876. var buildEntitiesLookup = function (items, radix) {
  7877. var i, chr, entity;
  7878. var lookup = {};
  7879. if (items) {
  7880. items = items.split(',');
  7881. radix = radix || 10;
  7882. for (i = 0; i < items.length; i += 2) {
  7883. chr = String.fromCharCode(parseInt(items[i], radix));
  7884. if (!baseEntities[chr]) {
  7885. entity = '&' + items[i + 1] + ';';
  7886. lookup[chr] = entity;
  7887. lookup[entity] = chr;
  7888. }
  7889. }
  7890. return lookup;
  7891. }
  7892. };
  7893. var namedEntities = buildEntitiesLookup('50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);
  7894. var encodeRaw = function (text, attr) {
  7895. return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
  7896. return baseEntities[chr] || chr;
  7897. });
  7898. };
  7899. var encodeAllRaw = function (text) {
  7900. return ('' + text).replace(rawCharsRegExp, function (chr) {
  7901. return baseEntities[chr] || chr;
  7902. });
  7903. };
  7904. var encodeNumeric = function (text, attr) {
  7905. return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
  7906. if (chr.length > 1) {
  7907. return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
  7908. }
  7909. return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
  7910. });
  7911. };
  7912. var encodeNamed = function (text, attr, entities) {
  7913. entities = entities || namedEntities;
  7914. return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
  7915. return baseEntities[chr] || entities[chr] || chr;
  7916. });
  7917. };
  7918. var getEncodeFunc = function (name, entities) {
  7919. var entitiesMap = buildEntitiesLookup(entities) || namedEntities;
  7920. var encodeNamedAndNumeric = function (text, attr) {
  7921. return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
  7922. if (baseEntities[chr] !== undefined) {
  7923. return baseEntities[chr];
  7924. }
  7925. if (entitiesMap[chr] !== undefined) {
  7926. return entitiesMap[chr];
  7927. }
  7928. if (chr.length > 1) {
  7929. return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
  7930. }
  7931. return '&#' + chr.charCodeAt(0) + ';';
  7932. });
  7933. };
  7934. var encodeCustomNamed = function (text, attr) {
  7935. return encodeNamed(text, attr, entitiesMap);
  7936. };
  7937. var nameMap = makeMap$3(name.replace(/\+/g, ','));
  7938. if (nameMap.named && nameMap.numeric) {
  7939. return encodeNamedAndNumeric;
  7940. }
  7941. if (nameMap.named) {
  7942. if (entities) {
  7943. return encodeCustomNamed;
  7944. }
  7945. return encodeNamed;
  7946. }
  7947. if (nameMap.numeric) {
  7948. return encodeNumeric;
  7949. }
  7950. return encodeRaw;
  7951. };
  7952. var decode = function (text) {
  7953. return text.replace(entityRegExp, function (all, numeric) {
  7954. if (numeric) {
  7955. if (numeric.charAt(0).toLowerCase() === 'x') {
  7956. numeric = parseInt(numeric.substr(1), 16);
  7957. } else {
  7958. numeric = parseInt(numeric, 10);
  7959. }
  7960. if (numeric > 65535) {
  7961. numeric -= 65536;
  7962. return String.fromCharCode(55296 + (numeric >> 10), 56320 + (numeric & 1023));
  7963. }
  7964. return asciiMap[numeric] || String.fromCharCode(numeric);
  7965. }
  7966. return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
  7967. });
  7968. };
  7969. var Entities = {
  7970. encodeRaw: encodeRaw,
  7971. encodeAllRaw: encodeAllRaw,
  7972. encodeNumeric: encodeNumeric,
  7973. encodeNamed: encodeNamed,
  7974. getEncodeFunc: getEncodeFunc,
  7975. decode: decode
  7976. };
  7977. var mapCache = {}, dummyObj = {};
  7978. var makeMap$2 = Tools.makeMap, each$h = Tools.each, extend$5 = Tools.extend, explode$3 = Tools.explode, inArray$2 = Tools.inArray;
  7979. var split$1 = function (items, delim) {
  7980. items = Tools.trim(items);
  7981. return items ? items.split(delim || ' ') : [];
  7982. };
  7983. var compileSchema = function (type) {
  7984. var schema = {};
  7985. var globalAttributes, blockContent;
  7986. var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
  7987. var add = function (name, attributes, children) {
  7988. var ni, attributesOrder, element;
  7989. var arrayToMap = function (array, obj) {
  7990. var map = {};
  7991. var i, l;
  7992. for (i = 0, l = array.length; i < l; i++) {
  7993. map[array[i]] = obj || {};
  7994. }
  7995. return map;
  7996. };
  7997. children = children || [];
  7998. attributes = attributes || '';
  7999. if (typeof children === 'string') {
  8000. children = split$1(children);
  8001. }
  8002. var names = split$1(name);
  8003. ni = names.length;
  8004. while (ni--) {
  8005. attributesOrder = split$1([
  8006. globalAttributes,
  8007. attributes
  8008. ].join(' '));
  8009. element = {
  8010. attributes: arrayToMap(attributesOrder),
  8011. attributesOrder: attributesOrder,
  8012. children: arrayToMap(children, dummyObj)
  8013. };
  8014. schema[names[ni]] = element;
  8015. }
  8016. };
  8017. var addAttrs = function (name, attributes) {
  8018. var ni, schemaItem, i, l;
  8019. var names = split$1(name);
  8020. ni = names.length;
  8021. var attrs = split$1(attributes);
  8022. while (ni--) {
  8023. schemaItem = schema[names[ni]];
  8024. for (i = 0, l = attrs.length; i < l; i++) {
  8025. schemaItem.attributes[attrs[i]] = {};
  8026. schemaItem.attributesOrder.push(attrs[i]);
  8027. }
  8028. }
  8029. };
  8030. if (mapCache[type]) {
  8031. return mapCache[type];
  8032. }
  8033. globalAttributes = 'id accesskey class dir lang style tabindex title role';
  8034. blockContent = 'address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul';
  8035. phrasingContent = 'a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd ' + 'label map noscript object q s samp script select small span strong sub sup ' + 'textarea u var #text #comment';
  8036. if (type !== 'html4') {
  8037. globalAttributes += ' contenteditable contextmenu draggable dropzone ' + 'hidden spellcheck translate';
  8038. blockContent += ' article aside details dialog figure main header footer hgroup section nav';
  8039. phrasingContent += ' audio canvas command datalist mark meter output picture ' + 'progress time wbr video ruby bdi keygen';
  8040. }
  8041. if (type !== 'html5-strict') {
  8042. globalAttributes += ' xml:lang';
  8043. html4PhrasingContent = 'acronym applet basefont big font strike tt';
  8044. phrasingContent = [
  8045. phrasingContent,
  8046. html4PhrasingContent
  8047. ].join(' ');
  8048. each$h(split$1(html4PhrasingContent), function (name) {
  8049. add(name, '', phrasingContent);
  8050. });
  8051. html4BlockContent = 'center dir isindex noframes';
  8052. blockContent = [
  8053. blockContent,
  8054. html4BlockContent
  8055. ].join(' ');
  8056. flowContent = [
  8057. blockContent,
  8058. phrasingContent
  8059. ].join(' ');
  8060. each$h(split$1(html4BlockContent), function (name) {
  8061. add(name, '', flowContent);
  8062. });
  8063. }
  8064. flowContent = flowContent || [
  8065. blockContent,
  8066. phrasingContent
  8067. ].join(' ');
  8068. add('html', 'manifest', 'head body');
  8069. add('head', '', 'base command link meta noscript script style title');
  8070. add('title hr noscript br');
  8071. add('base', 'href target');
  8072. add('link', 'href rel media hreflang type sizes hreflang');
  8073. add('meta', 'name http-equiv content charset');
  8074. add('style', 'media type scoped');
  8075. add('script', 'src async defer type charset');
  8076. add('body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + 'onpopstate onresize onscroll onstorage onunload', flowContent);
  8077. add('address dt dd div caption', '', flowContent);
  8078. add('h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn', '', phrasingContent);
  8079. add('blockquote', 'cite', flowContent);
  8080. add('ol', 'reversed start type', 'li');
  8081. add('ul', '', 'li');
  8082. add('li', 'value', flowContent);
  8083. add('dl', '', 'dt dd');
  8084. add('a', 'href target rel media hreflang type', phrasingContent);
  8085. add('q', 'cite', phrasingContent);
  8086. add('ins del', 'cite datetime', flowContent);
  8087. add('img', 'src sizes srcset alt usemap ismap width height');
  8088. add('iframe', 'src name width height', flowContent);
  8089. add('embed', 'src type width height');
  8090. add('object', 'data type typemustmatch name usemap form width height', [
  8091. flowContent,
  8092. 'param'
  8093. ].join(' '));
  8094. add('param', 'name value');
  8095. add('map', 'name', [
  8096. flowContent,
  8097. 'area'
  8098. ].join(' '));
  8099. add('area', 'alt coords shape href target rel media hreflang type');
  8100. add('table', 'border', 'caption colgroup thead tfoot tbody tr' + (type === 'html4' ? ' col' : ''));
  8101. add('colgroup', 'span', 'col');
  8102. add('col', 'span');
  8103. add('tbody thead tfoot', '', 'tr');
  8104. add('tr', '', 'td th');
  8105. add('td', 'colspan rowspan headers', flowContent);
  8106. add('th', 'colspan rowspan headers scope abbr', flowContent);
  8107. add('form', 'accept-charset action autocomplete enctype method name novalidate target', flowContent);
  8108. add('fieldset', 'disabled form name', [
  8109. flowContent,
  8110. 'legend'
  8111. ].join(' '));
  8112. add('label', 'form for', phrasingContent);
  8113. add('input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width');
  8114. add('button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', type === 'html4' ? flowContent : phrasingContent);
  8115. add('select', 'disabled form multiple name required size', 'option optgroup');
  8116. add('optgroup', 'disabled label', 'option');
  8117. add('option', 'disabled label selected value');
  8118. add('textarea', 'cols dirname disabled form maxlength name readonly required rows wrap');
  8119. add('menu', 'type label', [
  8120. flowContent,
  8121. 'li'
  8122. ].join(' '));
  8123. add('noscript', '', flowContent);
  8124. if (type !== 'html4') {
  8125. add('wbr');
  8126. add('ruby', '', [
  8127. phrasingContent,
  8128. 'rt rp'
  8129. ].join(' '));
  8130. add('figcaption', '', flowContent);
  8131. add('mark rt rp summary bdi', '', phrasingContent);
  8132. add('canvas', 'width height', flowContent);
  8133. add('video', 'src crossorigin poster preload autoplay mediagroup loop ' + 'muted controls width height buffered', [
  8134. flowContent,
  8135. 'track source'
  8136. ].join(' '));
  8137. add('audio', 'src crossorigin preload autoplay mediagroup loop muted controls ' + 'buffered volume', [
  8138. flowContent,
  8139. 'track source'
  8140. ].join(' '));
  8141. add('picture', '', 'img source');
  8142. add('source', 'src srcset type media sizes');
  8143. add('track', 'kind src srclang label default');
  8144. add('datalist', '', [
  8145. phrasingContent,
  8146. 'option'
  8147. ].join(' '));
  8148. add('article section nav aside main header footer', '', flowContent);
  8149. add('hgroup', '', 'h1 h2 h3 h4 h5 h6');
  8150. add('figure', '', [
  8151. flowContent,
  8152. 'figcaption'
  8153. ].join(' '));
  8154. add('time', 'datetime', phrasingContent);
  8155. add('dialog', 'open', flowContent);
  8156. add('command', 'type label icon disabled checked radiogroup command');
  8157. add('output', 'for form name', phrasingContent);
  8158. add('progress', 'value max', phrasingContent);
  8159. add('meter', 'value min max low high optimum', phrasingContent);
  8160. add('details', 'open', [
  8161. flowContent,
  8162. 'summary'
  8163. ].join(' '));
  8164. add('keygen', 'autofocus challenge disabled form keytype name');
  8165. }
  8166. if (type !== 'html5-strict') {
  8167. addAttrs('script', 'language xml:space');
  8168. addAttrs('style', 'xml:space');
  8169. addAttrs('object', 'declare classid code codebase codetype archive standby align border hspace vspace');
  8170. addAttrs('embed', 'align name hspace vspace');
  8171. addAttrs('param', 'valuetype type');
  8172. addAttrs('a', 'charset name rev shape coords');
  8173. addAttrs('br', 'clear');
  8174. addAttrs('applet', 'codebase archive code object alt name width height align hspace vspace');
  8175. addAttrs('img', 'name longdesc align border hspace vspace');
  8176. addAttrs('iframe', 'longdesc frameborder marginwidth marginheight scrolling align');
  8177. addAttrs('font basefont', 'size color face');
  8178. addAttrs('input', 'usemap align');
  8179. addAttrs('select');
  8180. addAttrs('textarea');
  8181. addAttrs('h1 h2 h3 h4 h5 h6 div p legend caption', 'align');
  8182. addAttrs('ul', 'type compact');
  8183. addAttrs('li', 'type');
  8184. addAttrs('ol dl menu dir', 'compact');
  8185. addAttrs('pre', 'width xml:space');
  8186. addAttrs('hr', 'align noshade size width');
  8187. addAttrs('isindex', 'prompt');
  8188. addAttrs('table', 'summary width frame rules cellspacing cellpadding align bgcolor');
  8189. addAttrs('col', 'width align char charoff valign');
  8190. addAttrs('colgroup', 'width align char charoff valign');
  8191. addAttrs('thead', 'align char charoff valign');
  8192. addAttrs('tr', 'align char charoff valign bgcolor');
  8193. addAttrs('th', 'axis align char charoff valign nowrap bgcolor width height');
  8194. addAttrs('form', 'accept');
  8195. addAttrs('td', 'abbr axis scope align char charoff valign nowrap bgcolor width height');
  8196. addAttrs('tfoot', 'align char charoff valign');
  8197. addAttrs('tbody', 'align char charoff valign');
  8198. addAttrs('area', 'nohref');
  8199. addAttrs('body', 'background bgcolor text link vlink alink');
  8200. }
  8201. if (type !== 'html4') {
  8202. addAttrs('input button select textarea', 'autofocus');
  8203. addAttrs('input textarea', 'placeholder');
  8204. addAttrs('a', 'download');
  8205. addAttrs('link script img', 'crossorigin');
  8206. addAttrs('img', 'loading');
  8207. addAttrs('iframe', 'sandbox seamless allowfullscreen loading');
  8208. }
  8209. each$h(split$1('a form meter progress dfn'), function (name) {
  8210. if (schema[name]) {
  8211. delete schema[name].children[name];
  8212. }
  8213. });
  8214. delete schema.caption.children.table;
  8215. delete schema.script;
  8216. mapCache[type] = schema;
  8217. return schema;
  8218. };
  8219. var compileElementMap = function (value, mode) {
  8220. var styles;
  8221. if (value) {
  8222. styles = {};
  8223. if (typeof value === 'string') {
  8224. value = { '*': value };
  8225. }
  8226. each$h(value, function (value, key) {
  8227. styles[key] = styles[key.toUpperCase()] = mode === 'map' ? makeMap$2(value, /[, ]/) : explode$3(value, /[, ]/);
  8228. });
  8229. }
  8230. return styles;
  8231. };
  8232. var Schema = function (settings) {
  8233. var elements = {};
  8234. var children = {};
  8235. var patternElements = [];
  8236. var customElementsMap = {}, specialElements = {};
  8237. var createLookupTable = function (option, defaultValue, extendWith) {
  8238. var value = settings[option];
  8239. if (!value) {
  8240. value = mapCache[option];
  8241. if (!value) {
  8242. value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
  8243. value = extend$5(value, extendWith);
  8244. mapCache[option] = value;
  8245. }
  8246. } else {
  8247. value = makeMap$2(value, /[, ]/, makeMap$2(value.toUpperCase(), /[, ]/));
  8248. }
  8249. return value;
  8250. };
  8251. settings = settings || {};
  8252. var schemaItems = compileSchema(settings.schema);
  8253. if (settings.verify_html === false) {
  8254. settings.valid_elements = '*[*]';
  8255. }
  8256. var validStyles = compileElementMap(settings.valid_styles);
  8257. var invalidStyles = compileElementMap(settings.invalid_styles, 'map');
  8258. var validClasses = compileElementMap(settings.valid_classes, 'map');
  8259. var whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object code');
  8260. var selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
  8261. var shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + 'meta param embed source wbr track');
  8262. var boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + 'noshade nowrap readonly selected autoplay loop controls');
  8263. var nonEmptyOrMoveCaretBeforeOnEnter = 'td th iframe video audio object script code';
  8264. var nonEmptyElementsMap = createLookupTable('non_empty_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' pre', shortEndedElementsMap);
  8265. var moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' table', shortEndedElementsMap);
  8266. var textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure');
  8267. var blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
  8268. var textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
  8269. each$h((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) {
  8270. specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
  8271. });
  8272. var patternToRegExp = function (str) {
  8273. return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
  8274. };
  8275. var addValidElements = function (validElements) {
  8276. var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, prefix, outputName, globalAttributes, globalAttributesOrder, value;
  8277. var elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/, attrRuleRegExp = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/, hasPatternsRegExp = /[*?+]/;
  8278. if (validElements) {
  8279. var validElementsArr = split$1(validElements, ',');
  8280. if (elements['@']) {
  8281. globalAttributes = elements['@'].attributes;
  8282. globalAttributesOrder = elements['@'].attributesOrder;
  8283. }
  8284. for (ei = 0, el = validElementsArr.length; ei < el; ei++) {
  8285. matches = elementRuleRegExp.exec(validElementsArr[ei]);
  8286. if (matches) {
  8287. prefix = matches[1];
  8288. elementName = matches[2];
  8289. outputName = matches[3];
  8290. attrData = matches[5];
  8291. attributes = {};
  8292. attributesOrder = [];
  8293. element = {
  8294. attributes: attributes,
  8295. attributesOrder: attributesOrder
  8296. };
  8297. if (prefix === '#') {
  8298. element.paddEmpty = true;
  8299. }
  8300. if (prefix === '-') {
  8301. element.removeEmpty = true;
  8302. }
  8303. if (matches[4] === '!') {
  8304. element.removeEmptyAttrs = true;
  8305. }
  8306. if (globalAttributes) {
  8307. each$j(globalAttributes, function (value, key) {
  8308. attributes[key] = value;
  8309. });
  8310. attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
  8311. }
  8312. if (attrData) {
  8313. attrData = split$1(attrData, '|');
  8314. for (ai = 0, al = attrData.length; ai < al; ai++) {
  8315. matches = attrRuleRegExp.exec(attrData[ai]);
  8316. if (matches) {
  8317. attr = {};
  8318. attrType = matches[1];
  8319. attrName = matches[2].replace(/[\\:]:/g, ':');
  8320. prefix = matches[3];
  8321. value = matches[4];
  8322. if (attrType === '!') {
  8323. element.attributesRequired = element.attributesRequired || [];
  8324. element.attributesRequired.push(attrName);
  8325. attr.required = true;
  8326. }
  8327. if (attrType === '-') {
  8328. delete attributes[attrName];
  8329. attributesOrder.splice(inArray$2(attributesOrder, attrName), 1);
  8330. continue;
  8331. }
  8332. if (prefix) {
  8333. if (prefix === '=') {
  8334. element.attributesDefault = element.attributesDefault || [];
  8335. element.attributesDefault.push({
  8336. name: attrName,
  8337. value: value
  8338. });
  8339. attr.defaultValue = value;
  8340. }
  8341. if (prefix === ':') {
  8342. element.attributesForced = element.attributesForced || [];
  8343. element.attributesForced.push({
  8344. name: attrName,
  8345. value: value
  8346. });
  8347. attr.forcedValue = value;
  8348. }
  8349. if (prefix === '<') {
  8350. attr.validValues = makeMap$2(value, '?');
  8351. }
  8352. }
  8353. if (hasPatternsRegExp.test(attrName)) {
  8354. element.attributePatterns = element.attributePatterns || [];
  8355. attr.pattern = patternToRegExp(attrName);
  8356. element.attributePatterns.push(attr);
  8357. } else {
  8358. if (!attributes[attrName]) {
  8359. attributesOrder.push(attrName);
  8360. }
  8361. attributes[attrName] = attr;
  8362. }
  8363. }
  8364. }
  8365. }
  8366. if (!globalAttributes && elementName === '@') {
  8367. globalAttributes = attributes;
  8368. globalAttributesOrder = attributesOrder;
  8369. }
  8370. if (outputName) {
  8371. element.outputName = elementName;
  8372. elements[outputName] = element;
  8373. }
  8374. if (hasPatternsRegExp.test(elementName)) {
  8375. element.pattern = patternToRegExp(elementName);
  8376. patternElements.push(element);
  8377. } else {
  8378. elements[elementName] = element;
  8379. }
  8380. }
  8381. }
  8382. }
  8383. };
  8384. var setValidElements = function (validElements) {
  8385. elements = {};
  8386. patternElements = [];
  8387. addValidElements(validElements);
  8388. each$h(schemaItems, function (element, name) {
  8389. children[name] = element.children;
  8390. });
  8391. };
  8392. var addCustomElements = function (customElements) {
  8393. var customElementRegExp = /^(~)?(.+)$/;
  8394. if (customElements) {
  8395. mapCache.text_block_elements = mapCache.block_elements = null;
  8396. each$h(split$1(customElements, ','), function (rule) {
  8397. var matches = customElementRegExp.exec(rule), inline = matches[1] === '~', cloneName = inline ? 'span' : 'div', name = matches[2];
  8398. children[name] = children[cloneName];
  8399. customElementsMap[name] = cloneName;
  8400. if (!inline) {
  8401. blockElementsMap[name.toUpperCase()] = {};
  8402. blockElementsMap[name] = {};
  8403. }
  8404. if (!elements[name]) {
  8405. var customRule = elements[cloneName];
  8406. customRule = extend$5({}, customRule);
  8407. delete customRule.removeEmptyAttrs;
  8408. delete customRule.removeEmpty;
  8409. elements[name] = customRule;
  8410. }
  8411. each$h(children, function (element, elmName) {
  8412. if (element[cloneName]) {
  8413. children[elmName] = element = extend$5({}, children[elmName]);
  8414. element[name] = element[cloneName];
  8415. }
  8416. });
  8417. });
  8418. }
  8419. };
  8420. var addValidChildren = function (validChildren) {
  8421. var childRuleRegExp = /^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;
  8422. mapCache[settings.schema] = null;
  8423. if (validChildren) {
  8424. each$h(split$1(validChildren, ','), function (rule) {
  8425. var matches = childRuleRegExp.exec(rule);
  8426. var parent, prefix;
  8427. if (matches) {
  8428. prefix = matches[1];
  8429. if (prefix) {
  8430. parent = children[matches[2]];
  8431. } else {
  8432. parent = children[matches[2]] = { '#comment': {} };
  8433. }
  8434. parent = children[matches[2]];
  8435. each$h(split$1(matches[3], '|'), function (child) {
  8436. if (prefix === '-') {
  8437. delete parent[child];
  8438. } else {
  8439. parent[child] = {};
  8440. }
  8441. });
  8442. }
  8443. });
  8444. }
  8445. };
  8446. var getElementRule = function (name) {
  8447. var element = elements[name], i;
  8448. if (element) {
  8449. return element;
  8450. }
  8451. i = patternElements.length;
  8452. while (i--) {
  8453. element = patternElements[i];
  8454. if (element.pattern.test(name)) {
  8455. return element;
  8456. }
  8457. }
  8458. };
  8459. if (!settings.valid_elements) {
  8460. each$h(schemaItems, function (element, name) {
  8461. elements[name] = {
  8462. attributes: element.attributes,
  8463. attributesOrder: element.attributesOrder
  8464. };
  8465. children[name] = element.children;
  8466. });
  8467. if (settings.schema !== 'html5') {
  8468. each$h(split$1('strong/b em/i'), function (item) {
  8469. var items = split$1(item, '/');
  8470. elements[items[1]].outputName = items[0];
  8471. });
  8472. }
  8473. each$h(split$1('ol ul sub sup blockquote span font a table tbody strong em b i'), function (name) {
  8474. if (elements[name]) {
  8475. elements[name].removeEmpty = true;
  8476. }
  8477. });
  8478. each$h(split$1('p h1 h2 h3 h4 h5 h6 th td pre div address caption li'), function (name) {
  8479. elements[name].paddEmpty = true;
  8480. });
  8481. each$h(split$1('span'), function (name) {
  8482. elements[name].removeEmptyAttrs = true;
  8483. });
  8484. } else {
  8485. setValidElements(settings.valid_elements);
  8486. }
  8487. addCustomElements(settings.custom_elements);
  8488. addValidChildren(settings.valid_children);
  8489. addValidElements(settings.extended_valid_elements);
  8490. addValidChildren('+ol[ul|ol],+ul[ul|ol]');
  8491. each$h({
  8492. dd: 'dl',
  8493. dt: 'dl',
  8494. li: 'ul ol',
  8495. td: 'tr',
  8496. th: 'tr',
  8497. tr: 'tbody thead tfoot',
  8498. tbody: 'table',
  8499. thead: 'table',
  8500. tfoot: 'table',
  8501. legend: 'fieldset',
  8502. area: 'map',
  8503. param: 'video audio object'
  8504. }, function (parents, item) {
  8505. if (elements[item]) {
  8506. elements[item].parentsRequired = split$1(parents);
  8507. }
  8508. });
  8509. if (settings.invalid_elements) {
  8510. each$h(explode$3(settings.invalid_elements), function (item) {
  8511. if (elements[item]) {
  8512. delete elements[item];
  8513. }
  8514. });
  8515. }
  8516. if (!getElementRule('span')) {
  8517. addValidElements('span[!data-mce-type|*]');
  8518. }
  8519. var getValidStyles = constant(validStyles);
  8520. var getInvalidStyles = constant(invalidStyles);
  8521. var getValidClasses = constant(validClasses);
  8522. var getBoolAttrs = constant(boolAttrMap);
  8523. var getBlockElements = constant(blockElementsMap);
  8524. var getTextBlockElements = constant(textBlockElementsMap);
  8525. var getTextInlineElements = constant(textInlineElementsMap);
  8526. var getShortEndedElements = constant(shortEndedElementsMap);
  8527. var getSelfClosingElements = constant(selfClosingElementsMap);
  8528. var getNonEmptyElements = constant(nonEmptyElementsMap);
  8529. var getMoveCaretBeforeOnEnterElements = constant(moveCaretBeforeOnEnterElementsMap);
  8530. var getWhiteSpaceElements = constant(whiteSpaceElementsMap);
  8531. var getSpecialElements = constant(specialElements);
  8532. var isValidChild = function (name, child) {
  8533. var parent = children[name.toLowerCase()];
  8534. return !!(parent && parent[child.toLowerCase()]);
  8535. };
  8536. var isValid = function (name, attr) {
  8537. var attrPatterns, i;
  8538. var rule = getElementRule(name);
  8539. if (rule) {
  8540. if (attr) {
  8541. if (rule.attributes[attr]) {
  8542. return true;
  8543. }
  8544. attrPatterns = rule.attributePatterns;
  8545. if (attrPatterns) {
  8546. i = attrPatterns.length;
  8547. while (i--) {
  8548. if (attrPatterns[i].pattern.test(name)) {
  8549. return true;
  8550. }
  8551. }
  8552. }
  8553. } else {
  8554. return true;
  8555. }
  8556. }
  8557. return false;
  8558. };
  8559. var getCustomElements = constant(customElementsMap);
  8560. return {
  8561. children: children,
  8562. elements: elements,
  8563. getValidStyles: getValidStyles,
  8564. getValidClasses: getValidClasses,
  8565. getBlockElements: getBlockElements,
  8566. getInvalidStyles: getInvalidStyles,
  8567. getShortEndedElements: getShortEndedElements,
  8568. getTextBlockElements: getTextBlockElements,
  8569. getTextInlineElements: getTextInlineElements,
  8570. getBoolAttrs: getBoolAttrs,
  8571. getElementRule: getElementRule,
  8572. getSelfClosingElements: getSelfClosingElements,
  8573. getNonEmptyElements: getNonEmptyElements,
  8574. getMoveCaretBeforeOnEnterElements: getMoveCaretBeforeOnEnterElements,
  8575. getWhiteSpaceElements: getWhiteSpaceElements,
  8576. getSpecialElements: getSpecialElements,
  8577. isValidChild: isValidChild,
  8578. isValid: isValid,
  8579. getCustomElements: getCustomElements,
  8580. addValidElements: addValidElements,
  8581. setValidElements: setValidElements,
  8582. addCustomElements: addCustomElements,
  8583. addValidChildren: addValidChildren
  8584. };
  8585. };
  8586. var toHex = function (match, r, g, b) {
  8587. var hex = function (val) {
  8588. val = parseInt(val, 10).toString(16);
  8589. return val.length > 1 ? val : '0' + val;
  8590. };
  8591. return '#' + hex(r) + hex(g) + hex(b);
  8592. };
  8593. var Styles = function (settings, schema) {
  8594. var _this = this;
  8595. var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi;
  8596. var urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;
  8597. var styleRegExp = /\s*([^:]+):\s*([^;]+);?/g;
  8598. var trimRightRegExp = /\s+$/;
  8599. var i;
  8600. var encodingLookup = {};
  8601. var validStyles;
  8602. var invalidStyles;
  8603. var invisibleChar = zeroWidth;
  8604. settings = settings || {};
  8605. if (schema) {
  8606. validStyles = schema.getValidStyles();
  8607. invalidStyles = schema.getInvalidStyles();
  8608. }
  8609. var encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
  8610. for (i = 0; i < encodingItems.length; i++) {
  8611. encodingLookup[encodingItems[i]] = invisibleChar + i;
  8612. encodingLookup[invisibleChar + i] = encodingItems[i];
  8613. }
  8614. return {
  8615. toHex: function (color) {
  8616. return color.replace(rgbRegExp, toHex);
  8617. },
  8618. parse: function (css) {
  8619. var styles = {};
  8620. var matches, name, value, isEncoded;
  8621. var urlConverter = settings.url_converter;
  8622. var urlConverterScope = settings.url_converter_scope || _this;
  8623. var compress = function (prefix, suffix, noJoin) {
  8624. var top = styles[prefix + '-top' + suffix];
  8625. if (!top) {
  8626. return;
  8627. }
  8628. var right = styles[prefix + '-right' + suffix];
  8629. if (!right) {
  8630. return;
  8631. }
  8632. var bottom = styles[prefix + '-bottom' + suffix];
  8633. if (!bottom) {
  8634. return;
  8635. }
  8636. var left = styles[prefix + '-left' + suffix];
  8637. if (!left) {
  8638. return;
  8639. }
  8640. var box = [
  8641. top,
  8642. right,
  8643. bottom,
  8644. left
  8645. ];
  8646. i = box.length - 1;
  8647. while (i--) {
  8648. if (box[i] !== box[i + 1]) {
  8649. break;
  8650. }
  8651. }
  8652. if (i > -1 && noJoin) {
  8653. return;
  8654. }
  8655. styles[prefix + suffix] = i === -1 ? box[0] : box.join(' ');
  8656. delete styles[prefix + '-top' + suffix];
  8657. delete styles[prefix + '-right' + suffix];
  8658. delete styles[prefix + '-bottom' + suffix];
  8659. delete styles[prefix + '-left' + suffix];
  8660. };
  8661. var canCompress = function (key) {
  8662. var value = styles[key], i;
  8663. if (!value) {
  8664. return;
  8665. }
  8666. value = value.split(' ');
  8667. i = value.length;
  8668. while (i--) {
  8669. if (value[i] !== value[0]) {
  8670. return false;
  8671. }
  8672. }
  8673. styles[key] = value[0];
  8674. return true;
  8675. };
  8676. var compress2 = function (target, a, b, c) {
  8677. if (!canCompress(a)) {
  8678. return;
  8679. }
  8680. if (!canCompress(b)) {
  8681. return;
  8682. }
  8683. if (!canCompress(c)) {
  8684. return;
  8685. }
  8686. styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
  8687. delete styles[a];
  8688. delete styles[b];
  8689. delete styles[c];
  8690. };
  8691. var encode = function (str) {
  8692. isEncoded = true;
  8693. return encodingLookup[str];
  8694. };
  8695. var decode = function (str, keepSlashes) {
  8696. if (isEncoded) {
  8697. str = str.replace(/\uFEFF[0-9]/g, function (str) {
  8698. return encodingLookup[str];
  8699. });
  8700. }
  8701. if (!keepSlashes) {
  8702. str = str.replace(/\\([\'\";:])/g, '$1');
  8703. }
  8704. return str;
  8705. };
  8706. var decodeSingleHexSequence = function (escSeq) {
  8707. return String.fromCharCode(parseInt(escSeq.slice(1), 16));
  8708. };
  8709. var decodeHexSequences = function (value) {
  8710. return value.replace(/\\[0-9a-f]+/gi, decodeSingleHexSequence);
  8711. };
  8712. var processUrl = function (match, url, url2, url3, str, str2) {
  8713. str = str || str2;
  8714. if (str) {
  8715. str = decode(str);
  8716. return '\'' + str.replace(/\'/g, '\\\'') + '\'';
  8717. }
  8718. url = decode(url || url2 || url3);
  8719. if (!settings.allow_script_urls) {
  8720. var scriptUrl = url.replace(/[\s\r\n]+/g, '');
  8721. if (/(java|vb)script:/i.test(scriptUrl)) {
  8722. return '';
  8723. }
  8724. if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
  8725. return '';
  8726. }
  8727. }
  8728. if (urlConverter) {
  8729. url = urlConverter.call(urlConverterScope, url, 'style');
  8730. }
  8731. return 'url(\'' + url.replace(/\'/g, '\\\'') + '\')';
  8732. };
  8733. if (css) {
  8734. css = css.replace(/[\u0000-\u001F]/g, '');
  8735. css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function (str) {
  8736. return str.replace(/[;:]/g, encode);
  8737. });
  8738. while (matches = styleRegExp.exec(css)) {
  8739. styleRegExp.lastIndex = matches.index + matches[0].length;
  8740. name = matches[1].replace(trimRightRegExp, '').toLowerCase();
  8741. value = matches[2].replace(trimRightRegExp, '');
  8742. if (name && value) {
  8743. name = decodeHexSequences(name);
  8744. value = decodeHexSequences(value);
  8745. if (name.indexOf(invisibleChar) !== -1 || name.indexOf('"') !== -1) {
  8746. continue;
  8747. }
  8748. if (!settings.allow_script_urls && (name === 'behavior' || /expression\s*\(|\/\*|\*\//.test(value))) {
  8749. continue;
  8750. }
  8751. if (name === 'font-weight' && value === '700') {
  8752. value = 'bold';
  8753. } else if (name === 'color' || name === 'background-color') {
  8754. value = value.toLowerCase();
  8755. }
  8756. value = value.replace(rgbRegExp, toHex);
  8757. value = value.replace(urlOrStrRegExp, processUrl);
  8758. styles[name] = isEncoded ? decode(value, true) : value;
  8759. }
  8760. }
  8761. compress('border', '', true);
  8762. compress('border', '-width');
  8763. compress('border', '-color');
  8764. compress('border', '-style');
  8765. compress('padding', '');
  8766. compress('margin', '');
  8767. compress2('border', 'border-width', 'border-style', 'border-color');
  8768. if (styles.border === 'medium none') {
  8769. delete styles.border;
  8770. }
  8771. if (styles['border-image'] === 'none') {
  8772. delete styles['border-image'];
  8773. }
  8774. }
  8775. return styles;
  8776. },
  8777. serialize: function (styles, elementName) {
  8778. var css = '';
  8779. var serializeStyles = function (name) {
  8780. var value;
  8781. var styleList = validStyles[name];
  8782. if (styleList) {
  8783. for (var i_1 = 0, l = styleList.length; i_1 < l; i_1++) {
  8784. name = styleList[i_1];
  8785. value = styles[name];
  8786. if (value) {
  8787. css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
  8788. }
  8789. }
  8790. }
  8791. };
  8792. var isValid = function (name, elementName) {
  8793. var styleMap = invalidStyles['*'];
  8794. if (styleMap && styleMap[name]) {
  8795. return false;
  8796. }
  8797. styleMap = invalidStyles[elementName];
  8798. return !(styleMap && styleMap[name]);
  8799. };
  8800. if (elementName && validStyles) {
  8801. serializeStyles('*');
  8802. serializeStyles(elementName);
  8803. } else {
  8804. each$j(styles, function (value, name) {
  8805. if (value && (!invalidStyles || isValid(name, elementName))) {
  8806. css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
  8807. }
  8808. });
  8809. }
  8810. return css;
  8811. }
  8812. };
  8813. };
  8814. var deprecated = {
  8815. keyLocation: true,
  8816. layerX: true,
  8817. layerY: true,
  8818. returnValue: true,
  8819. webkitMovementX: true,
  8820. webkitMovementY: true,
  8821. keyIdentifier: true,
  8822. mozPressure: true
  8823. };
  8824. var isNativeEvent = function (event) {
  8825. return event instanceof Event || isFunction(event.initEvent);
  8826. };
  8827. var hasIsDefaultPrevented = function (event) {
  8828. return event.isDefaultPrevented === always || event.isDefaultPrevented === never;
  8829. };
  8830. var needsNormalizing = function (event) {
  8831. return isNullable(event.preventDefault) || isNativeEvent(event);
  8832. };
  8833. var clone$2 = function (originalEvent, data) {
  8834. var event = data !== null && data !== void 0 ? data : {};
  8835. for (var name_1 in originalEvent) {
  8836. if (!has$2(deprecated, name_1)) {
  8837. event[name_1] = originalEvent[name_1];
  8838. }
  8839. }
  8840. if (isNonNullable(event.composedPath)) {
  8841. event.composedPath = function () {
  8842. return originalEvent.composedPath();
  8843. };
  8844. }
  8845. return event;
  8846. };
  8847. var normalize$3 = function (type, originalEvent, fallbackTarget, data) {
  8848. var _a;
  8849. var event = clone$2(originalEvent, data);
  8850. event.type = type;
  8851. if (isNullable(event.target)) {
  8852. event.target = (_a = event.srcElement) !== null && _a !== void 0 ? _a : fallbackTarget;
  8853. }
  8854. if (needsNormalizing(originalEvent)) {
  8855. event.preventDefault = function () {
  8856. event.defaultPrevented = true;
  8857. event.isDefaultPrevented = always;
  8858. if (isFunction(originalEvent.preventDefault)) {
  8859. originalEvent.preventDefault();
  8860. } else if (isNativeEvent(originalEvent)) {
  8861. originalEvent.returnValue = false;
  8862. }
  8863. };
  8864. event.stopPropagation = function () {
  8865. event.cancelBubble = true;
  8866. event.isPropagationStopped = always;
  8867. if (isFunction(originalEvent.stopPropagation)) {
  8868. originalEvent.stopPropagation();
  8869. } else if (isNativeEvent(originalEvent)) {
  8870. originalEvent.cancelBubble = true;
  8871. }
  8872. };
  8873. event.stopImmediatePropagation = function () {
  8874. event.isImmediatePropagationStopped = always;
  8875. event.stopPropagation();
  8876. };
  8877. if (!hasIsDefaultPrevented(event)) {
  8878. event.isDefaultPrevented = event.defaultPrevented === true ? always : never;
  8879. event.isPropagationStopped = event.cancelBubble === true ? always : never;
  8880. event.isImmediatePropagationStopped = never;
  8881. }
  8882. }
  8883. return event;
  8884. };
  8885. var eventExpandoPrefix = 'mce-data-';
  8886. var mouseEventRe = /^(?:mouse|contextmenu)|click/;
  8887. var addEvent = function (target, name, callback, capture) {
  8888. if (target.addEventListener) {
  8889. target.addEventListener(name, callback, capture || false);
  8890. } else if (target.attachEvent) {
  8891. target.attachEvent('on' + name, callback);
  8892. }
  8893. };
  8894. var removeEvent = function (target, name, callback, capture) {
  8895. if (target.removeEventListener) {
  8896. target.removeEventListener(name, callback, capture || false);
  8897. } else if (target.detachEvent) {
  8898. target.detachEvent('on' + name, callback);
  8899. }
  8900. };
  8901. var isMouseEvent = function (event) {
  8902. return isNonNullable(event) && mouseEventRe.test(event.type);
  8903. };
  8904. var fix = function (originalEvent, data) {
  8905. var event = normalize$3(originalEvent.type, originalEvent, document, data);
  8906. if (isMouseEvent(originalEvent) && isUndefined(originalEvent.pageX) && !isUndefined(originalEvent.clientX)) {
  8907. var eventDoc = event.target.ownerDocument || document;
  8908. var doc = eventDoc.documentElement;
  8909. var body = eventDoc.body;
  8910. var mouseEvent = event;
  8911. mouseEvent.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  8912. mouseEvent.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  8913. }
  8914. if (isUndefined(event.metaKey)) {
  8915. event.metaKey = false;
  8916. }
  8917. return event;
  8918. };
  8919. var bindOnReady = function (win, callback, eventUtils) {
  8920. var doc = win.document, event = { type: 'ready' };
  8921. if (eventUtils.domLoaded) {
  8922. callback(event);
  8923. return;
  8924. }
  8925. var isDocReady = function () {
  8926. return doc.readyState === 'complete' || doc.readyState === 'interactive' && doc.body;
  8927. };
  8928. var readyHandler = function () {
  8929. removeEvent(win, 'DOMContentLoaded', readyHandler);
  8930. removeEvent(win, 'load', readyHandler);
  8931. if (!eventUtils.domLoaded) {
  8932. eventUtils.domLoaded = true;
  8933. callback(event);
  8934. }
  8935. win = null;
  8936. };
  8937. if (isDocReady()) {
  8938. readyHandler();
  8939. } else {
  8940. addEvent(win, 'DOMContentLoaded', readyHandler);
  8941. }
  8942. if (!eventUtils.domLoaded) {
  8943. addEvent(win, 'load', readyHandler);
  8944. }
  8945. };
  8946. var EventUtils = function () {
  8947. function EventUtils() {
  8948. this.domLoaded = false;
  8949. this.events = {};
  8950. this.count = 1;
  8951. this.expando = eventExpandoPrefix + (+new Date()).toString(32);
  8952. this.hasMouseEnterLeave = 'onmouseenter' in document.documentElement;
  8953. this.hasFocusIn = 'onfocusin' in document.documentElement;
  8954. this.count = 1;
  8955. }
  8956. EventUtils.prototype.bind = function (target, names, callback, scope) {
  8957. var self = this;
  8958. var id, callbackList, i, name, fakeName, nativeHandler, capture;
  8959. var win = window;
  8960. var defaultNativeHandler = function (evt) {
  8961. self.executeHandlers(fix(evt || win.event), id);
  8962. };
  8963. if (!target || target.nodeType === 3 || target.nodeType === 8) {
  8964. return;
  8965. }
  8966. if (!target[self.expando]) {
  8967. id = self.count++;
  8968. target[self.expando] = id;
  8969. self.events[id] = {};
  8970. } else {
  8971. id = target[self.expando];
  8972. }
  8973. scope = scope || target;
  8974. var namesList = names.split(' ');
  8975. i = namesList.length;
  8976. while (i--) {
  8977. name = namesList[i];
  8978. nativeHandler = defaultNativeHandler;
  8979. fakeName = capture = false;
  8980. if (name === 'DOMContentLoaded') {
  8981. name = 'ready';
  8982. }
  8983. if (self.domLoaded && name === 'ready' && target.readyState === 'complete') {
  8984. callback.call(scope, fix({ type: name }));
  8985. continue;
  8986. }
  8987. if (!self.hasMouseEnterLeave) {
  8988. fakeName = self.mouseEnterLeave[name];
  8989. if (fakeName) {
  8990. nativeHandler = function (evt) {
  8991. var current = evt.currentTarget;
  8992. var related = evt.relatedTarget;
  8993. if (related && current.contains) {
  8994. related = current.contains(related);
  8995. } else {
  8996. while (related && related !== current) {
  8997. related = related.parentNode;
  8998. }
  8999. }
  9000. if (!related) {
  9001. evt = fix(evt || win.event);
  9002. evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
  9003. evt.target = current;
  9004. self.executeHandlers(evt, id);
  9005. }
  9006. };
  9007. }
  9008. }
  9009. if (!self.hasFocusIn && (name === 'focusin' || name === 'focusout')) {
  9010. capture = true;
  9011. fakeName = name === 'focusin' ? 'focus' : 'blur';
  9012. nativeHandler = function (evt) {
  9013. evt = fix(evt || win.event);
  9014. evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
  9015. self.executeHandlers(evt, id);
  9016. };
  9017. }
  9018. callbackList = self.events[id][name];
  9019. if (!callbackList) {
  9020. self.events[id][name] = callbackList = [{
  9021. func: callback,
  9022. scope: scope
  9023. }];
  9024. callbackList.fakeName = fakeName;
  9025. callbackList.capture = capture;
  9026. callbackList.nativeHandler = nativeHandler;
  9027. if (name === 'ready') {
  9028. bindOnReady(target, nativeHandler, self);
  9029. } else {
  9030. addEvent(target, fakeName || name, nativeHandler, capture);
  9031. }
  9032. } else {
  9033. if (name === 'ready' && self.domLoaded) {
  9034. callback(fix({ type: name }));
  9035. } else {
  9036. callbackList.push({
  9037. func: callback,
  9038. scope: scope
  9039. });
  9040. }
  9041. }
  9042. }
  9043. target = callbackList = null;
  9044. return callback;
  9045. };
  9046. EventUtils.prototype.unbind = function (target, names, callback) {
  9047. var callbackList, i, ci, name, eventMap;
  9048. if (!target || target.nodeType === 3 || target.nodeType === 8) {
  9049. return this;
  9050. }
  9051. var id = target[this.expando];
  9052. if (id) {
  9053. eventMap = this.events[id];
  9054. if (names) {
  9055. var namesList = names.split(' ');
  9056. i = namesList.length;
  9057. while (i--) {
  9058. name = namesList[i];
  9059. callbackList = eventMap[name];
  9060. if (callbackList) {
  9061. if (callback) {
  9062. ci = callbackList.length;
  9063. while (ci--) {
  9064. if (callbackList[ci].func === callback) {
  9065. var nativeHandler = callbackList.nativeHandler;
  9066. var fakeName = callbackList.fakeName, capture = callbackList.capture;
  9067. callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
  9068. callbackList.nativeHandler = nativeHandler;
  9069. callbackList.fakeName = fakeName;
  9070. callbackList.capture = capture;
  9071. eventMap[name] = callbackList;
  9072. }
  9073. }
  9074. }
  9075. if (!callback || callbackList.length === 0) {
  9076. delete eventMap[name];
  9077. removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
  9078. }
  9079. }
  9080. }
  9081. } else {
  9082. each$j(eventMap, function (callbackList, name) {
  9083. removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture);
  9084. });
  9085. eventMap = {};
  9086. }
  9087. for (name in eventMap) {
  9088. if (has$2(eventMap, name)) {
  9089. return this;
  9090. }
  9091. }
  9092. delete this.events[id];
  9093. try {
  9094. delete target[this.expando];
  9095. } catch (ex) {
  9096. target[this.expando] = null;
  9097. }
  9098. }
  9099. return this;
  9100. };
  9101. EventUtils.prototype.fire = function (target, name, args) {
  9102. var id;
  9103. if (!target || target.nodeType === 3 || target.nodeType === 8) {
  9104. return this;
  9105. }
  9106. var event = fix({
  9107. type: name,
  9108. target: target
  9109. }, args);
  9110. do {
  9111. id = target[this.expando];
  9112. if (id) {
  9113. this.executeHandlers(event, id);
  9114. }
  9115. target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
  9116. } while (target && !event.isPropagationStopped());
  9117. return this;
  9118. };
  9119. EventUtils.prototype.clean = function (target) {
  9120. var i, children;
  9121. if (!target || target.nodeType === 3 || target.nodeType === 8) {
  9122. return this;
  9123. }
  9124. if (target[this.expando]) {
  9125. this.unbind(target);
  9126. }
  9127. if (!target.getElementsByTagName) {
  9128. target = target.document;
  9129. }
  9130. if (target && target.getElementsByTagName) {
  9131. this.unbind(target);
  9132. children = target.getElementsByTagName('*');
  9133. i = children.length;
  9134. while (i--) {
  9135. target = children[i];
  9136. if (target[this.expando]) {
  9137. this.unbind(target);
  9138. }
  9139. }
  9140. }
  9141. return this;
  9142. };
  9143. EventUtils.prototype.destroy = function () {
  9144. this.events = {};
  9145. };
  9146. EventUtils.prototype.cancel = function (e) {
  9147. if (e) {
  9148. e.preventDefault();
  9149. e.stopImmediatePropagation();
  9150. }
  9151. return false;
  9152. };
  9153. EventUtils.prototype.executeHandlers = function (evt, id) {
  9154. var container = this.events[id];
  9155. var callbackList = container && container[evt.type];
  9156. if (callbackList) {
  9157. for (var i = 0, l = callbackList.length; i < l; i++) {
  9158. var callback = callbackList[i];
  9159. if (callback && callback.func.call(callback.scope, evt) === false) {
  9160. evt.preventDefault();
  9161. }
  9162. if (evt.isImmediatePropagationStopped()) {
  9163. return;
  9164. }
  9165. }
  9166. }
  9167. };
  9168. EventUtils.Event = new EventUtils();
  9169. return EventUtils;
  9170. }();
  9171. var support, Expr, getText, isXML, tokenize, compile, select$1, outermostContext, sortInput, hasDuplicate, setDocument, document$1, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = 'sizzle' + -new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function (a, b) {
  9172. if (a === b) {
  9173. hasDuplicate = true;
  9174. }
  9175. return 0;
  9176. }, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push$1 = arr.push, slice$1 = arr.slice, indexOf = arr.indexOf || function (elem) {
  9177. var i = 0, len = this.length;
  9178. for (; i < len; i++) {
  9179. if (this[i] === elem) {
  9180. return i;
  9181. }
  9182. }
  9183. return -1;
  9184. }, booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', whitespace = '[\\x20\\t\\r\\n\\f]', identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+', attributes = '\\[' + whitespace + '*(' + identifier + ')(?:' + whitespace + '*([*^$|!~]?=)' + whitespace + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + identifier + '))|)' + whitespace + '*\\]', pseudos = ':(' + identifier + ')(?:\\((' + '(\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|' + '((?:\\\\.|[^\\\\()[\\]]|' + attributes + ')*)|' + '.*' + ')\\)|)', rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g'), rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*'), rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*'), rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g'), rpseudo = new RegExp(pseudos), ridentifier = new RegExp('^' + identifier + '$'), matchExpr = {
  9185. ID: new RegExp('^#(' + identifier + ')'),
  9186. CLASS: new RegExp('^\\.(' + identifier + ')'),
  9187. TAG: new RegExp('^(' + identifier + '|[*])'),
  9188. ATTR: new RegExp('^' + attributes),
  9189. PSEUDO: new RegExp('^' + pseudos),
  9190. CHILD: new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + whitespace + '*(even|odd|(([+-]|)(\\d*)n|)' + whitespace + '*(?:([+-]|)' + whitespace + '*(\\d+)|))' + whitespace + '*\\)|)', 'i'),
  9191. bool: new RegExp('^(?:' + booleans + ')$', 'i'),
  9192. needsContext: new RegExp('^' + whitespace + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + whitespace + '*((?:-\\d)?\\d*)' + whitespace + '*\\)|)(?=[^-]|$)', 'i')
  9193. }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr$1 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'), funescape = function (_, escaped, escapedWhitespace) {
  9194. var high = '0x' + escaped - 65536;
  9195. return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  9196. };
  9197. try {
  9198. push$1.apply(arr = slice$1.call(preferredDoc.childNodes), preferredDoc.childNodes);
  9199. arr[preferredDoc.childNodes.length].nodeType;
  9200. } catch (e) {
  9201. push$1 = {
  9202. apply: arr.length ? function (target, els) {
  9203. push_native.apply(target, slice$1.call(els));
  9204. } : function (target, els) {
  9205. var j = target.length, i = 0;
  9206. while (target[j++] = els[i++]) {
  9207. }
  9208. target.length = j - 1;
  9209. }
  9210. };
  9211. }
  9212. var Sizzle = function (selector, context, results, seed) {
  9213. var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
  9214. if ((context ? context.ownerDocument || context : preferredDoc) !== document$1) {
  9215. setDocument(context);
  9216. }
  9217. context = context || document$1;
  9218. results = results || [];
  9219. if (!selector || typeof selector !== 'string') {
  9220. return results;
  9221. }
  9222. if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
  9223. return [];
  9224. }
  9225. if (documentIsHTML && !seed) {
  9226. if (match = rquickExpr$1.exec(selector)) {
  9227. if (m = match[1]) {
  9228. if (nodeType === 9) {
  9229. elem = context.getElementById(m);
  9230. if (elem && elem.parentNode) {
  9231. if (elem.id === m) {
  9232. results.push(elem);
  9233. return results;
  9234. }
  9235. } else {
  9236. return results;
  9237. }
  9238. } else {
  9239. if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) {
  9240. results.push(elem);
  9241. return results;
  9242. }
  9243. }
  9244. } else if (match[2]) {
  9245. push$1.apply(results, context.getElementsByTagName(selector));
  9246. return results;
  9247. } else if ((m = match[3]) && support.getElementsByClassName) {
  9248. push$1.apply(results, context.getElementsByClassName(m));
  9249. return results;
  9250. }
  9251. }
  9252. if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  9253. nid = old = expando;
  9254. newContext = context;
  9255. newSelector = nodeType === 9 && selector;
  9256. if (nodeType === 1 && context.nodeName.toLowerCase() !== 'object') {
  9257. groups = tokenize(selector);
  9258. if (old = context.getAttribute('id')) {
  9259. nid = old.replace(rescape, '\\$&');
  9260. } else {
  9261. context.setAttribute('id', nid);
  9262. }
  9263. nid = '[id=\'' + nid + '\'] ';
  9264. i = groups.length;
  9265. while (i--) {
  9266. groups[i] = nid + toSelector(groups[i]);
  9267. }
  9268. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  9269. newSelector = groups.join(',');
  9270. }
  9271. if (newSelector) {
  9272. try {
  9273. push$1.apply(results, newContext.querySelectorAll(newSelector));
  9274. return results;
  9275. } catch (qsaError) {
  9276. } finally {
  9277. if (!old) {
  9278. context.removeAttribute('id');
  9279. }
  9280. }
  9281. }
  9282. }
  9283. }
  9284. return select$1(selector.replace(rtrim, '$1'), context, results, seed);
  9285. };
  9286. function createCache() {
  9287. var keys = [];
  9288. function cache(key, value) {
  9289. if (keys.push(key + ' ') > Expr.cacheLength) {
  9290. delete cache[keys.shift()];
  9291. }
  9292. return cache[key + ' '] = value;
  9293. }
  9294. return cache;
  9295. }
  9296. function markFunction(fn) {
  9297. fn[expando] = true;
  9298. return fn;
  9299. }
  9300. function siblingCheck(a, b) {
  9301. var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
  9302. if (diff) {
  9303. return diff;
  9304. }
  9305. if (cur) {
  9306. while (cur = cur.nextSibling) {
  9307. if (cur === b) {
  9308. return -1;
  9309. }
  9310. }
  9311. }
  9312. return a ? 1 : -1;
  9313. }
  9314. function createInputPseudo(type) {
  9315. return function (elem) {
  9316. var name = elem.nodeName.toLowerCase();
  9317. return name === 'input' && elem.type === type;
  9318. };
  9319. }
  9320. function createButtonPseudo(type) {
  9321. return function (elem) {
  9322. var name = elem.nodeName.toLowerCase();
  9323. return (name === 'input' || name === 'button') && elem.type === type;
  9324. };
  9325. }
  9326. function createPositionalPseudo(fn) {
  9327. return markFunction(function (argument) {
  9328. argument = +argument;
  9329. return markFunction(function (seed, matches) {
  9330. var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
  9331. while (i--) {
  9332. if (seed[j = matchIndexes[i]]) {
  9333. seed[j] = !(matches[j] = seed[j]);
  9334. }
  9335. }
  9336. });
  9337. });
  9338. }
  9339. function testContext(context) {
  9340. return context && typeof context.getElementsByTagName !== strundefined && context;
  9341. }
  9342. support = Sizzle.support = {};
  9343. isXML = Sizzle.isXML = function (elem) {
  9344. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  9345. return documentElement ? documentElement.nodeName !== 'HTML' : false;
  9346. };
  9347. setDocument = Sizzle.setDocument = function (node) {
  9348. var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView;
  9349. function getTop(win) {
  9350. try {
  9351. return win.top;
  9352. } catch (ex) {
  9353. }
  9354. return null;
  9355. }
  9356. if (doc === document$1 || doc.nodeType !== 9 || !doc.documentElement) {
  9357. return document$1;
  9358. }
  9359. document$1 = doc;
  9360. docElem = doc.documentElement;
  9361. documentIsHTML = !isXML(doc);
  9362. if (parent && parent !== getTop(parent)) {
  9363. if (parent.addEventListener) {
  9364. parent.addEventListener('unload', function () {
  9365. setDocument();
  9366. }, false);
  9367. } else if (parent.attachEvent) {
  9368. parent.attachEvent('onunload', function () {
  9369. setDocument();
  9370. });
  9371. }
  9372. }
  9373. support.attributes = true;
  9374. support.getElementsByTagName = true;
  9375. support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
  9376. support.getById = true;
  9377. Expr.find.ID = function (id, context) {
  9378. if (typeof context.getElementById !== strundefined && documentIsHTML) {
  9379. var m = context.getElementById(id);
  9380. return m && m.parentNode ? [m] : [];
  9381. }
  9382. };
  9383. Expr.filter.ID = function (id) {
  9384. var attrId = id.replace(runescape, funescape);
  9385. return function (elem) {
  9386. return elem.getAttribute('id') === attrId;
  9387. };
  9388. };
  9389. Expr.find.TAG = support.getElementsByTagName ? function (tag, context) {
  9390. if (typeof context.getElementsByTagName !== strundefined) {
  9391. return context.getElementsByTagName(tag);
  9392. }
  9393. } : function (tag, context) {
  9394. var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag);
  9395. if (tag === '*') {
  9396. while (elem = results[i++]) {
  9397. if (elem.nodeType === 1) {
  9398. tmp.push(elem);
  9399. }
  9400. }
  9401. return tmp;
  9402. }
  9403. return results;
  9404. };
  9405. Expr.find.CLASS = support.getElementsByClassName && function (className, context) {
  9406. if (documentIsHTML) {
  9407. return context.getElementsByClassName(className);
  9408. }
  9409. };
  9410. rbuggyMatches = [];
  9411. rbuggyQSA = [];
  9412. support.disconnectedMatch = true;
  9413. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join('|'));
  9414. rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join('|'));
  9415. hasCompare = rnative.test(docElem.compareDocumentPosition);
  9416. contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) {
  9417. var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
  9418. return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  9419. } : function (a, b) {
  9420. if (b) {
  9421. while (b = b.parentNode) {
  9422. if (b === a) {
  9423. return true;
  9424. }
  9425. }
  9426. }
  9427. return false;
  9428. };
  9429. sortOrder = hasCompare ? function (a, b) {
  9430. if (a === b) {
  9431. hasDuplicate = true;
  9432. return 0;
  9433. }
  9434. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  9435. if (compare) {
  9436. return compare;
  9437. }
  9438. compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
  9439. if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
  9440. if (a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) {
  9441. return -1;
  9442. }
  9443. if (b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) {
  9444. return 1;
  9445. }
  9446. return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  9447. }
  9448. return compare & 4 ? -1 : 1;
  9449. } : function (a, b) {
  9450. if (a === b) {
  9451. hasDuplicate = true;
  9452. return 0;
  9453. }
  9454. var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
  9455. if (!aup || !bup) {
  9456. return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  9457. } else if (aup === bup) {
  9458. return siblingCheck(a, b);
  9459. }
  9460. cur = a;
  9461. while (cur = cur.parentNode) {
  9462. ap.unshift(cur);
  9463. }
  9464. cur = b;
  9465. while (cur = cur.parentNode) {
  9466. bp.unshift(cur);
  9467. }
  9468. while (ap[i] === bp[i]) {
  9469. i++;
  9470. }
  9471. return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
  9472. };
  9473. return doc;
  9474. };
  9475. Sizzle.matches = function (expr, elements) {
  9476. return Sizzle(expr, null, null, elements);
  9477. };
  9478. Sizzle.matchesSelector = function (elem, expr) {
  9479. if ((elem.ownerDocument || elem) !== document$1) {
  9480. setDocument(elem);
  9481. }
  9482. expr = expr.replace(rattributeQuotes, '=\'$1\']');
  9483. if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  9484. try {
  9485. var ret = matches.call(elem, expr);
  9486. if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
  9487. return ret;
  9488. }
  9489. } catch (e) {
  9490. }
  9491. }
  9492. return Sizzle(expr, document$1, null, [elem]).length > 0;
  9493. };
  9494. Sizzle.contains = function (context, elem) {
  9495. if ((context.ownerDocument || context) !== document$1) {
  9496. setDocument(context);
  9497. }
  9498. return contains(context, elem);
  9499. };
  9500. Sizzle.attr = function (elem, name) {
  9501. if ((elem.ownerDocument || elem) !== document$1) {
  9502. setDocument(elem);
  9503. }
  9504. var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;
  9505. return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
  9506. };
  9507. Sizzle.error = function (msg) {
  9508. throw new Error('Syntax error, unrecognized expression: ' + msg);
  9509. };
  9510. Sizzle.uniqueSort = function (results) {
  9511. var elem, duplicates = [], j = 0, i = 0;
  9512. hasDuplicate = !support.detectDuplicates;
  9513. sortInput = !support.sortStable && results.slice(0);
  9514. results.sort(sortOrder);
  9515. if (hasDuplicate) {
  9516. while (elem = results[i++]) {
  9517. if (elem === results[i]) {
  9518. j = duplicates.push(i);
  9519. }
  9520. }
  9521. while (j--) {
  9522. results.splice(duplicates[j], 1);
  9523. }
  9524. }
  9525. sortInput = null;
  9526. return results;
  9527. };
  9528. getText = Sizzle.getText = function (elem) {
  9529. var node, ret = '', i = 0, nodeType = elem.nodeType;
  9530. if (!nodeType) {
  9531. while (node = elem[i++]) {
  9532. ret += getText(node);
  9533. }
  9534. } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  9535. if (typeof elem.textContent === 'string') {
  9536. return elem.textContent;
  9537. } else {
  9538. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  9539. ret += getText(elem);
  9540. }
  9541. }
  9542. } else if (nodeType === 3 || nodeType === 4) {
  9543. return elem.nodeValue;
  9544. }
  9545. return ret;
  9546. };
  9547. Expr = Sizzle.selectors = {
  9548. cacheLength: 50,
  9549. createPseudo: markFunction,
  9550. match: matchExpr,
  9551. attrHandle: {},
  9552. find: {},
  9553. relative: {
  9554. '>': {
  9555. dir: 'parentNode',
  9556. first: true
  9557. },
  9558. ' ': { dir: 'parentNode' },
  9559. '+': {
  9560. dir: 'previousSibling',
  9561. first: true
  9562. },
  9563. '~': { dir: 'previousSibling' }
  9564. },
  9565. preFilter: {
  9566. ATTR: function (match) {
  9567. match[1] = match[1].replace(runescape, funescape);
  9568. match[3] = (match[3] || match[4] || match[5] || '').replace(runescape, funescape);
  9569. if (match[2] === '~=') {
  9570. match[3] = ' ' + match[3] + ' ';
  9571. }
  9572. return match.slice(0, 4);
  9573. },
  9574. CHILD: function (match) {
  9575. match[1] = match[1].toLowerCase();
  9576. if (match[1].slice(0, 3) === 'nth') {
  9577. if (!match[3]) {
  9578. Sizzle.error(match[0]);
  9579. }
  9580. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === 'even' || match[3] === 'odd'));
  9581. match[5] = +(match[7] + match[8] || match[3] === 'odd');
  9582. } else if (match[3]) {
  9583. Sizzle.error(match[0]);
  9584. }
  9585. return match;
  9586. },
  9587. PSEUDO: function (match) {
  9588. var excess, unquoted = !match[6] && match[2];
  9589. if (matchExpr.CHILD.test(match[0])) {
  9590. return null;
  9591. }
  9592. if (match[3]) {
  9593. match[2] = match[4] || match[5] || '';
  9594. } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(')', unquoted.length - excess) - unquoted.length)) {
  9595. match[0] = match[0].slice(0, excess);
  9596. match[2] = unquoted.slice(0, excess);
  9597. }
  9598. return match.slice(0, 3);
  9599. }
  9600. },
  9601. filter: {
  9602. TAG: function (nodeNameSelector) {
  9603. var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
  9604. return nodeNameSelector === '*' ? function () {
  9605. return true;
  9606. } : function (elem) {
  9607. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  9608. };
  9609. },
  9610. CLASS: function (className) {
  9611. var pattern = classCache[className + ' '];
  9612. return pattern || (pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && classCache(className, function (elem) {
  9613. return pattern.test(typeof elem.className === 'string' && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute('class') || '');
  9614. });
  9615. },
  9616. ATTR: function (name, operator, check) {
  9617. return function (elem) {
  9618. var result = Sizzle.attr(elem, name);
  9619. if (result == null) {
  9620. return operator === '!=';
  9621. }
  9622. if (!operator) {
  9623. return true;
  9624. }
  9625. result += '';
  9626. return operator === '=' ? result === check : operator === '!=' ? result !== check : operator === '^=' ? check && result.indexOf(check) === 0 : operator === '*=' ? check && result.indexOf(check) > -1 : operator === '$=' ? check && result.slice(-check.length) === check : operator === '~=' ? (' ' + result + ' ').indexOf(check) > -1 : operator === '|=' ? result === check || result.slice(0, check.length + 1) === check + '-' : false;
  9627. };
  9628. },
  9629. CHILD: function (type, what, argument, first, last) {
  9630. var simple = type.slice(0, 3) !== 'nth', forward = type.slice(-4) !== 'last', ofType = what === 'of-type';
  9631. return first === 1 && last === 0 ? function (elem) {
  9632. return !!elem.parentNode;
  9633. } : function (elem, context, xml) {
  9634. var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? 'nextSibling' : 'previousSibling', parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType;
  9635. if (parent) {
  9636. if (simple) {
  9637. while (dir) {
  9638. node = elem;
  9639. while (node = node[dir]) {
  9640. if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
  9641. return false;
  9642. }
  9643. }
  9644. start = dir = type === 'only' && !start && 'nextSibling';
  9645. }
  9646. return true;
  9647. }
  9648. start = [forward ? parent.firstChild : parent.lastChild];
  9649. if (forward && useCache) {
  9650. outerCache = parent[expando] || (parent[expando] = {});
  9651. cache = outerCache[type] || [];
  9652. nodeIndex = cache[0] === dirruns && cache[1];
  9653. diff = cache[0] === dirruns && cache[2];
  9654. node = nodeIndex && parent.childNodes[nodeIndex];
  9655. while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
  9656. if (node.nodeType === 1 && ++diff && node === elem) {
  9657. outerCache[type] = [
  9658. dirruns,
  9659. nodeIndex,
  9660. diff
  9661. ];
  9662. break;
  9663. }
  9664. }
  9665. } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
  9666. diff = cache[1];
  9667. } else {
  9668. while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
  9669. if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
  9670. if (useCache) {
  9671. (node[expando] || (node[expando] = {}))[type] = [
  9672. dirruns,
  9673. diff
  9674. ];
  9675. }
  9676. if (node === elem) {
  9677. break;
  9678. }
  9679. }
  9680. }
  9681. }
  9682. diff -= last;
  9683. return diff === first || diff % first === 0 && diff / first >= 0;
  9684. }
  9685. };
  9686. },
  9687. PSEUDO: function (pseudo, argument) {
  9688. var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error('unsupported pseudo: ' + pseudo);
  9689. if (fn[expando]) {
  9690. return fn(argument);
  9691. }
  9692. if (fn.length > 1) {
  9693. args = [
  9694. pseudo,
  9695. pseudo,
  9696. '',
  9697. argument
  9698. ];
  9699. return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
  9700. var idx, matched = fn(seed, argument), i = matched.length;
  9701. while (i--) {
  9702. idx = indexOf.call(seed, matched[i]);
  9703. seed[idx] = !(matches[idx] = matched[i]);
  9704. }
  9705. }) : function (elem) {
  9706. return fn(elem, 0, args);
  9707. };
  9708. }
  9709. return fn;
  9710. }
  9711. },
  9712. pseudos: {
  9713. not: markFunction(function (selector) {
  9714. var input = [], results = [], matcher = compile(selector.replace(rtrim, '$1'));
  9715. return matcher[expando] ? markFunction(function (seed, matches, context, xml) {
  9716. var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
  9717. while (i--) {
  9718. if (elem = unmatched[i]) {
  9719. seed[i] = !(matches[i] = elem);
  9720. }
  9721. }
  9722. }) : function (elem, context, xml) {
  9723. input[0] = elem;
  9724. matcher(input, null, xml, results);
  9725. input[0] = null;
  9726. return !results.pop();
  9727. };
  9728. }),
  9729. has: markFunction(function (selector) {
  9730. return function (elem) {
  9731. return Sizzle(selector, elem).length > 0;
  9732. };
  9733. }),
  9734. contains: markFunction(function (text) {
  9735. text = text.replace(runescape, funescape);
  9736. return function (elem) {
  9737. return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
  9738. };
  9739. }),
  9740. lang: markFunction(function (lang) {
  9741. if (!ridentifier.test(lang || '')) {
  9742. Sizzle.error('unsupported lang: ' + lang);
  9743. }
  9744. lang = lang.replace(runescape, funescape).toLowerCase();
  9745. return function (elem) {
  9746. var elemLang;
  9747. do {
  9748. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute('xml:lang') || elem.getAttribute('lang')) {
  9749. elemLang = elemLang.toLowerCase();
  9750. return elemLang === lang || elemLang.indexOf(lang + '-') === 0;
  9751. }
  9752. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  9753. return false;
  9754. };
  9755. }),
  9756. target: function (elem) {
  9757. var hash = window.location && window.location.hash;
  9758. return hash && hash.slice(1) === elem.id;
  9759. },
  9760. root: function (elem) {
  9761. return elem === docElem;
  9762. },
  9763. focus: function (elem) {
  9764. return elem === document$1.activeElement && (!document$1.hasFocus || document$1.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  9765. },
  9766. enabled: function (elem) {
  9767. return elem.disabled === false;
  9768. },
  9769. disabled: function (elem) {
  9770. return elem.disabled === true;
  9771. },
  9772. checked: function (elem) {
  9773. var nodeName = elem.nodeName.toLowerCase();
  9774. return nodeName === 'input' && !!elem.checked || nodeName === 'option' && !!elem.selected;
  9775. },
  9776. selected: function (elem) {
  9777. if (elem.parentNode) {
  9778. elem.parentNode.selectedIndex;
  9779. }
  9780. return elem.selected === true;
  9781. },
  9782. empty: function (elem) {
  9783. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  9784. if (elem.nodeType < 6) {
  9785. return false;
  9786. }
  9787. }
  9788. return true;
  9789. },
  9790. parent: function (elem) {
  9791. return !Expr.pseudos.empty(elem);
  9792. },
  9793. header: function (elem) {
  9794. return rheader.test(elem.nodeName);
  9795. },
  9796. input: function (elem) {
  9797. return rinputs.test(elem.nodeName);
  9798. },
  9799. button: function (elem) {
  9800. var name = elem.nodeName.toLowerCase();
  9801. return name === 'input' && elem.type === 'button' || name === 'button';
  9802. },
  9803. text: function (elem) {
  9804. var attr;
  9805. return elem.nodeName.toLowerCase() === 'input' && elem.type === 'text' && ((attr = elem.getAttribute('type')) == null || attr.toLowerCase() === 'text');
  9806. },
  9807. first: createPositionalPseudo(function () {
  9808. return [0];
  9809. }),
  9810. last: createPositionalPseudo(function (matchIndexes, length) {
  9811. return [length - 1];
  9812. }),
  9813. eq: createPositionalPseudo(function (matchIndexes, length, argument) {
  9814. return [argument < 0 ? argument + length : argument];
  9815. }),
  9816. even: createPositionalPseudo(function (matchIndexes, length) {
  9817. var i = 0;
  9818. for (; i < length; i += 2) {
  9819. matchIndexes.push(i);
  9820. }
  9821. return matchIndexes;
  9822. }),
  9823. odd: createPositionalPseudo(function (matchIndexes, length) {
  9824. var i = 1;
  9825. for (; i < length; i += 2) {
  9826. matchIndexes.push(i);
  9827. }
  9828. return matchIndexes;
  9829. }),
  9830. lt: createPositionalPseudo(function (matchIndexes, length, argument) {
  9831. var i = argument < 0 ? argument + length : argument;
  9832. for (; --i >= 0;) {
  9833. matchIndexes.push(i);
  9834. }
  9835. return matchIndexes;
  9836. }),
  9837. gt: createPositionalPseudo(function (matchIndexes, length, argument) {
  9838. var i = argument < 0 ? argument + length : argument;
  9839. for (; ++i < length;) {
  9840. matchIndexes.push(i);
  9841. }
  9842. return matchIndexes;
  9843. })
  9844. }
  9845. };
  9846. Expr.pseudos.nth = Expr.pseudos.eq;
  9847. each$k([
  9848. 'radio',
  9849. 'checkbox',
  9850. 'file',
  9851. 'password',
  9852. 'image'
  9853. ], function (i) {
  9854. Expr.pseudos[i] = createInputPseudo(i);
  9855. });
  9856. each$k([
  9857. 'submit',
  9858. 'reset'
  9859. ], function (i) {
  9860. Expr.pseudos[i] = createButtonPseudo(i);
  9861. });
  9862. function setFilters() {
  9863. }
  9864. setFilters.prototype = Expr.filters = Expr.pseudos;
  9865. Expr.setFilters = new setFilters();
  9866. tokenize = Sizzle.tokenize = function (selector, parseOnly) {
  9867. var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + ' '];
  9868. if (cached) {
  9869. return parseOnly ? 0 : cached.slice(0);
  9870. }
  9871. soFar = selector;
  9872. groups = [];
  9873. preFilters = Expr.preFilter;
  9874. while (soFar) {
  9875. if (!matched || (match = rcomma.exec(soFar))) {
  9876. if (match) {
  9877. soFar = soFar.slice(match[0].length) || soFar;
  9878. }
  9879. groups.push(tokens = []);
  9880. }
  9881. matched = false;
  9882. if (match = rcombinators.exec(soFar)) {
  9883. matched = match.shift();
  9884. tokens.push({
  9885. value: matched,
  9886. type: match[0].replace(rtrim, ' ')
  9887. });
  9888. soFar = soFar.slice(matched.length);
  9889. }
  9890. for (type in Expr.filter) {
  9891. if (!Expr.filter.hasOwnProperty(type)) {
  9892. continue;
  9893. }
  9894. if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
  9895. matched = match.shift();
  9896. tokens.push({
  9897. value: matched,
  9898. type: type,
  9899. matches: match
  9900. });
  9901. soFar = soFar.slice(matched.length);
  9902. }
  9903. }
  9904. if (!matched) {
  9905. break;
  9906. }
  9907. }
  9908. return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0);
  9909. };
  9910. function toSelector(tokens) {
  9911. var i = 0, len = tokens.length, selector = '';
  9912. for (; i < len; i++) {
  9913. selector += tokens[i].value;
  9914. }
  9915. return selector;
  9916. }
  9917. function addCombinator(matcher, combinator, base) {
  9918. var dir = combinator.dir, checkNonElements = base && dir === 'parentNode', doneName = done++;
  9919. return combinator.first ? function (elem, context, xml) {
  9920. while (elem = elem[dir]) {
  9921. if (elem.nodeType === 1 || checkNonElements) {
  9922. return matcher(elem, context, xml);
  9923. }
  9924. }
  9925. } : function (elem, context, xml) {
  9926. var oldCache, outerCache, newCache = [
  9927. dirruns,
  9928. doneName
  9929. ];
  9930. if (xml) {
  9931. while (elem = elem[dir]) {
  9932. if (elem.nodeType === 1 || checkNonElements) {
  9933. if (matcher(elem, context, xml)) {
  9934. return true;
  9935. }
  9936. }
  9937. }
  9938. } else {
  9939. while (elem = elem[dir]) {
  9940. if (elem.nodeType === 1 || checkNonElements) {
  9941. outerCache = elem[expando] || (elem[expando] = {});
  9942. if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  9943. return newCache[2] = oldCache[2];
  9944. } else {
  9945. outerCache[dir] = newCache;
  9946. if (newCache[2] = matcher(elem, context, xml)) {
  9947. return true;
  9948. }
  9949. }
  9950. }
  9951. }
  9952. }
  9953. };
  9954. }
  9955. function elementMatcher(matchers) {
  9956. return matchers.length > 1 ? function (elem, context, xml) {
  9957. var i = matchers.length;
  9958. while (i--) {
  9959. if (!matchers[i](elem, context, xml)) {
  9960. return false;
  9961. }
  9962. }
  9963. return true;
  9964. } : matchers[0];
  9965. }
  9966. function multipleContexts(selector, contexts, results) {
  9967. var i = 0, len = contexts.length;
  9968. for (; i < len; i++) {
  9969. Sizzle(selector, contexts[i], results);
  9970. }
  9971. return results;
  9972. }
  9973. function condense(unmatched, map, filter, context, xml) {
  9974. var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
  9975. for (; i < len; i++) {
  9976. if (elem = unmatched[i]) {
  9977. if (!filter || filter(elem, context, xml)) {
  9978. newUnmatched.push(elem);
  9979. if (mapped) {
  9980. map.push(i);
  9981. }
  9982. }
  9983. }
  9984. }
  9985. return newUnmatched;
  9986. }
  9987. function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
  9988. if (postFilter && !postFilter[expando]) {
  9989. postFilter = setMatcher(postFilter);
  9990. }
  9991. if (postFinder && !postFinder[expando]) {
  9992. postFinder = setMatcher(postFinder, postSelector);
  9993. }
  9994. return markFunction(function (seed, results, context, xml) {
  9995. var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || '*', context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
  9996. if (matcher) {
  9997. matcher(matcherIn, matcherOut, context, xml);
  9998. }
  9999. if (postFilter) {
  10000. temp = condense(matcherOut, postMap);
  10001. postFilter(temp, [], context, xml);
  10002. i = temp.length;
  10003. while (i--) {
  10004. if (elem = temp[i]) {
  10005. matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
  10006. }
  10007. }
  10008. }
  10009. if (seed) {
  10010. if (postFinder || preFilter) {
  10011. if (postFinder) {
  10012. temp = [];
  10013. i = matcherOut.length;
  10014. while (i--) {
  10015. if (elem = matcherOut[i]) {
  10016. temp.push(matcherIn[i] = elem);
  10017. }
  10018. }
  10019. postFinder(null, matcherOut = [], temp, xml);
  10020. }
  10021. i = matcherOut.length;
  10022. while (i--) {
  10023. if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {
  10024. seed[temp] = !(results[temp] = elem);
  10025. }
  10026. }
  10027. }
  10028. } else {
  10029. matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
  10030. if (postFinder) {
  10031. postFinder(null, results, matcherOut, xml);
  10032. } else {
  10033. push$1.apply(results, matcherOut);
  10034. }
  10035. }
  10036. });
  10037. }
  10038. function matcherFromTokens(tokens) {
  10039. var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[' '], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) {
  10040. return elem === checkContext;
  10041. }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) {
  10042. return indexOf.call(checkContext, elem) > -1;
  10043. }, implicitRelative, true), matchers = [function (elem, context, xml) {
  10044. var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  10045. checkContext = null;
  10046. return ret;
  10047. }];
  10048. for (; i < len; i++) {
  10049. if (matcher = Expr.relative[tokens[i].type]) {
  10050. matchers = [addCombinator(elementMatcher(matchers), matcher)];
  10051. } else {
  10052. matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
  10053. if (matcher[expando]) {
  10054. j = ++i;
  10055. for (; j < len; j++) {
  10056. if (Expr.relative[tokens[j].type]) {
  10057. break;
  10058. }
  10059. }
  10060. return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === ' ' ? '*' : '' })).replace(rtrim, '$1'), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
  10061. }
  10062. matchers.push(matcher);
  10063. }
  10064. }
  10065. return elementMatcher(matchers);
  10066. }
  10067. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  10068. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) {
  10069. var elem, j, matcher, matchedCount = 0, i = '0', unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG('*', outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
  10070. if (outermost) {
  10071. outermostContext = context !== document$1 && context;
  10072. }
  10073. for (; i !== len && (elem = elems[i]) != null; i++) {
  10074. if (byElement && elem) {
  10075. j = 0;
  10076. while (matcher = elementMatchers[j++]) {
  10077. if (matcher(elem, context, xml)) {
  10078. results.push(elem);
  10079. break;
  10080. }
  10081. }
  10082. if (outermost) {
  10083. dirruns = dirrunsUnique;
  10084. }
  10085. }
  10086. if (bySet) {
  10087. if (elem = !matcher && elem) {
  10088. matchedCount--;
  10089. }
  10090. if (seed) {
  10091. unmatched.push(elem);
  10092. }
  10093. }
  10094. }
  10095. matchedCount += i;
  10096. if (bySet && i !== matchedCount) {
  10097. j = 0;
  10098. while (matcher = setMatchers[j++]) {
  10099. matcher(unmatched, setMatched, context, xml);
  10100. }
  10101. if (seed) {
  10102. if (matchedCount > 0) {
  10103. while (i--) {
  10104. if (!(unmatched[i] || setMatched[i])) {
  10105. setMatched[i] = pop.call(results);
  10106. }
  10107. }
  10108. }
  10109. setMatched = condense(setMatched);
  10110. }
  10111. push$1.apply(results, setMatched);
  10112. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  10113. Sizzle.uniqueSort(results);
  10114. }
  10115. }
  10116. if (outermost) {
  10117. dirruns = dirrunsUnique;
  10118. outermostContext = contextBackup;
  10119. }
  10120. return unmatched;
  10121. };
  10122. return bySet ? markFunction(superMatcher) : superMatcher;
  10123. }
  10124. compile = Sizzle.compile = function (selector, match) {
  10125. var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + ' '];
  10126. if (!cached) {
  10127. if (!match) {
  10128. match = tokenize(selector);
  10129. }
  10130. i = match.length;
  10131. while (i--) {
  10132. cached = matcherFromTokens(match[i]);
  10133. if (cached[expando]) {
  10134. setMatchers.push(cached);
  10135. } else {
  10136. elementMatchers.push(cached);
  10137. }
  10138. }
  10139. cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
  10140. cached.selector = selector;
  10141. }
  10142. return cached;
  10143. };
  10144. select$1 = Sizzle.select = function (selector, context, results, seed) {
  10145. var i, tokens, token, type, find, compiled = typeof selector === 'function' && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  10146. results = results || [];
  10147. if (match.length === 1) {
  10148. tokens = match[0] = match[0].slice(0);
  10149. if (tokens.length > 2 && (token = tokens[0]).type === 'ID' && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
  10150. context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];
  10151. if (!context) {
  10152. return results;
  10153. } else if (compiled) {
  10154. context = context.parentNode;
  10155. }
  10156. selector = selector.slice(tokens.shift().value.length);
  10157. }
  10158. i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  10159. while (i--) {
  10160. token = tokens[i];
  10161. if (Expr.relative[type = token.type]) {
  10162. break;
  10163. }
  10164. if (find = Expr.find[type]) {
  10165. if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
  10166. tokens.splice(i, 1);
  10167. selector = seed.length && toSelector(tokens);
  10168. if (!selector) {
  10169. push$1.apply(results, seed);
  10170. return results;
  10171. }
  10172. break;
  10173. }
  10174. }
  10175. }
  10176. }
  10177. (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context);
  10178. return results;
  10179. };
  10180. support.sortStable = expando.split('').sort(sortOrder).join('') === expando;
  10181. support.detectDuplicates = !!hasDuplicate;
  10182. setDocument();
  10183. support.sortDetached = true;
  10184. var doc = document;
  10185. var push = Array.prototype.push;
  10186. var slice = Array.prototype.slice;
  10187. var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
  10188. var Event$1 = EventUtils.Event;
  10189. var skipUniques = Tools.makeMap('children,contents,next,prev');
  10190. var isDefined = function (obj) {
  10191. return typeof obj !== 'undefined';
  10192. };
  10193. var isString = function (obj) {
  10194. return typeof obj === 'string';
  10195. };
  10196. var isWindow = function (obj) {
  10197. return obj && obj === obj.window;
  10198. };
  10199. var createFragment$1 = function (html, fragDoc) {
  10200. fragDoc = fragDoc || doc;
  10201. var container = fragDoc.createElement('div');
  10202. var frag = fragDoc.createDocumentFragment();
  10203. container.innerHTML = html;
  10204. var node;
  10205. while (node = container.firstChild) {
  10206. frag.appendChild(node);
  10207. }
  10208. return frag;
  10209. };
  10210. var domManipulate = function (targetNodes, sourceItem, callback, reverse) {
  10211. var i;
  10212. if (isString(sourceItem)) {
  10213. sourceItem = createFragment$1(sourceItem, getElementDocument(targetNodes[0]));
  10214. } else if (sourceItem.length && !sourceItem.nodeType) {
  10215. sourceItem = DomQuery.makeArray(sourceItem);
  10216. if (reverse) {
  10217. for (i = sourceItem.length - 1; i >= 0; i--) {
  10218. domManipulate(targetNodes, sourceItem[i], callback, reverse);
  10219. }
  10220. } else {
  10221. for (i = 0; i < sourceItem.length; i++) {
  10222. domManipulate(targetNodes, sourceItem[i], callback, reverse);
  10223. }
  10224. }
  10225. return targetNodes;
  10226. }
  10227. if (sourceItem.nodeType) {
  10228. i = targetNodes.length;
  10229. while (i--) {
  10230. callback.call(targetNodes[i], sourceItem);
  10231. }
  10232. }
  10233. return targetNodes;
  10234. };
  10235. var hasClass = function (node, className) {
  10236. return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
  10237. };
  10238. var wrap$2 = function (elements, wrapper, all) {
  10239. var lastParent, newWrapper;
  10240. wrapper = DomQuery(wrapper)[0];
  10241. elements.each(function () {
  10242. var self = this;
  10243. if (!all || lastParent !== self.parentNode) {
  10244. lastParent = self.parentNode;
  10245. newWrapper = wrapper.cloneNode(false);
  10246. self.parentNode.insertBefore(newWrapper, self);
  10247. newWrapper.appendChild(self);
  10248. } else {
  10249. newWrapper.appendChild(self);
  10250. }
  10251. });
  10252. return elements;
  10253. };
  10254. var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
  10255. var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
  10256. var propFix = {
  10257. for: 'htmlFor',
  10258. class: 'className',
  10259. readonly: 'readOnly'
  10260. };
  10261. var cssFix = { float: 'cssFloat' };
  10262. var attrHooks = {}, cssHooks = {};
  10263. var DomQueryConstructor = function (selector, context) {
  10264. return new DomQuery.fn.init(selector, context);
  10265. };
  10266. var inArray$1 = function (item, array) {
  10267. var i;
  10268. if (array.indexOf) {
  10269. return array.indexOf(item);
  10270. }
  10271. i = array.length;
  10272. while (i--) {
  10273. if (array[i] === item) {
  10274. return i;
  10275. }
  10276. }
  10277. return -1;
  10278. };
  10279. var whiteSpaceRegExp = /^\s*|\s*$/g;
  10280. var trim$1 = function (str) {
  10281. return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, '');
  10282. };
  10283. var each$g = function (obj, callback) {
  10284. var length, key, i, value;
  10285. if (obj) {
  10286. length = obj.length;
  10287. if (length === undefined) {
  10288. for (key in obj) {
  10289. if (obj.hasOwnProperty(key)) {
  10290. value = obj[key];
  10291. if (callback.call(value, key, value) === false) {
  10292. break;
  10293. }
  10294. }
  10295. }
  10296. } else {
  10297. for (i = 0; i < length; i++) {
  10298. value = obj[i];
  10299. if (callback.call(value, i, value) === false) {
  10300. break;
  10301. }
  10302. }
  10303. }
  10304. }
  10305. return obj;
  10306. };
  10307. var grep$2 = function (array, callback) {
  10308. var out = [];
  10309. each$g(array, function (i, item) {
  10310. if (callback(item, i)) {
  10311. out.push(item);
  10312. }
  10313. });
  10314. return out;
  10315. };
  10316. var getElementDocument = function (element) {
  10317. if (!element) {
  10318. return doc;
  10319. }
  10320. if (element.nodeType === 9) {
  10321. return element;
  10322. }
  10323. return element.ownerDocument;
  10324. };
  10325. DomQueryConstructor.fn = DomQueryConstructor.prototype = {
  10326. constructor: DomQueryConstructor,
  10327. selector: '',
  10328. context: null,
  10329. length: 0,
  10330. init: function (selector, context) {
  10331. var self = this;
  10332. var match, node;
  10333. if (!selector) {
  10334. return self;
  10335. }
  10336. if (selector.nodeType) {
  10337. self.context = self[0] = selector;
  10338. self.length = 1;
  10339. return self;
  10340. }
  10341. if (context && context.nodeType) {
  10342. self.context = context;
  10343. } else {
  10344. if (context) {
  10345. return DomQuery(selector).attr(context);
  10346. }
  10347. self.context = context = document;
  10348. }
  10349. if (isString(selector)) {
  10350. self.selector = selector;
  10351. if (selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) {
  10352. match = [
  10353. null,
  10354. selector,
  10355. null
  10356. ];
  10357. } else {
  10358. match = rquickExpr.exec(selector);
  10359. }
  10360. if (match) {
  10361. if (match[1]) {
  10362. node = createFragment$1(selector, getElementDocument(context)).firstChild;
  10363. while (node) {
  10364. push.call(self, node);
  10365. node = node.nextSibling;
  10366. }
  10367. } else {
  10368. node = getElementDocument(context).getElementById(match[2]);
  10369. if (!node) {
  10370. return self;
  10371. }
  10372. if (node.id !== match[2]) {
  10373. return self.find(selector);
  10374. }
  10375. self.length = 1;
  10376. self[0] = node;
  10377. }
  10378. } else {
  10379. return DomQuery(context).find(selector);
  10380. }
  10381. } else {
  10382. this.add(selector, false);
  10383. }
  10384. return self;
  10385. },
  10386. toArray: function () {
  10387. return Tools.toArray(this);
  10388. },
  10389. add: function (items, sort) {
  10390. var self = this;
  10391. var nodes, i;
  10392. if (isString(items)) {
  10393. return self.add(DomQuery(items));
  10394. }
  10395. if (sort !== false) {
  10396. nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
  10397. self.length = nodes.length;
  10398. for (i = 0; i < nodes.length; i++) {
  10399. self[i] = nodes[i];
  10400. }
  10401. } else {
  10402. push.apply(self, DomQuery.makeArray(items));
  10403. }
  10404. return self;
  10405. },
  10406. attr: function (name, value) {
  10407. var self = this;
  10408. var hook;
  10409. if (typeof name === 'object') {
  10410. each$g(name, function (name, value) {
  10411. self.attr(name, value);
  10412. });
  10413. } else if (isDefined(value)) {
  10414. this.each(function () {
  10415. var hook;
  10416. if (this.nodeType === 1) {
  10417. hook = attrHooks[name];
  10418. if (hook && hook.set) {
  10419. hook.set(this, value);
  10420. return;
  10421. }
  10422. if (value === null) {
  10423. this.removeAttribute(name, 2);
  10424. } else {
  10425. this.setAttribute(name, value, 2);
  10426. }
  10427. }
  10428. });
  10429. } else {
  10430. if (self[0] && self[0].nodeType === 1) {
  10431. hook = attrHooks[name];
  10432. if (hook && hook.get) {
  10433. return hook.get(self[0], name);
  10434. }
  10435. if (booleanMap[name]) {
  10436. return self.prop(name) ? name : undefined;
  10437. }
  10438. value = self[0].getAttribute(name, 2);
  10439. if (value === null) {
  10440. value = undefined;
  10441. }
  10442. }
  10443. return value;
  10444. }
  10445. return self;
  10446. },
  10447. removeAttr: function (name) {
  10448. return this.attr(name, null);
  10449. },
  10450. prop: function (name, value) {
  10451. var self = this;
  10452. name = propFix[name] || name;
  10453. if (typeof name === 'object') {
  10454. each$g(name, function (name, value) {
  10455. self.prop(name, value);
  10456. });
  10457. } else if (isDefined(value)) {
  10458. this.each(function () {
  10459. if (this.nodeType === 1) {
  10460. this[name] = value;
  10461. }
  10462. });
  10463. } else {
  10464. if (self[0] && self[0].nodeType && name in self[0]) {
  10465. return self[0][name];
  10466. }
  10467. return value;
  10468. }
  10469. return self;
  10470. },
  10471. css: function (name, value) {
  10472. var self = this;
  10473. var elm, hook;
  10474. var camel = function (name) {
  10475. return name.replace(/-(\D)/g, function (a, b) {
  10476. return b.toUpperCase();
  10477. });
  10478. };
  10479. var dashed = function (name) {
  10480. return name.replace(/[A-Z]/g, function (a) {
  10481. return '-' + a;
  10482. });
  10483. };
  10484. if (typeof name === 'object') {
  10485. each$g(name, function (name, value) {
  10486. self.css(name, value);
  10487. });
  10488. } else {
  10489. if (isDefined(value)) {
  10490. name = camel(name);
  10491. if (typeof value === 'number' && !numericCssMap[name]) {
  10492. value = value.toString() + 'px';
  10493. }
  10494. self.each(function () {
  10495. var style = this.style;
  10496. hook = cssHooks[name];
  10497. if (hook && hook.set) {
  10498. hook.set(this, value);
  10499. return;
  10500. }
  10501. try {
  10502. this.style[cssFix[name] || name] = value;
  10503. } catch (ex) {
  10504. }
  10505. if (value === null || value === '') {
  10506. if (style.removeProperty) {
  10507. style.removeProperty(dashed(name));
  10508. } else {
  10509. style.removeAttribute(name);
  10510. }
  10511. }
  10512. });
  10513. } else {
  10514. elm = self[0];
  10515. hook = cssHooks[name];
  10516. if (hook && hook.get) {
  10517. return hook.get(elm);
  10518. }
  10519. if (elm.ownerDocument.defaultView) {
  10520. try {
  10521. return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
  10522. } catch (ex) {
  10523. return undefined;
  10524. }
  10525. } else if (elm.currentStyle) {
  10526. return elm.currentStyle[camel(name)];
  10527. } else {
  10528. return '';
  10529. }
  10530. }
  10531. }
  10532. return self;
  10533. },
  10534. remove: function () {
  10535. var self = this;
  10536. var node, i = this.length;
  10537. while (i--) {
  10538. node = self[i];
  10539. Event$1.clean(node);
  10540. if (node.parentNode) {
  10541. node.parentNode.removeChild(node);
  10542. }
  10543. }
  10544. return this;
  10545. },
  10546. empty: function () {
  10547. var self = this;
  10548. var node, i = this.length;
  10549. while (i--) {
  10550. node = self[i];
  10551. while (node.firstChild) {
  10552. node.removeChild(node.firstChild);
  10553. }
  10554. }
  10555. return this;
  10556. },
  10557. html: function (value) {
  10558. var self = this;
  10559. var i;
  10560. if (isDefined(value)) {
  10561. i = self.length;
  10562. try {
  10563. while (i--) {
  10564. self[i].innerHTML = value;
  10565. }
  10566. } catch (ex) {
  10567. DomQuery(self[i]).empty().append(value);
  10568. }
  10569. return self;
  10570. }
  10571. return self[0] ? self[0].innerHTML : '';
  10572. },
  10573. text: function (value) {
  10574. var self = this;
  10575. var i;
  10576. if (isDefined(value)) {
  10577. i = self.length;
  10578. while (i--) {
  10579. if ('innerText' in self[i]) {
  10580. self[i].innerText = value;
  10581. } else {
  10582. self[0].textContent = value;
  10583. }
  10584. }
  10585. return self;
  10586. }
  10587. return self[0] ? self[0].innerText || self[0].textContent : '';
  10588. },
  10589. append: function () {
  10590. return domManipulate(this, arguments, function (node) {
  10591. if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
  10592. this.appendChild(node);
  10593. }
  10594. });
  10595. },
  10596. prepend: function () {
  10597. return domManipulate(this, arguments, function (node) {
  10598. if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
  10599. this.insertBefore(node, this.firstChild);
  10600. }
  10601. }, true);
  10602. },
  10603. before: function () {
  10604. var self = this;
  10605. if (self[0] && self[0].parentNode) {
  10606. return domManipulate(self, arguments, function (node) {
  10607. this.parentNode.insertBefore(node, this);
  10608. });
  10609. }
  10610. return self;
  10611. },
  10612. after: function () {
  10613. var self = this;
  10614. if (self[0] && self[0].parentNode) {
  10615. return domManipulate(self, arguments, function (node) {
  10616. this.parentNode.insertBefore(node, this.nextSibling);
  10617. }, true);
  10618. }
  10619. return self;
  10620. },
  10621. appendTo: function (val) {
  10622. DomQuery(val).append(this);
  10623. return this;
  10624. },
  10625. prependTo: function (val) {
  10626. DomQuery(val).prepend(this);
  10627. return this;
  10628. },
  10629. replaceWith: function (content) {
  10630. return this.before(content).remove();
  10631. },
  10632. wrap: function (content) {
  10633. return wrap$2(this, content);
  10634. },
  10635. wrapAll: function (content) {
  10636. return wrap$2(this, content, true);
  10637. },
  10638. wrapInner: function (content) {
  10639. this.each(function () {
  10640. DomQuery(this).contents().wrapAll(content);
  10641. });
  10642. return this;
  10643. },
  10644. unwrap: function () {
  10645. return this.parent().each(function () {
  10646. DomQuery(this).replaceWith(this.childNodes);
  10647. });
  10648. },
  10649. clone: function () {
  10650. var result = [];
  10651. this.each(function () {
  10652. result.push(this.cloneNode(true));
  10653. });
  10654. return DomQuery(result);
  10655. },
  10656. addClass: function (className) {
  10657. return this.toggleClass(className, true);
  10658. },
  10659. removeClass: function (className) {
  10660. return this.toggleClass(className, false);
  10661. },
  10662. toggleClass: function (className, state) {
  10663. var self = this;
  10664. if (typeof className !== 'string') {
  10665. return self;
  10666. }
  10667. if (className.indexOf(' ') !== -1) {
  10668. each$g(className.split(' '), function () {
  10669. self.toggleClass(this, state);
  10670. });
  10671. } else {
  10672. self.each(function (index, node) {
  10673. var classState = hasClass(node, className);
  10674. if (classState !== state) {
  10675. var existingClassName = node.className;
  10676. if (classState) {
  10677. node.className = trim$1((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
  10678. } else {
  10679. node.className += existingClassName ? ' ' + className : className;
  10680. }
  10681. }
  10682. });
  10683. }
  10684. return self;
  10685. },
  10686. hasClass: function (className) {
  10687. return hasClass(this[0], className);
  10688. },
  10689. each: function (callback) {
  10690. return each$g(this, callback);
  10691. },
  10692. on: function (name, callback) {
  10693. return this.each(function () {
  10694. Event$1.bind(this, name, callback);
  10695. });
  10696. },
  10697. off: function (name, callback) {
  10698. return this.each(function () {
  10699. Event$1.unbind(this, name, callback);
  10700. });
  10701. },
  10702. trigger: function (name) {
  10703. return this.each(function () {
  10704. if (typeof name === 'object') {
  10705. Event$1.fire(this, name.type, name);
  10706. } else {
  10707. Event$1.fire(this, name);
  10708. }
  10709. });
  10710. },
  10711. show: function () {
  10712. return this.css('display', '');
  10713. },
  10714. hide: function () {
  10715. return this.css('display', 'none');
  10716. },
  10717. slice: function () {
  10718. return DomQuery(slice.apply(this, arguments));
  10719. },
  10720. eq: function (index) {
  10721. return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
  10722. },
  10723. first: function () {
  10724. return this.eq(0);
  10725. },
  10726. last: function () {
  10727. return this.eq(-1);
  10728. },
  10729. find: function (selector) {
  10730. var i, l;
  10731. var ret = [];
  10732. for (i = 0, l = this.length; i < l; i++) {
  10733. DomQuery.find(selector, this[i], ret);
  10734. }
  10735. return DomQuery(ret);
  10736. },
  10737. filter: function (selector) {
  10738. if (typeof selector === 'function') {
  10739. return DomQuery(grep$2(this.toArray(), function (item, i) {
  10740. return selector(i, item);
  10741. }));
  10742. }
  10743. return DomQuery(DomQuery.filter(selector, this.toArray()));
  10744. },
  10745. closest: function (selector) {
  10746. var result = [];
  10747. if (selector instanceof DomQuery) {
  10748. selector = selector[0];
  10749. }
  10750. this.each(function (i, node) {
  10751. while (node) {
  10752. if (typeof selector === 'string' && DomQuery(node).is(selector)) {
  10753. result.push(node);
  10754. break;
  10755. } else if (node === selector) {
  10756. result.push(node);
  10757. break;
  10758. }
  10759. node = node.parentNode;
  10760. }
  10761. });
  10762. return DomQuery(result);
  10763. },
  10764. offset: function (offset) {
  10765. var elm, doc, docElm;
  10766. var x = 0, y = 0, pos;
  10767. if (!offset) {
  10768. elm = this[0];
  10769. if (elm) {
  10770. doc = elm.ownerDocument;
  10771. docElm = doc.documentElement;
  10772. if (elm.getBoundingClientRect) {
  10773. pos = elm.getBoundingClientRect();
  10774. x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
  10775. y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
  10776. }
  10777. }
  10778. return {
  10779. left: x,
  10780. top: y
  10781. };
  10782. }
  10783. return this.css(offset);
  10784. },
  10785. push: push,
  10786. sort: Array.prototype.sort,
  10787. splice: Array.prototype.splice
  10788. };
  10789. Tools.extend(DomQueryConstructor, {
  10790. extend: Tools.extend,
  10791. makeArray: function (object) {
  10792. if (isWindow(object) || object.nodeType) {
  10793. return [object];
  10794. }
  10795. return Tools.toArray(object);
  10796. },
  10797. inArray: inArray$1,
  10798. isArray: Tools.isArray,
  10799. each: each$g,
  10800. trim: trim$1,
  10801. grep: grep$2,
  10802. find: Sizzle,
  10803. expr: Sizzle.selectors,
  10804. unique: Sizzle.uniqueSort,
  10805. text: Sizzle.getText,
  10806. contains: Sizzle.contains,
  10807. filter: function (expr, elems, not) {
  10808. var i = elems.length;
  10809. if (not) {
  10810. expr = ':not(' + expr + ')';
  10811. }
  10812. while (i--) {
  10813. if (elems[i].nodeType !== 1) {
  10814. elems.splice(i, 1);
  10815. }
  10816. }
  10817. if (elems.length === 1) {
  10818. elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
  10819. } else {
  10820. elems = DomQuery.find.matches(expr, elems);
  10821. }
  10822. return elems;
  10823. }
  10824. });
  10825. var dir = function (el, prop, until) {
  10826. var matched = [];
  10827. var cur = el[prop];
  10828. if (typeof until !== 'string' && until instanceof DomQuery) {
  10829. until = until[0];
  10830. }
  10831. while (cur && cur.nodeType !== 9) {
  10832. if (until !== undefined) {
  10833. if (cur === until) {
  10834. break;
  10835. }
  10836. if (typeof until === 'string' && DomQuery(cur).is(until)) {
  10837. break;
  10838. }
  10839. }
  10840. if (cur.nodeType === 1) {
  10841. matched.push(cur);
  10842. }
  10843. cur = cur[prop];
  10844. }
  10845. return matched;
  10846. };
  10847. var sibling$1 = function (node, siblingName, nodeType, until) {
  10848. var result = [];
  10849. if (until instanceof DomQuery) {
  10850. until = until[0];
  10851. }
  10852. for (; node; node = node[siblingName]) {
  10853. if (nodeType && node.nodeType !== nodeType) {
  10854. continue;
  10855. }
  10856. if (until !== undefined) {
  10857. if (node === until) {
  10858. break;
  10859. }
  10860. if (typeof until === 'string' && DomQuery(node).is(until)) {
  10861. break;
  10862. }
  10863. }
  10864. result.push(node);
  10865. }
  10866. return result;
  10867. };
  10868. var firstSibling = function (node, siblingName, nodeType) {
  10869. for (node = node[siblingName]; node; node = node[siblingName]) {
  10870. if (node.nodeType === nodeType) {
  10871. return node;
  10872. }
  10873. }
  10874. return null;
  10875. };
  10876. each$g({
  10877. parent: function (node) {
  10878. var parent = node.parentNode;
  10879. return parent && parent.nodeType !== 11 ? parent : null;
  10880. },
  10881. parents: function (node) {
  10882. return dir(node, 'parentNode');
  10883. },
  10884. next: function (node) {
  10885. return firstSibling(node, 'nextSibling', 1);
  10886. },
  10887. prev: function (node) {
  10888. return firstSibling(node, 'previousSibling', 1);
  10889. },
  10890. children: function (node) {
  10891. return sibling$1(node.firstChild, 'nextSibling', 1);
  10892. },
  10893. contents: function (node) {
  10894. return Tools.toArray((node.nodeName === 'iframe' ? node.contentDocument || node.contentWindow.document : node).childNodes);
  10895. }
  10896. }, function (name, fn) {
  10897. DomQueryConstructor.fn[name] = function (selector) {
  10898. var self = this;
  10899. var result = [];
  10900. self.each(function () {
  10901. var nodes = fn.call(result, this, selector, result);
  10902. if (nodes) {
  10903. if (DomQuery.isArray(nodes)) {
  10904. result.push.apply(result, nodes);
  10905. } else {
  10906. result.push(nodes);
  10907. }
  10908. }
  10909. });
  10910. if (this.length > 1) {
  10911. if (!skipUniques[name]) {
  10912. result = DomQuery.unique(result);
  10913. }
  10914. if (name.indexOf('parents') === 0) {
  10915. result = result.reverse();
  10916. }
  10917. }
  10918. var wrappedResult = DomQuery(result);
  10919. if (selector) {
  10920. return wrappedResult.filter(selector);
  10921. }
  10922. return wrappedResult;
  10923. };
  10924. });
  10925. each$g({
  10926. parentsUntil: function (node, until) {
  10927. return dir(node, 'parentNode', until);
  10928. },
  10929. nextUntil: function (node, until) {
  10930. return sibling$1(node, 'nextSibling', 1, until).slice(1);
  10931. },
  10932. prevUntil: function (node, until) {
  10933. return sibling$1(node, 'previousSibling', 1, until).slice(1);
  10934. }
  10935. }, function (name, fn) {
  10936. DomQueryConstructor.fn[name] = function (selector, filter) {
  10937. var self = this;
  10938. var result = [];
  10939. self.each(function () {
  10940. var nodes = fn.call(result, this, selector, result);
  10941. if (nodes) {
  10942. if (DomQuery.isArray(nodes)) {
  10943. result.push.apply(result, nodes);
  10944. } else {
  10945. result.push(nodes);
  10946. }
  10947. }
  10948. });
  10949. if (this.length > 1) {
  10950. result = DomQuery.unique(result);
  10951. if (name.indexOf('parents') === 0 || name === 'prevUntil') {
  10952. result = result.reverse();
  10953. }
  10954. }
  10955. var wrappedResult = DomQuery(result);
  10956. if (filter) {
  10957. return wrappedResult.filter(filter);
  10958. }
  10959. return wrappedResult;
  10960. };
  10961. });
  10962. DomQueryConstructor.fn.is = function (selector) {
  10963. return !!selector && this.filter(selector).length > 0;
  10964. };
  10965. DomQueryConstructor.fn.init.prototype = DomQueryConstructor.fn;
  10966. DomQueryConstructor.overrideDefaults = function (callback) {
  10967. var defaults;
  10968. var sub = function (selector, context) {
  10969. defaults = defaults || callback();
  10970. if (arguments.length === 0) {
  10971. selector = defaults.element;
  10972. }
  10973. if (!context) {
  10974. context = defaults.context;
  10975. }
  10976. return new sub.fn.init(selector, context);
  10977. };
  10978. DomQuery.extend(sub, this);
  10979. return sub;
  10980. };
  10981. DomQueryConstructor.attrHooks = attrHooks;
  10982. DomQueryConstructor.cssHooks = cssHooks;
  10983. var DomQuery = DomQueryConstructor;
  10984. var each$f = Tools.each;
  10985. var grep$1 = Tools.grep;
  10986. var isIE = Env.ie;
  10987. var simpleSelectorRe = /^([a-z0-9],?)+$/i;
  10988. var setupAttrHooks = function (styles, settings, getContext) {
  10989. var keepValues = settings.keep_values;
  10990. var keepUrlHook = {
  10991. set: function ($elm, value, name) {
  10992. if (settings.url_converter && value !== null) {
  10993. value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name, $elm[0]);
  10994. }
  10995. $elm.attr('data-mce-' + name, value).attr(name, value);
  10996. },
  10997. get: function ($elm, name) {
  10998. return $elm.attr('data-mce-' + name) || $elm.attr(name);
  10999. }
  11000. };
  11001. var attrHooks = {
  11002. style: {
  11003. set: function ($elm, value) {
  11004. if (value !== null && typeof value === 'object') {
  11005. $elm.css(value);
  11006. return;
  11007. }
  11008. if (keepValues) {
  11009. $elm.attr('data-mce-style', value);
  11010. }
  11011. if (value !== null && typeof value === 'string') {
  11012. $elm.removeAttr('style');
  11013. $elm.css(styles.parse(value));
  11014. } else {
  11015. $elm.attr('style', value);
  11016. }
  11017. },
  11018. get: function ($elm) {
  11019. var value = $elm.attr('data-mce-style') || $elm.attr('style');
  11020. value = styles.serialize(styles.parse(value), $elm[0].nodeName);
  11021. return value;
  11022. }
  11023. }
  11024. };
  11025. if (keepValues) {
  11026. attrHooks.href = attrHooks.src = keepUrlHook;
  11027. }
  11028. return attrHooks;
  11029. };
  11030. var updateInternalStyleAttr = function (styles, $elm) {
  11031. var rawValue = $elm.attr('style');
  11032. var value = styles.serialize(styles.parse(rawValue), $elm[0].nodeName);
  11033. if (!value) {
  11034. value = null;
  11035. }
  11036. $elm.attr('data-mce-style', value);
  11037. };
  11038. var findNodeIndex = function (node, normalized) {
  11039. var idx = 0, lastNodeType, nodeType;
  11040. if (node) {
  11041. for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
  11042. nodeType = node.nodeType;
  11043. if (normalized && nodeType === 3) {
  11044. if (nodeType === lastNodeType || !node.nodeValue.length) {
  11045. continue;
  11046. }
  11047. }
  11048. idx++;
  11049. lastNodeType = nodeType;
  11050. }
  11051. }
  11052. return idx;
  11053. };
  11054. var DOMUtils = function (doc, settings) {
  11055. if (settings === void 0) {
  11056. settings = {};
  11057. }
  11058. var addedStyles = {};
  11059. var win = window;
  11060. var files = {};
  11061. var counter = 0;
  11062. var stdMode = true;
  11063. var boxModel = true;
  11064. var styleSheetLoader = instance.forElement(SugarElement.fromDom(doc), {
  11065. contentCssCors: settings.contentCssCors,
  11066. referrerPolicy: settings.referrerPolicy
  11067. });
  11068. var boundEvents = [];
  11069. var schema = settings.schema ? settings.schema : Schema({});
  11070. var styles = Styles({
  11071. url_converter: settings.url_converter,
  11072. url_converter_scope: settings.url_converter_scope
  11073. }, settings.schema);
  11074. var events = settings.ownEvents ? new EventUtils() : EventUtils.Event;
  11075. var blockElementsMap = schema.getBlockElements();
  11076. var $ = DomQuery.overrideDefaults(function () {
  11077. return {
  11078. context: doc,
  11079. element: self.getRoot()
  11080. };
  11081. });
  11082. var isBlock = function (node) {
  11083. if (typeof node === 'string') {
  11084. return !!blockElementsMap[node];
  11085. } else if (node) {
  11086. var type = node.nodeType;
  11087. if (type) {
  11088. return !!(type === 1 && blockElementsMap[node.nodeName]);
  11089. }
  11090. }
  11091. return false;
  11092. };
  11093. var get = function (elm) {
  11094. return elm && doc && isString$1(elm) ? doc.getElementById(elm) : elm;
  11095. };
  11096. var $$ = function (elm) {
  11097. return $(typeof elm === 'string' ? get(elm) : elm);
  11098. };
  11099. var getAttrib = function (elm, name, defaultVal) {
  11100. var hook, value;
  11101. var $elm = $$(elm);
  11102. if ($elm.length) {
  11103. hook = attrHooks[name];
  11104. if (hook && hook.get) {
  11105. value = hook.get($elm, name);
  11106. } else {
  11107. value = $elm.attr(name);
  11108. }
  11109. }
  11110. if (typeof value === 'undefined') {
  11111. value = defaultVal || '';
  11112. }
  11113. return value;
  11114. };
  11115. var getAttribs = function (elm) {
  11116. var node = get(elm);
  11117. if (!node) {
  11118. return [];
  11119. }
  11120. return node.attributes;
  11121. };
  11122. var setAttrib = function (elm, name, value) {
  11123. if (value === '') {
  11124. value = null;
  11125. }
  11126. var $elm = $$(elm);
  11127. var originalValue = $elm.attr(name);
  11128. if (!$elm.length) {
  11129. return;
  11130. }
  11131. var hook = attrHooks[name];
  11132. if (hook && hook.set) {
  11133. hook.set($elm, value, name);
  11134. } else {
  11135. $elm.attr(name, value);
  11136. }
  11137. if (originalValue !== value && settings.onSetAttrib) {
  11138. settings.onSetAttrib({
  11139. attrElm: $elm,
  11140. attrName: name,
  11141. attrValue: value
  11142. });
  11143. }
  11144. };
  11145. var clone = function (node, deep) {
  11146. if (!isIE || node.nodeType !== 1 || deep) {
  11147. return node.cloneNode(deep);
  11148. } else {
  11149. var clone_1 = doc.createElement(node.nodeName);
  11150. each$f(getAttribs(node), function (attr) {
  11151. setAttrib(clone_1, attr.nodeName, getAttrib(node, attr.nodeName));
  11152. });
  11153. return clone_1;
  11154. }
  11155. };
  11156. var getRoot = function () {
  11157. return settings.root_element || doc.body;
  11158. };
  11159. var getViewPort = function (argWin) {
  11160. var vp = getBounds(argWin);
  11161. return {
  11162. x: vp.x,
  11163. y: vp.y,
  11164. w: vp.width,
  11165. h: vp.height
  11166. };
  11167. };
  11168. var getPos$1 = function (elm, rootElm) {
  11169. return getPos(doc.body, get(elm), rootElm);
  11170. };
  11171. var setStyle = function (elm, name, value) {
  11172. var $elm = isString$1(name) ? $$(elm).css(name, value) : $$(elm).css(name);
  11173. if (settings.update_styles) {
  11174. updateInternalStyleAttr(styles, $elm);
  11175. }
  11176. };
  11177. var setStyles = function (elm, stylesArg) {
  11178. var $elm = $$(elm).css(stylesArg);
  11179. if (settings.update_styles) {
  11180. updateInternalStyleAttr(styles, $elm);
  11181. }
  11182. };
  11183. var getStyle = function (elm, name, computed) {
  11184. var $elm = $$(elm);
  11185. if (computed) {
  11186. return $elm.css(name);
  11187. }
  11188. name = name.replace(/-(\D)/g, function (a, b) {
  11189. return b.toUpperCase();
  11190. });
  11191. if (name === 'float') {
  11192. name = Env.browser.isIE() ? 'styleFloat' : 'cssFloat';
  11193. }
  11194. return $elm[0] && $elm[0].style ? $elm[0].style[name] : undefined;
  11195. };
  11196. var getSize = function (elm) {
  11197. var w, h;
  11198. elm = get(elm);
  11199. w = getStyle(elm, 'width');
  11200. h = getStyle(elm, 'height');
  11201. if (w.indexOf('px') === -1) {
  11202. w = 0;
  11203. }
  11204. if (h.indexOf('px') === -1) {
  11205. h = 0;
  11206. }
  11207. return {
  11208. w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
  11209. h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
  11210. };
  11211. };
  11212. var getRect = function (elm) {
  11213. elm = get(elm);
  11214. var pos = getPos$1(elm);
  11215. var size = getSize(elm);
  11216. return {
  11217. x: pos.x,
  11218. y: pos.y,
  11219. w: size.w,
  11220. h: size.h
  11221. };
  11222. };
  11223. var is = function (elm, selector) {
  11224. var i;
  11225. if (!elm) {
  11226. return false;
  11227. }
  11228. if (!Array.isArray(elm)) {
  11229. if (selector === '*') {
  11230. return elm.nodeType === 1;
  11231. }
  11232. if (simpleSelectorRe.test(selector)) {
  11233. var selectors = selector.toLowerCase().split(/,/);
  11234. var elmName = elm.nodeName.toLowerCase();
  11235. for (i = selectors.length - 1; i >= 0; i--) {
  11236. if (selectors[i] === elmName) {
  11237. return true;
  11238. }
  11239. }
  11240. return false;
  11241. }
  11242. if (elm.nodeType && elm.nodeType !== 1) {
  11243. return false;
  11244. }
  11245. }
  11246. var elms = !Array.isArray(elm) ? [elm] : elm;
  11247. return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
  11248. };
  11249. var getParents = function (elm, selector, root, collect) {
  11250. var result = [];
  11251. var selectorVal;
  11252. var node = get(elm);
  11253. collect = collect === undefined;
  11254. root = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null);
  11255. if (Tools.is(selector, 'string')) {
  11256. selectorVal = selector;
  11257. if (selector === '*') {
  11258. selector = function (node) {
  11259. return node.nodeType === 1;
  11260. };
  11261. } else {
  11262. selector = function (node) {
  11263. return is(node, selectorVal);
  11264. };
  11265. }
  11266. }
  11267. while (node) {
  11268. if (node === root || isNullable(node.nodeType) || isDocument$1(node) || isDocumentFragment(node)) {
  11269. break;
  11270. }
  11271. if (!selector || typeof selector === 'function' && selector(node)) {
  11272. if (collect) {
  11273. result.push(node);
  11274. } else {
  11275. return [node];
  11276. }
  11277. }
  11278. node = node.parentNode;
  11279. }
  11280. return collect ? result : null;
  11281. };
  11282. var getParent = function (node, selector, root) {
  11283. var parents = getParents(node, selector, root, false);
  11284. return parents && parents.length > 0 ? parents[0] : null;
  11285. };
  11286. var _findSib = function (node, selector, name) {
  11287. var func = selector;
  11288. if (node) {
  11289. if (typeof selector === 'string') {
  11290. func = function (node) {
  11291. return is(node, selector);
  11292. };
  11293. }
  11294. for (node = node[name]; node; node = node[name]) {
  11295. if (typeof func === 'function' && func(node)) {
  11296. return node;
  11297. }
  11298. }
  11299. }
  11300. return null;
  11301. };
  11302. var getNext = function (node, selector) {
  11303. return _findSib(node, selector, 'nextSibling');
  11304. };
  11305. var getPrev = function (node, selector) {
  11306. return _findSib(node, selector, 'previousSibling');
  11307. };
  11308. var select = function (selector, scope) {
  11309. return Sizzle(selector, get(scope) || settings.root_element || doc, []);
  11310. };
  11311. var run = function (elm, func, scope) {
  11312. var result;
  11313. var node = typeof elm === 'string' ? get(elm) : elm;
  11314. if (!node) {
  11315. return false;
  11316. }
  11317. if (Tools.isArray(node) && (node.length || node.length === 0)) {
  11318. result = [];
  11319. each$f(node, function (elm, i) {
  11320. if (elm) {
  11321. result.push(func.call(scope, typeof elm === 'string' ? get(elm) : elm, i));
  11322. }
  11323. });
  11324. return result;
  11325. }
  11326. var context = scope ? scope : this;
  11327. return func.call(context, node);
  11328. };
  11329. var setAttribs = function (elm, attrs) {
  11330. $$(elm).each(function (i, node) {
  11331. each$f(attrs, function (value, name) {
  11332. setAttrib(node, name, value);
  11333. });
  11334. });
  11335. };
  11336. var setHTML = function (elm, html) {
  11337. var $elm = $$(elm);
  11338. if (isIE) {
  11339. $elm.each(function (i, target) {
  11340. if (target.canHaveHTML === false) {
  11341. return;
  11342. }
  11343. while (target.firstChild) {
  11344. target.removeChild(target.firstChild);
  11345. }
  11346. try {
  11347. target.innerHTML = '<br>' + html;
  11348. target.removeChild(target.firstChild);
  11349. } catch (ex) {
  11350. DomQuery('<div></div>').html('<br>' + html).contents().slice(1).appendTo(target);
  11351. }
  11352. return html;
  11353. });
  11354. } else {
  11355. $elm.html(html);
  11356. }
  11357. };
  11358. var add = function (parentElm, name, attrs, html, create) {
  11359. return run(parentElm, function (parentElm) {
  11360. var newElm = typeof name === 'string' ? doc.createElement(name) : name;
  11361. setAttribs(newElm, attrs);
  11362. if (html) {
  11363. if (typeof html !== 'string' && html.nodeType) {
  11364. newElm.appendChild(html);
  11365. } else if (typeof html === 'string') {
  11366. setHTML(newElm, html);
  11367. }
  11368. }
  11369. return !create ? parentElm.appendChild(newElm) : newElm;
  11370. });
  11371. };
  11372. var create = function (name, attrs, html) {
  11373. return add(doc.createElement(name), name, attrs, html, true);
  11374. };
  11375. var decode = Entities.decode;
  11376. var encode = Entities.encodeAllRaw;
  11377. var createHTML = function (name, attrs, html) {
  11378. var outHtml = '', key;
  11379. outHtml += '<' + name;
  11380. for (key in attrs) {
  11381. if (hasNonNullableKey(attrs, key)) {
  11382. outHtml += ' ' + key + '="' + encode(attrs[key]) + '"';
  11383. }
  11384. }
  11385. if (typeof html !== 'undefined') {
  11386. return outHtml + '>' + html + '</' + name + '>';
  11387. }
  11388. return outHtml + ' />';
  11389. };
  11390. var createFragment = function (html) {
  11391. var node;
  11392. var container = doc.createElement('div');
  11393. var frag = doc.createDocumentFragment();
  11394. frag.appendChild(container);
  11395. if (html) {
  11396. container.innerHTML = html;
  11397. }
  11398. while (node = container.firstChild) {
  11399. frag.appendChild(node);
  11400. }
  11401. frag.removeChild(container);
  11402. return frag;
  11403. };
  11404. var remove = function (node, keepChildren) {
  11405. var $node = $$(node);
  11406. if (keepChildren) {
  11407. $node.each(function () {
  11408. var child;
  11409. while (child = this.firstChild) {
  11410. if (child.nodeType === 3 && child.data.length === 0) {
  11411. this.removeChild(child);
  11412. } else {
  11413. this.parentNode.insertBefore(child, this);
  11414. }
  11415. }
  11416. }).remove();
  11417. } else {
  11418. $node.remove();
  11419. }
  11420. return $node.length > 1 ? $node.toArray() : $node[0];
  11421. };
  11422. var removeAllAttribs = function (e) {
  11423. return run(e, function (e) {
  11424. var i;
  11425. var attrs = e.attributes;
  11426. for (i = attrs.length - 1; i >= 0; i--) {
  11427. e.removeAttributeNode(attrs.item(i));
  11428. }
  11429. });
  11430. };
  11431. var parseStyle = function (cssText) {
  11432. return styles.parse(cssText);
  11433. };
  11434. var serializeStyle = function (stylesArg, name) {
  11435. return styles.serialize(stylesArg, name);
  11436. };
  11437. var addStyle = function (cssText) {
  11438. var head, styleElm;
  11439. if (self !== DOMUtils.DOM && doc === document) {
  11440. if (addedStyles[cssText]) {
  11441. return;
  11442. }
  11443. addedStyles[cssText] = true;
  11444. }
  11445. styleElm = doc.getElementById('mceDefaultStyles');
  11446. if (!styleElm) {
  11447. styleElm = doc.createElement('style');
  11448. styleElm.id = 'mceDefaultStyles';
  11449. styleElm.type = 'text/css';
  11450. head = doc.getElementsByTagName('head')[0];
  11451. if (head.firstChild) {
  11452. head.insertBefore(styleElm, head.firstChild);
  11453. } else {
  11454. head.appendChild(styleElm);
  11455. }
  11456. }
  11457. if (styleElm.styleSheet) {
  11458. styleElm.styleSheet.cssText += cssText;
  11459. } else {
  11460. styleElm.appendChild(doc.createTextNode(cssText));
  11461. }
  11462. };
  11463. var loadCSS = function (urls) {
  11464. if (!urls) {
  11465. urls = '';
  11466. }
  11467. each$k(urls.split(','), function (url) {
  11468. files[url] = true;
  11469. styleSheetLoader.load(url, noop);
  11470. });
  11471. };
  11472. var toggleClass = function (elm, cls, state) {
  11473. $$(elm).toggleClass(cls, state).each(function () {
  11474. if (this.className === '') {
  11475. DomQuery(this).attr('class', null);
  11476. }
  11477. });
  11478. };
  11479. var addClass = function (elm, cls) {
  11480. $$(elm).addClass(cls);
  11481. };
  11482. var removeClass = function (elm, cls) {
  11483. toggleClass(elm, cls, false);
  11484. };
  11485. var hasClass = function (elm, cls) {
  11486. return $$(elm).hasClass(cls);
  11487. };
  11488. var show = function (elm) {
  11489. $$(elm).show();
  11490. };
  11491. var hide = function (elm) {
  11492. $$(elm).hide();
  11493. };
  11494. var isHidden = function (elm) {
  11495. return $$(elm).css('display') === 'none';
  11496. };
  11497. var uniqueId = function (prefix) {
  11498. return (!prefix ? 'mce_' : prefix) + counter++;
  11499. };
  11500. var getOuterHTML = function (elm) {
  11501. var node = typeof elm === 'string' ? get(elm) : elm;
  11502. return isElement$5(node) ? node.outerHTML : DomQuery('<div></div>').append(DomQuery(node).clone()).html();
  11503. };
  11504. var setOuterHTML = function (elm, html) {
  11505. $$(elm).each(function () {
  11506. try {
  11507. if ('outerHTML' in this) {
  11508. this.outerHTML = html;
  11509. return;
  11510. }
  11511. } catch (ex) {
  11512. }
  11513. remove(DomQuery(this).html(html), true);
  11514. });
  11515. };
  11516. var insertAfter = function (node, reference) {
  11517. var referenceNode = get(reference);
  11518. return run(node, function (node) {
  11519. var parent = referenceNode.parentNode;
  11520. var nextSibling = referenceNode.nextSibling;
  11521. if (nextSibling) {
  11522. parent.insertBefore(node, nextSibling);
  11523. } else {
  11524. parent.appendChild(node);
  11525. }
  11526. return node;
  11527. });
  11528. };
  11529. var replace = function (newElm, oldElm, keepChildren) {
  11530. return run(oldElm, function (oldElm) {
  11531. if (Tools.is(oldElm, 'array')) {
  11532. newElm = newElm.cloneNode(true);
  11533. }
  11534. if (keepChildren) {
  11535. each$f(grep$1(oldElm.childNodes), function (node) {
  11536. newElm.appendChild(node);
  11537. });
  11538. }
  11539. return oldElm.parentNode.replaceChild(newElm, oldElm);
  11540. });
  11541. };
  11542. var rename = function (elm, name) {
  11543. var newElm;
  11544. if (elm.nodeName !== name.toUpperCase()) {
  11545. newElm = create(name);
  11546. each$f(getAttribs(elm), function (attrNode) {
  11547. setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.nodeName));
  11548. });
  11549. replace(newElm, elm, true);
  11550. }
  11551. return newElm || elm;
  11552. };
  11553. var findCommonAncestor = function (a, b) {
  11554. var ps = a, pe;
  11555. while (ps) {
  11556. pe = b;
  11557. while (pe && ps !== pe) {
  11558. pe = pe.parentNode;
  11559. }
  11560. if (ps === pe) {
  11561. break;
  11562. }
  11563. ps = ps.parentNode;
  11564. }
  11565. if (!ps && a.ownerDocument) {
  11566. return a.ownerDocument.documentElement;
  11567. }
  11568. return ps;
  11569. };
  11570. var toHex = function (rgbVal) {
  11571. return styles.toHex(Tools.trim(rgbVal));
  11572. };
  11573. var isNonEmptyElement = function (node) {
  11574. if (isElement$5(node)) {
  11575. var isNamedAnchor = node.nodeName.toLowerCase() === 'a' && !getAttrib(node, 'href') && getAttrib(node, 'id');
  11576. if (getAttrib(node, 'name') || getAttrib(node, 'data-mce-bookmark') || isNamedAnchor) {
  11577. return true;
  11578. }
  11579. }
  11580. return false;
  11581. };
  11582. var isEmpty = function (node, elements) {
  11583. var type, name, brCount = 0;
  11584. if (isNonEmptyElement(node)) {
  11585. return false;
  11586. }
  11587. node = node.firstChild;
  11588. if (node) {
  11589. var walker = new DomTreeWalker(node, node.parentNode);
  11590. var whitespace = schema ? schema.getWhiteSpaceElements() : {};
  11591. elements = elements || (schema ? schema.getNonEmptyElements() : null);
  11592. do {
  11593. type = node.nodeType;
  11594. if (isElement$5(node)) {
  11595. var bogusVal = node.getAttribute('data-mce-bogus');
  11596. if (bogusVal) {
  11597. node = walker.next(bogusVal === 'all');
  11598. continue;
  11599. }
  11600. name = node.nodeName.toLowerCase();
  11601. if (elements && elements[name]) {
  11602. if (name === 'br') {
  11603. brCount++;
  11604. node = walker.next();
  11605. continue;
  11606. }
  11607. return false;
  11608. }
  11609. if (isNonEmptyElement(node)) {
  11610. return false;
  11611. }
  11612. }
  11613. if (type === 8) {
  11614. return false;
  11615. }
  11616. if (type === 3 && !isWhitespaceText(node.nodeValue)) {
  11617. return false;
  11618. }
  11619. if (type === 3 && node.parentNode && whitespace[node.parentNode.nodeName] && isWhitespaceText(node.nodeValue)) {
  11620. return false;
  11621. }
  11622. node = walker.next();
  11623. } while (node);
  11624. }
  11625. return brCount <= 1;
  11626. };
  11627. var createRng = function () {
  11628. return doc.createRange();
  11629. };
  11630. var split = function (parentElm, splitElm, replacementElm) {
  11631. var range = createRng();
  11632. var beforeFragment;
  11633. var afterFragment;
  11634. var parentNode;
  11635. if (parentElm && splitElm) {
  11636. range.setStart(parentElm.parentNode, findNodeIndex(parentElm));
  11637. range.setEnd(splitElm.parentNode, findNodeIndex(splitElm));
  11638. beforeFragment = range.extractContents();
  11639. range = createRng();
  11640. range.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1);
  11641. range.setEnd(parentElm.parentNode, findNodeIndex(parentElm) + 1);
  11642. afterFragment = range.extractContents();
  11643. parentNode = parentElm.parentNode;
  11644. parentNode.insertBefore(trimNode(self, beforeFragment), parentElm);
  11645. if (replacementElm) {
  11646. parentNode.insertBefore(replacementElm, parentElm);
  11647. } else {
  11648. parentNode.insertBefore(splitElm, parentElm);
  11649. }
  11650. parentNode.insertBefore(trimNode(self, afterFragment), parentElm);
  11651. remove(parentElm);
  11652. return replacementElm || splitElm;
  11653. }
  11654. };
  11655. var bind = function (target, name, func, scope) {
  11656. if (Tools.isArray(target)) {
  11657. var i = target.length;
  11658. var rv = [];
  11659. while (i--) {
  11660. rv[i] = bind(target[i], name, func, scope);
  11661. }
  11662. return rv;
  11663. }
  11664. if (settings.collect && (target === doc || target === win)) {
  11665. boundEvents.push([
  11666. target,
  11667. name,
  11668. func,
  11669. scope
  11670. ]);
  11671. }
  11672. var output = events.bind(target, name, func, scope || self);
  11673. return output;
  11674. };
  11675. var unbind = function (target, name, func) {
  11676. if (Tools.isArray(target)) {
  11677. var i = target.length;
  11678. var rv = [];
  11679. while (i--) {
  11680. rv[i] = unbind(target[i], name, func);
  11681. }
  11682. return rv;
  11683. } else {
  11684. if (boundEvents.length > 0 && (target === doc || target === win)) {
  11685. var i = boundEvents.length;
  11686. while (i--) {
  11687. var item = boundEvents[i];
  11688. if (target === item[0] && (!name || name === item[1]) && (!func || func === item[2])) {
  11689. events.unbind(item[0], item[1], item[2]);
  11690. }
  11691. }
  11692. }
  11693. return events.unbind(target, name, func);
  11694. }
  11695. };
  11696. var fire = function (target, name, evt) {
  11697. return events.fire(target, name, evt);
  11698. };
  11699. var getContentEditable = function (node) {
  11700. if (node && isElement$5(node)) {
  11701. var contentEditable = node.getAttribute('data-mce-contenteditable');
  11702. if (contentEditable && contentEditable !== 'inherit') {
  11703. return contentEditable;
  11704. }
  11705. return node.contentEditable !== 'inherit' ? node.contentEditable : null;
  11706. } else {
  11707. return null;
  11708. }
  11709. };
  11710. var getContentEditableParent = function (node) {
  11711. var root = getRoot();
  11712. var state = null;
  11713. for (; node && node !== root; node = node.parentNode) {
  11714. state = getContentEditable(node);
  11715. if (state !== null) {
  11716. break;
  11717. }
  11718. }
  11719. return state;
  11720. };
  11721. var destroy = function () {
  11722. if (boundEvents.length > 0) {
  11723. var i = boundEvents.length;
  11724. while (i--) {
  11725. var item = boundEvents[i];
  11726. events.unbind(item[0], item[1], item[2]);
  11727. }
  11728. }
  11729. each$j(files, function (_, url) {
  11730. styleSheetLoader.unload(url);
  11731. delete files[url];
  11732. });
  11733. if (Sizzle.setDocument) {
  11734. Sizzle.setDocument();
  11735. }
  11736. };
  11737. var isChildOf = function (node, parent) {
  11738. if (!isIE) {
  11739. return node === parent || parent.contains(node);
  11740. } else {
  11741. while (node) {
  11742. if (parent === node) {
  11743. return true;
  11744. }
  11745. node = node.parentNode;
  11746. }
  11747. return false;
  11748. }
  11749. };
  11750. var dumpRng = function (r) {
  11751. return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset;
  11752. };
  11753. var self = {
  11754. doc: doc,
  11755. settings: settings,
  11756. win: win,
  11757. files: files,
  11758. stdMode: stdMode,
  11759. boxModel: boxModel,
  11760. styleSheetLoader: styleSheetLoader,
  11761. boundEvents: boundEvents,
  11762. styles: styles,
  11763. schema: schema,
  11764. events: events,
  11765. isBlock: isBlock,
  11766. $: $,
  11767. $$: $$,
  11768. root: null,
  11769. clone: clone,
  11770. getRoot: getRoot,
  11771. getViewPort: getViewPort,
  11772. getRect: getRect,
  11773. getSize: getSize,
  11774. getParent: getParent,
  11775. getParents: getParents,
  11776. get: get,
  11777. getNext: getNext,
  11778. getPrev: getPrev,
  11779. select: select,
  11780. is: is,
  11781. add: add,
  11782. create: create,
  11783. createHTML: createHTML,
  11784. createFragment: createFragment,
  11785. remove: remove,
  11786. setStyle: setStyle,
  11787. getStyle: getStyle,
  11788. setStyles: setStyles,
  11789. removeAllAttribs: removeAllAttribs,
  11790. setAttrib: setAttrib,
  11791. setAttribs: setAttribs,
  11792. getAttrib: getAttrib,
  11793. getPos: getPos$1,
  11794. parseStyle: parseStyle,
  11795. serializeStyle: serializeStyle,
  11796. addStyle: addStyle,
  11797. loadCSS: loadCSS,
  11798. addClass: addClass,
  11799. removeClass: removeClass,
  11800. hasClass: hasClass,
  11801. toggleClass: toggleClass,
  11802. show: show,
  11803. hide: hide,
  11804. isHidden: isHidden,
  11805. uniqueId: uniqueId,
  11806. setHTML: setHTML,
  11807. getOuterHTML: getOuterHTML,
  11808. setOuterHTML: setOuterHTML,
  11809. decode: decode,
  11810. encode: encode,
  11811. insertAfter: insertAfter,
  11812. replace: replace,
  11813. rename: rename,
  11814. findCommonAncestor: findCommonAncestor,
  11815. toHex: toHex,
  11816. run: run,
  11817. getAttribs: getAttribs,
  11818. isEmpty: isEmpty,
  11819. createRng: createRng,
  11820. nodeIndex: findNodeIndex,
  11821. split: split,
  11822. bind: bind,
  11823. unbind: unbind,
  11824. fire: fire,
  11825. getContentEditable: getContentEditable,
  11826. getContentEditableParent: getContentEditableParent,
  11827. destroy: destroy,
  11828. isChildOf: isChildOf,
  11829. dumpRng: dumpRng
  11830. };
  11831. var attrHooks = setupAttrHooks(styles, settings, constant(self));
  11832. return self;
  11833. };
  11834. DOMUtils.DOM = DOMUtils(document);
  11835. DOMUtils.nodeIndex = findNodeIndex;
  11836. var DOM$a = DOMUtils.DOM;
  11837. var each$e = Tools.each, grep = Tools.grep;
  11838. var QUEUED = 0;
  11839. var LOADING = 1;
  11840. var LOADED = 2;
  11841. var FAILED = 3;
  11842. var ScriptLoader = function () {
  11843. function ScriptLoader(settings) {
  11844. if (settings === void 0) {
  11845. settings = {};
  11846. }
  11847. this.states = {};
  11848. this.queue = [];
  11849. this.scriptLoadedCallbacks = {};
  11850. this.queueLoadedCallbacks = [];
  11851. this.loading = 0;
  11852. this.settings = settings;
  11853. }
  11854. ScriptLoader.prototype._setReferrerPolicy = function (referrerPolicy) {
  11855. this.settings.referrerPolicy = referrerPolicy;
  11856. };
  11857. ScriptLoader.prototype.loadScript = function (url, success, failure) {
  11858. var dom = DOM$a;
  11859. var elm;
  11860. var cleanup = function () {
  11861. dom.remove(id);
  11862. if (elm) {
  11863. elm.onerror = elm.onload = elm = null;
  11864. }
  11865. };
  11866. var done = function () {
  11867. cleanup();
  11868. success();
  11869. };
  11870. var error = function () {
  11871. cleanup();
  11872. if (isFunction(failure)) {
  11873. failure();
  11874. } else {
  11875. if (typeof console !== 'undefined' && console.log) {
  11876. console.log('Failed to load script: ' + url);
  11877. }
  11878. }
  11879. };
  11880. var id = dom.uniqueId();
  11881. elm = document.createElement('script');
  11882. elm.id = id;
  11883. elm.type = 'text/javascript';
  11884. elm.src = Tools._addCacheSuffix(url);
  11885. if (this.settings.referrerPolicy) {
  11886. dom.setAttrib(elm, 'referrerpolicy', this.settings.referrerPolicy);
  11887. }
  11888. elm.onload = done;
  11889. elm.onerror = error;
  11890. (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
  11891. };
  11892. ScriptLoader.prototype.isDone = function (url) {
  11893. return this.states[url] === LOADED;
  11894. };
  11895. ScriptLoader.prototype.markDone = function (url) {
  11896. this.states[url] = LOADED;
  11897. };
  11898. ScriptLoader.prototype.add = function (url, success, scope, failure) {
  11899. var state = this.states[url];
  11900. this.queue.push(url);
  11901. if (state === undefined) {
  11902. this.states[url] = QUEUED;
  11903. }
  11904. if (success) {
  11905. if (!this.scriptLoadedCallbacks[url]) {
  11906. this.scriptLoadedCallbacks[url] = [];
  11907. }
  11908. this.scriptLoadedCallbacks[url].push({
  11909. success: success,
  11910. failure: failure,
  11911. scope: scope || this
  11912. });
  11913. }
  11914. };
  11915. ScriptLoader.prototype.load = function (url, success, scope, failure) {
  11916. return this.add(url, success, scope, failure);
  11917. };
  11918. ScriptLoader.prototype.remove = function (url) {
  11919. delete this.states[url];
  11920. delete this.scriptLoadedCallbacks[url];
  11921. };
  11922. ScriptLoader.prototype.loadQueue = function (success, scope, failure) {
  11923. this.loadScripts(this.queue, success, scope, failure);
  11924. };
  11925. ScriptLoader.prototype.loadScripts = function (scripts, success, scope, failure) {
  11926. var self = this;
  11927. var failures = [];
  11928. var execCallbacks = function (name, url) {
  11929. each$e(self.scriptLoadedCallbacks[url], function (callback) {
  11930. if (isFunction(callback[name])) {
  11931. callback[name].call(callback.scope);
  11932. }
  11933. });
  11934. self.scriptLoadedCallbacks[url] = undefined;
  11935. };
  11936. self.queueLoadedCallbacks.push({
  11937. success: success,
  11938. failure: failure,
  11939. scope: scope || this
  11940. });
  11941. var loadScripts = function () {
  11942. var loadingScripts = grep(scripts);
  11943. scripts.length = 0;
  11944. each$e(loadingScripts, function (url) {
  11945. if (self.states[url] === LOADED) {
  11946. execCallbacks('success', url);
  11947. return;
  11948. }
  11949. if (self.states[url] === FAILED) {
  11950. execCallbacks('failure', url);
  11951. return;
  11952. }
  11953. if (self.states[url] !== LOADING) {
  11954. self.states[url] = LOADING;
  11955. self.loading++;
  11956. self.loadScript(url, function () {
  11957. self.states[url] = LOADED;
  11958. self.loading--;
  11959. execCallbacks('success', url);
  11960. loadScripts();
  11961. }, function () {
  11962. self.states[url] = FAILED;
  11963. self.loading--;
  11964. failures.push(url);
  11965. execCallbacks('failure', url);
  11966. loadScripts();
  11967. });
  11968. }
  11969. });
  11970. if (!self.loading) {
  11971. var notifyCallbacks = self.queueLoadedCallbacks.slice(0);
  11972. self.queueLoadedCallbacks.length = 0;
  11973. each$e(notifyCallbacks, function (callback) {
  11974. if (failures.length === 0) {
  11975. if (isFunction(callback.success)) {
  11976. callback.success.call(callback.scope);
  11977. }
  11978. } else {
  11979. if (isFunction(callback.failure)) {
  11980. callback.failure.call(callback.scope, failures);
  11981. }
  11982. }
  11983. });
  11984. }
  11985. };
  11986. loadScripts();
  11987. };
  11988. ScriptLoader.ScriptLoader = new ScriptLoader();
  11989. return ScriptLoader;
  11990. }();
  11991. var Cell = function (initial) {
  11992. var value = initial;
  11993. var get = function () {
  11994. return value;
  11995. };
  11996. var set = function (v) {
  11997. value = v;
  11998. };
  11999. return {
  12000. get: get,
  12001. set: set
  12002. };
  12003. };
  12004. var isRaw = function (str) {
  12005. return isObject(str) && has$2(str, 'raw');
  12006. };
  12007. var isTokenised = function (str) {
  12008. return isArray$1(str) && str.length > 1;
  12009. };
  12010. var data = {};
  12011. var currentCode = Cell('en');
  12012. var getLanguageData = function () {
  12013. return get$9(data, currentCode.get());
  12014. };
  12015. var getData = function () {
  12016. return map$2(data, function (value) {
  12017. return __assign({}, value);
  12018. });
  12019. };
  12020. var setCode = function (newCode) {
  12021. if (newCode) {
  12022. currentCode.set(newCode);
  12023. }
  12024. };
  12025. var getCode = function () {
  12026. return currentCode.get();
  12027. };
  12028. var add$4 = function (code, items) {
  12029. var langData = data[code];
  12030. if (!langData) {
  12031. data[code] = langData = {};
  12032. }
  12033. each$j(items, function (translation, name) {
  12034. langData[name.toLowerCase()] = translation;
  12035. });
  12036. };
  12037. var translate = function (text) {
  12038. var langData = getLanguageData().getOr({});
  12039. var toString = function (obj) {
  12040. if (isFunction(obj)) {
  12041. return Object.prototype.toString.call(obj);
  12042. }
  12043. return !isEmpty(obj) ? '' + obj : '';
  12044. };
  12045. var isEmpty = function (text) {
  12046. return text === '' || text === null || text === undefined;
  12047. };
  12048. var getLangData = function (text) {
  12049. var textstr = toString(text);
  12050. return get$9(langData, textstr.toLowerCase()).map(toString).getOr(textstr);
  12051. };
  12052. var removeContext = function (str) {
  12053. return str.replace(/{context:\w+}$/, '');
  12054. };
  12055. if (isEmpty(text)) {
  12056. return '';
  12057. }
  12058. if (isRaw(text)) {
  12059. return toString(text.raw);
  12060. }
  12061. if (isTokenised(text)) {
  12062. var values_1 = text.slice(1);
  12063. var substitued = getLangData(text[0]).replace(/\{([0-9]+)\}/g, function ($1, $2) {
  12064. return has$2(values_1, $2) ? toString(values_1[$2]) : $1;
  12065. });
  12066. return removeContext(substitued);
  12067. }
  12068. return removeContext(getLangData(text));
  12069. };
  12070. var isRtl$1 = function () {
  12071. return getLanguageData().bind(function (items) {
  12072. return get$9(items, '_dir');
  12073. }).exists(function (dir) {
  12074. return dir === 'rtl';
  12075. });
  12076. };
  12077. var hasCode = function (code) {
  12078. return has$2(data, code);
  12079. };
  12080. var I18n = {
  12081. getData: getData,
  12082. setCode: setCode,
  12083. getCode: getCode,
  12084. add: add$4,
  12085. translate: translate,
  12086. isRtl: isRtl$1,
  12087. hasCode: hasCode
  12088. };
  12089. var AddOnManager = function () {
  12090. var items = [];
  12091. var urls = {};
  12092. var lookup = {};
  12093. var _listeners = [];
  12094. var runListeners = function (name, state) {
  12095. var matchedListeners = filter$4(_listeners, function (listener) {
  12096. return listener.name === name && listener.state === state;
  12097. });
  12098. each$k(matchedListeners, function (listener) {
  12099. return listener.callback();
  12100. });
  12101. };
  12102. var get = function (name) {
  12103. if (lookup[name]) {
  12104. return lookup[name].instance;
  12105. }
  12106. return undefined;
  12107. };
  12108. var dependencies = function (name) {
  12109. var result;
  12110. if (lookup[name]) {
  12111. result = lookup[name].dependencies;
  12112. }
  12113. return result || [];
  12114. };
  12115. var requireLangPack = function (name, languages) {
  12116. if (AddOnManager.languageLoad !== false) {
  12117. waitFor(name, function () {
  12118. var language = I18n.getCode();
  12119. var wrappedLanguages = ',' + (languages || '') + ',';
  12120. if (!language || languages && wrappedLanguages.indexOf(',' + language + ',') === -1) {
  12121. return;
  12122. }
  12123. ScriptLoader.ScriptLoader.add(urls[name] + '/langs/' + language + '.js');
  12124. }, 'loaded');
  12125. }
  12126. };
  12127. var add = function (id, addOn, dependencies) {
  12128. var addOnConstructor = addOn;
  12129. items.push(addOnConstructor);
  12130. lookup[id] = {
  12131. instance: addOnConstructor,
  12132. dependencies: dependencies
  12133. };
  12134. runListeners(id, 'added');
  12135. return addOnConstructor;
  12136. };
  12137. var remove = function (name) {
  12138. delete urls[name];
  12139. delete lookup[name];
  12140. };
  12141. var createUrl = function (baseUrl, dep) {
  12142. if (typeof dep === 'object') {
  12143. return dep;
  12144. }
  12145. return typeof baseUrl === 'string' ? {
  12146. prefix: '',
  12147. resource: dep,
  12148. suffix: ''
  12149. } : {
  12150. prefix: baseUrl.prefix,
  12151. resource: dep,
  12152. suffix: baseUrl.suffix
  12153. };
  12154. };
  12155. var addComponents = function (pluginName, scripts) {
  12156. var pluginUrl = urls[pluginName];
  12157. each$k(scripts, function (script) {
  12158. ScriptLoader.ScriptLoader.add(pluginUrl + '/' + script);
  12159. });
  12160. };
  12161. var loadDependencies = function (name, addOnUrl, success, scope) {
  12162. var deps = dependencies(name);
  12163. each$k(deps, function (dep) {
  12164. var newUrl = createUrl(addOnUrl, dep);
  12165. load(newUrl.resource, newUrl, undefined, undefined);
  12166. });
  12167. if (success) {
  12168. if (scope) {
  12169. success.call(scope);
  12170. } else {
  12171. success.call(ScriptLoader);
  12172. }
  12173. }
  12174. };
  12175. var load = function (name, addOnUrl, success, scope, failure) {
  12176. if (urls[name]) {
  12177. return;
  12178. }
  12179. var urlString = typeof addOnUrl === 'string' ? addOnUrl : addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
  12180. if (urlString.indexOf('/') !== 0 && urlString.indexOf('://') === -1) {
  12181. urlString = AddOnManager.baseURL + '/' + urlString;
  12182. }
  12183. urls[name] = urlString.substring(0, urlString.lastIndexOf('/'));
  12184. var done = function () {
  12185. runListeners(name, 'loaded');
  12186. loadDependencies(name, addOnUrl, success, scope);
  12187. };
  12188. if (lookup[name]) {
  12189. done();
  12190. } else {
  12191. ScriptLoader.ScriptLoader.add(urlString, done, scope, failure);
  12192. }
  12193. };
  12194. var waitFor = function (name, callback, state) {
  12195. if (state === void 0) {
  12196. state = 'added';
  12197. }
  12198. if (has$2(lookup, name) && state === 'added') {
  12199. callback();
  12200. } else if (has$2(urls, name) && state === 'loaded') {
  12201. callback();
  12202. } else {
  12203. _listeners.push({
  12204. name: name,
  12205. state: state,
  12206. callback: callback
  12207. });
  12208. }
  12209. };
  12210. return {
  12211. items: items,
  12212. urls: urls,
  12213. lookup: lookup,
  12214. _listeners: _listeners,
  12215. get: get,
  12216. dependencies: dependencies,
  12217. requireLangPack: requireLangPack,
  12218. add: add,
  12219. remove: remove,
  12220. createUrl: createUrl,
  12221. addComponents: addComponents,
  12222. load: load,
  12223. waitFor: waitFor
  12224. };
  12225. };
  12226. AddOnManager.languageLoad = true;
  12227. AddOnManager.baseURL = '';
  12228. AddOnManager.PluginManager = AddOnManager();
  12229. AddOnManager.ThemeManager = AddOnManager();
  12230. var singleton = function (doRevoke) {
  12231. var subject = Cell(Optional.none());
  12232. var revoke = function () {
  12233. return subject.get().each(doRevoke);
  12234. };
  12235. var clear = function () {
  12236. revoke();
  12237. subject.set(Optional.none());
  12238. };
  12239. var isSet = function () {
  12240. return subject.get().isSome();
  12241. };
  12242. var get = function () {
  12243. return subject.get();
  12244. };
  12245. var set = function (s) {
  12246. revoke();
  12247. subject.set(Optional.some(s));
  12248. };
  12249. return {
  12250. clear: clear,
  12251. isSet: isSet,
  12252. get: get,
  12253. set: set
  12254. };
  12255. };
  12256. var value = function () {
  12257. var subject = singleton(noop);
  12258. var on = function (f) {
  12259. return subject.get().each(f);
  12260. };
  12261. return __assign(__assign({}, subject), { on: on });
  12262. };
  12263. var first = function (fn, rate) {
  12264. var timer = null;
  12265. var cancel = function () {
  12266. if (!isNull(timer)) {
  12267. clearTimeout(timer);
  12268. timer = null;
  12269. }
  12270. };
  12271. var throttle = function () {
  12272. var args = [];
  12273. for (var _i = 0; _i < arguments.length; _i++) {
  12274. args[_i] = arguments[_i];
  12275. }
  12276. if (isNull(timer)) {
  12277. timer = setTimeout(function () {
  12278. timer = null;
  12279. fn.apply(null, args);
  12280. }, rate);
  12281. }
  12282. };
  12283. return {
  12284. cancel: cancel,
  12285. throttle: throttle
  12286. };
  12287. };
  12288. var last = function (fn, rate) {
  12289. var timer = null;
  12290. var cancel = function () {
  12291. if (!isNull(timer)) {
  12292. clearTimeout(timer);
  12293. timer = null;
  12294. }
  12295. };
  12296. var throttle = function () {
  12297. var args = [];
  12298. for (var _i = 0; _i < arguments.length; _i++) {
  12299. args[_i] = arguments[_i];
  12300. }
  12301. cancel();
  12302. timer = setTimeout(function () {
  12303. timer = null;
  12304. fn.apply(null, args);
  12305. }, rate);
  12306. };
  12307. return {
  12308. cancel: cancel,
  12309. throttle: throttle
  12310. };
  12311. };
  12312. var read$4 = function (element, attr) {
  12313. var value = get$6(element, attr);
  12314. return value === undefined || value === '' ? [] : value.split(' ');
  12315. };
  12316. var add$3 = function (element, attr, id) {
  12317. var old = read$4(element, attr);
  12318. var nu = old.concat([id]);
  12319. set$1(element, attr, nu.join(' '));
  12320. return true;
  12321. };
  12322. var remove$5 = function (element, attr, id) {
  12323. var nu = filter$4(read$4(element, attr), function (v) {
  12324. return v !== id;
  12325. });
  12326. if (nu.length > 0) {
  12327. set$1(element, attr, nu.join(' '));
  12328. } else {
  12329. remove$6(element, attr);
  12330. }
  12331. return false;
  12332. };
  12333. var supports = function (element) {
  12334. return element.dom.classList !== undefined;
  12335. };
  12336. var get$4 = function (element) {
  12337. return read$4(element, 'class');
  12338. };
  12339. var add$2 = function (element, clazz) {
  12340. return add$3(element, 'class', clazz);
  12341. };
  12342. var remove$4 = function (element, clazz) {
  12343. return remove$5(element, 'class', clazz);
  12344. };
  12345. var add$1 = function (element, clazz) {
  12346. if (supports(element)) {
  12347. element.dom.classList.add(clazz);
  12348. } else {
  12349. add$2(element, clazz);
  12350. }
  12351. };
  12352. var cleanClass = function (element) {
  12353. var classList = supports(element) ? element.dom.classList : get$4(element);
  12354. if (classList.length === 0) {
  12355. remove$6(element, 'class');
  12356. }
  12357. };
  12358. var remove$3 = function (element, clazz) {
  12359. if (supports(element)) {
  12360. var classList = element.dom.classList;
  12361. classList.remove(clazz);
  12362. } else {
  12363. remove$4(element, clazz);
  12364. }
  12365. cleanClass(element);
  12366. };
  12367. var has = function (element, clazz) {
  12368. return supports(element) && element.dom.classList.contains(clazz);
  12369. };
  12370. var descendants$1 = function (scope, predicate) {
  12371. var result = [];
  12372. each$k(children(scope), function (x) {
  12373. if (predicate(x)) {
  12374. result = result.concat([x]);
  12375. }
  12376. result = result.concat(descendants$1(x, predicate));
  12377. });
  12378. return result;
  12379. };
  12380. var descendants = function (scope, selector) {
  12381. return all(selector, scope);
  12382. };
  12383. var annotation = constant('mce-annotation');
  12384. var dataAnnotation = constant('data-mce-annotation');
  12385. var dataAnnotationId = constant('data-mce-annotation-uid');
  12386. var identify = function (editor, annotationName) {
  12387. var rng = editor.selection.getRng();
  12388. var start = SugarElement.fromDom(rng.startContainer);
  12389. var root = SugarElement.fromDom(editor.getBody());
  12390. var selector = annotationName.fold(function () {
  12391. return '.' + annotation();
  12392. }, function (an) {
  12393. return '[' + dataAnnotation() + '="' + an + '"]';
  12394. });
  12395. var newStart = child$1(start, rng.startOffset).getOr(start);
  12396. var closest = closest$2(newStart, selector, function (n) {
  12397. return eq(n, root);
  12398. });
  12399. var getAttr = function (c, property) {
  12400. if (has$1(c, property)) {
  12401. return Optional.some(get$6(c, property));
  12402. } else {
  12403. return Optional.none();
  12404. }
  12405. };
  12406. return closest.bind(function (c) {
  12407. return getAttr(c, '' + dataAnnotationId()).bind(function (uid) {
  12408. return getAttr(c, '' + dataAnnotation()).map(function (name) {
  12409. var elements = findMarkers(editor, uid);
  12410. return {
  12411. uid: uid,
  12412. name: name,
  12413. elements: elements
  12414. };
  12415. });
  12416. });
  12417. });
  12418. };
  12419. var isAnnotation = function (elem) {
  12420. return isElement$6(elem) && has(elem, annotation());
  12421. };
  12422. var findMarkers = function (editor, uid) {
  12423. var body = SugarElement.fromDom(editor.getBody());
  12424. return descendants(body, '[' + dataAnnotationId() + '="' + uid + '"]');
  12425. };
  12426. var findAll = function (editor, name) {
  12427. var body = SugarElement.fromDom(editor.getBody());
  12428. var markers = descendants(body, '[' + dataAnnotation() + '="' + name + '"]');
  12429. var directory = {};
  12430. each$k(markers, function (m) {
  12431. var uid = get$6(m, dataAnnotationId());
  12432. var nodesAlready = get$9(directory, uid).getOr([]);
  12433. directory[uid] = nodesAlready.concat([m]);
  12434. });
  12435. return directory;
  12436. };
  12437. var setup$n = function (editor, _registry) {
  12438. var changeCallbacks = Cell({});
  12439. var initData = function () {
  12440. return {
  12441. listeners: [],
  12442. previous: value()
  12443. };
  12444. };
  12445. var withCallbacks = function (name, f) {
  12446. updateCallbacks(name, function (data) {
  12447. f(data);
  12448. return data;
  12449. });
  12450. };
  12451. var updateCallbacks = function (name, f) {
  12452. var callbackMap = changeCallbacks.get();
  12453. var data = get$9(callbackMap, name).getOrThunk(initData);
  12454. var outputData = f(data);
  12455. callbackMap[name] = outputData;
  12456. changeCallbacks.set(callbackMap);
  12457. };
  12458. var fireCallbacks = function (name, uid, elements) {
  12459. withCallbacks(name, function (data) {
  12460. each$k(data.listeners, function (f) {
  12461. return f(true, name, {
  12462. uid: uid,
  12463. nodes: map$3(elements, function (elem) {
  12464. return elem.dom;
  12465. })
  12466. });
  12467. });
  12468. });
  12469. };
  12470. var fireNoAnnotation = function (name) {
  12471. withCallbacks(name, function (data) {
  12472. each$k(data.listeners, function (f) {
  12473. return f(false, name);
  12474. });
  12475. });
  12476. };
  12477. var onNodeChange = last(function () {
  12478. var callbackMap = changeCallbacks.get();
  12479. var annotations = sort(keys(callbackMap));
  12480. each$k(annotations, function (name) {
  12481. updateCallbacks(name, function (data) {
  12482. var prev = data.previous.get();
  12483. identify(editor, Optional.some(name)).fold(function () {
  12484. if (prev.isSome()) {
  12485. fireNoAnnotation(name);
  12486. data.previous.clear();
  12487. }
  12488. }, function (_a) {
  12489. var uid = _a.uid, name = _a.name, elements = _a.elements;
  12490. if (!is$1(prev, uid)) {
  12491. fireCallbacks(name, uid, elements);
  12492. data.previous.set(uid);
  12493. }
  12494. });
  12495. return {
  12496. previous: data.previous,
  12497. listeners: data.listeners
  12498. };
  12499. });
  12500. });
  12501. }, 30);
  12502. editor.on('remove', function () {
  12503. onNodeChange.cancel();
  12504. });
  12505. editor.on('NodeChange', function () {
  12506. onNodeChange.throttle();
  12507. });
  12508. var addListener = function (name, f) {
  12509. updateCallbacks(name, function (data) {
  12510. return {
  12511. previous: data.previous,
  12512. listeners: data.listeners.concat([f])
  12513. };
  12514. });
  12515. };
  12516. return { addListener: addListener };
  12517. };
  12518. var setup$m = function (editor, registry) {
  12519. var identifyParserNode = function (span) {
  12520. return Optional.from(span.attr(dataAnnotation())).bind(registry.lookup);
  12521. };
  12522. editor.on('init', function () {
  12523. editor.serializer.addNodeFilter('span', function (spans) {
  12524. each$k(spans, function (span) {
  12525. identifyParserNode(span).each(function (settings) {
  12526. if (settings.persistent === false) {
  12527. span.unwrap();
  12528. }
  12529. });
  12530. });
  12531. });
  12532. });
  12533. };
  12534. var create$7 = function () {
  12535. var annotations = {};
  12536. var register = function (name, settings) {
  12537. annotations[name] = {
  12538. name: name,
  12539. settings: settings
  12540. };
  12541. };
  12542. var lookup = function (name) {
  12543. return get$9(annotations, name).map(function (a) {
  12544. return a.settings;
  12545. });
  12546. };
  12547. return {
  12548. register: register,
  12549. lookup: lookup
  12550. };
  12551. };
  12552. var unique = 0;
  12553. var generate = function (prefix) {
  12554. var date = new Date();
  12555. var time = date.getTime();
  12556. var random = Math.floor(Math.random() * 1000000000);
  12557. unique++;
  12558. return prefix + '_' + random + unique + String(time);
  12559. };
  12560. var add = function (element, classes) {
  12561. each$k(classes, function (x) {
  12562. add$1(element, x);
  12563. });
  12564. };
  12565. var fromHtml = function (html, scope) {
  12566. var doc = scope || document;
  12567. var div = doc.createElement('div');
  12568. div.innerHTML = html;
  12569. return children(SugarElement.fromDom(div));
  12570. };
  12571. var fromDom$1 = function (nodes) {
  12572. return map$3(nodes, SugarElement.fromDom);
  12573. };
  12574. var get$3 = function (element) {
  12575. return element.dom.innerHTML;
  12576. };
  12577. var set = function (element, content) {
  12578. var owner = owner$1(element);
  12579. var docDom = owner.dom;
  12580. var fragment = SugarElement.fromDom(docDom.createDocumentFragment());
  12581. var contentElements = fromHtml(content, docDom);
  12582. append(fragment, contentElements);
  12583. empty(element);
  12584. append$1(element, fragment);
  12585. };
  12586. var clone$1 = function (original, isDeep) {
  12587. return SugarElement.fromDom(original.dom.cloneNode(isDeep));
  12588. };
  12589. var shallow = function (original) {
  12590. return clone$1(original, false);
  12591. };
  12592. var deep$1 = function (original) {
  12593. return clone$1(original, true);
  12594. };
  12595. var TextWalker = function (startNode, rootNode, isBoundary) {
  12596. if (isBoundary === void 0) {
  12597. isBoundary = never;
  12598. }
  12599. var walker = new DomTreeWalker(startNode, rootNode);
  12600. var walk = function (direction) {
  12601. var next;
  12602. do {
  12603. next = walker[direction]();
  12604. } while (next && !isText$7(next) && !isBoundary(next));
  12605. return Optional.from(next).filter(isText$7);
  12606. };
  12607. return {
  12608. current: function () {
  12609. return Optional.from(walker.current()).filter(isText$7);
  12610. },
  12611. next: function () {
  12612. return walk('next');
  12613. },
  12614. prev: function () {
  12615. return walk('prev');
  12616. },
  12617. prev2: function () {
  12618. return walk('prev2');
  12619. }
  12620. };
  12621. };
  12622. var TextSeeker = function (dom, isBoundary) {
  12623. var isBlockBoundary = isBoundary ? isBoundary : function (node) {
  12624. return dom.isBlock(node) || isBr$5(node) || isContentEditableFalse$b(node);
  12625. };
  12626. var walk = function (node, offset, walker, process) {
  12627. if (isText$7(node)) {
  12628. var newOffset = process(node, offset, node.data);
  12629. if (newOffset !== -1) {
  12630. return Optional.some({
  12631. container: node,
  12632. offset: newOffset
  12633. });
  12634. }
  12635. }
  12636. return walker().bind(function (next) {
  12637. return walk(next.container, next.offset, walker, process);
  12638. });
  12639. };
  12640. var backwards = function (node, offset, process, root) {
  12641. var walker = TextWalker(node, root, isBlockBoundary);
  12642. return walk(node, offset, function () {
  12643. return walker.prev().map(function (prev) {
  12644. return {
  12645. container: prev,
  12646. offset: prev.length
  12647. };
  12648. });
  12649. }, process).getOrNull();
  12650. };
  12651. var forwards = function (node, offset, process, root) {
  12652. var walker = TextWalker(node, root, isBlockBoundary);
  12653. return walk(node, offset, function () {
  12654. return walker.next().map(function (next) {
  12655. return {
  12656. container: next,
  12657. offset: 0
  12658. };
  12659. });
  12660. }, process).getOrNull();
  12661. };
  12662. return {
  12663. backwards: backwards,
  12664. forwards: forwards
  12665. };
  12666. };
  12667. var round$2 = Math.round;
  12668. var clone = function (rect) {
  12669. if (!rect) {
  12670. return {
  12671. left: 0,
  12672. top: 0,
  12673. bottom: 0,
  12674. right: 0,
  12675. width: 0,
  12676. height: 0
  12677. };
  12678. }
  12679. return {
  12680. left: round$2(rect.left),
  12681. top: round$2(rect.top),
  12682. bottom: round$2(rect.bottom),
  12683. right: round$2(rect.right),
  12684. width: round$2(rect.width),
  12685. height: round$2(rect.height)
  12686. };
  12687. };
  12688. var collapse = function (rect, toStart) {
  12689. rect = clone(rect);
  12690. if (toStart) {
  12691. rect.right = rect.left;
  12692. } else {
  12693. rect.left = rect.left + rect.width;
  12694. rect.right = rect.left;
  12695. }
  12696. rect.width = 0;
  12697. return rect;
  12698. };
  12699. var isEqual = function (rect1, rect2) {
  12700. return rect1.left === rect2.left && rect1.top === rect2.top && rect1.bottom === rect2.bottom && rect1.right === rect2.right;
  12701. };
  12702. var isValidOverflow = function (overflowY, rect1, rect2) {
  12703. return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
  12704. };
  12705. var isAbove$1 = function (rect1, rect2) {
  12706. var halfHeight = Math.min(rect2.height / 2, rect1.height / 2);
  12707. if (rect1.bottom - halfHeight < rect2.top) {
  12708. return true;
  12709. }
  12710. if (rect1.top > rect2.bottom) {
  12711. return false;
  12712. }
  12713. return isValidOverflow(rect2.top - rect1.bottom, rect1, rect2);
  12714. };
  12715. var isBelow$1 = function (rect1, rect2) {
  12716. if (rect1.top > rect2.bottom) {
  12717. return true;
  12718. }
  12719. if (rect1.bottom < rect2.top) {
  12720. return false;
  12721. }
  12722. return isValidOverflow(rect2.bottom - rect1.top, rect1, rect2);
  12723. };
  12724. var containsXY = function (rect, clientX, clientY) {
  12725. return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
  12726. };
  12727. var clamp$2 = function (value, min, max) {
  12728. return Math.min(Math.max(value, min), max);
  12729. };
  12730. var getSelectedNode = function (range) {
  12731. var startContainer = range.startContainer, startOffset = range.startOffset;
  12732. if (startContainer.hasChildNodes() && range.endOffset === startOffset + 1) {
  12733. return startContainer.childNodes[startOffset];
  12734. }
  12735. return null;
  12736. };
  12737. var getNode$1 = function (container, offset) {
  12738. if (isElement$5(container) && container.hasChildNodes()) {
  12739. var childNodes = container.childNodes;
  12740. var safeOffset = clamp$2(offset, 0, childNodes.length - 1);
  12741. return childNodes[safeOffset];
  12742. } else {
  12743. return container;
  12744. }
  12745. };
  12746. var getNodeUnsafe = function (container, offset) {
  12747. if (offset < 0 && isElement$5(container) && container.hasChildNodes()) {
  12748. return undefined;
  12749. } else {
  12750. return getNode$1(container, offset);
  12751. }
  12752. };
  12753. var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\uA670-\uA672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]');
  12754. var isExtendingChar = function (ch) {
  12755. return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch);
  12756. };
  12757. var or = function () {
  12758. var args = [];
  12759. for (var _i = 0; _i < arguments.length; _i++) {
  12760. args[_i] = arguments[_i];
  12761. }
  12762. return function (x) {
  12763. for (var i = 0; i < args.length; i++) {
  12764. if (args[i](x)) {
  12765. return true;
  12766. }
  12767. }
  12768. return false;
  12769. };
  12770. };
  12771. var and = function () {
  12772. var args = [];
  12773. for (var _i = 0; _i < arguments.length; _i++) {
  12774. args[_i] = arguments[_i];
  12775. }
  12776. return function (x) {
  12777. for (var i = 0; i < args.length; i++) {
  12778. if (!args[i](x)) {
  12779. return false;
  12780. }
  12781. }
  12782. return true;
  12783. };
  12784. };
  12785. var isElement$3 = isElement$5;
  12786. var isCaretCandidate$2 = isCaretCandidate$3;
  12787. var isBlock$1 = matchStyleValues('display', 'block table');
  12788. var isFloated = matchStyleValues('float', 'left right');
  12789. var isValidElementCaretCandidate = and(isElement$3, isCaretCandidate$2, not(isFloated));
  12790. var isNotPre = not(matchStyleValues('white-space', 'pre pre-line pre-wrap'));
  12791. var isText$4 = isText$7;
  12792. var isBr$2 = isBr$5;
  12793. var nodeIndex$1 = DOMUtils.nodeIndex;
  12794. var resolveIndex$1 = getNodeUnsafe;
  12795. var createRange$1 = function (doc) {
  12796. return 'createRange' in doc ? doc.createRange() : DOMUtils.DOM.createRng();
  12797. };
  12798. var isWhiteSpace$1 = function (chr) {
  12799. return chr && /[\r\n\t ]/.test(chr);
  12800. };
  12801. var isRange = function (rng) {
  12802. return !!rng.setStart && !!rng.setEnd;
  12803. };
  12804. var isHiddenWhiteSpaceRange = function (range) {
  12805. var container = range.startContainer;
  12806. var offset = range.startOffset;
  12807. if (isWhiteSpace$1(range.toString()) && isNotPre(container.parentNode) && isText$7(container)) {
  12808. var text = container.data;
  12809. if (isWhiteSpace$1(text[offset - 1]) || isWhiteSpace$1(text[offset + 1])) {
  12810. return true;
  12811. }
  12812. }
  12813. return false;
  12814. };
  12815. var getBrClientRect = function (brNode) {
  12816. var doc = brNode.ownerDocument;
  12817. var rng = createRange$1(doc);
  12818. var nbsp$1 = doc.createTextNode(nbsp);
  12819. var parentNode = brNode.parentNode;
  12820. parentNode.insertBefore(nbsp$1, brNode);
  12821. rng.setStart(nbsp$1, 0);
  12822. rng.setEnd(nbsp$1, 1);
  12823. var clientRect = clone(rng.getBoundingClientRect());
  12824. parentNode.removeChild(nbsp$1);
  12825. return clientRect;
  12826. };
  12827. var getBoundingClientRectWebKitText = function (rng) {
  12828. var sc = rng.startContainer;
  12829. var ec = rng.endContainer;
  12830. var so = rng.startOffset;
  12831. var eo = rng.endOffset;
  12832. if (sc === ec && isText$7(ec) && so === 0 && eo === 1) {
  12833. var newRng = rng.cloneRange();
  12834. newRng.setEndAfter(ec);
  12835. return getBoundingClientRect$1(newRng);
  12836. } else {
  12837. return null;
  12838. }
  12839. };
  12840. var isZeroRect = function (r) {
  12841. return r.left === 0 && r.right === 0 && r.top === 0 && r.bottom === 0;
  12842. };
  12843. var getBoundingClientRect$1 = function (item) {
  12844. var clientRect;
  12845. var clientRects = item.getClientRects();
  12846. if (clientRects.length > 0) {
  12847. clientRect = clone(clientRects[0]);
  12848. } else {
  12849. clientRect = clone(item.getBoundingClientRect());
  12850. }
  12851. if (!isRange(item) && isBr$2(item) && isZeroRect(clientRect)) {
  12852. return getBrClientRect(item);
  12853. }
  12854. if (isZeroRect(clientRect) && isRange(item)) {
  12855. return getBoundingClientRectWebKitText(item);
  12856. }
  12857. return clientRect;
  12858. };
  12859. var collapseAndInflateWidth = function (clientRect, toStart) {
  12860. var newClientRect = collapse(clientRect, toStart);
  12861. newClientRect.width = 1;
  12862. newClientRect.right = newClientRect.left + 1;
  12863. return newClientRect;
  12864. };
  12865. var getCaretPositionClientRects = function (caretPosition) {
  12866. var clientRects = [];
  12867. var addUniqueAndValidRect = function (clientRect) {
  12868. if (clientRect.height === 0) {
  12869. return;
  12870. }
  12871. if (clientRects.length > 0) {
  12872. if (isEqual(clientRect, clientRects[clientRects.length - 1])) {
  12873. return;
  12874. }
  12875. }
  12876. clientRects.push(clientRect);
  12877. };
  12878. var addCharacterOffset = function (container, offset) {
  12879. var range = createRange$1(container.ownerDocument);
  12880. if (offset < container.data.length) {
  12881. if (isExtendingChar(container.data[offset])) {
  12882. return clientRects;
  12883. }
  12884. if (isExtendingChar(container.data[offset - 1])) {
  12885. range.setStart(container, offset);
  12886. range.setEnd(container, offset + 1);
  12887. if (!isHiddenWhiteSpaceRange(range)) {
  12888. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), false));
  12889. return clientRects;
  12890. }
  12891. }
  12892. }
  12893. if (offset > 0) {
  12894. range.setStart(container, offset - 1);
  12895. range.setEnd(container, offset);
  12896. if (!isHiddenWhiteSpaceRange(range)) {
  12897. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), false));
  12898. }
  12899. }
  12900. if (offset < container.data.length) {
  12901. range.setStart(container, offset);
  12902. range.setEnd(container, offset + 1);
  12903. if (!isHiddenWhiteSpaceRange(range)) {
  12904. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(range), true));
  12905. }
  12906. }
  12907. };
  12908. var container = caretPosition.container();
  12909. var offset = caretPosition.offset();
  12910. if (isText$4(container)) {
  12911. addCharacterOffset(container, offset);
  12912. return clientRects;
  12913. }
  12914. if (isElement$3(container)) {
  12915. if (caretPosition.isAtEnd()) {
  12916. var node = resolveIndex$1(container, offset);
  12917. if (isText$4(node)) {
  12918. addCharacterOffset(node, node.data.length);
  12919. }
  12920. if (isValidElementCaretCandidate(node) && !isBr$2(node)) {
  12921. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), false));
  12922. }
  12923. } else {
  12924. var node = resolveIndex$1(container, offset);
  12925. if (isText$4(node)) {
  12926. addCharacterOffset(node, 0);
  12927. }
  12928. if (isValidElementCaretCandidate(node) && caretPosition.isAtEnd()) {
  12929. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), false));
  12930. return clientRects;
  12931. }
  12932. var beforeNode = resolveIndex$1(caretPosition.container(), caretPosition.offset() - 1);
  12933. if (isValidElementCaretCandidate(beforeNode) && !isBr$2(beforeNode)) {
  12934. if (isBlock$1(beforeNode) || isBlock$1(node) || !isValidElementCaretCandidate(node)) {
  12935. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(beforeNode), false));
  12936. }
  12937. }
  12938. if (isValidElementCaretCandidate(node)) {
  12939. addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect$1(node), true));
  12940. }
  12941. }
  12942. }
  12943. return clientRects;
  12944. };
  12945. var CaretPosition = function (container, offset, clientRects) {
  12946. var isAtStart = function () {
  12947. if (isText$4(container)) {
  12948. return offset === 0;
  12949. }
  12950. return offset === 0;
  12951. };
  12952. var isAtEnd = function () {
  12953. if (isText$4(container)) {
  12954. return offset >= container.data.length;
  12955. }
  12956. return offset >= container.childNodes.length;
  12957. };
  12958. var toRange = function () {
  12959. var range = createRange$1(container.ownerDocument);
  12960. range.setStart(container, offset);
  12961. range.setEnd(container, offset);
  12962. return range;
  12963. };
  12964. var getClientRects = function () {
  12965. if (!clientRects) {
  12966. clientRects = getCaretPositionClientRects(CaretPosition(container, offset));
  12967. }
  12968. return clientRects;
  12969. };
  12970. var isVisible = function () {
  12971. return getClientRects().length > 0;
  12972. };
  12973. var isEqual = function (caretPosition) {
  12974. return caretPosition && container === caretPosition.container() && offset === caretPosition.offset();
  12975. };
  12976. var getNode = function (before) {
  12977. return resolveIndex$1(container, before ? offset - 1 : offset);
  12978. };
  12979. return {
  12980. container: constant(container),
  12981. offset: constant(offset),
  12982. toRange: toRange,
  12983. getClientRects: getClientRects,
  12984. isVisible: isVisible,
  12985. isAtStart: isAtStart,
  12986. isAtEnd: isAtEnd,
  12987. isEqual: isEqual,
  12988. getNode: getNode
  12989. };
  12990. };
  12991. CaretPosition.fromRangeStart = function (range) {
  12992. return CaretPosition(range.startContainer, range.startOffset);
  12993. };
  12994. CaretPosition.fromRangeEnd = function (range) {
  12995. return CaretPosition(range.endContainer, range.endOffset);
  12996. };
  12997. CaretPosition.after = function (node) {
  12998. return CaretPosition(node.parentNode, nodeIndex$1(node) + 1);
  12999. };
  13000. CaretPosition.before = function (node) {
  13001. return CaretPosition(node.parentNode, nodeIndex$1(node));
  13002. };
  13003. CaretPosition.isAbove = function (pos1, pos2) {
  13004. return lift2(head(pos2.getClientRects()), last$2(pos1.getClientRects()), isAbove$1).getOr(false);
  13005. };
  13006. CaretPosition.isBelow = function (pos1, pos2) {
  13007. return lift2(last$2(pos2.getClientRects()), head(pos1.getClientRects()), isBelow$1).getOr(false);
  13008. };
  13009. CaretPosition.isAtStart = function (pos) {
  13010. return pos ? pos.isAtStart() : false;
  13011. };
  13012. CaretPosition.isAtEnd = function (pos) {
  13013. return pos ? pos.isAtEnd() : false;
  13014. };
  13015. CaretPosition.isTextPosition = function (pos) {
  13016. return pos ? isText$7(pos.container()) : false;
  13017. };
  13018. CaretPosition.isElementPosition = function (pos) {
  13019. return CaretPosition.isTextPosition(pos) === false;
  13020. };
  13021. var trimEmptyTextNode$1 = function (dom, node) {
  13022. if (isText$7(node) && node.data.length === 0) {
  13023. dom.remove(node);
  13024. }
  13025. };
  13026. var insertNode = function (dom, rng, node) {
  13027. rng.insertNode(node);
  13028. trimEmptyTextNode$1(dom, node.previousSibling);
  13029. trimEmptyTextNode$1(dom, node.nextSibling);
  13030. };
  13031. var insertFragment = function (dom, rng, frag) {
  13032. var firstChild = Optional.from(frag.firstChild);
  13033. var lastChild = Optional.from(frag.lastChild);
  13034. rng.insertNode(frag);
  13035. firstChild.each(function (child) {
  13036. return trimEmptyTextNode$1(dom, child.previousSibling);
  13037. });
  13038. lastChild.each(function (child) {
  13039. return trimEmptyTextNode$1(dom, child.nextSibling);
  13040. });
  13041. };
  13042. var rangeInsertNode = function (dom, rng, node) {
  13043. if (isDocumentFragment(node)) {
  13044. insertFragment(dom, rng, node);
  13045. } else {
  13046. insertNode(dom, rng, node);
  13047. }
  13048. };
  13049. var isText$3 = isText$7;
  13050. var isBogus = isBogus$2;
  13051. var nodeIndex = DOMUtils.nodeIndex;
  13052. var normalizedParent = function (node) {
  13053. var parentNode = node.parentNode;
  13054. if (isBogus(parentNode)) {
  13055. return normalizedParent(parentNode);
  13056. }
  13057. return parentNode;
  13058. };
  13059. var getChildNodes = function (node) {
  13060. if (!node) {
  13061. return [];
  13062. }
  13063. return reduce(node.childNodes, function (result, node) {
  13064. if (isBogus(node) && node.nodeName !== 'BR') {
  13065. result = result.concat(getChildNodes(node));
  13066. } else {
  13067. result.push(node);
  13068. }
  13069. return result;
  13070. }, []);
  13071. };
  13072. var normalizedTextOffset = function (node, offset) {
  13073. while (node = node.previousSibling) {
  13074. if (!isText$3(node)) {
  13075. break;
  13076. }
  13077. offset += node.data.length;
  13078. }
  13079. return offset;
  13080. };
  13081. var equal = function (a) {
  13082. return function (b) {
  13083. return a === b;
  13084. };
  13085. };
  13086. var normalizedNodeIndex = function (node) {
  13087. var nodes, index;
  13088. nodes = getChildNodes(normalizedParent(node));
  13089. index = findIndex$1(nodes, equal(node), node);
  13090. nodes = nodes.slice(0, index + 1);
  13091. var numTextFragments = reduce(nodes, function (result, node, i) {
  13092. if (isText$3(node) && isText$3(nodes[i - 1])) {
  13093. result++;
  13094. }
  13095. return result;
  13096. }, 0);
  13097. nodes = filter$2(nodes, matchNodeNames([node.nodeName]));
  13098. index = findIndex$1(nodes, equal(node), node);
  13099. return index - numTextFragments;
  13100. };
  13101. var createPathItem = function (node) {
  13102. var name;
  13103. if (isText$3(node)) {
  13104. name = 'text()';
  13105. } else {
  13106. name = node.nodeName.toLowerCase();
  13107. }
  13108. return name + '[' + normalizedNodeIndex(node) + ']';
  13109. };
  13110. var parentsUntil$1 = function (root, node, predicate) {
  13111. var parents = [];
  13112. for (node = node.parentNode; node !== root; node = node.parentNode) {
  13113. if (predicate && predicate(node)) {
  13114. break;
  13115. }
  13116. parents.push(node);
  13117. }
  13118. return parents;
  13119. };
  13120. var create$6 = function (root, caretPosition) {
  13121. var container, offset, path = [], outputOffset, childNodes, parents;
  13122. container = caretPosition.container();
  13123. offset = caretPosition.offset();
  13124. if (isText$3(container)) {
  13125. outputOffset = normalizedTextOffset(container, offset);
  13126. } else {
  13127. childNodes = container.childNodes;
  13128. if (offset >= childNodes.length) {
  13129. outputOffset = 'after';
  13130. offset = childNodes.length - 1;
  13131. } else {
  13132. outputOffset = 'before';
  13133. }
  13134. container = childNodes[offset];
  13135. }
  13136. path.push(createPathItem(container));
  13137. parents = parentsUntil$1(root, container);
  13138. parents = filter$2(parents, not(isBogus$2));
  13139. path = path.concat(map$1(parents, function (node) {
  13140. return createPathItem(node);
  13141. }));
  13142. return path.reverse().join('/') + ',' + outputOffset;
  13143. };
  13144. var resolvePathItem = function (node, name, index) {
  13145. var nodes = getChildNodes(node);
  13146. nodes = filter$2(nodes, function (node, index) {
  13147. return !isText$3(node) || !isText$3(nodes[index - 1]);
  13148. });
  13149. nodes = filter$2(nodes, matchNodeNames([name]));
  13150. return nodes[index];
  13151. };
  13152. var findTextPosition = function (container, offset) {
  13153. var node = container, targetOffset = 0, dataLen;
  13154. while (isText$3(node)) {
  13155. dataLen = node.data.length;
  13156. if (offset >= targetOffset && offset <= targetOffset + dataLen) {
  13157. container = node;
  13158. offset = offset - targetOffset;
  13159. break;
  13160. }
  13161. if (!isText$3(node.nextSibling)) {
  13162. container = node;
  13163. offset = dataLen;
  13164. break;
  13165. }
  13166. targetOffset += dataLen;
  13167. node = node.nextSibling;
  13168. }
  13169. if (isText$3(container) && offset > container.data.length) {
  13170. offset = container.data.length;
  13171. }
  13172. return CaretPosition(container, offset);
  13173. };
  13174. var resolve$2 = function (root, path) {
  13175. var offset;
  13176. if (!path) {
  13177. return null;
  13178. }
  13179. var parts = path.split(',');
  13180. var paths = parts[0].split('/');
  13181. offset = parts.length > 1 ? parts[1] : 'before';
  13182. var container = reduce(paths, function (result, value) {
  13183. var match = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(value);
  13184. if (!match) {
  13185. return null;
  13186. }
  13187. if (match[1] === 'text()') {
  13188. match[1] = '#text';
  13189. }
  13190. return resolvePathItem(result, match[1], parseInt(match[2], 10));
  13191. }, root);
  13192. if (!container) {
  13193. return null;
  13194. }
  13195. if (!isText$3(container)) {
  13196. if (offset === 'after') {
  13197. offset = nodeIndex(container) + 1;
  13198. } else {
  13199. offset = nodeIndex(container);
  13200. }
  13201. return CaretPosition(container.parentNode, offset);
  13202. }
  13203. return findTextPosition(container, parseInt(offset, 10));
  13204. };
  13205. var isContentEditableFalse$9 = isContentEditableFalse$b;
  13206. var getNormalizedTextOffset = function (trim, container, offset) {
  13207. var node, trimmedOffset;
  13208. trimmedOffset = trim(container.data.slice(0, offset)).length;
  13209. for (node = container.previousSibling; node && isText$7(node); node = node.previousSibling) {
  13210. trimmedOffset += trim(node.data).length;
  13211. }
  13212. return trimmedOffset;
  13213. };
  13214. var getPoint = function (dom, trim, normalized, rng, start) {
  13215. var container = rng[start ? 'startContainer' : 'endContainer'];
  13216. var offset = rng[start ? 'startOffset' : 'endOffset'];
  13217. var point = [];
  13218. var childNodes, after = 0;
  13219. var root = dom.getRoot();
  13220. if (isText$7(container)) {
  13221. point.push(normalized ? getNormalizedTextOffset(trim, container, offset) : offset);
  13222. } else {
  13223. childNodes = container.childNodes;
  13224. if (offset >= childNodes.length && childNodes.length) {
  13225. after = 1;
  13226. offset = Math.max(0, childNodes.length - 1);
  13227. }
  13228. point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
  13229. }
  13230. for (; container && container !== root; container = container.parentNode) {
  13231. point.push(dom.nodeIndex(container, normalized));
  13232. }
  13233. return point;
  13234. };
  13235. var getLocation = function (trim, selection, normalized, rng) {
  13236. var dom = selection.dom, bookmark = {};
  13237. bookmark.start = getPoint(dom, trim, normalized, rng, true);
  13238. if (!selection.isCollapsed()) {
  13239. bookmark.end = getPoint(dom, trim, normalized, rng, false);
  13240. }
  13241. if (isRangeInCaretContainerBlock(rng)) {
  13242. bookmark.isFakeCaret = true;
  13243. }
  13244. return bookmark;
  13245. };
  13246. var findIndex = function (dom, name, element) {
  13247. var count = 0;
  13248. Tools.each(dom.select(name), function (node) {
  13249. if (node.getAttribute('data-mce-bogus') === 'all') {
  13250. return;
  13251. }
  13252. if (node === element) {
  13253. return false;
  13254. }
  13255. count++;
  13256. });
  13257. return count;
  13258. };
  13259. var moveEndPoint$1 = function (rng, start) {
  13260. var container, offset, childNodes;
  13261. var prefix = start ? 'start' : 'end';
  13262. container = rng[prefix + 'Container'];
  13263. offset = rng[prefix + 'Offset'];
  13264. if (isElement$5(container) && container.nodeName === 'TR') {
  13265. childNodes = container.childNodes;
  13266. container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
  13267. if (container) {
  13268. offset = start ? 0 : container.childNodes.length;
  13269. rng['set' + (start ? 'Start' : 'End')](container, offset);
  13270. }
  13271. }
  13272. };
  13273. var normalizeTableCellSelection = function (rng) {
  13274. moveEndPoint$1(rng, true);
  13275. moveEndPoint$1(rng, false);
  13276. return rng;
  13277. };
  13278. var findSibling = function (node, offset) {
  13279. var sibling;
  13280. if (isElement$5(node)) {
  13281. node = getNode$1(node, offset);
  13282. if (isContentEditableFalse$9(node)) {
  13283. return node;
  13284. }
  13285. }
  13286. if (isCaretContainer$2(node)) {
  13287. if (isText$7(node) && isCaretContainerBlock$1(node)) {
  13288. node = node.parentNode;
  13289. }
  13290. sibling = node.previousSibling;
  13291. if (isContentEditableFalse$9(sibling)) {
  13292. return sibling;
  13293. }
  13294. sibling = node.nextSibling;
  13295. if (isContentEditableFalse$9(sibling)) {
  13296. return sibling;
  13297. }
  13298. }
  13299. };
  13300. var findAdjacentContentEditableFalseElm = function (rng) {
  13301. return findSibling(rng.startContainer, rng.startOffset) || findSibling(rng.endContainer, rng.endOffset);
  13302. };
  13303. var getOffsetBookmark = function (trim, normalized, selection) {
  13304. var element = selection.getNode();
  13305. var name = element ? element.nodeName : null;
  13306. var rng = selection.getRng();
  13307. if (isContentEditableFalse$9(element) || name === 'IMG') {
  13308. return {
  13309. name: name,
  13310. index: findIndex(selection.dom, name, element)
  13311. };
  13312. }
  13313. var sibling = findAdjacentContentEditableFalseElm(rng);
  13314. if (sibling) {
  13315. name = sibling.tagName;
  13316. return {
  13317. name: name,
  13318. index: findIndex(selection.dom, name, sibling)
  13319. };
  13320. }
  13321. return getLocation(trim, selection, normalized, rng);
  13322. };
  13323. var getCaretBookmark = function (selection) {
  13324. var rng = selection.getRng();
  13325. return {
  13326. start: create$6(selection.dom.getRoot(), CaretPosition.fromRangeStart(rng)),
  13327. end: create$6(selection.dom.getRoot(), CaretPosition.fromRangeEnd(rng))
  13328. };
  13329. };
  13330. var getRangeBookmark = function (selection) {
  13331. return { rng: selection.getRng() };
  13332. };
  13333. var createBookmarkSpan = function (dom, id, filled) {
  13334. var args = {
  13335. 'data-mce-type': 'bookmark',
  13336. id: id,
  13337. 'style': 'overflow:hidden;line-height:0px'
  13338. };
  13339. return filled ? dom.create('span', args, '&#xFEFF;') : dom.create('span', args);
  13340. };
  13341. var getPersistentBookmark = function (selection, filled) {
  13342. var dom = selection.dom;
  13343. var rng = selection.getRng();
  13344. var id = dom.uniqueId();
  13345. var collapsed = selection.isCollapsed();
  13346. var element = selection.getNode();
  13347. var name = element.nodeName;
  13348. if (name === 'IMG') {
  13349. return {
  13350. name: name,
  13351. index: findIndex(dom, name, element)
  13352. };
  13353. }
  13354. var rng2 = normalizeTableCellSelection(rng.cloneRange());
  13355. if (!collapsed) {
  13356. rng2.collapse(false);
  13357. var endBookmarkNode = createBookmarkSpan(dom, id + '_end', filled);
  13358. rangeInsertNode(dom, rng2, endBookmarkNode);
  13359. }
  13360. rng = normalizeTableCellSelection(rng);
  13361. rng.collapse(true);
  13362. var startBookmarkNode = createBookmarkSpan(dom, id + '_start', filled);
  13363. rangeInsertNode(dom, rng, startBookmarkNode);
  13364. selection.moveToBookmark({
  13365. id: id,
  13366. keep: true
  13367. });
  13368. return { id: id };
  13369. };
  13370. var getBookmark$2 = function (selection, type, normalized) {
  13371. if (type === 2) {
  13372. return getOffsetBookmark(trim$2, normalized, selection);
  13373. } else if (type === 3) {
  13374. return getCaretBookmark(selection);
  13375. } else if (type) {
  13376. return getRangeBookmark(selection);
  13377. } else {
  13378. return getPersistentBookmark(selection, false);
  13379. }
  13380. };
  13381. var getUndoBookmark = curry(getOffsetBookmark, identity, true);
  13382. var DOM$9 = DOMUtils.DOM;
  13383. var defaultPreviewStyles = 'font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow';
  13384. var getBodySetting = function (editor, name, defaultValue) {
  13385. var value = editor.getParam(name, defaultValue);
  13386. if (value.indexOf('=') !== -1) {
  13387. var bodyObj = editor.getParam(name, '', 'hash');
  13388. return get$9(bodyObj, editor.id).getOr(defaultValue);
  13389. } else {
  13390. return value;
  13391. }
  13392. };
  13393. var getIframeAttrs = function (editor) {
  13394. return editor.getParam('iframe_attrs', {});
  13395. };
  13396. var getDocType = function (editor) {
  13397. return editor.getParam('doctype', '<!DOCTYPE html>');
  13398. };
  13399. var getDocumentBaseUrl = function (editor) {
  13400. return editor.getParam('document_base_url', '');
  13401. };
  13402. var getBodyId = function (editor) {
  13403. return getBodySetting(editor, 'body_id', 'tinymce');
  13404. };
  13405. var getBodyClass = function (editor) {
  13406. return getBodySetting(editor, 'body_class', '');
  13407. };
  13408. var getContentSecurityPolicy = function (editor) {
  13409. return editor.getParam('content_security_policy', '');
  13410. };
  13411. var shouldPutBrInPre$1 = function (editor) {
  13412. return editor.getParam('br_in_pre', true);
  13413. };
  13414. var getForcedRootBlock = function (editor) {
  13415. if (editor.getParam('force_p_newlines', false)) {
  13416. return 'p';
  13417. }
  13418. var block = editor.getParam('forced_root_block', 'p');
  13419. if (block === false) {
  13420. return '';
  13421. } else if (block === true) {
  13422. return 'p';
  13423. } else {
  13424. return block;
  13425. }
  13426. };
  13427. var getForcedRootBlockAttrs = function (editor) {
  13428. return editor.getParam('forced_root_block_attrs', {});
  13429. };
  13430. var getBrNewLineSelector = function (editor) {
  13431. return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
  13432. };
  13433. var getNoNewLineSelector = function (editor) {
  13434. return editor.getParam('no_newline_selector', '');
  13435. };
  13436. var shouldKeepStyles = function (editor) {
  13437. return editor.getParam('keep_styles', true);
  13438. };
  13439. var shouldEndContainerOnEmptyBlock = function (editor) {
  13440. return editor.getParam('end_container_on_empty_block', false);
  13441. };
  13442. var getFontStyleValues = function (editor) {
  13443. return Tools.explode(editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'));
  13444. };
  13445. var getFontSizeClasses = function (editor) {
  13446. return Tools.explode(editor.getParam('font_size_classes', ''));
  13447. };
  13448. var getImagesDataImgFilter = function (editor) {
  13449. return editor.getParam('images_dataimg_filter', always, 'function');
  13450. };
  13451. var isAutomaticUploadsEnabled = function (editor) {
  13452. return editor.getParam('automatic_uploads', true, 'boolean');
  13453. };
  13454. var shouldReuseFileName = function (editor) {
  13455. return editor.getParam('images_reuse_filename', false, 'boolean');
  13456. };
  13457. var shouldReplaceBlobUris = function (editor) {
  13458. return editor.getParam('images_replace_blob_uris', true, 'boolean');
  13459. };
  13460. var getIconPackName = function (editor) {
  13461. return editor.getParam('icons', '', 'string');
  13462. };
  13463. var getIconsUrl = function (editor) {
  13464. return editor.getParam('icons_url', '', 'string');
  13465. };
  13466. var getImageUploadUrl = function (editor) {
  13467. return editor.getParam('images_upload_url', '', 'string');
  13468. };
  13469. var getImageUploadBasePath = function (editor) {
  13470. return editor.getParam('images_upload_base_path', '', 'string');
  13471. };
  13472. var getImagesUploadCredentials = function (editor) {
  13473. return editor.getParam('images_upload_credentials', false, 'boolean');
  13474. };
  13475. var getImagesUploadHandler = function (editor) {
  13476. return editor.getParam('images_upload_handler', null, 'function');
  13477. };
  13478. var shouldUseContentCssCors = function (editor) {
  13479. return editor.getParam('content_css_cors', false, 'boolean');
  13480. };
  13481. var getReferrerPolicy = function (editor) {
  13482. return editor.getParam('referrer_policy', '', 'string');
  13483. };
  13484. var getLanguageCode = function (editor) {
  13485. return editor.getParam('language', 'en', 'string');
  13486. };
  13487. var getLanguageUrl = function (editor) {
  13488. return editor.getParam('language_url', '', 'string');
  13489. };
  13490. var shouldIndentUseMargin = function (editor) {
  13491. return editor.getParam('indent_use_margin', false);
  13492. };
  13493. var getIndentation = function (editor) {
  13494. return editor.getParam('indentation', '40px', 'string');
  13495. };
  13496. var getContentCss = function (editor) {
  13497. var contentCss = editor.getParam('content_css');
  13498. if (isString$1(contentCss)) {
  13499. return map$3(contentCss.split(','), trim$4);
  13500. } else if (isArray$1(contentCss)) {
  13501. return contentCss;
  13502. } else if (contentCss === false || editor.inline) {
  13503. return [];
  13504. } else {
  13505. return ['default'];
  13506. }
  13507. };
  13508. var getFontCss = function (editor) {
  13509. var fontCss = editor.getParam('font_css', []);
  13510. return isArray$1(fontCss) ? fontCss : map$3(fontCss.split(','), trim$4);
  13511. };
  13512. var getDirectionality = function (editor) {
  13513. return editor.getParam('directionality', I18n.isRtl() ? 'rtl' : undefined);
  13514. };
  13515. var getInlineBoundarySelector = function (editor) {
  13516. return editor.getParam('inline_boundaries_selector', 'a[href],code,.mce-annotation', 'string');
  13517. };
  13518. var getObjectResizing = function (editor) {
  13519. var selector = editor.getParam('object_resizing');
  13520. if (selector === false || Env.iOS) {
  13521. return false;
  13522. } else {
  13523. return isString$1(selector) ? selector : 'table,img,figure.image,div,video,iframe';
  13524. }
  13525. };
  13526. var getResizeImgProportional = function (editor) {
  13527. return editor.getParam('resize_img_proportional', true, 'boolean');
  13528. };
  13529. var getPlaceholder = function (editor) {
  13530. return editor.getParam('placeholder', DOM$9.getAttrib(editor.getElement(), 'placeholder'), 'string');
  13531. };
  13532. var getEventRoot = function (editor) {
  13533. return editor.getParam('event_root');
  13534. };
  13535. var getServiceMessage = function (editor) {
  13536. return editor.getParam('service_message');
  13537. };
  13538. var getTheme = function (editor) {
  13539. return editor.getParam('theme');
  13540. };
  13541. var shouldValidate = function (editor) {
  13542. return editor.getParam('validate');
  13543. };
  13544. var isInlineBoundariesEnabled = function (editor) {
  13545. return editor.getParam('inline_boundaries') !== false;
  13546. };
  13547. var getFormats = function (editor) {
  13548. return editor.getParam('formats');
  13549. };
  13550. var getPreviewStyles = function (editor) {
  13551. var style = editor.getParam('preview_styles', defaultPreviewStyles);
  13552. if (isString$1(style)) {
  13553. return style;
  13554. } else {
  13555. return '';
  13556. }
  13557. };
  13558. var canFormatEmptyLines = function (editor) {
  13559. return editor.getParam('format_empty_lines', false, 'boolean');
  13560. };
  13561. var getCustomUiSelector = function (editor) {
  13562. return editor.getParam('custom_ui_selector', '', 'string');
  13563. };
  13564. var getThemeUrl = function (editor) {
  13565. return editor.getParam('theme_url');
  13566. };
  13567. var isInline = function (editor) {
  13568. return editor.getParam('inline');
  13569. };
  13570. var hasHiddenInput = function (editor) {
  13571. return editor.getParam('hidden_input');
  13572. };
  13573. var shouldPatchSubmit = function (editor) {
  13574. return editor.getParam('submit_patch');
  13575. };
  13576. var isEncodingXml = function (editor) {
  13577. return editor.getParam('encoding') === 'xml';
  13578. };
  13579. var shouldAddFormSubmitTrigger = function (editor) {
  13580. return editor.getParam('add_form_submit_trigger');
  13581. };
  13582. var shouldAddUnloadTrigger = function (editor) {
  13583. return editor.getParam('add_unload_trigger');
  13584. };
  13585. var hasForcedRootBlock = function (editor) {
  13586. return getForcedRootBlock(editor) !== '';
  13587. };
  13588. var getCustomUndoRedoLevels = function (editor) {
  13589. return editor.getParam('custom_undo_redo_levels', 0, 'number');
  13590. };
  13591. var shouldDisableNodeChange = function (editor) {
  13592. return editor.getParam('disable_nodechange');
  13593. };
  13594. var isReadOnly$1 = function (editor) {
  13595. return editor.getParam('readonly');
  13596. };
  13597. var hasContentCssCors = function (editor) {
  13598. return editor.getParam('content_css_cors');
  13599. };
  13600. var getPlugins = function (editor) {
  13601. return editor.getParam('plugins', '', 'string');
  13602. };
  13603. var getExternalPlugins$1 = function (editor) {
  13604. return editor.getParam('external_plugins');
  13605. };
  13606. var shouldBlockUnsupportedDrop = function (editor) {
  13607. return editor.getParam('block_unsupported_drop', true, 'boolean');
  13608. };
  13609. var isVisualAidsEnabled = function (editor) {
  13610. return editor.getParam('visual', true, 'boolean');
  13611. };
  13612. var getVisualAidsTableClass = function (editor) {
  13613. return editor.getParam('visual_table_class', 'mce-item-table', 'string');
  13614. };
  13615. var getVisualAidsAnchorClass = function (editor) {
  13616. return editor.getParam('visual_anchor_class', 'mce-item-anchor', 'string');
  13617. };
  13618. var getIframeAriaText = function (editor) {
  13619. return editor.getParam('iframe_aria_text', 'Rich Text Area. Press ALT-0 for help.', 'string');
  13620. };
  13621. var isElement$2 = isElement$5;
  13622. var isText$2 = isText$7;
  13623. var removeNode$1 = function (node) {
  13624. var parentNode = node.parentNode;
  13625. if (parentNode) {
  13626. parentNode.removeChild(node);
  13627. }
  13628. };
  13629. var trimCount = function (text) {
  13630. var trimmedText = trim$2(text);
  13631. return {
  13632. count: text.length - trimmedText.length,
  13633. text: trimmedText
  13634. };
  13635. };
  13636. var deleteZwspChars = function (caretContainer) {
  13637. var idx;
  13638. while ((idx = caretContainer.data.lastIndexOf(ZWSP$1)) !== -1) {
  13639. caretContainer.deleteData(idx, 1);
  13640. }
  13641. };
  13642. var removeUnchanged = function (caretContainer, pos) {
  13643. remove$2(caretContainer);
  13644. return pos;
  13645. };
  13646. var removeTextAndReposition = function (caretContainer, pos) {
  13647. var before = trimCount(caretContainer.data.substr(0, pos.offset()));
  13648. var after = trimCount(caretContainer.data.substr(pos.offset()));
  13649. var text = before.text + after.text;
  13650. if (text.length > 0) {
  13651. deleteZwspChars(caretContainer);
  13652. return CaretPosition(caretContainer, pos.offset() - before.count);
  13653. } else {
  13654. return pos;
  13655. }
  13656. };
  13657. var removeElementAndReposition = function (caretContainer, pos) {
  13658. var parentNode = pos.container();
  13659. var newPosition = indexOf$2(from(parentNode.childNodes), caretContainer).map(function (index) {
  13660. return index < pos.offset() ? CaretPosition(parentNode, pos.offset() - 1) : pos;
  13661. }).getOr(pos);
  13662. remove$2(caretContainer);
  13663. return newPosition;
  13664. };
  13665. var removeTextCaretContainer = function (caretContainer, pos) {
  13666. return isText$2(caretContainer) && pos.container() === caretContainer ? removeTextAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
  13667. };
  13668. var removeElementCaretContainer = function (caretContainer, pos) {
  13669. return pos.container() === caretContainer.parentNode ? removeElementAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
  13670. };
  13671. var removeAndReposition = function (container, pos) {
  13672. return CaretPosition.isTextPosition(pos) ? removeTextCaretContainer(container, pos) : removeElementCaretContainer(container, pos);
  13673. };
  13674. var remove$2 = function (caretContainerNode) {
  13675. if (isElement$2(caretContainerNode) && isCaretContainer$2(caretContainerNode)) {
  13676. if (hasContent(caretContainerNode)) {
  13677. caretContainerNode.removeAttribute('data-mce-caret');
  13678. } else {
  13679. removeNode$1(caretContainerNode);
  13680. }
  13681. }
  13682. if (isText$2(caretContainerNode)) {
  13683. deleteZwspChars(caretContainerNode);
  13684. if (caretContainerNode.data.length === 0) {
  13685. removeNode$1(caretContainerNode);
  13686. }
  13687. }
  13688. };
  13689. var browser$2 = detect().browser;
  13690. var isContentEditableFalse$8 = isContentEditableFalse$b;
  13691. var isMedia$1 = isMedia$2;
  13692. var isTableCell$3 = isTableCell$5;
  13693. var inlineFakeCaretSelector = '*[contentEditable=false],video,audio,embed,object';
  13694. var getAbsoluteClientRect = function (root, element, before) {
  13695. var clientRect = collapse(element.getBoundingClientRect(), before);
  13696. var scrollX;
  13697. var scrollY;
  13698. if (root.tagName === 'BODY') {
  13699. var docElm = root.ownerDocument.documentElement;
  13700. scrollX = root.scrollLeft || docElm.scrollLeft;
  13701. scrollY = root.scrollTop || docElm.scrollTop;
  13702. } else {
  13703. var rootRect = root.getBoundingClientRect();
  13704. scrollX = root.scrollLeft - rootRect.left;
  13705. scrollY = root.scrollTop - rootRect.top;
  13706. }
  13707. clientRect.left += scrollX;
  13708. clientRect.right += scrollX;
  13709. clientRect.top += scrollY;
  13710. clientRect.bottom += scrollY;
  13711. clientRect.width = 1;
  13712. var margin = element.offsetWidth - element.clientWidth;
  13713. if (margin > 0) {
  13714. if (before) {
  13715. margin *= -1;
  13716. }
  13717. clientRect.left += margin;
  13718. clientRect.right += margin;
  13719. }
  13720. return clientRect;
  13721. };
  13722. var trimInlineCaretContainers = function (root) {
  13723. var fakeCaretTargetNodes = descendants(SugarElement.fromDom(root), inlineFakeCaretSelector);
  13724. for (var i = 0; i < fakeCaretTargetNodes.length; i++) {
  13725. var node = fakeCaretTargetNodes[i].dom;
  13726. var sibling = node.previousSibling;
  13727. if (endsWithCaretContainer$1(sibling)) {
  13728. var data = sibling.data;
  13729. if (data.length === 1) {
  13730. sibling.parentNode.removeChild(sibling);
  13731. } else {
  13732. sibling.deleteData(data.length - 1, 1);
  13733. }
  13734. }
  13735. sibling = node.nextSibling;
  13736. if (startsWithCaretContainer$1(sibling)) {
  13737. var data = sibling.data;
  13738. if (data.length === 1) {
  13739. sibling.parentNode.removeChild(sibling);
  13740. } else {
  13741. sibling.deleteData(0, 1);
  13742. }
  13743. }
  13744. }
  13745. };
  13746. var FakeCaret = function (editor, root, isBlock, hasFocus) {
  13747. var lastVisualCaret = value();
  13748. var cursorInterval;
  13749. var caretContainerNode;
  13750. var rootBlock = getForcedRootBlock(editor);
  13751. var caretBlock = rootBlock.length > 0 ? rootBlock : 'p';
  13752. var show = function (before, element) {
  13753. var rng;
  13754. hide();
  13755. if (isTableCell$3(element)) {
  13756. return null;
  13757. }
  13758. if (isBlock(element)) {
  13759. caretContainerNode = insertBlock$1(caretBlock, element, before);
  13760. var clientRect = getAbsoluteClientRect(root, element, before);
  13761. DomQuery(caretContainerNode).css('top', clientRect.top);
  13762. var caret = DomQuery('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(__assign({}, clientRect)).appendTo(root)[0];
  13763. lastVisualCaret.set({
  13764. caret: caret,
  13765. element: element,
  13766. before: before
  13767. });
  13768. if (before) {
  13769. DomQuery(caret).addClass('mce-visual-caret-before');
  13770. }
  13771. startBlink();
  13772. rng = element.ownerDocument.createRange();
  13773. rng.setStart(caretContainerNode, 0);
  13774. rng.setEnd(caretContainerNode, 0);
  13775. } else {
  13776. caretContainerNode = insertInline$1(element, before);
  13777. rng = element.ownerDocument.createRange();
  13778. if (isInlineFakeCaretTarget(caretContainerNode.nextSibling)) {
  13779. rng.setStart(caretContainerNode, 0);
  13780. rng.setEnd(caretContainerNode, 0);
  13781. } else {
  13782. rng.setStart(caretContainerNode, 1);
  13783. rng.setEnd(caretContainerNode, 1);
  13784. }
  13785. return rng;
  13786. }
  13787. return rng;
  13788. };
  13789. var hide = function () {
  13790. trimInlineCaretContainers(root);
  13791. if (caretContainerNode) {
  13792. remove$2(caretContainerNode);
  13793. caretContainerNode = null;
  13794. }
  13795. lastVisualCaret.on(function (caretState) {
  13796. DomQuery(caretState.caret).remove();
  13797. lastVisualCaret.clear();
  13798. });
  13799. if (cursorInterval) {
  13800. Delay.clearInterval(cursorInterval);
  13801. cursorInterval = undefined;
  13802. }
  13803. };
  13804. var startBlink = function () {
  13805. cursorInterval = Delay.setInterval(function () {
  13806. if (hasFocus()) {
  13807. DomQuery('div.mce-visual-caret', root).toggleClass('mce-visual-caret-hidden');
  13808. } else {
  13809. DomQuery('div.mce-visual-caret', root).addClass('mce-visual-caret-hidden');
  13810. }
  13811. }, 500);
  13812. };
  13813. var reposition = function () {
  13814. lastVisualCaret.on(function (caretState) {
  13815. var clientRect = getAbsoluteClientRect(root, caretState.element, caretState.before);
  13816. DomQuery(caretState.caret).css(__assign({}, clientRect));
  13817. });
  13818. };
  13819. var destroy = function () {
  13820. return Delay.clearInterval(cursorInterval);
  13821. };
  13822. var getCss = function () {
  13823. return '.mce-visual-caret {' + 'position: absolute;' + 'background-color: black;' + 'background-color: currentcolor;' + '}' + '.mce-visual-caret-hidden {' + 'display: none;' + '}' + '*[data-mce-caret] {' + 'position: absolute;' + 'left: -1000px;' + 'right: auto;' + 'top: 0;' + 'margin: 0;' + 'padding: 0;' + '}';
  13824. };
  13825. return {
  13826. show: show,
  13827. hide: hide,
  13828. getCss: getCss,
  13829. reposition: reposition,
  13830. destroy: destroy
  13831. };
  13832. };
  13833. var isFakeCaretTableBrowser = function () {
  13834. return browser$2.isIE() || browser$2.isEdge() || browser$2.isFirefox();
  13835. };
  13836. var isInlineFakeCaretTarget = function (node) {
  13837. return isContentEditableFalse$8(node) || isMedia$1(node);
  13838. };
  13839. var isFakeCaretTarget = function (node) {
  13840. return isInlineFakeCaretTarget(node) || isTable$3(node) && isFakeCaretTableBrowser();
  13841. };
  13842. var isContentEditableFalse$7 = isContentEditableFalse$b;
  13843. var isMedia = isMedia$2;
  13844. var isBlockLike = matchStyleValues('display', 'block table table-cell table-caption list-item');
  13845. var isCaretContainer = isCaretContainer$2;
  13846. var isCaretContainerBlock = isCaretContainerBlock$1;
  13847. var isElement$1 = isElement$5;
  13848. var isCaretCandidate$1 = isCaretCandidate$3;
  13849. var isForwards = function (direction) {
  13850. return direction > 0;
  13851. };
  13852. var isBackwards = function (direction) {
  13853. return direction < 0;
  13854. };
  13855. var skipCaretContainers = function (walk, shallow) {
  13856. var node;
  13857. while (node = walk(shallow)) {
  13858. if (!isCaretContainerBlock(node)) {
  13859. return node;
  13860. }
  13861. }
  13862. return null;
  13863. };
  13864. var findNode$1 = function (node, direction, predicateFn, rootNode, shallow) {
  13865. var walker = new DomTreeWalker(node, rootNode);
  13866. var isCefOrCaretContainer = isContentEditableFalse$7(node) || isCaretContainerBlock(node);
  13867. if (isBackwards(direction)) {
  13868. if (isCefOrCaretContainer) {
  13869. node = skipCaretContainers(walker.prev.bind(walker), true);
  13870. if (predicateFn(node)) {
  13871. return node;
  13872. }
  13873. }
  13874. while (node = skipCaretContainers(walker.prev.bind(walker), shallow)) {
  13875. if (predicateFn(node)) {
  13876. return node;
  13877. }
  13878. }
  13879. }
  13880. if (isForwards(direction)) {
  13881. if (isCefOrCaretContainer) {
  13882. node = skipCaretContainers(walker.next.bind(walker), true);
  13883. if (predicateFn(node)) {
  13884. return node;
  13885. }
  13886. }
  13887. while (node = skipCaretContainers(walker.next.bind(walker), shallow)) {
  13888. if (predicateFn(node)) {
  13889. return node;
  13890. }
  13891. }
  13892. }
  13893. return null;
  13894. };
  13895. var getParentBlock$2 = function (node, rootNode) {
  13896. while (node && node !== rootNode) {
  13897. if (isBlockLike(node)) {
  13898. return node;
  13899. }
  13900. node = node.parentNode;
  13901. }
  13902. return null;
  13903. };
  13904. var isInSameBlock = function (caretPosition1, caretPosition2, rootNode) {
  13905. return getParentBlock$2(caretPosition1.container(), rootNode) === getParentBlock$2(caretPosition2.container(), rootNode);
  13906. };
  13907. var getChildNodeAtRelativeOffset = function (relativeOffset, caretPosition) {
  13908. if (!caretPosition) {
  13909. return null;
  13910. }
  13911. var container = caretPosition.container();
  13912. var offset = caretPosition.offset();
  13913. if (!isElement$1(container)) {
  13914. return null;
  13915. }
  13916. return container.childNodes[offset + relativeOffset];
  13917. };
  13918. var beforeAfter = function (before, node) {
  13919. var range = node.ownerDocument.createRange();
  13920. if (before) {
  13921. range.setStartBefore(node);
  13922. range.setEndBefore(node);
  13923. } else {
  13924. range.setStartAfter(node);
  13925. range.setEndAfter(node);
  13926. }
  13927. return range;
  13928. };
  13929. var isNodesInSameBlock = function (root, node1, node2) {
  13930. return getParentBlock$2(node1, root) === getParentBlock$2(node2, root);
  13931. };
  13932. var lean = function (left, root, node) {
  13933. var siblingName = left ? 'previousSibling' : 'nextSibling';
  13934. while (node && node !== root) {
  13935. var sibling = node[siblingName];
  13936. if (isCaretContainer(sibling)) {
  13937. sibling = sibling[siblingName];
  13938. }
  13939. if (isContentEditableFalse$7(sibling) || isMedia(sibling)) {
  13940. if (isNodesInSameBlock(root, sibling, node)) {
  13941. return sibling;
  13942. }
  13943. break;
  13944. }
  13945. if (isCaretCandidate$1(sibling)) {
  13946. break;
  13947. }
  13948. node = node.parentNode;
  13949. }
  13950. return null;
  13951. };
  13952. var before$2 = curry(beforeAfter, true);
  13953. var after$2 = curry(beforeAfter, false);
  13954. var normalizeRange = function (direction, root, range) {
  13955. var node;
  13956. var leanLeft = curry(lean, true, root);
  13957. var leanRight = curry(lean, false, root);
  13958. var container = range.startContainer;
  13959. var offset = range.startOffset;
  13960. if (isCaretContainerBlock$1(container)) {
  13961. if (!isElement$1(container)) {
  13962. container = container.parentNode;
  13963. }
  13964. var location_1 = container.getAttribute('data-mce-caret');
  13965. if (location_1 === 'before') {
  13966. node = container.nextSibling;
  13967. if (isFakeCaretTarget(node)) {
  13968. return before$2(node);
  13969. }
  13970. }
  13971. if (location_1 === 'after') {
  13972. node = container.previousSibling;
  13973. if (isFakeCaretTarget(node)) {
  13974. return after$2(node);
  13975. }
  13976. }
  13977. }
  13978. if (!range.collapsed) {
  13979. return range;
  13980. }
  13981. if (isText$7(container)) {
  13982. if (isCaretContainer(container)) {
  13983. if (direction === 1) {
  13984. node = leanRight(container);
  13985. if (node) {
  13986. return before$2(node);
  13987. }
  13988. node = leanLeft(container);
  13989. if (node) {
  13990. return after$2(node);
  13991. }
  13992. }
  13993. if (direction === -1) {
  13994. node = leanLeft(container);
  13995. if (node) {
  13996. return after$2(node);
  13997. }
  13998. node = leanRight(container);
  13999. if (node) {
  14000. return before$2(node);
  14001. }
  14002. }
  14003. return range;
  14004. }
  14005. if (endsWithCaretContainer$1(container) && offset >= container.data.length - 1) {
  14006. if (direction === 1) {
  14007. node = leanRight(container);
  14008. if (node) {
  14009. return before$2(node);
  14010. }
  14011. }
  14012. return range;
  14013. }
  14014. if (startsWithCaretContainer$1(container) && offset <= 1) {
  14015. if (direction === -1) {
  14016. node = leanLeft(container);
  14017. if (node) {
  14018. return after$2(node);
  14019. }
  14020. }
  14021. return range;
  14022. }
  14023. if (offset === container.data.length) {
  14024. node = leanRight(container);
  14025. if (node) {
  14026. return before$2(node);
  14027. }
  14028. return range;
  14029. }
  14030. if (offset === 0) {
  14031. node = leanLeft(container);
  14032. if (node) {
  14033. return after$2(node);
  14034. }
  14035. return range;
  14036. }
  14037. }
  14038. return range;
  14039. };
  14040. var getRelativeCefElm = function (forward, caretPosition) {
  14041. return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, caretPosition)).filter(isContentEditableFalse$7);
  14042. };
  14043. var getNormalizedRangeEndPoint = function (direction, root, range) {
  14044. var normalizedRange = normalizeRange(direction, root, range);
  14045. if (direction === -1) {
  14046. return CaretPosition.fromRangeStart(normalizedRange);
  14047. }
  14048. return CaretPosition.fromRangeEnd(normalizedRange);
  14049. };
  14050. var getElementFromPosition = function (pos) {
  14051. return Optional.from(pos.getNode()).map(SugarElement.fromDom);
  14052. };
  14053. var getElementFromPrevPosition = function (pos) {
  14054. return Optional.from(pos.getNode(true)).map(SugarElement.fromDom);
  14055. };
  14056. var getVisualCaretPosition = function (walkFn, caretPosition) {
  14057. while (caretPosition = walkFn(caretPosition)) {
  14058. if (caretPosition.isVisible()) {
  14059. return caretPosition;
  14060. }
  14061. }
  14062. return caretPosition;
  14063. };
  14064. var isMoveInsideSameBlock = function (from, to) {
  14065. var inSameBlock = isInSameBlock(from, to);
  14066. if (!inSameBlock && isBr$5(from.getNode())) {
  14067. return true;
  14068. }
  14069. return inSameBlock;
  14070. };
  14071. var HDirection;
  14072. (function (HDirection) {
  14073. HDirection[HDirection['Backwards'] = -1] = 'Backwards';
  14074. HDirection[HDirection['Forwards'] = 1] = 'Forwards';
  14075. }(HDirection || (HDirection = {})));
  14076. var isContentEditableFalse$6 = isContentEditableFalse$b;
  14077. var isText$1 = isText$7;
  14078. var isElement = isElement$5;
  14079. var isBr$1 = isBr$5;
  14080. var isCaretCandidate = isCaretCandidate$3;
  14081. var isAtomic = isAtomic$1;
  14082. var isEditableCaretCandidate = isEditableCaretCandidate$1;
  14083. var getParents$3 = function (node, root) {
  14084. var parents = [];
  14085. while (node && node !== root) {
  14086. parents.push(node);
  14087. node = node.parentNode;
  14088. }
  14089. return parents;
  14090. };
  14091. var nodeAtIndex = function (container, offset) {
  14092. if (container.hasChildNodes() && offset < container.childNodes.length) {
  14093. return container.childNodes[offset];
  14094. }
  14095. return null;
  14096. };
  14097. var getCaretCandidatePosition = function (direction, node) {
  14098. if (isForwards(direction)) {
  14099. if (isCaretCandidate(node.previousSibling) && !isText$1(node.previousSibling)) {
  14100. return CaretPosition.before(node);
  14101. }
  14102. if (isText$1(node)) {
  14103. return CaretPosition(node, 0);
  14104. }
  14105. }
  14106. if (isBackwards(direction)) {
  14107. if (isCaretCandidate(node.nextSibling) && !isText$1(node.nextSibling)) {
  14108. return CaretPosition.after(node);
  14109. }
  14110. if (isText$1(node)) {
  14111. return CaretPosition(node, node.data.length);
  14112. }
  14113. }
  14114. if (isBackwards(direction)) {
  14115. if (isBr$1(node)) {
  14116. return CaretPosition.before(node);
  14117. }
  14118. return CaretPosition.after(node);
  14119. }
  14120. return CaretPosition.before(node);
  14121. };
  14122. var moveForwardFromBr = function (root, nextNode) {
  14123. var nextSibling = nextNode.nextSibling;
  14124. if (nextSibling && isCaretCandidate(nextSibling)) {
  14125. if (isText$1(nextSibling)) {
  14126. return CaretPosition(nextSibling, 0);
  14127. } else {
  14128. return CaretPosition.before(nextSibling);
  14129. }
  14130. } else {
  14131. return findCaretPosition$1(HDirection.Forwards, CaretPosition.after(nextNode), root);
  14132. }
  14133. };
  14134. var findCaretPosition$1 = function (direction, startPos, root) {
  14135. var node;
  14136. var nextNode;
  14137. var innerNode;
  14138. var caretPosition;
  14139. if (!isElement(root) || !startPos) {
  14140. return null;
  14141. }
  14142. if (startPos.isEqual(CaretPosition.after(root)) && root.lastChild) {
  14143. caretPosition = CaretPosition.after(root.lastChild);
  14144. if (isBackwards(direction) && isCaretCandidate(root.lastChild) && isElement(root.lastChild)) {
  14145. return isBr$1(root.lastChild) ? CaretPosition.before(root.lastChild) : caretPosition;
  14146. }
  14147. } else {
  14148. caretPosition = startPos;
  14149. }
  14150. var container = caretPosition.container();
  14151. var offset = caretPosition.offset();
  14152. if (isText$1(container)) {
  14153. if (isBackwards(direction) && offset > 0) {
  14154. return CaretPosition(container, --offset);
  14155. }
  14156. if (isForwards(direction) && offset < container.length) {
  14157. return CaretPosition(container, ++offset);
  14158. }
  14159. node = container;
  14160. } else {
  14161. if (isBackwards(direction) && offset > 0) {
  14162. nextNode = nodeAtIndex(container, offset - 1);
  14163. if (isCaretCandidate(nextNode)) {
  14164. if (!isAtomic(nextNode)) {
  14165. innerNode = findNode$1(nextNode, direction, isEditableCaretCandidate, nextNode);
  14166. if (innerNode) {
  14167. if (isText$1(innerNode)) {
  14168. return CaretPosition(innerNode, innerNode.data.length);
  14169. }
  14170. return CaretPosition.after(innerNode);
  14171. }
  14172. }
  14173. if (isText$1(nextNode)) {
  14174. return CaretPosition(nextNode, nextNode.data.length);
  14175. }
  14176. return CaretPosition.before(nextNode);
  14177. }
  14178. }
  14179. if (isForwards(direction) && offset < container.childNodes.length) {
  14180. nextNode = nodeAtIndex(container, offset);
  14181. if (isCaretCandidate(nextNode)) {
  14182. if (isBr$1(nextNode)) {
  14183. return moveForwardFromBr(root, nextNode);
  14184. }
  14185. if (!isAtomic(nextNode)) {
  14186. innerNode = findNode$1(nextNode, direction, isEditableCaretCandidate, nextNode);
  14187. if (innerNode) {
  14188. if (isText$1(innerNode)) {
  14189. return CaretPosition(innerNode, 0);
  14190. }
  14191. return CaretPosition.before(innerNode);
  14192. }
  14193. }
  14194. if (isText$1(nextNode)) {
  14195. return CaretPosition(nextNode, 0);
  14196. }
  14197. return CaretPosition.after(nextNode);
  14198. }
  14199. }
  14200. node = nextNode ? nextNode : caretPosition.getNode();
  14201. }
  14202. if (isForwards(direction) && caretPosition.isAtEnd() || isBackwards(direction) && caretPosition.isAtStart()) {
  14203. node = findNode$1(node, direction, always, root, true);
  14204. if (isEditableCaretCandidate(node, root)) {
  14205. return getCaretCandidatePosition(direction, node);
  14206. }
  14207. }
  14208. nextNode = findNode$1(node, direction, isEditableCaretCandidate, root);
  14209. var rootContentEditableFalseElm = last$1(filter$4(getParents$3(container, root), isContentEditableFalse$6));
  14210. if (rootContentEditableFalseElm && (!nextNode || !rootContentEditableFalseElm.contains(nextNode))) {
  14211. if (isForwards(direction)) {
  14212. caretPosition = CaretPosition.after(rootContentEditableFalseElm);
  14213. } else {
  14214. caretPosition = CaretPosition.before(rootContentEditableFalseElm);
  14215. }
  14216. return caretPosition;
  14217. }
  14218. if (nextNode) {
  14219. return getCaretCandidatePosition(direction, nextNode);
  14220. }
  14221. return null;
  14222. };
  14223. var CaretWalker = function (root) {
  14224. return {
  14225. next: function (caretPosition) {
  14226. return findCaretPosition$1(HDirection.Forwards, caretPosition, root);
  14227. },
  14228. prev: function (caretPosition) {
  14229. return findCaretPosition$1(HDirection.Backwards, caretPosition, root);
  14230. }
  14231. };
  14232. };
  14233. var walkToPositionIn = function (forward, root, start) {
  14234. var position = forward ? CaretPosition.before(start) : CaretPosition.after(start);
  14235. return fromPosition(forward, root, position);
  14236. };
  14237. var afterElement = function (node) {
  14238. return isBr$5(node) ? CaretPosition.before(node) : CaretPosition.after(node);
  14239. };
  14240. var isBeforeOrStart = function (position) {
  14241. if (CaretPosition.isTextPosition(position)) {
  14242. return position.offset() === 0;
  14243. } else {
  14244. return isCaretCandidate$3(position.getNode());
  14245. }
  14246. };
  14247. var isAfterOrEnd = function (position) {
  14248. if (CaretPosition.isTextPosition(position)) {
  14249. var container = position.container();
  14250. return position.offset() === container.data.length;
  14251. } else {
  14252. return isCaretCandidate$3(position.getNode(true));
  14253. }
  14254. };
  14255. var isBeforeAfterSameElement = function (from, to) {
  14256. return !CaretPosition.isTextPosition(from) && !CaretPosition.isTextPosition(to) && from.getNode() === to.getNode(true);
  14257. };
  14258. var isAtBr = function (position) {
  14259. return !CaretPosition.isTextPosition(position) && isBr$5(position.getNode());
  14260. };
  14261. var shouldSkipPosition = function (forward, from, to) {
  14262. if (forward) {
  14263. return !isBeforeAfterSameElement(from, to) && !isAtBr(from) && isAfterOrEnd(from) && isBeforeOrStart(to);
  14264. } else {
  14265. return !isBeforeAfterSameElement(to, from) && isBeforeOrStart(from) && isAfterOrEnd(to);
  14266. }
  14267. };
  14268. var fromPosition = function (forward, root, pos) {
  14269. var walker = CaretWalker(root);
  14270. return Optional.from(forward ? walker.next(pos) : walker.prev(pos));
  14271. };
  14272. var navigate = function (forward, root, from) {
  14273. return fromPosition(forward, root, from).bind(function (to) {
  14274. if (isInSameBlock(from, to, root) && shouldSkipPosition(forward, from, to)) {
  14275. return fromPosition(forward, root, to);
  14276. } else {
  14277. return Optional.some(to);
  14278. }
  14279. });
  14280. };
  14281. var navigateIgnore = function (forward, root, from, ignoreFilter) {
  14282. return navigate(forward, root, from).bind(function (pos) {
  14283. return ignoreFilter(pos) ? navigateIgnore(forward, root, pos, ignoreFilter) : Optional.some(pos);
  14284. });
  14285. };
  14286. var positionIn = function (forward, element) {
  14287. var startNode = forward ? element.firstChild : element.lastChild;
  14288. if (isText$7(startNode)) {
  14289. return Optional.some(CaretPosition(startNode, forward ? 0 : startNode.data.length));
  14290. } else if (startNode) {
  14291. if (isCaretCandidate$3(startNode)) {
  14292. return Optional.some(forward ? CaretPosition.before(startNode) : afterElement(startNode));
  14293. } else {
  14294. return walkToPositionIn(forward, element, startNode);
  14295. }
  14296. } else {
  14297. return Optional.none();
  14298. }
  14299. };
  14300. var nextPosition = curry(fromPosition, true);
  14301. var prevPosition = curry(fromPosition, false);
  14302. var firstPositionIn = curry(positionIn, true);
  14303. var lastPositionIn = curry(positionIn, false);
  14304. var CARET_ID$1 = '_mce_caret';
  14305. var isCaretNode = function (node) {
  14306. return isElement$5(node) && node.id === CARET_ID$1;
  14307. };
  14308. var getParentCaretContainer = function (body, node) {
  14309. while (node && node !== body) {
  14310. if (node.id === CARET_ID$1) {
  14311. return node;
  14312. }
  14313. node = node.parentNode;
  14314. }
  14315. return null;
  14316. };
  14317. var isStringPathBookmark = function (bookmark) {
  14318. return isString$1(bookmark.start);
  14319. };
  14320. var isRangeBookmark = function (bookmark) {
  14321. return has$2(bookmark, 'rng');
  14322. };
  14323. var isIdBookmark = function (bookmark) {
  14324. return has$2(bookmark, 'id');
  14325. };
  14326. var isIndexBookmark = function (bookmark) {
  14327. return has$2(bookmark, 'name');
  14328. };
  14329. var isPathBookmark = function (bookmark) {
  14330. return Tools.isArray(bookmark.start);
  14331. };
  14332. var addBogus = function (dom, node) {
  14333. if (isElement$5(node) && dom.isBlock(node) && !node.innerHTML && !Env.ie) {
  14334. node.innerHTML = '<br data-mce-bogus="1" />';
  14335. }
  14336. return node;
  14337. };
  14338. var resolveCaretPositionBookmark = function (dom, bookmark) {
  14339. var pos;
  14340. var rng = dom.createRng();
  14341. pos = resolve$2(dom.getRoot(), bookmark.start);
  14342. rng.setStart(pos.container(), pos.offset());
  14343. pos = resolve$2(dom.getRoot(), bookmark.end);
  14344. rng.setEnd(pos.container(), pos.offset());
  14345. return rng;
  14346. };
  14347. var insertZwsp = function (node, rng) {
  14348. var textNode = node.ownerDocument.createTextNode(ZWSP$1);
  14349. node.appendChild(textNode);
  14350. rng.setStart(textNode, 0);
  14351. rng.setEnd(textNode, 0);
  14352. };
  14353. var isEmpty$1 = function (node) {
  14354. return node.hasChildNodes() === false;
  14355. };
  14356. var tryFindRangePosition = function (node, rng) {
  14357. return lastPositionIn(node).fold(never, function (pos) {
  14358. rng.setStart(pos.container(), pos.offset());
  14359. rng.setEnd(pos.container(), pos.offset());
  14360. return true;
  14361. });
  14362. };
  14363. var padEmptyCaretContainer = function (root, node, rng) {
  14364. if (isEmpty$1(node) && getParentCaretContainer(root, node)) {
  14365. insertZwsp(node, rng);
  14366. return true;
  14367. } else {
  14368. return false;
  14369. }
  14370. };
  14371. var setEndPoint = function (dom, start, bookmark, rng) {
  14372. var point = bookmark[start ? 'start' : 'end'];
  14373. var i, node, offset, children;
  14374. var root = dom.getRoot();
  14375. if (point) {
  14376. offset = point[0];
  14377. for (node = root, i = point.length - 1; i >= 1; i--) {
  14378. children = node.childNodes;
  14379. if (padEmptyCaretContainer(root, node, rng)) {
  14380. return true;
  14381. }
  14382. if (point[i] > children.length - 1) {
  14383. if (padEmptyCaretContainer(root, node, rng)) {
  14384. return true;
  14385. }
  14386. return tryFindRangePosition(node, rng);
  14387. }
  14388. node = children[point[i]];
  14389. }
  14390. if (node.nodeType === 3) {
  14391. offset = Math.min(point[0], node.nodeValue.length);
  14392. }
  14393. if (node.nodeType === 1) {
  14394. offset = Math.min(point[0], node.childNodes.length);
  14395. }
  14396. if (start) {
  14397. rng.setStart(node, offset);
  14398. } else {
  14399. rng.setEnd(node, offset);
  14400. }
  14401. }
  14402. return true;
  14403. };
  14404. var isValidTextNode = function (node) {
  14405. return isText$7(node) && node.data.length > 0;
  14406. };
  14407. var restoreEndPoint = function (dom, suffix, bookmark) {
  14408. var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev;
  14409. var keep = bookmark.keep;
  14410. var container, offset;
  14411. if (marker) {
  14412. node = marker.parentNode;
  14413. if (suffix === 'start') {
  14414. if (!keep) {
  14415. idx = dom.nodeIndex(marker);
  14416. } else {
  14417. if (marker.hasChildNodes()) {
  14418. node = marker.firstChild;
  14419. idx = 1;
  14420. } else if (isValidTextNode(marker.nextSibling)) {
  14421. node = marker.nextSibling;
  14422. idx = 0;
  14423. } else if (isValidTextNode(marker.previousSibling)) {
  14424. node = marker.previousSibling;
  14425. idx = marker.previousSibling.data.length;
  14426. } else {
  14427. node = marker.parentNode;
  14428. idx = dom.nodeIndex(marker) + 1;
  14429. }
  14430. }
  14431. container = node;
  14432. offset = idx;
  14433. } else {
  14434. if (!keep) {
  14435. idx = dom.nodeIndex(marker);
  14436. } else {
  14437. if (marker.hasChildNodes()) {
  14438. node = marker.firstChild;
  14439. idx = 1;
  14440. } else if (isValidTextNode(marker.previousSibling)) {
  14441. node = marker.previousSibling;
  14442. idx = marker.previousSibling.data.length;
  14443. } else {
  14444. node = marker.parentNode;
  14445. idx = dom.nodeIndex(marker);
  14446. }
  14447. }
  14448. container = node;
  14449. offset = idx;
  14450. }
  14451. if (!keep) {
  14452. prev = marker.previousSibling;
  14453. next = marker.nextSibling;
  14454. Tools.each(Tools.grep(marker.childNodes), function (node) {
  14455. if (isText$7(node)) {
  14456. node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
  14457. }
  14458. });
  14459. while (marker = dom.get(bookmark.id + '_' + suffix)) {
  14460. dom.remove(marker, true);
  14461. }
  14462. if (prev && next && prev.nodeType === next.nodeType && isText$7(prev) && !Env.opera) {
  14463. idx = prev.nodeValue.length;
  14464. prev.appendData(next.nodeValue);
  14465. dom.remove(next);
  14466. container = prev;
  14467. offset = idx;
  14468. }
  14469. }
  14470. return Optional.some(CaretPosition(container, offset));
  14471. } else {
  14472. return Optional.none();
  14473. }
  14474. };
  14475. var resolvePaths = function (dom, bookmark) {
  14476. var rng = dom.createRng();
  14477. if (setEndPoint(dom, true, bookmark, rng) && setEndPoint(dom, false, bookmark, rng)) {
  14478. return Optional.some(rng);
  14479. } else {
  14480. return Optional.none();
  14481. }
  14482. };
  14483. var resolveId = function (dom, bookmark) {
  14484. var startPos = restoreEndPoint(dom, 'start', bookmark);
  14485. var endPos = restoreEndPoint(dom, 'end', bookmark);
  14486. return lift2(startPos, endPos.or(startPos), function (spos, epos) {
  14487. var rng = dom.createRng();
  14488. rng.setStart(addBogus(dom, spos.container()), spos.offset());
  14489. rng.setEnd(addBogus(dom, epos.container()), epos.offset());
  14490. return rng;
  14491. });
  14492. };
  14493. var resolveIndex = function (dom, bookmark) {
  14494. return Optional.from(dom.select(bookmark.name)[bookmark.index]).map(function (elm) {
  14495. var rng = dom.createRng();
  14496. rng.selectNode(elm);
  14497. return rng;
  14498. });
  14499. };
  14500. var resolve$1 = function (selection, bookmark) {
  14501. var dom = selection.dom;
  14502. if (bookmark) {
  14503. if (isPathBookmark(bookmark)) {
  14504. return resolvePaths(dom, bookmark);
  14505. } else if (isStringPathBookmark(bookmark)) {
  14506. return Optional.some(resolveCaretPositionBookmark(dom, bookmark));
  14507. } else if (isIdBookmark(bookmark)) {
  14508. return resolveId(dom, bookmark);
  14509. } else if (isIndexBookmark(bookmark)) {
  14510. return resolveIndex(dom, bookmark);
  14511. } else if (isRangeBookmark(bookmark)) {
  14512. return Optional.some(bookmark.rng);
  14513. }
  14514. }
  14515. return Optional.none();
  14516. };
  14517. var getBookmark$1 = function (selection, type, normalized) {
  14518. return getBookmark$2(selection, type, normalized);
  14519. };
  14520. var moveToBookmark = function (selection, bookmark) {
  14521. resolve$1(selection, bookmark).each(function (rng) {
  14522. selection.setRng(rng);
  14523. });
  14524. };
  14525. var isBookmarkNode$1 = function (node) {
  14526. return isElement$5(node) && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
  14527. };
  14528. var is = function (expected) {
  14529. return function (actual) {
  14530. return expected === actual;
  14531. };
  14532. };
  14533. var isNbsp = is(nbsp);
  14534. var isWhiteSpace = function (chr) {
  14535. return chr !== '' && ' \f\n\r\t\x0B'.indexOf(chr) !== -1;
  14536. };
  14537. var isContent = function (chr) {
  14538. return !isWhiteSpace(chr) && !isNbsp(chr);
  14539. };
  14540. var isNode = function (node) {
  14541. return !!node.nodeType;
  14542. };
  14543. var isInlineBlock = function (node) {
  14544. return node && /^(IMG)$/.test(node.nodeName);
  14545. };
  14546. var moveStart = function (dom, selection, rng) {
  14547. var offset = rng.startOffset;
  14548. var container = rng.startContainer;
  14549. if (container === rng.endContainer) {
  14550. if (isInlineBlock(container.childNodes[offset])) {
  14551. return;
  14552. }
  14553. }
  14554. if (isElement$5(container)) {
  14555. var nodes = container.childNodes;
  14556. var walker = void 0;
  14557. if (offset < nodes.length) {
  14558. container = nodes[offset];
  14559. walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock));
  14560. } else {
  14561. container = nodes[nodes.length - 1];
  14562. walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock));
  14563. walker.next(true);
  14564. }
  14565. for (var node = walker.current(); node; node = walker.next()) {
  14566. if (isText$7(node) && !isWhiteSpaceNode$1(node)) {
  14567. rng.setStart(node, 0);
  14568. selection.setRng(rng);
  14569. return;
  14570. }
  14571. }
  14572. }
  14573. };
  14574. var getNonWhiteSpaceSibling = function (node, next, inc) {
  14575. if (node) {
  14576. var nextName = next ? 'nextSibling' : 'previousSibling';
  14577. for (node = inc ? node : node[nextName]; node; node = node[nextName]) {
  14578. if (isElement$5(node) || !isWhiteSpaceNode$1(node)) {
  14579. return node;
  14580. }
  14581. }
  14582. }
  14583. };
  14584. var isTextBlock$1 = function (editor, name) {
  14585. if (isNode(name)) {
  14586. name = name.nodeName;
  14587. }
  14588. return !!editor.schema.getTextBlockElements()[name.toLowerCase()];
  14589. };
  14590. var isValid = function (ed, parent, child) {
  14591. return ed.schema.isValidChild(parent, child);
  14592. };
  14593. var isWhiteSpaceNode$1 = function (node, allowSpaces) {
  14594. if (allowSpaces === void 0) {
  14595. allowSpaces = false;
  14596. }
  14597. if (isNonNullable(node) && isText$7(node)) {
  14598. var data = allowSpaces ? node.data.replace(/ /g, '\xA0') : node.data;
  14599. return isWhitespaceText(data);
  14600. } else {
  14601. return false;
  14602. }
  14603. };
  14604. var isEmptyTextNode$1 = function (node) {
  14605. return isNonNullable(node) && isText$7(node) && node.length === 0;
  14606. };
  14607. var replaceVars = function (value, vars) {
  14608. if (isFunction(value)) {
  14609. value = value(vars);
  14610. } else if (isNonNullable(vars)) {
  14611. value = value.replace(/%(\w+)/g, function (str, name) {
  14612. return vars[name] || str;
  14613. });
  14614. }
  14615. return value;
  14616. };
  14617. var isEq$5 = function (str1, str2) {
  14618. str1 = str1 || '';
  14619. str2 = str2 || '';
  14620. str1 = '' + (str1.nodeName || str1);
  14621. str2 = '' + (str2.nodeName || str2);
  14622. return str1.toLowerCase() === str2.toLowerCase();
  14623. };
  14624. var normalizeStyleValue = function (dom, value, name) {
  14625. if (name === 'color' || name === 'backgroundColor') {
  14626. value = dom.toHex(value);
  14627. }
  14628. if (name === 'fontWeight' && value === 700) {
  14629. value = 'bold';
  14630. }
  14631. if (name === 'fontFamily') {
  14632. value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
  14633. }
  14634. return '' + value;
  14635. };
  14636. var getStyle = function (dom, node, name) {
  14637. return normalizeStyleValue(dom, dom.getStyle(node, name), name);
  14638. };
  14639. var getTextDecoration = function (dom, node) {
  14640. var decoration;
  14641. dom.getParent(node, function (n) {
  14642. decoration = dom.getStyle(n, 'text-decoration');
  14643. return decoration && decoration !== 'none';
  14644. });
  14645. return decoration;
  14646. };
  14647. var getParents$2 = function (dom, node, selector) {
  14648. return dom.getParents(node, selector, dom.getRoot());
  14649. };
  14650. var isVariableFormatName = function (editor, formatName) {
  14651. var hasVariableValues = function (format) {
  14652. var isVariableValue = function (val) {
  14653. return val.length > 1 && val.charAt(0) === '%';
  14654. };
  14655. return exists([
  14656. 'styles',
  14657. 'attributes'
  14658. ], function (key) {
  14659. return get$9(format, key).exists(function (field) {
  14660. var fieldValues = isArray$1(field) ? field : values(field);
  14661. return exists(fieldValues, isVariableValue);
  14662. });
  14663. });
  14664. };
  14665. return exists(editor.formatter.get(formatName), hasVariableValues);
  14666. };
  14667. var areSimilarFormats = function (editor, formatName, otherFormatName) {
  14668. var validKeys = [
  14669. 'inline',
  14670. 'block',
  14671. 'selector',
  14672. 'attributes',
  14673. 'styles',
  14674. 'classes'
  14675. ];
  14676. var filterObj = function (format) {
  14677. return filter$3(format, function (_, key) {
  14678. return exists(validKeys, function (validKey) {
  14679. return validKey === key;
  14680. });
  14681. });
  14682. };
  14683. return exists(editor.formatter.get(formatName), function (fmt1) {
  14684. var filteredFmt1 = filterObj(fmt1);
  14685. return exists(editor.formatter.get(otherFormatName), function (fmt2) {
  14686. var filteredFmt2 = filterObj(fmt2);
  14687. return equal$1(filteredFmt1, filteredFmt2);
  14688. });
  14689. });
  14690. };
  14691. var isBlockFormat = function (format) {
  14692. return hasNonNullableKey(format, 'block');
  14693. };
  14694. var isSelectorFormat = function (format) {
  14695. return hasNonNullableKey(format, 'selector');
  14696. };
  14697. var isInlineFormat = function (format) {
  14698. return hasNonNullableKey(format, 'inline');
  14699. };
  14700. var isMixedFormat = function (format) {
  14701. return isSelectorFormat(format) && isInlineFormat(format) && is$1(get$9(format, 'mixed'), true);
  14702. };
  14703. var shouldExpandToSelector = function (format) {
  14704. return isSelectorFormat(format) && format.expand !== false && !isInlineFormat(format);
  14705. };
  14706. var isBookmarkNode = isBookmarkNode$1;
  14707. var getParents$1 = getParents$2;
  14708. var isWhiteSpaceNode = isWhiteSpaceNode$1;
  14709. var isTextBlock = isTextBlock$1;
  14710. var isBogusBr = function (node) {
  14711. return isBr$5(node) && node.getAttribute('data-mce-bogus') && !node.nextSibling;
  14712. };
  14713. var findParentContentEditable = function (dom, node) {
  14714. var parent = node;
  14715. while (parent) {
  14716. if (isElement$5(parent) && dom.getContentEditable(parent)) {
  14717. return dom.getContentEditable(parent) === 'false' ? parent : node;
  14718. }
  14719. parent = parent.parentNode;
  14720. }
  14721. return node;
  14722. };
  14723. var walkText = function (start, node, offset, predicate) {
  14724. var str = node.data;
  14725. for (var i = offset; start ? i >= 0 : i < str.length; start ? i-- : i++) {
  14726. if (predicate(str.charAt(i))) {
  14727. return start ? i + 1 : i;
  14728. }
  14729. }
  14730. return -1;
  14731. };
  14732. var findSpace = function (start, node, offset) {
  14733. return walkText(start, node, offset, function (c) {
  14734. return isNbsp(c) || isWhiteSpace(c);
  14735. });
  14736. };
  14737. var findContent = function (start, node, offset) {
  14738. return walkText(start, node, offset, isContent);
  14739. };
  14740. var findWordEndPoint = function (dom, body, container, offset, start, includeTrailingSpaces) {
  14741. var lastTextNode;
  14742. var rootNode = dom.getParent(container, dom.isBlock) || body;
  14743. var walk = function (container, offset, pred) {
  14744. var textSeeker = TextSeeker(dom);
  14745. var walker = start ? textSeeker.backwards : textSeeker.forwards;
  14746. return Optional.from(walker(container, offset, function (text, textOffset) {
  14747. if (isBookmarkNode(text.parentNode)) {
  14748. return -1;
  14749. } else {
  14750. lastTextNode = text;
  14751. return pred(start, text, textOffset);
  14752. }
  14753. }, rootNode));
  14754. };
  14755. var spaceResult = walk(container, offset, findSpace);
  14756. return spaceResult.bind(function (result) {
  14757. return includeTrailingSpaces ? walk(result.container, result.offset + (start ? -1 : 0), findContent) : Optional.some(result);
  14758. }).orThunk(function () {
  14759. return lastTextNode ? Optional.some({
  14760. container: lastTextNode,
  14761. offset: start ? 0 : lastTextNode.length
  14762. }) : Optional.none();
  14763. });
  14764. };
  14765. var findSelectorEndPoint = function (dom, formatList, rng, container, siblingName) {
  14766. if (isText$7(container) && isEmpty$3(container.data) && container[siblingName]) {
  14767. container = container[siblingName];
  14768. }
  14769. var parents = getParents$1(dom, container);
  14770. for (var i = 0; i < parents.length; i++) {
  14771. for (var y = 0; y < formatList.length; y++) {
  14772. var curFormat = formatList[y];
  14773. if (isNonNullable(curFormat.collapsed) && curFormat.collapsed !== rng.collapsed) {
  14774. continue;
  14775. }
  14776. if (isSelectorFormat(curFormat) && dom.is(parents[i], curFormat.selector)) {
  14777. return parents[i];
  14778. }
  14779. }
  14780. }
  14781. return container;
  14782. };
  14783. var findBlockEndPoint = function (editor, formatList, container, siblingName) {
  14784. var node = container;
  14785. var dom = editor.dom;
  14786. var root = dom.getRoot();
  14787. var format = formatList[0];
  14788. if (isBlockFormat(format)) {
  14789. node = format.wrapper ? null : dom.getParent(container, format.block, root);
  14790. }
  14791. if (!node) {
  14792. var scopeRoot = dom.getParent(container, 'LI,TD,TH');
  14793. node = dom.getParent(isText$7(container) ? container.parentNode : container, function (node) {
  14794. return node !== root && isTextBlock(editor, node);
  14795. }, scopeRoot);
  14796. }
  14797. if (node && isBlockFormat(format) && format.wrapper) {
  14798. node = getParents$1(dom, node, 'ul,ol').reverse()[0] || node;
  14799. }
  14800. if (!node) {
  14801. node = container;
  14802. while (node[siblingName] && !dom.isBlock(node[siblingName])) {
  14803. node = node[siblingName];
  14804. if (isEq$5(node, 'br')) {
  14805. break;
  14806. }
  14807. }
  14808. }
  14809. return node || container;
  14810. };
  14811. var isAtBlockBoundary$1 = function (dom, root, container, siblingName) {
  14812. var parent = container.parentNode;
  14813. if (isNonNullable(container[siblingName])) {
  14814. return false;
  14815. } else if (parent === root || isNullable(parent) || dom.isBlock(parent)) {
  14816. return true;
  14817. } else {
  14818. return isAtBlockBoundary$1(dom, root, parent, siblingName);
  14819. }
  14820. };
  14821. var findParentContainer = function (dom, formatList, container, offset, start) {
  14822. var parent = container;
  14823. var siblingName = start ? 'previousSibling' : 'nextSibling';
  14824. var root = dom.getRoot();
  14825. if (isText$7(container) && !isWhiteSpaceNode(container)) {
  14826. if (start ? offset > 0 : offset < container.data.length) {
  14827. return container;
  14828. }
  14829. }
  14830. while (true) {
  14831. if (!formatList[0].block_expand && dom.isBlock(parent)) {
  14832. return parent;
  14833. }
  14834. for (var sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
  14835. var allowSpaces = isText$7(sibling) && !isAtBlockBoundary$1(dom, root, sibling, siblingName);
  14836. if (!isBookmarkNode(sibling) && !isBogusBr(sibling) && !isWhiteSpaceNode(sibling, allowSpaces)) {
  14837. return parent;
  14838. }
  14839. }
  14840. if (parent === root || parent.parentNode === root) {
  14841. container = parent;
  14842. break;
  14843. }
  14844. parent = parent.parentNode;
  14845. }
  14846. return container;
  14847. };
  14848. var isSelfOrParentBookmark = function (container) {
  14849. return isBookmarkNode(container.parentNode) || isBookmarkNode(container);
  14850. };
  14851. var expandRng = function (editor, rng, formatList, includeTrailingSpace) {
  14852. if (includeTrailingSpace === void 0) {
  14853. includeTrailingSpace = false;
  14854. }
  14855. var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
  14856. var dom = editor.dom;
  14857. var format = formatList[0];
  14858. if (isElement$5(startContainer) && startContainer.hasChildNodes()) {
  14859. startContainer = getNode$1(startContainer, startOffset);
  14860. if (isText$7(startContainer)) {
  14861. startOffset = 0;
  14862. }
  14863. }
  14864. if (isElement$5(endContainer) && endContainer.hasChildNodes()) {
  14865. endContainer = getNode$1(endContainer, rng.collapsed ? endOffset : endOffset - 1);
  14866. if (isText$7(endContainer)) {
  14867. endOffset = endContainer.nodeValue.length;
  14868. }
  14869. }
  14870. startContainer = findParentContentEditable(dom, startContainer);
  14871. endContainer = findParentContentEditable(dom, endContainer);
  14872. if (isSelfOrParentBookmark(startContainer)) {
  14873. startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode;
  14874. if (rng.collapsed) {
  14875. startContainer = startContainer.previousSibling || startContainer;
  14876. } else {
  14877. startContainer = startContainer.nextSibling || startContainer;
  14878. }
  14879. if (isText$7(startContainer)) {
  14880. startOffset = rng.collapsed ? startContainer.length : 0;
  14881. }
  14882. }
  14883. if (isSelfOrParentBookmark(endContainer)) {
  14884. endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode;
  14885. if (rng.collapsed) {
  14886. endContainer = endContainer.nextSibling || endContainer;
  14887. } else {
  14888. endContainer = endContainer.previousSibling || endContainer;
  14889. }
  14890. if (isText$7(endContainer)) {
  14891. endOffset = rng.collapsed ? 0 : endContainer.length;
  14892. }
  14893. }
  14894. if (rng.collapsed) {
  14895. var startPoint = findWordEndPoint(dom, editor.getBody(), startContainer, startOffset, true, includeTrailingSpace);
  14896. startPoint.each(function (_a) {
  14897. var container = _a.container, offset = _a.offset;
  14898. startContainer = container;
  14899. startOffset = offset;
  14900. });
  14901. var endPoint = findWordEndPoint(dom, editor.getBody(), endContainer, endOffset, false, includeTrailingSpace);
  14902. endPoint.each(function (_a) {
  14903. var container = _a.container, offset = _a.offset;
  14904. endContainer = container;
  14905. endOffset = offset;
  14906. });
  14907. }
  14908. if (isInlineFormat(format) || format.block_expand) {
  14909. if (!isInlineFormat(format) || (!isText$7(startContainer) || startOffset === 0)) {
  14910. startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
  14911. }
  14912. if (!isInlineFormat(format) || (!isText$7(endContainer) || endOffset === endContainer.nodeValue.length)) {
  14913. endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
  14914. }
  14915. }
  14916. if (shouldExpandToSelector(format)) {
  14917. startContainer = findSelectorEndPoint(dom, formatList, rng, startContainer, 'previousSibling');
  14918. endContainer = findSelectorEndPoint(dom, formatList, rng, endContainer, 'nextSibling');
  14919. }
  14920. if (isBlockFormat(format) || isSelectorFormat(format)) {
  14921. startContainer = findBlockEndPoint(editor, formatList, startContainer, 'previousSibling');
  14922. endContainer = findBlockEndPoint(editor, formatList, endContainer, 'nextSibling');
  14923. if (isBlockFormat(format)) {
  14924. if (!dom.isBlock(startContainer)) {
  14925. startContainer = findParentContainer(dom, formatList, startContainer, startOffset, true);
  14926. }
  14927. if (!dom.isBlock(endContainer)) {
  14928. endContainer = findParentContainer(dom, formatList, endContainer, endOffset, false);
  14929. }
  14930. }
  14931. }
  14932. if (isElement$5(startContainer)) {
  14933. startOffset = dom.nodeIndex(startContainer);
  14934. startContainer = startContainer.parentNode;
  14935. }
  14936. if (isElement$5(endContainer)) {
  14937. endOffset = dom.nodeIndex(endContainer) + 1;
  14938. endContainer = endContainer.parentNode;
  14939. }
  14940. return {
  14941. startContainer: startContainer,
  14942. startOffset: startOffset,
  14943. endContainer: endContainer,
  14944. endOffset: endOffset
  14945. };
  14946. };
  14947. var walk$2 = function (dom, rng, callback) {
  14948. var startOffset = rng.startOffset;
  14949. var startContainer = getNode$1(rng.startContainer, startOffset);
  14950. var endOffset = rng.endOffset;
  14951. var endContainer = getNode$1(rng.endContainer, endOffset - 1);
  14952. var exclude = function (nodes) {
  14953. var firstNode = nodes[0];
  14954. if (isText$7(firstNode) && firstNode === startContainer && startOffset >= firstNode.data.length) {
  14955. nodes.splice(0, 1);
  14956. }
  14957. var lastNode = nodes[nodes.length - 1];
  14958. if (endOffset === 0 && nodes.length > 0 && lastNode === endContainer && isText$7(lastNode)) {
  14959. nodes.splice(nodes.length - 1, 1);
  14960. }
  14961. return nodes;
  14962. };
  14963. var collectSiblings = function (node, name, endNode) {
  14964. var siblings = [];
  14965. for (; node && node !== endNode; node = node[name]) {
  14966. siblings.push(node);
  14967. }
  14968. return siblings;
  14969. };
  14970. var findEndPoint = function (node, root) {
  14971. return dom.getParent(node, function (node) {
  14972. return node.parentNode === root;
  14973. }, root);
  14974. };
  14975. var walkBoundary = function (startNode, endNode, next) {
  14976. var siblingName = next ? 'nextSibling' : 'previousSibling';
  14977. for (var node = startNode, parent_1 = node.parentNode; node && node !== endNode; node = parent_1) {
  14978. parent_1 = node.parentNode;
  14979. var siblings_1 = collectSiblings(node === startNode ? node : node[siblingName], siblingName);
  14980. if (siblings_1.length) {
  14981. if (!next) {
  14982. siblings_1.reverse();
  14983. }
  14984. callback(exclude(siblings_1));
  14985. }
  14986. }
  14987. };
  14988. if (startContainer === endContainer) {
  14989. return callback(exclude([startContainer]));
  14990. }
  14991. var ancestor = dom.findCommonAncestor(startContainer, endContainer);
  14992. if (dom.isChildOf(startContainer, endContainer)) {
  14993. return walkBoundary(startContainer, ancestor, true);
  14994. }
  14995. if (dom.isChildOf(endContainer, startContainer)) {
  14996. return walkBoundary(endContainer, ancestor);
  14997. }
  14998. var startPoint = findEndPoint(startContainer, ancestor) || startContainer;
  14999. var endPoint = findEndPoint(endContainer, ancestor) || endContainer;
  15000. walkBoundary(startContainer, startPoint, true);
  15001. var siblings = collectSiblings(startPoint === startContainer ? startPoint : startPoint.nextSibling, 'nextSibling', endPoint === endContainer ? endPoint.nextSibling : endPoint);
  15002. if (siblings.length) {
  15003. callback(exclude(siblings));
  15004. }
  15005. walkBoundary(endContainer, endPoint);
  15006. };
  15007. var getRanges = function (selection) {
  15008. var ranges = [];
  15009. if (selection) {
  15010. for (var i = 0; i < selection.rangeCount; i++) {
  15011. ranges.push(selection.getRangeAt(i));
  15012. }
  15013. }
  15014. return ranges;
  15015. };
  15016. var getSelectedNodes = function (ranges) {
  15017. return bind(ranges, function (range) {
  15018. var node = getSelectedNode(range);
  15019. return node ? [SugarElement.fromDom(node)] : [];
  15020. });
  15021. };
  15022. var hasMultipleRanges = function (selection) {
  15023. return getRanges(selection).length > 1;
  15024. };
  15025. var getCellsFromRanges = function (ranges) {
  15026. return filter$4(getSelectedNodes(ranges), isTableCell$4);
  15027. };
  15028. var getCellsFromElement = function (elm) {
  15029. return descendants(elm, 'td[data-mce-selected],th[data-mce-selected]');
  15030. };
  15031. var getCellsFromElementOrRanges = function (ranges, element) {
  15032. var selectedCells = getCellsFromElement(element);
  15033. return selectedCells.length > 0 ? selectedCells : getCellsFromRanges(ranges);
  15034. };
  15035. var getCellsFromEditor = function (editor) {
  15036. return getCellsFromElementOrRanges(getRanges(editor.selection.getSel()), SugarElement.fromDom(editor.getBody()));
  15037. };
  15038. var getClosestTable = function (cell, isRoot) {
  15039. return ancestor$2(cell, 'table', isRoot);
  15040. };
  15041. var getStartNode = function (rng) {
  15042. var sc = rng.startContainer, so = rng.startOffset;
  15043. if (isText$7(sc)) {
  15044. return so === 0 ? Optional.some(SugarElement.fromDom(sc)) : Optional.none();
  15045. } else {
  15046. return Optional.from(sc.childNodes[so]).map(SugarElement.fromDom);
  15047. }
  15048. };
  15049. var getEndNode = function (rng) {
  15050. var ec = rng.endContainer, eo = rng.endOffset;
  15051. if (isText$7(ec)) {
  15052. return eo === ec.data.length ? Optional.some(SugarElement.fromDom(ec)) : Optional.none();
  15053. } else {
  15054. return Optional.from(ec.childNodes[eo - 1]).map(SugarElement.fromDom);
  15055. }
  15056. };
  15057. var getFirstChildren = function (node) {
  15058. return firstChild(node).fold(constant([node]), function (child) {
  15059. return [node].concat(getFirstChildren(child));
  15060. });
  15061. };
  15062. var getLastChildren$1 = function (node) {
  15063. return lastChild(node).fold(constant([node]), function (child) {
  15064. if (name(child) === 'br') {
  15065. return prevSibling(child).map(function (sibling) {
  15066. return [node].concat(getLastChildren$1(sibling));
  15067. }).getOr([]);
  15068. } else {
  15069. return [node].concat(getLastChildren$1(child));
  15070. }
  15071. });
  15072. };
  15073. var hasAllContentsSelected = function (elm, rng) {
  15074. return lift2(getStartNode(rng), getEndNode(rng), function (startNode, endNode) {
  15075. var start = find$3(getFirstChildren(elm), curry(eq, startNode));
  15076. var end = find$3(getLastChildren$1(elm), curry(eq, endNode));
  15077. return start.isSome() && end.isSome();
  15078. }).getOr(false);
  15079. };
  15080. var moveEndPoint = function (dom, rng, node, start) {
  15081. var root = node, walker = new DomTreeWalker(node, root);
  15082. var moveCaretBeforeOnEnterElementsMap = filter$3(dom.schema.getMoveCaretBeforeOnEnterElements(), function (_, name) {
  15083. return !contains$3([
  15084. 'td',
  15085. 'th',
  15086. 'table'
  15087. ], name.toLowerCase());
  15088. });
  15089. do {
  15090. if (isText$7(node) && Tools.trim(node.nodeValue).length !== 0) {
  15091. if (start) {
  15092. rng.setStart(node, 0);
  15093. } else {
  15094. rng.setEnd(node, node.nodeValue.length);
  15095. }
  15096. return;
  15097. }
  15098. if (moveCaretBeforeOnEnterElementsMap[node.nodeName]) {
  15099. if (start) {
  15100. rng.setStartBefore(node);
  15101. } else {
  15102. if (node.nodeName === 'BR') {
  15103. rng.setEndBefore(node);
  15104. } else {
  15105. rng.setEndAfter(node);
  15106. }
  15107. }
  15108. return;
  15109. }
  15110. } while (node = start ? walker.next() : walker.prev());
  15111. if (root.nodeName === 'BODY') {
  15112. if (start) {
  15113. rng.setStart(root, 0);
  15114. } else {
  15115. rng.setEnd(root, root.childNodes.length);
  15116. }
  15117. }
  15118. };
  15119. var hasAnyRanges = function (editor) {
  15120. var sel = editor.selection.getSel();
  15121. return sel && sel.rangeCount > 0;
  15122. };
  15123. var runOnRanges = function (editor, executor) {
  15124. var fakeSelectionNodes = getCellsFromEditor(editor);
  15125. if (fakeSelectionNodes.length > 0) {
  15126. each$k(fakeSelectionNodes, function (elem) {
  15127. var node = elem.dom;
  15128. var fakeNodeRng = editor.dom.createRng();
  15129. fakeNodeRng.setStartBefore(node);
  15130. fakeNodeRng.setEndAfter(node);
  15131. executor(fakeNodeRng, true);
  15132. });
  15133. } else {
  15134. executor(editor.selection.getRng(), false);
  15135. }
  15136. };
  15137. var preserve = function (selection, fillBookmark, executor) {
  15138. var bookmark = getPersistentBookmark(selection, fillBookmark);
  15139. executor(bookmark);
  15140. selection.moveToBookmark(bookmark);
  15141. };
  15142. var NodeValue = function (is, name) {
  15143. var get = function (element) {
  15144. if (!is(element)) {
  15145. throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
  15146. }
  15147. return getOption(element).getOr('');
  15148. };
  15149. var getOption = function (element) {
  15150. return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none();
  15151. };
  15152. var set = function (element, value) {
  15153. if (!is(element)) {
  15154. throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
  15155. }
  15156. element.dom.nodeValue = value;
  15157. };
  15158. return {
  15159. get: get,
  15160. getOption: getOption,
  15161. set: set
  15162. };
  15163. };
  15164. var api$1 = NodeValue(isText$8, 'text');
  15165. var get$2 = function (element) {
  15166. return api$1.get(element);
  15167. };
  15168. var isZeroWidth = function (elem) {
  15169. return isText$8(elem) && get$2(elem) === ZWSP$1;
  15170. };
  15171. var context = function (editor, elem, wrapName, nodeName) {
  15172. return parent(elem).fold(function () {
  15173. return 'skipping';
  15174. }, function (parent) {
  15175. if (nodeName === 'br' || isZeroWidth(elem)) {
  15176. return 'valid';
  15177. } else if (isAnnotation(elem)) {
  15178. return 'existing';
  15179. } else if (isCaretNode(elem.dom)) {
  15180. return 'caret';
  15181. } else if (!isValid(editor, wrapName, nodeName) || !isValid(editor, name(parent), wrapName)) {
  15182. return 'invalid-child';
  15183. } else {
  15184. return 'valid';
  15185. }
  15186. });
  15187. };
  15188. var applyWordGrab = function (editor, rng) {
  15189. var r = expandRng(editor, rng, [{ inline: 'span' }]);
  15190. rng.setStart(r.startContainer, r.startOffset);
  15191. rng.setEnd(r.endContainer, r.endOffset);
  15192. editor.selection.setRng(rng);
  15193. };
  15194. var makeAnnotation = function (eDoc, _a, annotationName, decorate) {
  15195. var _b = _a.uid, uid = _b === void 0 ? generate('mce-annotation') : _b, data = __rest(_a, ['uid']);
  15196. var master = SugarElement.fromTag('span', eDoc);
  15197. add$1(master, annotation());
  15198. set$1(master, '' + dataAnnotationId(), uid);
  15199. set$1(master, '' + dataAnnotation(), annotationName);
  15200. var _c = decorate(uid, data), _d = _c.attributes, attributes = _d === void 0 ? {} : _d, _e = _c.classes, classes = _e === void 0 ? [] : _e;
  15201. setAll$1(master, attributes);
  15202. add(master, classes);
  15203. return master;
  15204. };
  15205. var annotate = function (editor, rng, annotationName, decorate, data) {
  15206. var newWrappers = [];
  15207. var master = makeAnnotation(editor.getDoc(), data, annotationName, decorate);
  15208. var wrapper = value();
  15209. var finishWrapper = function () {
  15210. wrapper.clear();
  15211. };
  15212. var getOrOpenWrapper = function () {
  15213. return wrapper.get().getOrThunk(function () {
  15214. var nu = shallow(master);
  15215. newWrappers.push(nu);
  15216. wrapper.set(nu);
  15217. return nu;
  15218. });
  15219. };
  15220. var processElements = function (elems) {
  15221. each$k(elems, processElement);
  15222. };
  15223. var processElement = function (elem) {
  15224. var ctx = context(editor, elem, 'span', name(elem));
  15225. switch (ctx) {
  15226. case 'invalid-child': {
  15227. finishWrapper();
  15228. var children$1 = children(elem);
  15229. processElements(children$1);
  15230. finishWrapper();
  15231. break;
  15232. }
  15233. case 'valid': {
  15234. var w = getOrOpenWrapper();
  15235. wrap$3(elem, w);
  15236. break;
  15237. }
  15238. }
  15239. };
  15240. var processNodes = function (nodes) {
  15241. var elems = map$3(nodes, SugarElement.fromDom);
  15242. processElements(elems);
  15243. };
  15244. walk$2(editor.dom, rng, function (nodes) {
  15245. finishWrapper();
  15246. processNodes(nodes);
  15247. });
  15248. return newWrappers;
  15249. };
  15250. var annotateWithBookmark = function (editor, name, settings, data) {
  15251. editor.undoManager.transact(function () {
  15252. var selection = editor.selection;
  15253. var initialRng = selection.getRng();
  15254. var hasFakeSelection = getCellsFromEditor(editor).length > 0;
  15255. if (initialRng.collapsed && !hasFakeSelection) {
  15256. applyWordGrab(editor, initialRng);
  15257. }
  15258. if (selection.getRng().collapsed && !hasFakeSelection) {
  15259. var wrapper = makeAnnotation(editor.getDoc(), data, name, settings.decorate);
  15260. set(wrapper, nbsp);
  15261. selection.getRng().insertNode(wrapper.dom);
  15262. selection.select(wrapper.dom);
  15263. } else {
  15264. preserve(selection, false, function () {
  15265. runOnRanges(editor, function (selectionRng) {
  15266. annotate(editor, selectionRng, name, settings.decorate, data);
  15267. });
  15268. });
  15269. }
  15270. });
  15271. };
  15272. var Annotator = function (editor) {
  15273. var registry = create$7();
  15274. setup$m(editor, registry);
  15275. var changes = setup$n(editor);
  15276. return {
  15277. register: function (name, settings) {
  15278. registry.register(name, settings);
  15279. },
  15280. annotate: function (name, data) {
  15281. registry.lookup(name).each(function (settings) {
  15282. annotateWithBookmark(editor, name, settings, data);
  15283. });
  15284. },
  15285. annotationChanged: function (name, callback) {
  15286. changes.addListener(name, callback);
  15287. },
  15288. remove: function (name) {
  15289. identify(editor, Optional.some(name)).each(function (_a) {
  15290. var elements = _a.elements;
  15291. each$k(elements, unwrap);
  15292. });
  15293. },
  15294. getAll: function (name) {
  15295. var directory = findAll(editor, name);
  15296. return map$2(directory, function (elems) {
  15297. return map$3(elems, function (elem) {
  15298. return elem.dom;
  15299. });
  15300. });
  15301. }
  15302. };
  15303. };
  15304. var BookmarkManager = function (selection) {
  15305. return {
  15306. getBookmark: curry(getBookmark$1, selection),
  15307. moveToBookmark: curry(moveToBookmark, selection)
  15308. };
  15309. };
  15310. BookmarkManager.isBookmarkNode = isBookmarkNode$1;
  15311. var getContentEditableRoot$1 = function (root, node) {
  15312. while (node && node !== root) {
  15313. if (isContentEditableTrue$4(node) || isContentEditableFalse$b(node)) {
  15314. return node;
  15315. }
  15316. node = node.parentNode;
  15317. }
  15318. return null;
  15319. };
  15320. var isXYWithinRange = function (clientX, clientY, range) {
  15321. if (range.collapsed) {
  15322. return false;
  15323. }
  15324. if (Env.browser.isIE() && range.startOffset === range.endOffset - 1 && range.startContainer === range.endContainer) {
  15325. var elm = range.startContainer.childNodes[range.startOffset];
  15326. if (isElement$5(elm)) {
  15327. return exists(elm.getClientRects(), function (rect) {
  15328. return containsXY(rect, clientX, clientY);
  15329. });
  15330. }
  15331. }
  15332. return exists(range.getClientRects(), function (rect) {
  15333. return containsXY(rect, clientX, clientY);
  15334. });
  15335. };
  15336. var firePreProcess = function (editor, args) {
  15337. return editor.fire('PreProcess', args);
  15338. };
  15339. var firePostProcess = function (editor, args) {
  15340. return editor.fire('PostProcess', args);
  15341. };
  15342. var fireRemove = function (editor) {
  15343. return editor.fire('remove');
  15344. };
  15345. var fireDetach = function (editor) {
  15346. return editor.fire('detach');
  15347. };
  15348. var fireSwitchMode = function (editor, mode) {
  15349. return editor.fire('SwitchMode', { mode: mode });
  15350. };
  15351. var fireObjectResizeStart = function (editor, target, width, height, origin) {
  15352. editor.fire('ObjectResizeStart', {
  15353. target: target,
  15354. width: width,
  15355. height: height,
  15356. origin: origin
  15357. });
  15358. };
  15359. var fireObjectResized = function (editor, target, width, height, origin) {
  15360. editor.fire('ObjectResized', {
  15361. target: target,
  15362. width: width,
  15363. height: height,
  15364. origin: origin
  15365. });
  15366. };
  15367. var firePreInit = function (editor) {
  15368. return editor.fire('PreInit');
  15369. };
  15370. var firePostRender = function (editor) {
  15371. return editor.fire('PostRender');
  15372. };
  15373. var fireInit = function (editor) {
  15374. return editor.fire('Init');
  15375. };
  15376. var firePlaceholderToggle = function (editor, state) {
  15377. return editor.fire('PlaceholderToggle', { state: state });
  15378. };
  15379. var fireError = function (editor, errorType, error) {
  15380. return editor.fire(errorType, error);
  15381. };
  15382. var fireFormatApply = function (editor, format, node, vars) {
  15383. return editor.fire('FormatApply', {
  15384. format: format,
  15385. node: node,
  15386. vars: vars
  15387. });
  15388. };
  15389. var fireFormatRemove = function (editor, format, node, vars) {
  15390. return editor.fire('FormatRemove', {
  15391. format: format,
  15392. node: node,
  15393. vars: vars
  15394. });
  15395. };
  15396. var VK = {
  15397. BACKSPACE: 8,
  15398. DELETE: 46,
  15399. DOWN: 40,
  15400. ENTER: 13,
  15401. ESC: 27,
  15402. LEFT: 37,
  15403. RIGHT: 39,
  15404. SPACEBAR: 32,
  15405. TAB: 9,
  15406. UP: 38,
  15407. PAGE_UP: 33,
  15408. PAGE_DOWN: 34,
  15409. END: 35,
  15410. HOME: 36,
  15411. modifierPressed: function (e) {
  15412. return e.shiftKey || e.ctrlKey || e.altKey || VK.metaKeyPressed(e);
  15413. },
  15414. metaKeyPressed: function (e) {
  15415. return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey;
  15416. }
  15417. };
  15418. var isContentEditableFalse$5 = isContentEditableFalse$b;
  15419. var ControlSelection = function (selection, editor) {
  15420. var elementSelectionAttr = 'data-mce-selected';
  15421. var dom = editor.dom, each = Tools.each;
  15422. var selectedElm, selectedElmGhost, resizeHelper, selectedHandle, resizeBackdrop;
  15423. var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
  15424. var width, height;
  15425. var editableDoc = editor.getDoc(), rootDocument = document;
  15426. var abs = Math.abs, round = Math.round, rootElement = editor.getBody();
  15427. var startScrollWidth, startScrollHeight;
  15428. var resizeHandles = {
  15429. nw: [
  15430. 0,
  15431. 0,
  15432. -1,
  15433. -1
  15434. ],
  15435. ne: [
  15436. 1,
  15437. 0,
  15438. 1,
  15439. -1
  15440. ],
  15441. se: [
  15442. 1,
  15443. 1,
  15444. 1,
  15445. 1
  15446. ],
  15447. sw: [
  15448. 0,
  15449. 1,
  15450. -1,
  15451. 1
  15452. ]
  15453. };
  15454. var isImage = function (elm) {
  15455. return elm && (elm.nodeName === 'IMG' || editor.dom.is(elm, 'figure.image'));
  15456. };
  15457. var isMedia = function (elm) {
  15458. return isMedia$2(elm) || dom.hasClass(elm, 'mce-preview-object');
  15459. };
  15460. var isEventOnImageOutsideRange = function (evt, range) {
  15461. if (evt.type === 'longpress' || evt.type.indexOf('touch') === 0) {
  15462. var touch = evt.touches[0];
  15463. return isImage(evt.target) && !isXYWithinRange(touch.clientX, touch.clientY, range);
  15464. } else {
  15465. return isImage(evt.target) && !isXYWithinRange(evt.clientX, evt.clientY, range);
  15466. }
  15467. };
  15468. var contextMenuSelectImage = function (evt) {
  15469. var target = evt.target;
  15470. if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) {
  15471. editor.selection.select(target);
  15472. }
  15473. };
  15474. var getResizeTargets = function (elm) {
  15475. if (dom.is(elm, 'figure.image')) {
  15476. return [elm.querySelector('img')];
  15477. } else if (dom.hasClass(elm, 'mce-preview-object') && isNonNullable(elm.firstElementChild)) {
  15478. return [
  15479. elm,
  15480. elm.firstElementChild
  15481. ];
  15482. } else {
  15483. return [elm];
  15484. }
  15485. };
  15486. var isResizable = function (elm) {
  15487. var selector = getObjectResizing(editor);
  15488. if (!selector) {
  15489. return false;
  15490. }
  15491. if (elm.getAttribute('data-mce-resize') === 'false') {
  15492. return false;
  15493. }
  15494. if (elm === editor.getBody()) {
  15495. return false;
  15496. }
  15497. if (dom.hasClass(elm, 'mce-preview-object')) {
  15498. return is$2(SugarElement.fromDom(elm.firstElementChild), selector);
  15499. } else {
  15500. return is$2(SugarElement.fromDom(elm), selector);
  15501. }
  15502. };
  15503. var createGhostElement = function (elm) {
  15504. if (isMedia(elm)) {
  15505. return dom.create('img', { src: Env.transparentSrc });
  15506. } else {
  15507. return elm.cloneNode(true);
  15508. }
  15509. };
  15510. var setSizeProp = function (element, name, value) {
  15511. if (isNonNullable(value)) {
  15512. var targets = getResizeTargets(element);
  15513. each$k(targets, function (target) {
  15514. if (target.style[name] || !editor.schema.isValid(target.nodeName.toLowerCase(), name)) {
  15515. dom.setStyle(target, name, value);
  15516. } else {
  15517. dom.setAttrib(target, name, '' + value);
  15518. }
  15519. });
  15520. }
  15521. };
  15522. var setGhostElmSize = function (ghostElm, width, height) {
  15523. setSizeProp(ghostElm, 'width', width);
  15524. setSizeProp(ghostElm, 'height', height);
  15525. };
  15526. var resizeGhostElement = function (e) {
  15527. var deltaX, deltaY, proportional;
  15528. var resizeHelperX, resizeHelperY;
  15529. deltaX = e.screenX - startX;
  15530. deltaY = e.screenY - startY;
  15531. width = deltaX * selectedHandle[2] + startW;
  15532. height = deltaY * selectedHandle[3] + startH;
  15533. width = width < 5 ? 5 : width;
  15534. height = height < 5 ? 5 : height;
  15535. if ((isImage(selectedElm) || isMedia(selectedElm)) && getResizeImgProportional(editor) !== false) {
  15536. proportional = !VK.modifierPressed(e);
  15537. } else {
  15538. proportional = VK.modifierPressed(e);
  15539. }
  15540. if (proportional) {
  15541. if (abs(deltaX) > abs(deltaY)) {
  15542. height = round(width * ratio);
  15543. width = round(height / ratio);
  15544. } else {
  15545. width = round(height / ratio);
  15546. height = round(width * ratio);
  15547. }
  15548. }
  15549. setGhostElmSize(selectedElmGhost, width, height);
  15550. resizeHelperX = selectedHandle.startPos.x + deltaX;
  15551. resizeHelperY = selectedHandle.startPos.y + deltaY;
  15552. resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
  15553. resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
  15554. dom.setStyles(resizeHelper, {
  15555. left: resizeHelperX,
  15556. top: resizeHelperY,
  15557. display: 'block'
  15558. });
  15559. resizeHelper.innerHTML = width + ' &times; ' + height;
  15560. if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
  15561. dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
  15562. }
  15563. if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
  15564. dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
  15565. }
  15566. deltaX = rootElement.scrollWidth - startScrollWidth;
  15567. deltaY = rootElement.scrollHeight - startScrollHeight;
  15568. if (deltaX + deltaY !== 0) {
  15569. dom.setStyles(resizeHelper, {
  15570. left: resizeHelperX - deltaX,
  15571. top: resizeHelperY - deltaY
  15572. });
  15573. }
  15574. if (!resizeStarted) {
  15575. fireObjectResizeStart(editor, selectedElm, startW, startH, 'corner-' + selectedHandle.name);
  15576. resizeStarted = true;
  15577. }
  15578. };
  15579. var endGhostResize = function () {
  15580. var wasResizeStarted = resizeStarted;
  15581. resizeStarted = false;
  15582. if (wasResizeStarted) {
  15583. setSizeProp(selectedElm, 'width', width);
  15584. setSizeProp(selectedElm, 'height', height);
  15585. }
  15586. dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
  15587. dom.unbind(editableDoc, 'mouseup', endGhostResize);
  15588. if (rootDocument !== editableDoc) {
  15589. dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
  15590. dom.unbind(rootDocument, 'mouseup', endGhostResize);
  15591. }
  15592. dom.remove(selectedElmGhost);
  15593. dom.remove(resizeHelper);
  15594. dom.remove(resizeBackdrop);
  15595. showResizeRect(selectedElm);
  15596. if (wasResizeStarted) {
  15597. fireObjectResized(editor, selectedElm, width, height, 'corner-' + selectedHandle.name);
  15598. dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
  15599. }
  15600. editor.nodeChanged();
  15601. };
  15602. var showResizeRect = function (targetElm) {
  15603. unbindResizeHandleEvents();
  15604. var position = dom.getPos(targetElm, rootElement);
  15605. var selectedElmX = position.x;
  15606. var selectedElmY = position.y;
  15607. var rect = targetElm.getBoundingClientRect();
  15608. var targetWidth = rect.width || rect.right - rect.left;
  15609. var targetHeight = rect.height || rect.bottom - rect.top;
  15610. if (selectedElm !== targetElm) {
  15611. hideResizeRect();
  15612. selectedElm = targetElm;
  15613. width = height = 0;
  15614. }
  15615. var e = editor.fire('ObjectSelected', { target: targetElm });
  15616. var selectedValue = dom.getAttrib(selectedElm, elementSelectionAttr, '1');
  15617. if (isResizable(targetElm) && !e.isDefaultPrevented()) {
  15618. each(resizeHandles, function (handle, name) {
  15619. var handleElm;
  15620. var startDrag = function (e) {
  15621. var target = getResizeTargets(selectedElm)[0];
  15622. startX = e.screenX;
  15623. startY = e.screenY;
  15624. startW = target.clientWidth;
  15625. startH = target.clientHeight;
  15626. ratio = startH / startW;
  15627. selectedHandle = handle;
  15628. selectedHandle.name = name;
  15629. selectedHandle.startPos = {
  15630. x: targetWidth * handle[0] + selectedElmX,
  15631. y: targetHeight * handle[1] + selectedElmY
  15632. };
  15633. startScrollWidth = rootElement.scrollWidth;
  15634. startScrollHeight = rootElement.scrollHeight;
  15635. resizeBackdrop = dom.add(rootElement, 'div', {
  15636. 'class': 'mce-resize-backdrop',
  15637. 'data-mce-bogus': 'all'
  15638. });
  15639. dom.setStyles(resizeBackdrop, {
  15640. position: 'fixed',
  15641. left: '0',
  15642. top: '0',
  15643. width: '100%',
  15644. height: '100%'
  15645. });
  15646. selectedElmGhost = createGhostElement(selectedElm);
  15647. dom.addClass(selectedElmGhost, 'mce-clonedresizable');
  15648. dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
  15649. selectedElmGhost.contentEditable = 'false';
  15650. dom.setStyles(selectedElmGhost, {
  15651. left: selectedElmX,
  15652. top: selectedElmY,
  15653. margin: 0
  15654. });
  15655. setGhostElmSize(selectedElmGhost, targetWidth, targetHeight);
  15656. selectedElmGhost.removeAttribute(elementSelectionAttr);
  15657. rootElement.appendChild(selectedElmGhost);
  15658. dom.bind(editableDoc, 'mousemove', resizeGhostElement);
  15659. dom.bind(editableDoc, 'mouseup', endGhostResize);
  15660. if (rootDocument !== editableDoc) {
  15661. dom.bind(rootDocument, 'mousemove', resizeGhostElement);
  15662. dom.bind(rootDocument, 'mouseup', endGhostResize);
  15663. }
  15664. resizeHelper = dom.add(rootElement, 'div', {
  15665. 'class': 'mce-resize-helper',
  15666. 'data-mce-bogus': 'all'
  15667. }, startW + ' &times; ' + startH);
  15668. };
  15669. handleElm = dom.get('mceResizeHandle' + name);
  15670. if (handleElm) {
  15671. dom.remove(handleElm);
  15672. }
  15673. handleElm = dom.add(rootElement, 'div', {
  15674. 'id': 'mceResizeHandle' + name,
  15675. 'data-mce-bogus': 'all',
  15676. 'class': 'mce-resizehandle',
  15677. 'unselectable': true,
  15678. 'style': 'cursor:' + name + '-resize; margin:0; padding:0'
  15679. });
  15680. if (Env.ie === 11) {
  15681. handleElm.contentEditable = false;
  15682. }
  15683. dom.bind(handleElm, 'mousedown', function (e) {
  15684. e.stopImmediatePropagation();
  15685. e.preventDefault();
  15686. startDrag(e);
  15687. });
  15688. handle.elm = handleElm;
  15689. dom.setStyles(handleElm, {
  15690. left: targetWidth * handle[0] + selectedElmX - handleElm.offsetWidth / 2,
  15691. top: targetHeight * handle[1] + selectedElmY - handleElm.offsetHeight / 2
  15692. });
  15693. });
  15694. } else {
  15695. hideResizeRect();
  15696. }
  15697. if (!dom.getAttrib(selectedElm, elementSelectionAttr)) {
  15698. selectedElm.setAttribute(elementSelectionAttr, selectedValue);
  15699. }
  15700. };
  15701. var hideResizeRect = function () {
  15702. unbindResizeHandleEvents();
  15703. if (selectedElm) {
  15704. selectedElm.removeAttribute(elementSelectionAttr);
  15705. }
  15706. each$j(resizeHandles, function (value, name) {
  15707. var handleElm = dom.get('mceResizeHandle' + name);
  15708. if (handleElm) {
  15709. dom.unbind(handleElm);
  15710. dom.remove(handleElm);
  15711. }
  15712. });
  15713. };
  15714. var updateResizeRect = function (e) {
  15715. var startElm, controlElm;
  15716. var isChildOrEqual = function (node, parent) {
  15717. if (node) {
  15718. do {
  15719. if (node === parent) {
  15720. return true;
  15721. }
  15722. } while (node = node.parentNode);
  15723. }
  15724. };
  15725. if (resizeStarted || editor.removed) {
  15726. return;
  15727. }
  15728. each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function (img) {
  15729. img.removeAttribute(elementSelectionAttr);
  15730. });
  15731. controlElm = e.type === 'mousedown' ? e.target : selection.getNode();
  15732. controlElm = dom.$(controlElm).closest('table,img,figure.image,hr,video,span.mce-preview-object')[0];
  15733. if (isChildOrEqual(controlElm, rootElement)) {
  15734. disableGeckoResize();
  15735. startElm = selection.getStart(true);
  15736. if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
  15737. showResizeRect(controlElm);
  15738. return;
  15739. }
  15740. }
  15741. hideResizeRect();
  15742. };
  15743. var isWithinContentEditableFalse = function (elm) {
  15744. return isContentEditableFalse$5(getContentEditableRoot$1(editor.getBody(), elm));
  15745. };
  15746. var unbindResizeHandleEvents = function () {
  15747. each$j(resizeHandles, function (handle) {
  15748. if (handle.elm) {
  15749. dom.unbind(handle.elm);
  15750. delete handle.elm;
  15751. }
  15752. });
  15753. };
  15754. var disableGeckoResize = function () {
  15755. try {
  15756. editor.getDoc().execCommand('enableObjectResizing', false, 'false');
  15757. } catch (ex) {
  15758. }
  15759. };
  15760. editor.on('init', function () {
  15761. disableGeckoResize();
  15762. if (Env.browser.isIE() || Env.browser.isEdge()) {
  15763. editor.on('mousedown click', function (e) {
  15764. var target = e.target, nodeName = target.nodeName;
  15765. if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName) && !isWithinContentEditableFalse(target)) {
  15766. if (e.button !== 2) {
  15767. editor.selection.select(target, nodeName === 'TABLE');
  15768. }
  15769. if (e.type === 'mousedown') {
  15770. editor.nodeChanged();
  15771. }
  15772. }
  15773. });
  15774. var handleMSControlSelect_1 = function (e) {
  15775. var delayedSelect = function (node) {
  15776. Delay.setEditorTimeout(editor, function () {
  15777. return editor.selection.select(node);
  15778. });
  15779. };
  15780. if (isWithinContentEditableFalse(e.target) || isMedia$2(e.target)) {
  15781. e.preventDefault();
  15782. delayedSelect(e.target);
  15783. return;
  15784. }
  15785. if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
  15786. e.preventDefault();
  15787. if (e.target.tagName === 'IMG') {
  15788. delayedSelect(e.target);
  15789. }
  15790. }
  15791. };
  15792. dom.bind(rootElement, 'mscontrolselect', handleMSControlSelect_1);
  15793. editor.on('remove', function () {
  15794. return dom.unbind(rootElement, 'mscontrolselect', handleMSControlSelect_1);
  15795. });
  15796. }
  15797. var throttledUpdateResizeRect = Delay.throttle(function (e) {
  15798. if (!editor.composing) {
  15799. updateResizeRect(e);
  15800. }
  15801. });
  15802. editor.on('nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged', throttledUpdateResizeRect);
  15803. editor.on('keyup compositionend', function (e) {
  15804. if (selectedElm && selectedElm.nodeName === 'TABLE') {
  15805. throttledUpdateResizeRect(e);
  15806. }
  15807. });
  15808. editor.on('hide blur', hideResizeRect);
  15809. editor.on('contextmenu longpress', contextMenuSelectImage, true);
  15810. });
  15811. editor.on('remove', unbindResizeHandleEvents);
  15812. var destroy = function () {
  15813. selectedElm = selectedElmGhost = resizeBackdrop = null;
  15814. };
  15815. return {
  15816. isResizable: isResizable,
  15817. showResizeRect: showResizeRect,
  15818. hideResizeRect: hideResizeRect,
  15819. updateResizeRect: updateResizeRect,
  15820. destroy: destroy
  15821. };
  15822. };
  15823. var hasCeProperty = function (node) {
  15824. return isContentEditableTrue$4(node) || isContentEditableFalse$b(node);
  15825. };
  15826. var findParent$1 = function (node, rootNode, predicate) {
  15827. while (node && node !== rootNode) {
  15828. if (predicate(node)) {
  15829. return node;
  15830. }
  15831. node = node.parentNode;
  15832. }
  15833. return null;
  15834. };
  15835. var findClosestIeRange = function (clientX, clientY, doc) {
  15836. var rects;
  15837. var element = doc.elementFromPoint(clientX, clientY);
  15838. var rng = doc.body.createTextRange();
  15839. if (!element || element.tagName === 'HTML') {
  15840. element = doc.body;
  15841. }
  15842. rng.moveToElementText(element);
  15843. rects = Tools.toArray(rng.getClientRects());
  15844. rects = rects.sort(function (a, b) {
  15845. a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY));
  15846. b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY));
  15847. return a - b;
  15848. });
  15849. if (rects.length > 0) {
  15850. clientY = (rects[0].bottom + rects[0].top) / 2;
  15851. try {
  15852. rng.moveToPoint(clientX, clientY);
  15853. rng.collapse(true);
  15854. return rng;
  15855. } catch (ex) {
  15856. }
  15857. }
  15858. return null;
  15859. };
  15860. var moveOutOfContentEditableFalse = function (rng, rootNode) {
  15861. var parentElement = rng && rng.parentElement ? rng.parentElement() : null;
  15862. return isContentEditableFalse$b(findParent$1(parentElement, rootNode, hasCeProperty)) ? null : rng;
  15863. };
  15864. var fromPoint = function (clientX, clientY, doc) {
  15865. var rng, point;
  15866. var pointDoc = doc;
  15867. if (pointDoc.caretPositionFromPoint) {
  15868. point = pointDoc.caretPositionFromPoint(clientX, clientY);
  15869. if (point) {
  15870. rng = doc.createRange();
  15871. rng.setStart(point.offsetNode, point.offset);
  15872. rng.collapse(true);
  15873. }
  15874. } else if (pointDoc.caretRangeFromPoint) {
  15875. rng = pointDoc.caretRangeFromPoint(clientX, clientY);
  15876. } else if (pointDoc.body.createTextRange) {
  15877. rng = pointDoc.body.createTextRange();
  15878. try {
  15879. rng.moveToPoint(clientX, clientY);
  15880. rng.collapse(true);
  15881. } catch (ex) {
  15882. rng = findClosestIeRange(clientX, clientY, doc);
  15883. }
  15884. return moveOutOfContentEditableFalse(rng, doc.body);
  15885. }
  15886. return rng;
  15887. };
  15888. var isEq$4 = function (rng1, rng2) {
  15889. return rng1 && rng2 && (rng1.startContainer === rng2.startContainer && rng1.startOffset === rng2.startOffset) && (rng1.endContainer === rng2.endContainer && rng1.endOffset === rng2.endOffset);
  15890. };
  15891. var findParent = function (node, rootNode, predicate) {
  15892. while (node && node !== rootNode) {
  15893. if (predicate(node)) {
  15894. return node;
  15895. }
  15896. node = node.parentNode;
  15897. }
  15898. return null;
  15899. };
  15900. var hasParent$1 = function (node, rootNode, predicate) {
  15901. return findParent(node, rootNode, predicate) !== null;
  15902. };
  15903. var hasParentWithName = function (node, rootNode, name) {
  15904. return hasParent$1(node, rootNode, function (node) {
  15905. return node.nodeName === name;
  15906. });
  15907. };
  15908. var isTable = function (node) {
  15909. return node && node.nodeName === 'TABLE';
  15910. };
  15911. var isTableCell$2 = function (node) {
  15912. return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
  15913. };
  15914. var isCeFalseCaretContainer = function (node, rootNode) {
  15915. return isCaretContainer$2(node) && hasParent$1(node, rootNode, isCaretNode) === false;
  15916. };
  15917. var hasBrBeforeAfter = function (dom, node, left) {
  15918. var walker = new DomTreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || dom.getRoot());
  15919. while (node = walker[left ? 'prev' : 'next']()) {
  15920. if (isBr$5(node)) {
  15921. return true;
  15922. }
  15923. }
  15924. };
  15925. var isPrevNode = function (node, name) {
  15926. return node.previousSibling && node.previousSibling.nodeName === name;
  15927. };
  15928. var hasContentEditableFalseParent = function (body, node) {
  15929. while (node && node !== body) {
  15930. if (isContentEditableFalse$b(node)) {
  15931. return true;
  15932. }
  15933. node = node.parentNode;
  15934. }
  15935. return false;
  15936. };
  15937. var findTextNodeRelative = function (dom, isAfterNode, collapsed, left, startNode) {
  15938. var lastInlineElement;
  15939. var body = dom.getRoot();
  15940. var node;
  15941. var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
  15942. var parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
  15943. if (left && isBr$5(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) {
  15944. return Optional.some(CaretPosition(startNode.parentNode, dom.nodeIndex(startNode)));
  15945. }
  15946. var walker = new DomTreeWalker(startNode, parentBlockContainer);
  15947. while (node = walker[left ? 'prev' : 'next']()) {
  15948. if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) {
  15949. return Optional.none();
  15950. }
  15951. if (isText$7(node) && node.nodeValue.length > 0) {
  15952. if (hasParentWithName(node, body, 'A') === false) {
  15953. return Optional.some(CaretPosition(node, left ? node.nodeValue.length : 0));
  15954. }
  15955. return Optional.none();
  15956. }
  15957. if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
  15958. return Optional.none();
  15959. }
  15960. lastInlineElement = node;
  15961. }
  15962. if (collapsed && lastInlineElement) {
  15963. return Optional.some(CaretPosition(lastInlineElement, 0));
  15964. }
  15965. return Optional.none();
  15966. };
  15967. var normalizeEndPoint = function (dom, collapsed, start, rng) {
  15968. var container, offset;
  15969. var body = dom.getRoot();
  15970. var node;
  15971. var directionLeft, normalized = false;
  15972. container = rng[(start ? 'start' : 'end') + 'Container'];
  15973. offset = rng[(start ? 'start' : 'end') + 'Offset'];
  15974. var isAfterNode = isElement$5(container) && offset === container.childNodes.length;
  15975. var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
  15976. directionLeft = start;
  15977. if (isCaretContainer$2(container)) {
  15978. return Optional.none();
  15979. }
  15980. if (isElement$5(container) && offset > container.childNodes.length - 1) {
  15981. directionLeft = false;
  15982. }
  15983. if (isDocument$1(container)) {
  15984. container = body;
  15985. offset = 0;
  15986. }
  15987. if (container === body) {
  15988. if (directionLeft) {
  15989. node = container.childNodes[offset > 0 ? offset - 1 : 0];
  15990. if (node) {
  15991. if (isCaretContainer$2(node)) {
  15992. return Optional.none();
  15993. }
  15994. if (nonEmptyElementsMap[node.nodeName] || isTable(node)) {
  15995. return Optional.none();
  15996. }
  15997. }
  15998. }
  15999. if (container.hasChildNodes()) {
  16000. offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
  16001. container = container.childNodes[offset];
  16002. offset = isText$7(container) && isAfterNode ? container.data.length : 0;
  16003. if (!collapsed && container === body.lastChild && isTable(container)) {
  16004. return Optional.none();
  16005. }
  16006. if (hasContentEditableFalseParent(body, container) || isCaretContainer$2(container)) {
  16007. return Optional.none();
  16008. }
  16009. if (container.hasChildNodes() && isTable(container) === false) {
  16010. node = container;
  16011. var walker = new DomTreeWalker(container, body);
  16012. do {
  16013. if (isContentEditableFalse$b(node) || isCaretContainer$2(node)) {
  16014. normalized = false;
  16015. break;
  16016. }
  16017. if (isText$7(node) && node.nodeValue.length > 0) {
  16018. offset = directionLeft ? 0 : node.nodeValue.length;
  16019. container = node;
  16020. normalized = true;
  16021. break;
  16022. }
  16023. if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell$2(node)) {
  16024. offset = dom.nodeIndex(node);
  16025. container = node.parentNode;
  16026. if (!directionLeft) {
  16027. offset++;
  16028. }
  16029. normalized = true;
  16030. break;
  16031. }
  16032. } while (node = directionLeft ? walker.next() : walker.prev());
  16033. }
  16034. }
  16035. }
  16036. if (collapsed) {
  16037. if (isText$7(container) && offset === 0) {
  16038. findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each(function (pos) {
  16039. container = pos.container();
  16040. offset = pos.offset();
  16041. normalized = true;
  16042. });
  16043. }
  16044. if (isElement$5(container)) {
  16045. node = container.childNodes[offset];
  16046. if (!node) {
  16047. node = container.childNodes[offset - 1];
  16048. }
  16049. if (node && isBr$5(node) && !isPrevNode(node, 'A') && !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) {
  16050. findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each(function (pos) {
  16051. container = pos.container();
  16052. offset = pos.offset();
  16053. normalized = true;
  16054. });
  16055. }
  16056. }
  16057. }
  16058. if (directionLeft && !collapsed && isText$7(container) && offset === container.nodeValue.length) {
  16059. findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each(function (pos) {
  16060. container = pos.container();
  16061. offset = pos.offset();
  16062. normalized = true;
  16063. });
  16064. }
  16065. return normalized ? Optional.some(CaretPosition(container, offset)) : Optional.none();
  16066. };
  16067. var normalize$2 = function (dom, rng) {
  16068. var collapsed = rng.collapsed, normRng = rng.cloneRange();
  16069. var startPos = CaretPosition.fromRangeStart(rng);
  16070. normalizeEndPoint(dom, collapsed, true, normRng).each(function (pos) {
  16071. if (!collapsed || !CaretPosition.isAbove(startPos, pos)) {
  16072. normRng.setStart(pos.container(), pos.offset());
  16073. }
  16074. });
  16075. if (!collapsed) {
  16076. normalizeEndPoint(dom, collapsed, false, normRng).each(function (pos) {
  16077. normRng.setEnd(pos.container(), pos.offset());
  16078. });
  16079. }
  16080. if (collapsed) {
  16081. normRng.collapse(true);
  16082. }
  16083. return isEq$4(rng, normRng) ? Optional.none() : Optional.some(normRng);
  16084. };
  16085. var splitText = function (node, offset) {
  16086. return node.splitText(offset);
  16087. };
  16088. var split = function (rng) {
  16089. var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
  16090. if (startContainer === endContainer && isText$7(startContainer)) {
  16091. if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
  16092. endContainer = splitText(startContainer, startOffset);
  16093. startContainer = endContainer.previousSibling;
  16094. if (endOffset > startOffset) {
  16095. endOffset = endOffset - startOffset;
  16096. startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
  16097. endOffset = endContainer.nodeValue.length;
  16098. startOffset = 0;
  16099. } else {
  16100. endOffset = 0;
  16101. }
  16102. }
  16103. } else {
  16104. if (isText$7(startContainer) && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
  16105. startContainer = splitText(startContainer, startOffset);
  16106. startOffset = 0;
  16107. }
  16108. if (isText$7(endContainer) && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
  16109. endContainer = splitText(endContainer, endOffset).previousSibling;
  16110. endOffset = endContainer.nodeValue.length;
  16111. }
  16112. }
  16113. return {
  16114. startContainer: startContainer,
  16115. startOffset: startOffset,
  16116. endContainer: endContainer,
  16117. endOffset: endOffset
  16118. };
  16119. };
  16120. var RangeUtils = function (dom) {
  16121. var walk = function (rng, callback) {
  16122. return walk$2(dom, rng, callback);
  16123. };
  16124. var split$1 = split;
  16125. var normalize = function (rng) {
  16126. return normalize$2(dom, rng).fold(never, function (normalizedRng) {
  16127. rng.setStart(normalizedRng.startContainer, normalizedRng.startOffset);
  16128. rng.setEnd(normalizedRng.endContainer, normalizedRng.endOffset);
  16129. return true;
  16130. });
  16131. };
  16132. return {
  16133. walk: walk,
  16134. split: split$1,
  16135. normalize: normalize
  16136. };
  16137. };
  16138. RangeUtils.compareRanges = isEq$4;
  16139. RangeUtils.getCaretRangeFromPoint = fromPoint;
  16140. RangeUtils.getSelectedNode = getSelectedNode;
  16141. RangeUtils.getNode = getNode$1;
  16142. var Dimension = function (name, getOffset) {
  16143. var set = function (element, h) {
  16144. if (!isNumber(h) && !h.match(/^[0-9]+$/)) {
  16145. throw new Error(name + '.set accepts only positive integer values. Value was ' + h);
  16146. }
  16147. var dom = element.dom;
  16148. if (isSupported(dom)) {
  16149. dom.style[name] = h + 'px';
  16150. }
  16151. };
  16152. var get = function (element) {
  16153. var r = getOffset(element);
  16154. if (r <= 0 || r === null) {
  16155. var css = get$5(element, name);
  16156. return parseFloat(css) || 0;
  16157. }
  16158. return r;
  16159. };
  16160. var getOuter = get;
  16161. var aggregate = function (element, properties) {
  16162. return foldl(properties, function (acc, property) {
  16163. var val = get$5(element, property);
  16164. var value = val === undefined ? 0 : parseInt(val, 10);
  16165. return isNaN(value) ? acc : acc + value;
  16166. }, 0);
  16167. };
  16168. var max = function (element, value, properties) {
  16169. var cumulativeInclusions = aggregate(element, properties);
  16170. var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0;
  16171. return absoluteMax;
  16172. };
  16173. return {
  16174. set: set,
  16175. get: get,
  16176. getOuter: getOuter,
  16177. aggregate: aggregate,
  16178. max: max
  16179. };
  16180. };
  16181. var api = Dimension('height', function (element) {
  16182. var dom = element.dom;
  16183. return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight;
  16184. });
  16185. var get$1 = function (element) {
  16186. return api.get(element);
  16187. };
  16188. var walkUp = function (navigation, doc) {
  16189. var frame = navigation.view(doc);
  16190. return frame.fold(constant([]), function (f) {
  16191. var parent = navigation.owner(f);
  16192. var rest = walkUp(navigation, parent);
  16193. return [f].concat(rest);
  16194. });
  16195. };
  16196. var pathTo = function (element, navigation) {
  16197. var d = navigation.owner(element);
  16198. return walkUp(navigation, d);
  16199. };
  16200. var view = function (doc) {
  16201. var _a;
  16202. var element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement);
  16203. return element.map(SugarElement.fromDom);
  16204. };
  16205. var owner = function (element) {
  16206. return documentOrOwner(element);
  16207. };
  16208. var Navigation = /*#__PURE__*/Object.freeze({
  16209. __proto__: null,
  16210. view: view,
  16211. owner: owner
  16212. });
  16213. var find$1 = function (element) {
  16214. var doc = SugarElement.fromDom(document);
  16215. var scroll = get$8(doc);
  16216. var frames = pathTo(element, Navigation);
  16217. var offset = viewport(element);
  16218. var r = foldr(frames, function (b, a) {
  16219. var loc = viewport(a);
  16220. return {
  16221. left: b.left + loc.left,
  16222. top: b.top + loc.top
  16223. };
  16224. }, {
  16225. left: 0,
  16226. top: 0
  16227. });
  16228. return SugarPosition(r.left + offset.left + scroll.left, r.top + offset.top + scroll.top);
  16229. };
  16230. var excludeFromDescend = function (element) {
  16231. return name(element) === 'textarea';
  16232. };
  16233. var fireScrollIntoViewEvent = function (editor, data) {
  16234. var scrollEvent = editor.fire('ScrollIntoView', data);
  16235. return scrollEvent.isDefaultPrevented();
  16236. };
  16237. var fireAfterScrollIntoViewEvent = function (editor, data) {
  16238. editor.fire('AfterScrollIntoView', data);
  16239. };
  16240. var descend = function (element, offset) {
  16241. var children$1 = children(element);
  16242. if (children$1.length === 0 || excludeFromDescend(element)) {
  16243. return {
  16244. element: element,
  16245. offset: offset
  16246. };
  16247. } else if (offset < children$1.length && !excludeFromDescend(children$1[offset])) {
  16248. return {
  16249. element: children$1[offset],
  16250. offset: 0
  16251. };
  16252. } else {
  16253. var last = children$1[children$1.length - 1];
  16254. if (excludeFromDescend(last)) {
  16255. return {
  16256. element: element,
  16257. offset: offset
  16258. };
  16259. } else {
  16260. if (name(last) === 'img') {
  16261. return {
  16262. element: last,
  16263. offset: 1
  16264. };
  16265. } else if (isText$8(last)) {
  16266. return {
  16267. element: last,
  16268. offset: get$2(last).length
  16269. };
  16270. } else {
  16271. return {
  16272. element: last,
  16273. offset: children(last).length
  16274. };
  16275. }
  16276. }
  16277. }
  16278. };
  16279. var markerInfo = function (element, cleanupFun) {
  16280. var pos = absolute(element);
  16281. var height = get$1(element);
  16282. return {
  16283. element: element,
  16284. bottom: pos.top + height,
  16285. height: height,
  16286. pos: pos,
  16287. cleanup: cleanupFun
  16288. };
  16289. };
  16290. var createMarker = function (element, offset) {
  16291. var startPoint = descend(element, offset);
  16292. var span = SugarElement.fromHtml('<span data-mce-bogus="all" style="display: inline-block;">' + ZWSP$1 + '</span>');
  16293. before$4(startPoint.element, span);
  16294. return markerInfo(span, function () {
  16295. return remove$7(span);
  16296. });
  16297. };
  16298. var elementMarker = function (element) {
  16299. return markerInfo(SugarElement.fromDom(element), noop);
  16300. };
  16301. var withMarker = function (editor, f, rng, alignToTop) {
  16302. preserveWith(editor, function (_s, _e) {
  16303. return applyWithMarker(editor, f, rng, alignToTop);
  16304. }, rng);
  16305. };
  16306. var withScrollEvents = function (editor, doc, f, marker, alignToTop) {
  16307. var data = {
  16308. elm: marker.element.dom,
  16309. alignToTop: alignToTop
  16310. };
  16311. if (fireScrollIntoViewEvent(editor, data)) {
  16312. return;
  16313. }
  16314. var scrollTop = get$8(doc).top;
  16315. f(doc, scrollTop, marker, alignToTop);
  16316. fireAfterScrollIntoViewEvent(editor, data);
  16317. };
  16318. var applyWithMarker = function (editor, f, rng, alignToTop) {
  16319. var body = SugarElement.fromDom(editor.getBody());
  16320. var doc = SugarElement.fromDom(editor.getDoc());
  16321. reflow(body);
  16322. var marker = createMarker(SugarElement.fromDom(rng.startContainer), rng.startOffset);
  16323. withScrollEvents(editor, doc, f, marker, alignToTop);
  16324. marker.cleanup();
  16325. };
  16326. var withElement = function (editor, element, f, alignToTop) {
  16327. var doc = SugarElement.fromDom(editor.getDoc());
  16328. withScrollEvents(editor, doc, f, elementMarker(element), alignToTop);
  16329. };
  16330. var preserveWith = function (editor, f, rng) {
  16331. var startElement = rng.startContainer;
  16332. var startOffset = rng.startOffset;
  16333. var endElement = rng.endContainer;
  16334. var endOffset = rng.endOffset;
  16335. f(SugarElement.fromDom(startElement), SugarElement.fromDom(endElement));
  16336. var newRng = editor.dom.createRng();
  16337. newRng.setStart(startElement, startOffset);
  16338. newRng.setEnd(endElement, endOffset);
  16339. editor.selection.setRng(rng);
  16340. };
  16341. var scrollToMarker = function (marker, viewHeight, alignToTop, doc) {
  16342. var pos = marker.pos;
  16343. if (alignToTop) {
  16344. to(pos.left, pos.top, doc);
  16345. } else {
  16346. var y = pos.top - viewHeight + marker.height;
  16347. to(pos.left, y, doc);
  16348. }
  16349. };
  16350. var intoWindowIfNeeded = function (doc, scrollTop, viewHeight, marker, alignToTop) {
  16351. var viewportBottom = viewHeight + scrollTop;
  16352. var markerTop = marker.pos.top;
  16353. var markerBottom = marker.bottom;
  16354. var largerThanViewport = markerBottom - markerTop >= viewHeight;
  16355. if (markerTop < scrollTop) {
  16356. scrollToMarker(marker, viewHeight, alignToTop !== false, doc);
  16357. } else if (markerTop > viewportBottom) {
  16358. var align = largerThanViewport ? alignToTop !== false : alignToTop === true;
  16359. scrollToMarker(marker, viewHeight, align, doc);
  16360. } else if (markerBottom > viewportBottom && !largerThanViewport) {
  16361. scrollToMarker(marker, viewHeight, alignToTop === true, doc);
  16362. }
  16363. };
  16364. var intoWindow = function (doc, scrollTop, marker, alignToTop) {
  16365. var viewHeight = doc.dom.defaultView.innerHeight;
  16366. intoWindowIfNeeded(doc, scrollTop, viewHeight, marker, alignToTop);
  16367. };
  16368. var intoFrame = function (doc, scrollTop, marker, alignToTop) {
  16369. var frameViewHeight = doc.dom.defaultView.innerHeight;
  16370. intoWindowIfNeeded(doc, scrollTop, frameViewHeight, marker, alignToTop);
  16371. var op = find$1(marker.element);
  16372. var viewportBounds = getBounds(window);
  16373. if (op.top < viewportBounds.y) {
  16374. intoView(marker.element, alignToTop !== false);
  16375. } else if (op.top > viewportBounds.bottom) {
  16376. intoView(marker.element, alignToTop === true);
  16377. }
  16378. };
  16379. var rangeIntoWindow = function (editor, rng, alignToTop) {
  16380. return withMarker(editor, intoWindow, rng, alignToTop);
  16381. };
  16382. var elementIntoWindow = function (editor, element, alignToTop) {
  16383. return withElement(editor, element, intoWindow, alignToTop);
  16384. };
  16385. var rangeIntoFrame = function (editor, rng, alignToTop) {
  16386. return withMarker(editor, intoFrame, rng, alignToTop);
  16387. };
  16388. var elementIntoFrame = function (editor, element, alignToTop) {
  16389. return withElement(editor, element, intoFrame, alignToTop);
  16390. };
  16391. var scrollElementIntoView = function (editor, element, alignToTop) {
  16392. var scroller = editor.inline ? elementIntoWindow : elementIntoFrame;
  16393. scroller(editor, element, alignToTop);
  16394. };
  16395. var scrollRangeIntoView = function (editor, rng, alignToTop) {
  16396. var scroller = editor.inline ? rangeIntoWindow : rangeIntoFrame;
  16397. scroller(editor, rng, alignToTop);
  16398. };
  16399. var getDocument = function () {
  16400. return SugarElement.fromDom(document);
  16401. };
  16402. var focus$1 = function (element) {
  16403. return element.dom.focus();
  16404. };
  16405. var hasFocus$1 = function (element) {
  16406. var root = getRootNode(element).dom;
  16407. return element.dom === root.activeElement;
  16408. };
  16409. var active = function (root) {
  16410. if (root === void 0) {
  16411. root = getDocument();
  16412. }
  16413. return Optional.from(root.dom.activeElement).map(SugarElement.fromDom);
  16414. };
  16415. var search = function (element) {
  16416. return active(getRootNode(element)).filter(function (e) {
  16417. return element.dom.contains(e.dom);
  16418. });
  16419. };
  16420. var create$5 = function (start, soffset, finish, foffset) {
  16421. return {
  16422. start: start,
  16423. soffset: soffset,
  16424. finish: finish,
  16425. foffset: foffset
  16426. };
  16427. };
  16428. var SimRange = { create: create$5 };
  16429. var adt$1 = Adt.generate([
  16430. { before: ['element'] },
  16431. {
  16432. on: [
  16433. 'element',
  16434. 'offset'
  16435. ]
  16436. },
  16437. { after: ['element'] }
  16438. ]);
  16439. var cata = function (subject, onBefore, onOn, onAfter) {
  16440. return subject.fold(onBefore, onOn, onAfter);
  16441. };
  16442. var getStart$2 = function (situ) {
  16443. return situ.fold(identity, identity, identity);
  16444. };
  16445. var before$1 = adt$1.before;
  16446. var on = adt$1.on;
  16447. var after$1 = adt$1.after;
  16448. var Situ = {
  16449. before: before$1,
  16450. on: on,
  16451. after: after$1,
  16452. cata: cata,
  16453. getStart: getStart$2
  16454. };
  16455. var adt = Adt.generate([
  16456. { domRange: ['rng'] },
  16457. {
  16458. relative: [
  16459. 'startSitu',
  16460. 'finishSitu'
  16461. ]
  16462. },
  16463. {
  16464. exact: [
  16465. 'start',
  16466. 'soffset',
  16467. 'finish',
  16468. 'foffset'
  16469. ]
  16470. }
  16471. ]);
  16472. var exactFromRange = function (simRange) {
  16473. return adt.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset);
  16474. };
  16475. var getStart$1 = function (selection) {
  16476. return selection.match({
  16477. domRange: function (rng) {
  16478. return SugarElement.fromDom(rng.startContainer);
  16479. },
  16480. relative: function (startSitu, _finishSitu) {
  16481. return Situ.getStart(startSitu);
  16482. },
  16483. exact: function (start, _soffset, _finish, _foffset) {
  16484. return start;
  16485. }
  16486. });
  16487. };
  16488. var domRange = adt.domRange;
  16489. var relative = adt.relative;
  16490. var exact = adt.exact;
  16491. var getWin = function (selection) {
  16492. var start = getStart$1(selection);
  16493. return defaultView(start);
  16494. };
  16495. var range = SimRange.create;
  16496. var SimSelection = {
  16497. domRange: domRange,
  16498. relative: relative,
  16499. exact: exact,
  16500. exactFromRange: exactFromRange,
  16501. getWin: getWin,
  16502. range: range
  16503. };
  16504. var browser$1 = detect().browser;
  16505. var clamp$1 = function (offset, element) {
  16506. var max = isText$8(element) ? get$2(element).length : children(element).length + 1;
  16507. if (offset > max) {
  16508. return max;
  16509. } else if (offset < 0) {
  16510. return 0;
  16511. }
  16512. return offset;
  16513. };
  16514. var normalizeRng = function (rng) {
  16515. return SimSelection.range(rng.start, clamp$1(rng.soffset, rng.start), rng.finish, clamp$1(rng.foffset, rng.finish));
  16516. };
  16517. var isOrContains = function (root, elm) {
  16518. return !isRestrictedNode(elm.dom) && (contains$1(root, elm) || eq(root, elm));
  16519. };
  16520. var isRngInRoot = function (root) {
  16521. return function (rng) {
  16522. return isOrContains(root, rng.start) && isOrContains(root, rng.finish);
  16523. };
  16524. };
  16525. var shouldStore = function (editor) {
  16526. return editor.inline === true || browser$1.isIE();
  16527. };
  16528. var nativeRangeToSelectionRange = function (r) {
  16529. return SimSelection.range(SugarElement.fromDom(r.startContainer), r.startOffset, SugarElement.fromDom(r.endContainer), r.endOffset);
  16530. };
  16531. var readRange = function (win) {
  16532. var selection = win.getSelection();
  16533. var rng = !selection || selection.rangeCount === 0 ? Optional.none() : Optional.from(selection.getRangeAt(0));
  16534. return rng.map(nativeRangeToSelectionRange);
  16535. };
  16536. var getBookmark = function (root) {
  16537. var win = defaultView(root);
  16538. return readRange(win.dom).filter(isRngInRoot(root));
  16539. };
  16540. var validate = function (root, bookmark) {
  16541. return Optional.from(bookmark).filter(isRngInRoot(root)).map(normalizeRng);
  16542. };
  16543. var bookmarkToNativeRng = function (bookmark) {
  16544. var rng = document.createRange();
  16545. try {
  16546. rng.setStart(bookmark.start.dom, bookmark.soffset);
  16547. rng.setEnd(bookmark.finish.dom, bookmark.foffset);
  16548. return Optional.some(rng);
  16549. } catch (_) {
  16550. return Optional.none();
  16551. }
  16552. };
  16553. var store = function (editor) {
  16554. var newBookmark = shouldStore(editor) ? getBookmark(SugarElement.fromDom(editor.getBody())) : Optional.none();
  16555. editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
  16556. };
  16557. var storeNative = function (editor, rng) {
  16558. var root = SugarElement.fromDom(editor.getBody());
  16559. var range = shouldStore(editor) ? Optional.from(rng) : Optional.none();
  16560. var newBookmark = range.map(nativeRangeToSelectionRange).filter(isRngInRoot(root));
  16561. editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
  16562. };
  16563. var getRng = function (editor) {
  16564. var bookmark = editor.bookmark ? editor.bookmark : Optional.none();
  16565. return bookmark.bind(function (x) {
  16566. return validate(SugarElement.fromDom(editor.getBody()), x);
  16567. }).bind(bookmarkToNativeRng);
  16568. };
  16569. var restore = function (editor) {
  16570. getRng(editor).each(function (rng) {
  16571. return editor.selection.setRng(rng);
  16572. });
  16573. };
  16574. var isEditorUIElement$1 = function (elm) {
  16575. var className = elm.className.toString();
  16576. return className.indexOf('tox-') !== -1 || className.indexOf('mce-') !== -1;
  16577. };
  16578. var FocusManager = { isEditorUIElement: isEditorUIElement$1 };
  16579. var isManualNodeChange = function (e) {
  16580. return e.type === 'nodechange' && e.selectionChange;
  16581. };
  16582. var registerPageMouseUp = function (editor, throttledStore) {
  16583. var mouseUpPage = function () {
  16584. throttledStore.throttle();
  16585. };
  16586. DOMUtils.DOM.bind(document, 'mouseup', mouseUpPage);
  16587. editor.on('remove', function () {
  16588. DOMUtils.DOM.unbind(document, 'mouseup', mouseUpPage);
  16589. });
  16590. };
  16591. var registerFocusOut = function (editor) {
  16592. editor.on('focusout', function () {
  16593. store(editor);
  16594. });
  16595. };
  16596. var registerMouseUp = function (editor, throttledStore) {
  16597. editor.on('mouseup touchend', function (_e) {
  16598. throttledStore.throttle();
  16599. });
  16600. };
  16601. var registerEditorEvents = function (editor, throttledStore) {
  16602. var browser = detect().browser;
  16603. if (browser.isIE()) {
  16604. registerFocusOut(editor);
  16605. } else {
  16606. registerMouseUp(editor, throttledStore);
  16607. }
  16608. editor.on('keyup NodeChange', function (e) {
  16609. if (!isManualNodeChange(e)) {
  16610. store(editor);
  16611. }
  16612. });
  16613. };
  16614. var register$3 = function (editor) {
  16615. var throttledStore = first(function () {
  16616. store(editor);
  16617. }, 0);
  16618. editor.on('init', function () {
  16619. if (editor.inline) {
  16620. registerPageMouseUp(editor, throttledStore);
  16621. }
  16622. registerEditorEvents(editor, throttledStore);
  16623. });
  16624. editor.on('remove', function () {
  16625. throttledStore.cancel();
  16626. });
  16627. };
  16628. var documentFocusInHandler;
  16629. var DOM$8 = DOMUtils.DOM;
  16630. var isEditorUIElement = function (elm) {
  16631. return FocusManager.isEditorUIElement(elm);
  16632. };
  16633. var isEditorContentAreaElement = function (elm) {
  16634. var classList = elm.classList;
  16635. if (classList !== undefined) {
  16636. return classList.contains('tox-edit-area') || classList.contains('tox-edit-area__iframe') || classList.contains('mce-content-body');
  16637. } else {
  16638. return false;
  16639. }
  16640. };
  16641. var isUIElement = function (editor, elm) {
  16642. var customSelector = getCustomUiSelector(editor);
  16643. var parent = DOM$8.getParent(elm, function (elm) {
  16644. return isEditorUIElement(elm) || (customSelector ? editor.dom.is(elm, customSelector) : false);
  16645. });
  16646. return parent !== null;
  16647. };
  16648. var getActiveElement = function (editor) {
  16649. try {
  16650. var root = getRootNode(SugarElement.fromDom(editor.getElement()));
  16651. return active(root).fold(function () {
  16652. return document.body;
  16653. }, function (x) {
  16654. return x.dom;
  16655. });
  16656. } catch (ex) {
  16657. return document.body;
  16658. }
  16659. };
  16660. var registerEvents$1 = function (editorManager, e) {
  16661. var editor = e.editor;
  16662. register$3(editor);
  16663. editor.on('focusin', function () {
  16664. var focusedEditor = editorManager.focusedEditor;
  16665. if (focusedEditor !== editor) {
  16666. if (focusedEditor) {
  16667. focusedEditor.fire('blur', { focusedEditor: editor });
  16668. }
  16669. editorManager.setActive(editor);
  16670. editorManager.focusedEditor = editor;
  16671. editor.fire('focus', { blurredEditor: focusedEditor });
  16672. editor.focus(true);
  16673. }
  16674. });
  16675. editor.on('focusout', function () {
  16676. Delay.setEditorTimeout(editor, function () {
  16677. var focusedEditor = editorManager.focusedEditor;
  16678. if (!isUIElement(editor, getActiveElement(editor)) && focusedEditor === editor) {
  16679. editor.fire('blur', { focusedEditor: null });
  16680. editorManager.focusedEditor = null;
  16681. }
  16682. });
  16683. });
  16684. if (!documentFocusInHandler) {
  16685. documentFocusInHandler = function (e) {
  16686. var activeEditor = editorManager.activeEditor;
  16687. if (activeEditor) {
  16688. getOriginalEventTarget(e).each(function (target) {
  16689. if (target.ownerDocument === document) {
  16690. if (target !== document.body && !isUIElement(activeEditor, target) && editorManager.focusedEditor === activeEditor) {
  16691. activeEditor.fire('blur', { focusedEditor: null });
  16692. editorManager.focusedEditor = null;
  16693. }
  16694. }
  16695. });
  16696. }
  16697. };
  16698. DOM$8.bind(document, 'focusin', documentFocusInHandler);
  16699. }
  16700. };
  16701. var unregisterDocumentEvents = function (editorManager, e) {
  16702. if (editorManager.focusedEditor === e.editor) {
  16703. editorManager.focusedEditor = null;
  16704. }
  16705. if (!editorManager.activeEditor) {
  16706. DOM$8.unbind(document, 'focusin', documentFocusInHandler);
  16707. documentFocusInHandler = null;
  16708. }
  16709. };
  16710. var setup$l = function (editorManager) {
  16711. editorManager.on('AddEditor', curry(registerEvents$1, editorManager));
  16712. editorManager.on('RemoveEditor', curry(unregisterDocumentEvents, editorManager));
  16713. };
  16714. var getContentEditableHost = function (editor, node) {
  16715. return editor.dom.getParent(node, function (node) {
  16716. return editor.dom.getContentEditable(node) === 'true';
  16717. });
  16718. };
  16719. var getCollapsedNode = function (rng) {
  16720. return rng.collapsed ? Optional.from(getNode$1(rng.startContainer, rng.startOffset)).map(SugarElement.fromDom) : Optional.none();
  16721. };
  16722. var getFocusInElement = function (root, rng) {
  16723. return getCollapsedNode(rng).bind(function (node) {
  16724. if (isTableSection(node)) {
  16725. return Optional.some(node);
  16726. } else if (contains$1(root, node) === false) {
  16727. return Optional.some(root);
  16728. } else {
  16729. return Optional.none();
  16730. }
  16731. });
  16732. };
  16733. var normalizeSelection$1 = function (editor, rng) {
  16734. getFocusInElement(SugarElement.fromDom(editor.getBody()), rng).bind(function (elm) {
  16735. return firstPositionIn(elm.dom);
  16736. }).fold(function () {
  16737. editor.selection.normalize();
  16738. return;
  16739. }, function (caretPos) {
  16740. return editor.selection.setRng(caretPos.toRange());
  16741. });
  16742. };
  16743. var focusBody = function (body) {
  16744. if (body.setActive) {
  16745. try {
  16746. body.setActive();
  16747. } catch (ex) {
  16748. body.focus();
  16749. }
  16750. } else {
  16751. body.focus();
  16752. }
  16753. };
  16754. var hasElementFocus = function (elm) {
  16755. return hasFocus$1(elm) || search(elm).isSome();
  16756. };
  16757. var hasIframeFocus = function (editor) {
  16758. return editor.iframeElement && hasFocus$1(SugarElement.fromDom(editor.iframeElement));
  16759. };
  16760. var hasInlineFocus = function (editor) {
  16761. var rawBody = editor.getBody();
  16762. return rawBody && hasElementFocus(SugarElement.fromDom(rawBody));
  16763. };
  16764. var hasUiFocus = function (editor) {
  16765. var dos = getRootNode(SugarElement.fromDom(editor.getElement()));
  16766. return active(dos).filter(function (elem) {
  16767. return !isEditorContentAreaElement(elem.dom) && isUIElement(editor, elem.dom);
  16768. }).isSome();
  16769. };
  16770. var hasFocus = function (editor) {
  16771. return editor.inline ? hasInlineFocus(editor) : hasIframeFocus(editor);
  16772. };
  16773. var hasEditorOrUiFocus = function (editor) {
  16774. return hasFocus(editor) || hasUiFocus(editor);
  16775. };
  16776. var focusEditor = function (editor) {
  16777. var selection = editor.selection;
  16778. var body = editor.getBody();
  16779. var rng = selection.getRng();
  16780. editor.quirks.refreshContentEditable();
  16781. if (editor.bookmark !== undefined && hasFocus(editor) === false) {
  16782. getRng(editor).each(function (bookmarkRng) {
  16783. editor.selection.setRng(bookmarkRng);
  16784. rng = bookmarkRng;
  16785. });
  16786. }
  16787. var contentEditableHost = getContentEditableHost(editor, selection.getNode());
  16788. if (editor.$.contains(body, contentEditableHost)) {
  16789. focusBody(contentEditableHost);
  16790. normalizeSelection$1(editor, rng);
  16791. activateEditor(editor);
  16792. return;
  16793. }
  16794. if (!editor.inline) {
  16795. if (!Env.opera) {
  16796. focusBody(body);
  16797. }
  16798. editor.getWin().focus();
  16799. }
  16800. if (Env.gecko || editor.inline) {
  16801. focusBody(body);
  16802. normalizeSelection$1(editor, rng);
  16803. }
  16804. activateEditor(editor);
  16805. };
  16806. var activateEditor = function (editor) {
  16807. return editor.editorManager.setActive(editor);
  16808. };
  16809. var focus = function (editor, skipFocus) {
  16810. if (editor.removed) {
  16811. return;
  16812. }
  16813. if (skipFocus) {
  16814. activateEditor(editor);
  16815. } else {
  16816. focusEditor(editor);
  16817. }
  16818. };
  16819. var getEndpointElement = function (root, rng, start, real, resolve) {
  16820. var container = start ? rng.startContainer : rng.endContainer;
  16821. var offset = start ? rng.startOffset : rng.endOffset;
  16822. return Optional.from(container).map(SugarElement.fromDom).map(function (elm) {
  16823. return !real || !rng.collapsed ? child$1(elm, resolve(elm, offset)).getOr(elm) : elm;
  16824. }).bind(function (elm) {
  16825. return isElement$6(elm) ? Optional.some(elm) : parent(elm).filter(isElement$6);
  16826. }).map(function (elm) {
  16827. return elm.dom;
  16828. }).getOr(root);
  16829. };
  16830. var getStart = function (root, rng, real) {
  16831. return getEndpointElement(root, rng, true, real, function (elm, offset) {
  16832. return Math.min(childNodesCount(elm), offset);
  16833. });
  16834. };
  16835. var getEnd = function (root, rng, real) {
  16836. return getEndpointElement(root, rng, false, real, function (elm, offset) {
  16837. return offset > 0 ? offset - 1 : offset;
  16838. });
  16839. };
  16840. var skipEmptyTextNodes = function (node, forwards) {
  16841. var orig = node;
  16842. while (node && isText$7(node) && node.length === 0) {
  16843. node = forwards ? node.nextSibling : node.previousSibling;
  16844. }
  16845. return node || orig;
  16846. };
  16847. var getNode = function (root, rng) {
  16848. var elm, startContainer, endContainer;
  16849. if (!rng) {
  16850. return root;
  16851. }
  16852. startContainer = rng.startContainer;
  16853. endContainer = rng.endContainer;
  16854. var startOffset = rng.startOffset;
  16855. var endOffset = rng.endOffset;
  16856. elm = rng.commonAncestorContainer;
  16857. if (!rng.collapsed) {
  16858. if (startContainer === endContainer) {
  16859. if (endOffset - startOffset < 2) {
  16860. if (startContainer.hasChildNodes()) {
  16861. elm = startContainer.childNodes[startOffset];
  16862. }
  16863. }
  16864. }
  16865. if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
  16866. if (startContainer.length === startOffset) {
  16867. startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
  16868. } else {
  16869. startContainer = startContainer.parentNode;
  16870. }
  16871. if (endOffset === 0) {
  16872. endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
  16873. } else {
  16874. endContainer = endContainer.parentNode;
  16875. }
  16876. if (startContainer && startContainer === endContainer) {
  16877. return startContainer;
  16878. }
  16879. }
  16880. }
  16881. if (elm && elm.nodeType === 3) {
  16882. return elm.parentNode;
  16883. }
  16884. return elm;
  16885. };
  16886. var getSelectedBlocks = function (dom, rng, startElm, endElm) {
  16887. var node;
  16888. var selectedBlocks = [];
  16889. var root = dom.getRoot();
  16890. startElm = dom.getParent(startElm || getStart(root, rng, rng.collapsed), dom.isBlock);
  16891. endElm = dom.getParent(endElm || getEnd(root, rng, rng.collapsed), dom.isBlock);
  16892. if (startElm && startElm !== root) {
  16893. selectedBlocks.push(startElm);
  16894. }
  16895. if (startElm && endElm && startElm !== endElm) {
  16896. node = startElm;
  16897. var walker = new DomTreeWalker(startElm, root);
  16898. while ((node = walker.next()) && node !== endElm) {
  16899. if (dom.isBlock(node)) {
  16900. selectedBlocks.push(node);
  16901. }
  16902. }
  16903. }
  16904. if (endElm && startElm !== endElm && endElm !== root) {
  16905. selectedBlocks.push(endElm);
  16906. }
  16907. return selectedBlocks;
  16908. };
  16909. var select = function (dom, node, content) {
  16910. return Optional.from(node).map(function (node) {
  16911. var idx = dom.nodeIndex(node);
  16912. var rng = dom.createRng();
  16913. rng.setStart(node.parentNode, idx);
  16914. rng.setEnd(node.parentNode, idx + 1);
  16915. if (content) {
  16916. moveEndPoint(dom, rng, node, true);
  16917. moveEndPoint(dom, rng, node, false);
  16918. }
  16919. return rng;
  16920. });
  16921. };
  16922. var processRanges = function (editor, ranges) {
  16923. return map$3(ranges, function (range) {
  16924. var evt = editor.fire('GetSelectionRange', { range: range });
  16925. return evt.range !== range ? evt.range : range;
  16926. });
  16927. };
  16928. var typeLookup = {
  16929. '#text': 3,
  16930. '#comment': 8,
  16931. '#cdata': 4,
  16932. '#pi': 7,
  16933. '#doctype': 10,
  16934. '#document-fragment': 11
  16935. };
  16936. var walk$1 = function (node, root, prev) {
  16937. var startName = prev ? 'lastChild' : 'firstChild';
  16938. var siblingName = prev ? 'prev' : 'next';
  16939. if (node[startName]) {
  16940. return node[startName];
  16941. }
  16942. if (node !== root) {
  16943. var sibling = node[siblingName];
  16944. if (sibling) {
  16945. return sibling;
  16946. }
  16947. for (var parent_1 = node.parent; parent_1 && parent_1 !== root; parent_1 = parent_1.parent) {
  16948. sibling = parent_1[siblingName];
  16949. if (sibling) {
  16950. return sibling;
  16951. }
  16952. }
  16953. }
  16954. };
  16955. var isEmptyTextNode = function (node) {
  16956. if (!isWhitespaceText(node.value)) {
  16957. return false;
  16958. }
  16959. var parentNode = node.parent;
  16960. if (parentNode && (parentNode.name !== 'span' || parentNode.attr('style')) && /^[ ]+$/.test(node.value)) {
  16961. return false;
  16962. }
  16963. return true;
  16964. };
  16965. var isNonEmptyElement = function (node) {
  16966. var isNamedAnchor = node.name === 'a' && !node.attr('href') && node.attr('id');
  16967. return node.attr('name') || node.attr('id') && !node.firstChild || node.attr('data-mce-bookmark') || isNamedAnchor;
  16968. };
  16969. var AstNode = function () {
  16970. function AstNode(name, type) {
  16971. this.name = name;
  16972. this.type = type;
  16973. if (type === 1) {
  16974. this.attributes = [];
  16975. this.attributes.map = {};
  16976. }
  16977. }
  16978. AstNode.create = function (name, attrs) {
  16979. var node = new AstNode(name, typeLookup[name] || 1);
  16980. if (attrs) {
  16981. each$j(attrs, function (value, attrName) {
  16982. node.attr(attrName, value);
  16983. });
  16984. }
  16985. return node;
  16986. };
  16987. AstNode.prototype.replace = function (node) {
  16988. var self = this;
  16989. if (node.parent) {
  16990. node.remove();
  16991. }
  16992. self.insert(node, self);
  16993. self.remove();
  16994. return self;
  16995. };
  16996. AstNode.prototype.attr = function (name, value) {
  16997. var self = this;
  16998. var attrs;
  16999. if (typeof name !== 'string') {
  17000. if (name !== undefined && name !== null) {
  17001. each$j(name, function (value, key) {
  17002. self.attr(key, value);
  17003. });
  17004. }
  17005. return self;
  17006. }
  17007. if (attrs = self.attributes) {
  17008. if (value !== undefined) {
  17009. if (value === null) {
  17010. if (name in attrs.map) {
  17011. delete attrs.map[name];
  17012. var i = attrs.length;
  17013. while (i--) {
  17014. if (attrs[i].name === name) {
  17015. attrs.splice(i, 1);
  17016. return self;
  17017. }
  17018. }
  17019. }
  17020. return self;
  17021. }
  17022. if (name in attrs.map) {
  17023. var i = attrs.length;
  17024. while (i--) {
  17025. if (attrs[i].name === name) {
  17026. attrs[i].value = value;
  17027. break;
  17028. }
  17029. }
  17030. } else {
  17031. attrs.push({
  17032. name: name,
  17033. value: value
  17034. });
  17035. }
  17036. attrs.map[name] = value;
  17037. return self;
  17038. }
  17039. return attrs.map[name];
  17040. }
  17041. };
  17042. AstNode.prototype.clone = function () {
  17043. var self = this;
  17044. var clone = new AstNode(self.name, self.type);
  17045. var selfAttrs;
  17046. if (selfAttrs = self.attributes) {
  17047. var cloneAttrs = [];
  17048. cloneAttrs.map = {};
  17049. for (var i = 0, l = selfAttrs.length; i < l; i++) {
  17050. var selfAttr = selfAttrs[i];
  17051. if (selfAttr.name !== 'id') {
  17052. cloneAttrs[cloneAttrs.length] = {
  17053. name: selfAttr.name,
  17054. value: selfAttr.value
  17055. };
  17056. cloneAttrs.map[selfAttr.name] = selfAttr.value;
  17057. }
  17058. }
  17059. clone.attributes = cloneAttrs;
  17060. }
  17061. clone.value = self.value;
  17062. clone.shortEnded = self.shortEnded;
  17063. return clone;
  17064. };
  17065. AstNode.prototype.wrap = function (wrapper) {
  17066. var self = this;
  17067. self.parent.insert(wrapper, self);
  17068. wrapper.append(self);
  17069. return self;
  17070. };
  17071. AstNode.prototype.unwrap = function () {
  17072. var self = this;
  17073. for (var node = self.firstChild; node;) {
  17074. var next = node.next;
  17075. self.insert(node, self, true);
  17076. node = next;
  17077. }
  17078. self.remove();
  17079. };
  17080. AstNode.prototype.remove = function () {
  17081. var self = this, parent = self.parent, next = self.next, prev = self.prev;
  17082. if (parent) {
  17083. if (parent.firstChild === self) {
  17084. parent.firstChild = next;
  17085. if (next) {
  17086. next.prev = null;
  17087. }
  17088. } else {
  17089. prev.next = next;
  17090. }
  17091. if (parent.lastChild === self) {
  17092. parent.lastChild = prev;
  17093. if (prev) {
  17094. prev.next = null;
  17095. }
  17096. } else {
  17097. next.prev = prev;
  17098. }
  17099. self.parent = self.next = self.prev = null;
  17100. }
  17101. return self;
  17102. };
  17103. AstNode.prototype.append = function (node) {
  17104. var self = this;
  17105. if (node.parent) {
  17106. node.remove();
  17107. }
  17108. var last = self.lastChild;
  17109. if (last) {
  17110. last.next = node;
  17111. node.prev = last;
  17112. self.lastChild = node;
  17113. } else {
  17114. self.lastChild = self.firstChild = node;
  17115. }
  17116. node.parent = self;
  17117. return node;
  17118. };
  17119. AstNode.prototype.insert = function (node, refNode, before) {
  17120. if (node.parent) {
  17121. node.remove();
  17122. }
  17123. var parent = refNode.parent || this;
  17124. if (before) {
  17125. if (refNode === parent.firstChild) {
  17126. parent.firstChild = node;
  17127. } else {
  17128. refNode.prev.next = node;
  17129. }
  17130. node.prev = refNode.prev;
  17131. node.next = refNode;
  17132. refNode.prev = node;
  17133. } else {
  17134. if (refNode === parent.lastChild) {
  17135. parent.lastChild = node;
  17136. } else {
  17137. refNode.next.prev = node;
  17138. }
  17139. node.next = refNode.next;
  17140. node.prev = refNode;
  17141. refNode.next = node;
  17142. }
  17143. node.parent = parent;
  17144. return node;
  17145. };
  17146. AstNode.prototype.getAll = function (name) {
  17147. var self = this;
  17148. var collection = [];
  17149. for (var node = self.firstChild; node; node = walk$1(node, self)) {
  17150. if (node.name === name) {
  17151. collection.push(node);
  17152. }
  17153. }
  17154. return collection;
  17155. };
  17156. AstNode.prototype.children = function () {
  17157. var self = this;
  17158. var collection = [];
  17159. for (var node = self.firstChild; node; node = node.next) {
  17160. collection.push(node);
  17161. }
  17162. return collection;
  17163. };
  17164. AstNode.prototype.empty = function () {
  17165. var self = this;
  17166. if (self.firstChild) {
  17167. var nodes = [];
  17168. for (var node = self.firstChild; node; node = walk$1(node, self)) {
  17169. nodes.push(node);
  17170. }
  17171. var i = nodes.length;
  17172. while (i--) {
  17173. var node = nodes[i];
  17174. node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
  17175. }
  17176. }
  17177. self.firstChild = self.lastChild = null;
  17178. return self;
  17179. };
  17180. AstNode.prototype.isEmpty = function (elements, whitespace, predicate) {
  17181. if (whitespace === void 0) {
  17182. whitespace = {};
  17183. }
  17184. var self = this;
  17185. var node = self.firstChild;
  17186. if (isNonEmptyElement(self)) {
  17187. return false;
  17188. }
  17189. if (node) {
  17190. do {
  17191. if (node.type === 1) {
  17192. if (node.attr('data-mce-bogus')) {
  17193. continue;
  17194. }
  17195. if (elements[node.name]) {
  17196. return false;
  17197. }
  17198. if (isNonEmptyElement(node)) {
  17199. return false;
  17200. }
  17201. }
  17202. if (node.type === 8) {
  17203. return false;
  17204. }
  17205. if (node.type === 3 && !isEmptyTextNode(node)) {
  17206. return false;
  17207. }
  17208. if (node.type === 3 && node.parent && whitespace[node.parent.name] && isWhitespaceText(node.value)) {
  17209. return false;
  17210. }
  17211. if (predicate && predicate(node)) {
  17212. return false;
  17213. }
  17214. } while (node = walk$1(node, self));
  17215. }
  17216. return true;
  17217. };
  17218. AstNode.prototype.walk = function (prev) {
  17219. return walk$1(this, null, prev);
  17220. };
  17221. return AstNode;
  17222. }();
  17223. var extractBase64DataUris = function (html) {
  17224. var dataImageUri = /data:[^;]+;base64,([a-z0-9\+\/=\s]+)/gi;
  17225. var chunks = [];
  17226. var uris = {};
  17227. var prefix = generate('img');
  17228. var matches;
  17229. var index = 0;
  17230. var count = 0;
  17231. while (matches = dataImageUri.exec(html)) {
  17232. var uri = matches[0];
  17233. var imageId = prefix + '_' + count++;
  17234. uris[imageId] = uri;
  17235. if (index < matches.index) {
  17236. chunks.push(html.substr(index, matches.index - index));
  17237. }
  17238. chunks.push(imageId);
  17239. index = matches.index + uri.length;
  17240. }
  17241. var re = new RegExp(prefix + '_[0-9]+', 'g');
  17242. if (index === 0) {
  17243. return {
  17244. prefix: prefix,
  17245. uris: uris,
  17246. html: html,
  17247. re: re
  17248. };
  17249. } else {
  17250. if (index < html.length) {
  17251. chunks.push(html.substr(index));
  17252. }
  17253. return {
  17254. prefix: prefix,
  17255. uris: uris,
  17256. html: chunks.join(''),
  17257. re: re
  17258. };
  17259. }
  17260. };
  17261. var restoreDataUris = function (html, result) {
  17262. return html.replace(result.re, function (imageId) {
  17263. return get$9(result.uris, imageId).getOr(imageId);
  17264. });
  17265. };
  17266. var parseDataUri$1 = function (uri) {
  17267. var matches = /data:([^;]+);base64,([a-z0-9\+\/=\s]+)/i.exec(uri);
  17268. if (matches) {
  17269. return Optional.some({
  17270. type: matches[1],
  17271. data: decodeURIComponent(matches[2])
  17272. });
  17273. } else {
  17274. return Optional.none();
  17275. }
  17276. };
  17277. var each$d = Tools.each, trim = Tools.trim;
  17278. var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
  17279. var DEFAULT_PORTS = {
  17280. ftp: 21,
  17281. http: 80,
  17282. https: 443,
  17283. mailto: 25
  17284. };
  17285. var safeSvgDataUrlElements = [
  17286. 'img',
  17287. 'video'
  17288. ];
  17289. var blockSvgDataUris = function (allowSvgDataUrls, tagName) {
  17290. if (isNonNullable(allowSvgDataUrls)) {
  17291. return !allowSvgDataUrls;
  17292. } else {
  17293. return isNonNullable(tagName) ? !contains$3(safeSvgDataUrlElements, tagName) : true;
  17294. }
  17295. };
  17296. var isInvalidUri = function (settings, uri, tagName) {
  17297. if (settings.allow_html_data_urls) {
  17298. return false;
  17299. } else if (/^data:image\//i.test(uri)) {
  17300. return blockSvgDataUris(settings.allow_svg_data_urls, tagName) && /^data:image\/svg\+xml/i.test(uri);
  17301. } else {
  17302. return /^data:/i.test(uri);
  17303. }
  17304. };
  17305. var URI = function () {
  17306. function URI(url, settings) {
  17307. url = trim(url);
  17308. this.settings = settings || {};
  17309. var baseUri = this.settings.base_uri;
  17310. var self = this;
  17311. if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
  17312. self.source = url;
  17313. return;
  17314. }
  17315. var isProtocolRelative = url.indexOf('//') === 0;
  17316. if (url.indexOf('/') === 0 && !isProtocolRelative) {
  17317. url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
  17318. }
  17319. if (!/^[\w\-]*:?\/\//.test(url)) {
  17320. var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory;
  17321. if (this.settings.base_uri && this.settings.base_uri.protocol == '') {
  17322. url = '//mce_host' + self.toAbsPath(baseUrl, url);
  17323. } else {
  17324. var match = /([^#?]*)([#?]?.*)/.exec(url);
  17325. url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2];
  17326. }
  17327. }
  17328. url = url.replace(/@@/g, '(mce_at)');
  17329. var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?(\[[a-zA-Z0-9:.%]+\]|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
  17330. each$d(queryParts, function (v, i) {
  17331. var part = urlMatch[i];
  17332. if (part) {
  17333. part = part.replace(/\(mce_at\)/g, '@@');
  17334. }
  17335. self[v] = part;
  17336. });
  17337. if (baseUri) {
  17338. if (!self.protocol) {
  17339. self.protocol = baseUri.protocol;
  17340. }
  17341. if (!self.userInfo) {
  17342. self.userInfo = baseUri.userInfo;
  17343. }
  17344. if (!self.port && self.host === 'mce_host') {
  17345. self.port = baseUri.port;
  17346. }
  17347. if (!self.host || self.host === 'mce_host') {
  17348. self.host = baseUri.host;
  17349. }
  17350. self.source = '';
  17351. }
  17352. if (isProtocolRelative) {
  17353. self.protocol = '';
  17354. }
  17355. }
  17356. URI.parseDataUri = function (uri) {
  17357. var type;
  17358. var uriComponents = decodeURIComponent(uri).split(',');
  17359. var matches = /data:([^;]+)/.exec(uriComponents[0]);
  17360. if (matches) {
  17361. type = matches[1];
  17362. }
  17363. return {
  17364. type: type,
  17365. data: uriComponents[1]
  17366. };
  17367. };
  17368. URI.isDomSafe = function (uri, context, options) {
  17369. if (options === void 0) {
  17370. options = {};
  17371. }
  17372. if (options.allow_script_urls) {
  17373. return true;
  17374. } else {
  17375. var decodedUri = Entities.decode(uri).replace(/[\s\u0000-\u001F]+/g, '');
  17376. try {
  17377. decodedUri = decodeURIComponent(decodedUri);
  17378. } catch (ex) {
  17379. decodedUri = unescape(decodedUri);
  17380. }
  17381. if (/((java|vb)script|mhtml):/i.test(decodedUri)) {
  17382. return false;
  17383. }
  17384. return !isInvalidUri(options, decodedUri, context);
  17385. }
  17386. };
  17387. URI.getDocumentBaseUrl = function (loc) {
  17388. var baseUrl;
  17389. if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
  17390. baseUrl = loc.href;
  17391. } else {
  17392. baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
  17393. }
  17394. if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
  17395. baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
  17396. if (!/[\/\\]$/.test(baseUrl)) {
  17397. baseUrl += '/';
  17398. }
  17399. }
  17400. return baseUrl;
  17401. };
  17402. URI.prototype.setPath = function (path) {
  17403. var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path);
  17404. this.path = pathMatch[0];
  17405. this.directory = pathMatch[1];
  17406. this.file = pathMatch[2];
  17407. this.source = '';
  17408. this.getURI();
  17409. };
  17410. URI.prototype.toRelative = function (uri) {
  17411. var output;
  17412. if (uri === './') {
  17413. return uri;
  17414. }
  17415. var relativeUri = new URI(uri, { base_uri: this });
  17416. if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') {
  17417. return relativeUri.getURI();
  17418. }
  17419. var tu = this.getURI(), uu = relativeUri.getURI();
  17420. if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
  17421. return tu;
  17422. }
  17423. output = this.toRelPath(this.path, relativeUri.path);
  17424. if (relativeUri.query) {
  17425. output += '?' + relativeUri.query;
  17426. }
  17427. if (relativeUri.anchor) {
  17428. output += '#' + relativeUri.anchor;
  17429. }
  17430. return output;
  17431. };
  17432. URI.prototype.toAbsolute = function (uri, noHost) {
  17433. var absoluteUri = new URI(uri, { base_uri: this });
  17434. return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri));
  17435. };
  17436. URI.prototype.isSameOrigin = function (uri) {
  17437. if (this.host == uri.host && this.protocol == uri.protocol) {
  17438. if (this.port == uri.port) {
  17439. return true;
  17440. }
  17441. var defaultPort = DEFAULT_PORTS[this.protocol];
  17442. if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
  17443. return true;
  17444. }
  17445. }
  17446. return false;
  17447. };
  17448. URI.prototype.toRelPath = function (base, path) {
  17449. var breakPoint = 0, out = '', i, l;
  17450. var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/');
  17451. var items = path.split('/');
  17452. if (normalizedBase.length >= items.length) {
  17453. for (i = 0, l = normalizedBase.length; i < l; i++) {
  17454. if (i >= items.length || normalizedBase[i] !== items[i]) {
  17455. breakPoint = i + 1;
  17456. break;
  17457. }
  17458. }
  17459. }
  17460. if (normalizedBase.length < items.length) {
  17461. for (i = 0, l = items.length; i < l; i++) {
  17462. if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) {
  17463. breakPoint = i + 1;
  17464. break;
  17465. }
  17466. }
  17467. }
  17468. if (breakPoint === 1) {
  17469. return path;
  17470. }
  17471. for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) {
  17472. out += '../';
  17473. }
  17474. for (i = breakPoint - 1, l = items.length; i < l; i++) {
  17475. if (i !== breakPoint - 1) {
  17476. out += '/' + items[i];
  17477. } else {
  17478. out += items[i];
  17479. }
  17480. }
  17481. return out;
  17482. };
  17483. URI.prototype.toAbsPath = function (base, path) {
  17484. var i, nb = 0, o = [], outPath;
  17485. var tr = /\/$/.test(path) ? '/' : '';
  17486. var normalizedBase = base.split('/');
  17487. var normalizedPath = path.split('/');
  17488. each$d(normalizedBase, function (k) {
  17489. if (k) {
  17490. o.push(k);
  17491. }
  17492. });
  17493. normalizedBase = o;
  17494. for (i = normalizedPath.length - 1, o = []; i >= 0; i--) {
  17495. if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') {
  17496. continue;
  17497. }
  17498. if (normalizedPath[i] === '..') {
  17499. nb++;
  17500. continue;
  17501. }
  17502. if (nb > 0) {
  17503. nb--;
  17504. continue;
  17505. }
  17506. o.push(normalizedPath[i]);
  17507. }
  17508. i = normalizedBase.length - nb;
  17509. if (i <= 0) {
  17510. outPath = reverse(o).join('/');
  17511. } else {
  17512. outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/');
  17513. }
  17514. if (outPath.indexOf('/') !== 0) {
  17515. outPath = '/' + outPath;
  17516. }
  17517. if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
  17518. outPath += tr;
  17519. }
  17520. return outPath;
  17521. };
  17522. URI.prototype.getURI = function (noProtoHost) {
  17523. if (noProtoHost === void 0) {
  17524. noProtoHost = false;
  17525. }
  17526. var s;
  17527. if (!this.source || noProtoHost) {
  17528. s = '';
  17529. if (!noProtoHost) {
  17530. if (this.protocol) {
  17531. s += this.protocol + '://';
  17532. } else {
  17533. s += '//';
  17534. }
  17535. if (this.userInfo) {
  17536. s += this.userInfo + '@';
  17537. }
  17538. if (this.host) {
  17539. s += this.host;
  17540. }
  17541. if (this.port) {
  17542. s += ':' + this.port;
  17543. }
  17544. }
  17545. if (this.path) {
  17546. s += this.path;
  17547. }
  17548. if (this.query) {
  17549. s += '?' + this.query;
  17550. }
  17551. if (this.anchor) {
  17552. s += '#' + this.anchor;
  17553. }
  17554. this.source = s;
  17555. }
  17556. return this.source;
  17557. };
  17558. return URI;
  17559. }();
  17560. var filteredClobberElements = Tools.makeMap('button,fieldset,form,iframe,img,image,input,object,output,select,textarea');
  17561. var isValidPrefixAttrName = function (name) {
  17562. return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
  17563. };
  17564. var findMatchingEndTagIndex = function (schema, html, startIndex) {
  17565. var startTagRegExp = /<([!?\/])?([A-Za-z0-9\-_:.]+)/g;
  17566. var endTagRegExp = /(?:\s(?:[^'">]+(?:"[^"]*"|'[^']*'))*[^"'>]*(?:"[^">]*|'[^'>]*)?|\s*|\/)>/g;
  17567. var shortEndedElements = schema.getShortEndedElements();
  17568. var count = 1, index = startIndex;
  17569. while (count !== 0) {
  17570. startTagRegExp.lastIndex = index;
  17571. while (true) {
  17572. var startMatch = startTagRegExp.exec(html);
  17573. if (startMatch === null) {
  17574. return index;
  17575. } else if (startMatch[1] === '!') {
  17576. if (startsWith(startMatch[2], '--')) {
  17577. index = findCommentEndIndex(html, false, startMatch.index + '!--'.length);
  17578. } else {
  17579. index = findCommentEndIndex(html, true, startMatch.index + 1);
  17580. }
  17581. break;
  17582. } else {
  17583. endTagRegExp.lastIndex = startTagRegExp.lastIndex;
  17584. var endMatch = endTagRegExp.exec(html);
  17585. if (isNull(endMatch) || endMatch.index !== startTagRegExp.lastIndex) {
  17586. continue;
  17587. }
  17588. if (startMatch[1] === '/') {
  17589. count -= 1;
  17590. } else if (!has$2(shortEndedElements, startMatch[2])) {
  17591. count += 1;
  17592. }
  17593. index = startTagRegExp.lastIndex + endMatch[0].length;
  17594. break;
  17595. }
  17596. }
  17597. }
  17598. return index;
  17599. };
  17600. var isConditionalComment = function (html, startIndex) {
  17601. return /^\s*\[if [\w\W]+\]>.*<!\[endif\](--!?)?>/.test(html.substr(startIndex));
  17602. };
  17603. var findCommentEndIndex = function (html, isBogus, startIndex) {
  17604. if (startIndex === void 0) {
  17605. startIndex = 0;
  17606. }
  17607. var lcHtml = html.toLowerCase();
  17608. if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) {
  17609. var endIfIndex = lcHtml.indexOf('[endif]', startIndex);
  17610. return lcHtml.indexOf('>', endIfIndex);
  17611. } else {
  17612. if (isBogus) {
  17613. var endIndex = lcHtml.indexOf('>', startIndex);
  17614. return endIndex !== -1 ? endIndex : lcHtml.length;
  17615. } else {
  17616. var endCommentRegexp = /--!?>/g;
  17617. endCommentRegexp.lastIndex = startIndex;
  17618. var match = endCommentRegexp.exec(html);
  17619. return match ? match.index + match[0].length : lcHtml.length;
  17620. }
  17621. }
  17622. };
  17623. var checkBogusAttribute = function (regExp, attrString) {
  17624. var matches = regExp.exec(attrString);
  17625. if (matches) {
  17626. var name_1 = matches[1];
  17627. var value = matches[2];
  17628. return typeof name_1 === 'string' && name_1.toLowerCase() === 'data-mce-bogus' ? value : null;
  17629. } else {
  17630. return null;
  17631. }
  17632. };
  17633. var SaxParser = function (settings, schema) {
  17634. var _a;
  17635. if (schema === void 0) {
  17636. schema = Schema();
  17637. }
  17638. settings = settings || {};
  17639. var doc = (_a = settings.document) !== null && _a !== void 0 ? _a : document;
  17640. var form = doc.createElement('form');
  17641. if (settings.fix_self_closing !== false) {
  17642. settings.fix_self_closing = true;
  17643. }
  17644. var comment = settings.comment ? settings.comment : noop;
  17645. var cdata = settings.cdata ? settings.cdata : noop;
  17646. var text = settings.text ? settings.text : noop;
  17647. var start = settings.start ? settings.start : noop;
  17648. var end = settings.end ? settings.end : noop;
  17649. var pi = settings.pi ? settings.pi : noop;
  17650. var doctype = settings.doctype ? settings.doctype : noop;
  17651. var parseInternal = function (base64Extract, format) {
  17652. if (format === void 0) {
  17653. format = 'html';
  17654. }
  17655. var html = base64Extract.html;
  17656. var matches, index = 0, value, endRegExp;
  17657. var stack = [];
  17658. var attrList, i, textData, name;
  17659. var isInternalElement, isShortEnded;
  17660. var elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
  17661. var attributesRequired, attributesDefault, attributesForced;
  17662. var anyAttributesRequired, attrValue, idCount = 0;
  17663. var decode = Entities.decode;
  17664. var filteredUrlAttrs = Tools.makeMap('src,href,data,background,action,formaction,poster,xlink:href');
  17665. var parsingMode = format === 'html' ? 0 : 1;
  17666. var processEndTag = function (name) {
  17667. var pos, i;
  17668. pos = stack.length;
  17669. while (pos--) {
  17670. if (stack[pos].name === name) {
  17671. break;
  17672. }
  17673. }
  17674. if (pos >= 0) {
  17675. for (i = stack.length - 1; i >= pos; i--) {
  17676. name = stack[i];
  17677. if (name.valid) {
  17678. end(name.name);
  17679. }
  17680. }
  17681. stack.length = pos;
  17682. }
  17683. };
  17684. var processText = function (value, raw) {
  17685. return text(restoreDataUris(value, base64Extract), raw);
  17686. };
  17687. var processComment = function (value) {
  17688. if (value === '') {
  17689. return;
  17690. }
  17691. if (value.charAt(0) === '>') {
  17692. value = ' ' + value;
  17693. }
  17694. if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
  17695. value = ' ' + value;
  17696. }
  17697. comment(restoreDataUris(value, base64Extract));
  17698. };
  17699. var processAttr = function (value) {
  17700. return restoreDataUris(value, base64Extract);
  17701. };
  17702. var processMalformedComment = function (value, startIndex) {
  17703. var startTag = value || '';
  17704. var isBogus = !startsWith(startTag, '--');
  17705. var endIndex = findCommentEndIndex(html, isBogus, startIndex);
  17706. value = html.substr(startIndex, endIndex - startIndex);
  17707. processComment(isBogus ? startTag + value : value);
  17708. return endIndex + 1;
  17709. };
  17710. var parseAttribute = function (tagName, name, value, val2, val3) {
  17711. name = name.toLowerCase();
  17712. value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || ''));
  17713. if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
  17714. var attrRule = validAttributesMap[name];
  17715. if (!attrRule && validAttributePatterns) {
  17716. var i_1 = validAttributePatterns.length;
  17717. while (i_1--) {
  17718. attrRule = validAttributePatterns[i_1];
  17719. if (attrRule.pattern.test(name)) {
  17720. break;
  17721. }
  17722. }
  17723. if (i_1 === -1) {
  17724. attrRule = null;
  17725. }
  17726. }
  17727. if (!attrRule) {
  17728. return;
  17729. }
  17730. if (attrRule.validValues && !(value in attrRule.validValues)) {
  17731. return;
  17732. }
  17733. }
  17734. var isNameOrId = name === 'name' || name === 'id';
  17735. if (isNameOrId && tagName in filteredClobberElements && (value in doc || value in form)) {
  17736. return;
  17737. }
  17738. if (filteredUrlAttrs[name] && !URI.isDomSafe(value, tagName, settings)) {
  17739. return;
  17740. }
  17741. if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
  17742. return;
  17743. }
  17744. attrList.map[name] = value;
  17745. attrList.push({
  17746. name: name,
  17747. value: value
  17748. });
  17749. };
  17750. var tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|' + '(?:!(--)?)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_:.]*)(\\s(?:[^\'">]+(?:"[^"]*"|\'[^\']*\'))*[^"\'>]*(?:"[^">]*|\'[^\'>]*)?|\\s*|\\/)>)' + ')', 'g');
  17751. var attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
  17752. var shortEndedElements = schema.getShortEndedElements();
  17753. var selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
  17754. var fillAttrsMap = schema.getBoolAttrs();
  17755. var validate = settings.validate;
  17756. var removeInternalElements = settings.remove_internals;
  17757. var fixSelfClosing = settings.fix_self_closing;
  17758. var specialElements = schema.getSpecialElements();
  17759. var processHtml = html + '>';
  17760. while (matches = tokenRegExp.exec(processHtml)) {
  17761. var matchText = matches[0];
  17762. if (index < matches.index) {
  17763. processText(decode(html.substr(index, matches.index - index)));
  17764. }
  17765. if (value = matches[7]) {
  17766. value = value.toLowerCase();
  17767. if (value.charAt(0) === ':') {
  17768. value = value.substr(1);
  17769. }
  17770. processEndTag(value);
  17771. } else if (value = matches[8]) {
  17772. if (matches.index + matchText.length > html.length) {
  17773. processText(decode(html.substr(matches.index)));
  17774. index = matches.index + matchText.length;
  17775. continue;
  17776. }
  17777. value = value.toLowerCase();
  17778. if (value.charAt(0) === ':') {
  17779. value = value.substr(1);
  17780. }
  17781. isShortEnded = value in shortEndedElements;
  17782. if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
  17783. processEndTag(value);
  17784. }
  17785. var bogusValue = checkBogusAttribute(attrRegExp, matches[9]);
  17786. if (bogusValue !== null) {
  17787. if (bogusValue === 'all') {
  17788. index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
  17789. tokenRegExp.lastIndex = index;
  17790. continue;
  17791. }
  17792. isValidElement = false;
  17793. }
  17794. if (!validate || (elementRule = schema.getElementRule(value))) {
  17795. isValidElement = true;
  17796. if (validate) {
  17797. validAttributesMap = elementRule.attributes;
  17798. validAttributePatterns = elementRule.attributePatterns;
  17799. }
  17800. if (attribsValue = matches[9]) {
  17801. isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
  17802. if (isInternalElement && removeInternalElements) {
  17803. isValidElement = false;
  17804. }
  17805. attrList = [];
  17806. attrList.map = {};
  17807. attribsValue.replace(attrRegExp, function (match, name, val, val2, val3) {
  17808. parseAttribute(value, name, val, val2, val3);
  17809. return '';
  17810. });
  17811. } else {
  17812. attrList = [];
  17813. attrList.map = {};
  17814. }
  17815. if (validate && !isInternalElement) {
  17816. attributesRequired = elementRule.attributesRequired;
  17817. attributesDefault = elementRule.attributesDefault;
  17818. attributesForced = elementRule.attributesForced;
  17819. anyAttributesRequired = elementRule.removeEmptyAttrs;
  17820. if (anyAttributesRequired && !attrList.length) {
  17821. isValidElement = false;
  17822. }
  17823. if (attributesForced) {
  17824. i = attributesForced.length;
  17825. while (i--) {
  17826. attr = attributesForced[i];
  17827. name = attr.name;
  17828. attrValue = attr.value;
  17829. if (attrValue === '{$uid}') {
  17830. attrValue = 'mce_' + idCount++;
  17831. }
  17832. attrList.map[name] = attrValue;
  17833. attrList.push({
  17834. name: name,
  17835. value: attrValue
  17836. });
  17837. }
  17838. }
  17839. if (attributesDefault) {
  17840. i = attributesDefault.length;
  17841. while (i--) {
  17842. attr = attributesDefault[i];
  17843. name = attr.name;
  17844. if (!(name in attrList.map)) {
  17845. attrValue = attr.value;
  17846. if (attrValue === '{$uid}') {
  17847. attrValue = 'mce_' + idCount++;
  17848. }
  17849. attrList.map[name] = attrValue;
  17850. attrList.push({
  17851. name: name,
  17852. value: attrValue
  17853. });
  17854. }
  17855. }
  17856. }
  17857. if (attributesRequired) {
  17858. i = attributesRequired.length;
  17859. while (i--) {
  17860. if (attributesRequired[i] in attrList.map) {
  17861. break;
  17862. }
  17863. }
  17864. if (i === -1) {
  17865. isValidElement = false;
  17866. }
  17867. }
  17868. if (attr = attrList.map['data-mce-bogus']) {
  17869. if (attr === 'all') {
  17870. index = findMatchingEndTagIndex(schema, html, tokenRegExp.lastIndex);
  17871. tokenRegExp.lastIndex = index;
  17872. continue;
  17873. }
  17874. isValidElement = false;
  17875. }
  17876. }
  17877. if (isValidElement) {
  17878. start(value, attrList, isShortEnded);
  17879. }
  17880. } else {
  17881. isValidElement = false;
  17882. }
  17883. if (endRegExp = specialElements[value]) {
  17884. endRegExp.lastIndex = index = matches.index + matchText.length;
  17885. if (matches = endRegExp.exec(html)) {
  17886. if (isValidElement) {
  17887. textData = html.substr(index, matches.index - index);
  17888. }
  17889. index = matches.index + matches[0].length;
  17890. } else {
  17891. textData = html.substr(index);
  17892. index = html.length;
  17893. }
  17894. if (isValidElement) {
  17895. if (textData.length > 0) {
  17896. processText(textData, true);
  17897. }
  17898. end(value);
  17899. }
  17900. tokenRegExp.lastIndex = index;
  17901. continue;
  17902. }
  17903. if (!isShortEnded) {
  17904. if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
  17905. stack.push({
  17906. name: value,
  17907. valid: isValidElement
  17908. });
  17909. } else if (isValidElement) {
  17910. end(value);
  17911. }
  17912. }
  17913. } else if (value = matches[1]) {
  17914. processComment(value);
  17915. } else if (value = matches[2]) {
  17916. var isValidCdataSection = parsingMode === 1 || settings.preserve_cdata || stack.length > 0 && schema.isValidChild(stack[stack.length - 1].name, '#cdata');
  17917. if (isValidCdataSection) {
  17918. cdata(value);
  17919. } else {
  17920. index = processMalformedComment('', matches.index + 2);
  17921. tokenRegExp.lastIndex = index;
  17922. continue;
  17923. }
  17924. } else if (value = matches[3]) {
  17925. doctype(value);
  17926. } else if ((value = matches[4]) || matchText === '<!') {
  17927. index = processMalformedComment(value, matches.index + matchText.length);
  17928. tokenRegExp.lastIndex = index;
  17929. continue;
  17930. } else if (value = matches[5]) {
  17931. if (parsingMode === 1) {
  17932. pi(value, matches[6]);
  17933. } else {
  17934. index = processMalformedComment('?', matches.index + 2);
  17935. tokenRegExp.lastIndex = index;
  17936. continue;
  17937. }
  17938. }
  17939. index = matches.index + matchText.length;
  17940. }
  17941. if (index < html.length) {
  17942. processText(decode(html.substr(index)));
  17943. }
  17944. for (i = stack.length - 1; i >= 0; i--) {
  17945. value = stack[i];
  17946. if (value.valid) {
  17947. end(value.name);
  17948. }
  17949. }
  17950. };
  17951. var parse = function (html, format) {
  17952. if (format === void 0) {
  17953. format = 'html';
  17954. }
  17955. parseInternal(extractBase64DataUris(html), format);
  17956. };
  17957. return { parse: parse };
  17958. };
  17959. SaxParser.findEndTag = findMatchingEndTagIndex;
  17960. var trimHtml = function (tempAttrs, html) {
  17961. var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
  17962. return html.replace(trimContentRegExp, '');
  17963. };
  17964. var trimInternal = function (serializer, html) {
  17965. var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
  17966. var schema = serializer.schema;
  17967. var content = trimHtml(serializer.getTempAttrs(), html);
  17968. var shortEndedElements = schema.getShortEndedElements();
  17969. var matches;
  17970. while (matches = bogusAllRegExp.exec(content)) {
  17971. var index = bogusAllRegExp.lastIndex;
  17972. var matchLength = matches[0].length;
  17973. var endTagIndex = void 0;
  17974. if (shortEndedElements[matches[1]]) {
  17975. endTagIndex = index;
  17976. } else {
  17977. endTagIndex = SaxParser.findEndTag(schema, content, index);
  17978. }
  17979. content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
  17980. bogusAllRegExp.lastIndex = index - matchLength;
  17981. }
  17982. return trim$2(content);
  17983. };
  17984. var trimExternal = trimInternal;
  17985. var trimEmptyContents = function (editor, html) {
  17986. var blockName = getForcedRootBlock(editor);
  17987. var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>(&nbsp;|&#160;|\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
  17988. return html.replace(emptyRegExp, '');
  17989. };
  17990. var setupArgs$3 = function (args, format) {
  17991. return __assign(__assign({}, args), {
  17992. format: format,
  17993. get: true,
  17994. getInner: true
  17995. });
  17996. };
  17997. var getContentFromBody = function (editor, args, format, body) {
  17998. var defaultedArgs = setupArgs$3(args, format);
  17999. var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeGetContent', defaultedArgs);
  18000. var content;
  18001. if (updatedArgs.format === 'raw') {
  18002. content = Tools.trim(trimExternal(editor.serializer, body.innerHTML));
  18003. } else if (updatedArgs.format === 'text') {
  18004. content = editor.dom.isEmpty(body) ? '' : trim$2(body.innerText || body.textContent);
  18005. } else if (updatedArgs.format === 'tree') {
  18006. content = editor.serializer.serialize(body, updatedArgs);
  18007. } else {
  18008. content = trimEmptyContents(editor, editor.serializer.serialize(body, updatedArgs));
  18009. }
  18010. if (!contains$3([
  18011. 'text',
  18012. 'tree'
  18013. ], updatedArgs.format) && !isWsPreserveElement(SugarElement.fromDom(body))) {
  18014. updatedArgs.content = Tools.trim(content);
  18015. } else {
  18016. updatedArgs.content = content;
  18017. }
  18018. if (updatedArgs.no_events) {
  18019. return updatedArgs.content;
  18020. } else {
  18021. return editor.fire('GetContent', updatedArgs).content;
  18022. }
  18023. };
  18024. var getContentInternal = function (editor, args, format) {
  18025. return Optional.from(editor.getBody()).fold(constant(args.format === 'tree' ? new AstNode('body', 11) : ''), function (body) {
  18026. return getContentFromBody(editor, args, format, body);
  18027. });
  18028. };
  18029. var each$c = Tools.each;
  18030. var ElementUtils = function (dom) {
  18031. var compare = function (node1, node2) {
  18032. if (node1.nodeName !== node2.nodeName) {
  18033. return false;
  18034. }
  18035. var getAttribs = function (node) {
  18036. var attribs = {};
  18037. each$c(dom.getAttribs(node), function (attr) {
  18038. var name = attr.nodeName.toLowerCase();
  18039. if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
  18040. attribs[name] = dom.getAttrib(node, name);
  18041. }
  18042. });
  18043. return attribs;
  18044. };
  18045. var compareObjects = function (obj1, obj2) {
  18046. var value, name;
  18047. for (name in obj1) {
  18048. if (has$2(obj1, name)) {
  18049. value = obj2[name];
  18050. if (typeof value === 'undefined') {
  18051. return false;
  18052. }
  18053. if (obj1[name] !== value) {
  18054. return false;
  18055. }
  18056. delete obj2[name];
  18057. }
  18058. }
  18059. for (name in obj2) {
  18060. if (has$2(obj2, name)) {
  18061. return false;
  18062. }
  18063. }
  18064. return true;
  18065. };
  18066. if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
  18067. return false;
  18068. }
  18069. if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
  18070. return false;
  18071. }
  18072. return !isBookmarkNode$1(node1) && !isBookmarkNode$1(node2);
  18073. };
  18074. return { compare: compare };
  18075. };
  18076. var makeMap$1 = Tools.makeMap;
  18077. var Writer = function (settings) {
  18078. var html = [];
  18079. settings = settings || {};
  18080. var indent = settings.indent;
  18081. var indentBefore = makeMap$1(settings.indent_before || '');
  18082. var indentAfter = makeMap$1(settings.indent_after || '');
  18083. var encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
  18084. var htmlOutput = settings.element_format === 'html';
  18085. return {
  18086. start: function (name, attrs, empty) {
  18087. var i, l, attr, value;
  18088. if (indent && indentBefore[name] && html.length > 0) {
  18089. value = html[html.length - 1];
  18090. if (value.length > 0 && value !== '\n') {
  18091. html.push('\n');
  18092. }
  18093. }
  18094. html.push('<', name);
  18095. if (attrs) {
  18096. for (i = 0, l = attrs.length; i < l; i++) {
  18097. attr = attrs[i];
  18098. html.push(' ', attr.name, '="', encode(attr.value, true), '"');
  18099. }
  18100. }
  18101. if (!empty || htmlOutput) {
  18102. html[html.length] = '>';
  18103. } else {
  18104. html[html.length] = ' />';
  18105. }
  18106. if (empty && indent && indentAfter[name] && html.length > 0) {
  18107. value = html[html.length - 1];
  18108. if (value.length > 0 && value !== '\n') {
  18109. html.push('\n');
  18110. }
  18111. }
  18112. },
  18113. end: function (name) {
  18114. var value;
  18115. html.push('</', name, '>');
  18116. if (indent && indentAfter[name] && html.length > 0) {
  18117. value = html[html.length - 1];
  18118. if (value.length > 0 && value !== '\n') {
  18119. html.push('\n');
  18120. }
  18121. }
  18122. },
  18123. text: function (text, raw) {
  18124. if (text.length > 0) {
  18125. html[html.length] = raw ? text : encode(text);
  18126. }
  18127. },
  18128. cdata: function (text) {
  18129. html.push('<![CDATA[', text, ']]>');
  18130. },
  18131. comment: function (text) {
  18132. html.push('<!--', text, '-->');
  18133. },
  18134. pi: function (name, text) {
  18135. if (text) {
  18136. html.push('<?', name, ' ', encode(text), '?>');
  18137. } else {
  18138. html.push('<?', name, '?>');
  18139. }
  18140. if (indent) {
  18141. html.push('\n');
  18142. }
  18143. },
  18144. doctype: function (text) {
  18145. html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
  18146. },
  18147. reset: function () {
  18148. html.length = 0;
  18149. },
  18150. getContent: function () {
  18151. return html.join('').replace(/\n$/, '');
  18152. }
  18153. };
  18154. };
  18155. var HtmlSerializer = function (settings, schema) {
  18156. if (schema === void 0) {
  18157. schema = Schema();
  18158. }
  18159. var writer = Writer(settings);
  18160. settings = settings || {};
  18161. settings.validate = 'validate' in settings ? settings.validate : true;
  18162. var serialize = function (node) {
  18163. var validate = settings.validate;
  18164. var handlers = {
  18165. 3: function (node) {
  18166. writer.text(node.value, node.raw);
  18167. },
  18168. 8: function (node) {
  18169. writer.comment(node.value);
  18170. },
  18171. 7: function (node) {
  18172. writer.pi(node.name, node.value);
  18173. },
  18174. 10: function (node) {
  18175. writer.doctype(node.value);
  18176. },
  18177. 4: function (node) {
  18178. writer.cdata(node.value);
  18179. },
  18180. 11: function (node) {
  18181. if (node = node.firstChild) {
  18182. do {
  18183. walk(node);
  18184. } while (node = node.next);
  18185. }
  18186. }
  18187. };
  18188. writer.reset();
  18189. var walk = function (node) {
  18190. var handler = handlers[node.type];
  18191. if (!handler) {
  18192. var name_1 = node.name;
  18193. var isEmpty = node.shortEnded;
  18194. var attrs = node.attributes;
  18195. if (validate && attrs && attrs.length > 1) {
  18196. var sortedAttrs = [];
  18197. sortedAttrs.map = {};
  18198. var elementRule = schema.getElementRule(node.name);
  18199. if (elementRule) {
  18200. for (var i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
  18201. var attrName = elementRule.attributesOrder[i];
  18202. if (attrName in attrs.map) {
  18203. var attrValue = attrs.map[attrName];
  18204. sortedAttrs.map[attrName] = attrValue;
  18205. sortedAttrs.push({
  18206. name: attrName,
  18207. value: attrValue
  18208. });
  18209. }
  18210. }
  18211. for (var i = 0, l = attrs.length; i < l; i++) {
  18212. var attrName = attrs[i].name;
  18213. if (!(attrName in sortedAttrs.map)) {
  18214. var attrValue = attrs.map[attrName];
  18215. sortedAttrs.map[attrName] = attrValue;
  18216. sortedAttrs.push({
  18217. name: attrName,
  18218. value: attrValue
  18219. });
  18220. }
  18221. }
  18222. attrs = sortedAttrs;
  18223. }
  18224. }
  18225. writer.start(node.name, attrs, isEmpty);
  18226. if (!isEmpty) {
  18227. if (node = node.firstChild) {
  18228. do {
  18229. walk(node);
  18230. } while (node = node.next);
  18231. }
  18232. writer.end(name_1);
  18233. }
  18234. } else {
  18235. handler(node);
  18236. }
  18237. };
  18238. if (node.type === 1 && !settings.inner) {
  18239. walk(node);
  18240. } else {
  18241. handlers[11](node);
  18242. }
  18243. return writer.getContent();
  18244. };
  18245. return { serialize: serialize };
  18246. };
  18247. var nonInheritableStyles = new Set();
  18248. (function () {
  18249. var nonInheritableStylesArr = [
  18250. 'margin',
  18251. 'margin-left',
  18252. 'margin-right',
  18253. 'margin-top',
  18254. 'margin-bottom',
  18255. 'padding',
  18256. 'padding-left',
  18257. 'padding-right',
  18258. 'padding-top',
  18259. 'padding-bottom',
  18260. 'border',
  18261. 'border-width',
  18262. 'border-style',
  18263. 'border-color',
  18264. 'background',
  18265. 'background-attachment',
  18266. 'background-clip',
  18267. 'background-color',
  18268. 'background-image',
  18269. 'background-origin',
  18270. 'background-position',
  18271. 'background-repeat',
  18272. 'background-size',
  18273. 'float',
  18274. 'position',
  18275. 'left',
  18276. 'right',
  18277. 'top',
  18278. 'bottom',
  18279. 'z-index',
  18280. 'display',
  18281. 'transform',
  18282. 'width',
  18283. 'max-width',
  18284. 'min-width',
  18285. 'height',
  18286. 'max-height',
  18287. 'min-height',
  18288. 'overflow',
  18289. 'overflow-x',
  18290. 'overflow-y',
  18291. 'text-overflow',
  18292. 'vertical-align',
  18293. 'transition',
  18294. 'transition-delay',
  18295. 'transition-duration',
  18296. 'transition-property',
  18297. 'transition-timing-function'
  18298. ];
  18299. each$k(nonInheritableStylesArr, function (style) {
  18300. nonInheritableStyles.add(style);
  18301. });
  18302. }());
  18303. var shorthandStyleProps = [
  18304. 'font',
  18305. 'text-decoration',
  18306. 'text-emphasis'
  18307. ];
  18308. var getStyleProps = function (dom, node) {
  18309. return keys(dom.parseStyle(dom.getAttrib(node, 'style')));
  18310. };
  18311. var isNonInheritableStyle = function (style) {
  18312. return nonInheritableStyles.has(style);
  18313. };
  18314. var hasInheritableStyles = function (dom, node) {
  18315. return forall(getStyleProps(dom, node), function (style) {
  18316. return !isNonInheritableStyle(style);
  18317. });
  18318. };
  18319. var getLonghandStyleProps = function (styles) {
  18320. return filter$4(styles, function (style) {
  18321. return exists(shorthandStyleProps, function (prop) {
  18322. return startsWith(style, prop);
  18323. });
  18324. });
  18325. };
  18326. var hasStyleConflict = function (dom, node, parentNode) {
  18327. var nodeStyleProps = getStyleProps(dom, node);
  18328. var parentNodeStyleProps = getStyleProps(dom, parentNode);
  18329. var valueMismatch = function (prop) {
  18330. var nodeValue = dom.getStyle(node, prop);
  18331. var parentValue = dom.getStyle(parentNode, prop);
  18332. return isNotEmpty(nodeValue) && isNotEmpty(parentValue) && nodeValue !== parentValue;
  18333. };
  18334. return exists(nodeStyleProps, function (nodeStyleProp) {
  18335. var propExists = function (props) {
  18336. return exists(props, function (prop) {
  18337. return prop === nodeStyleProp;
  18338. });
  18339. };
  18340. if (!propExists(parentNodeStyleProps) && propExists(shorthandStyleProps)) {
  18341. var longhandProps = getLonghandStyleProps(parentNodeStyleProps);
  18342. return exists(longhandProps, valueMismatch);
  18343. } else {
  18344. return valueMismatch(nodeStyleProp);
  18345. }
  18346. });
  18347. };
  18348. var isChar = function (forward, predicate, pos) {
  18349. return Optional.from(pos.container()).filter(isText$7).exists(function (text) {
  18350. var delta = forward ? 0 : -1;
  18351. return predicate(text.data.charAt(pos.offset() + delta));
  18352. });
  18353. };
  18354. var isBeforeSpace = curry(isChar, true, isWhiteSpace);
  18355. var isAfterSpace = curry(isChar, false, isWhiteSpace);
  18356. var isEmptyText = function (pos) {
  18357. var container = pos.container();
  18358. return isText$7(container) && (container.data.length === 0 || isZwsp(container.data) && BookmarkManager.isBookmarkNode(container.parentNode));
  18359. };
  18360. var matchesElementPosition = function (before, predicate) {
  18361. return function (pos) {
  18362. return Optional.from(getChildNodeAtRelativeOffset(before ? 0 : -1, pos)).filter(predicate).isSome();
  18363. };
  18364. };
  18365. var isImageBlock = function (node) {
  18366. return isImg(node) && get$5(SugarElement.fromDom(node), 'display') === 'block';
  18367. };
  18368. var isCefNode = function (node) {
  18369. return isContentEditableFalse$b(node) && !isBogusAll$1(node);
  18370. };
  18371. var isBeforeImageBlock = matchesElementPosition(true, isImageBlock);
  18372. var isAfterImageBlock = matchesElementPosition(false, isImageBlock);
  18373. var isBeforeMedia = matchesElementPosition(true, isMedia$2);
  18374. var isAfterMedia = matchesElementPosition(false, isMedia$2);
  18375. var isBeforeTable = matchesElementPosition(true, isTable$3);
  18376. var isAfterTable = matchesElementPosition(false, isTable$3);
  18377. var isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode);
  18378. var isAfterContentEditableFalse = matchesElementPosition(false, isCefNode);
  18379. var getLastChildren = function (elm) {
  18380. var children = [];
  18381. var rawNode = elm.dom;
  18382. while (rawNode) {
  18383. children.push(SugarElement.fromDom(rawNode));
  18384. rawNode = rawNode.lastChild;
  18385. }
  18386. return children;
  18387. };
  18388. var removeTrailingBr = function (elm) {
  18389. var allBrs = descendants(elm, 'br');
  18390. var brs = filter$4(getLastChildren(elm).slice(-1), isBr$4);
  18391. if (allBrs.length === brs.length) {
  18392. each$k(brs, remove$7);
  18393. }
  18394. };
  18395. var fillWithPaddingBr = function (elm) {
  18396. empty(elm);
  18397. append$1(elm, SugarElement.fromHtml('<br data-mce-bogus="1">'));
  18398. };
  18399. var trimBlockTrailingBr = function (elm) {
  18400. lastChild(elm).each(function (lastChild) {
  18401. prevSibling(lastChild).each(function (lastChildPrevSibling) {
  18402. if (isBlock$2(elm) && isBr$4(lastChild) && isBlock$2(lastChildPrevSibling)) {
  18403. remove$7(lastChild);
  18404. }
  18405. });
  18406. });
  18407. };
  18408. var dropLast = function (xs) {
  18409. return xs.slice(0, -1);
  18410. };
  18411. var parentsUntil = function (start, root, predicate) {
  18412. if (contains$1(root, start)) {
  18413. return dropLast(parents$1(start, function (elm) {
  18414. return predicate(elm) || eq(elm, root);
  18415. }));
  18416. } else {
  18417. return [];
  18418. }
  18419. };
  18420. var parents = function (start, root) {
  18421. return parentsUntil(start, root, never);
  18422. };
  18423. var parentsAndSelf = function (start, root) {
  18424. return [start].concat(parents(start, root));
  18425. };
  18426. var navigateIgnoreEmptyTextNodes = function (forward, root, from) {
  18427. return navigateIgnore(forward, root, from, isEmptyText);
  18428. };
  18429. var getClosestBlock$1 = function (root, pos) {
  18430. return find$3(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
  18431. };
  18432. var isAtBeforeAfterBlockBoundary = function (forward, root, pos) {
  18433. return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) {
  18434. return getClosestBlock$1(root, pos).fold(function () {
  18435. return isInSameBlock(newPos, pos, root.dom) === false;
  18436. }, function (fromBlock) {
  18437. return isInSameBlock(newPos, pos, root.dom) === false && contains$1(fromBlock, SugarElement.fromDom(newPos.container()));
  18438. });
  18439. });
  18440. };
  18441. var isAtBlockBoundary = function (forward, root, pos) {
  18442. return getClosestBlock$1(root, pos).fold(function () {
  18443. return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) {
  18444. return isInSameBlock(newPos, pos, root.dom) === false;
  18445. });
  18446. }, function (parent) {
  18447. return navigateIgnoreEmptyTextNodes(forward, parent.dom, pos).isNone();
  18448. });
  18449. };
  18450. var isAtStartOfBlock = curry(isAtBlockBoundary, false);
  18451. var isAtEndOfBlock = curry(isAtBlockBoundary, true);
  18452. var isBeforeBlock = curry(isAtBeforeAfterBlockBoundary, false);
  18453. var isAfterBlock = curry(isAtBeforeAfterBlockBoundary, true);
  18454. var isBr = function (pos) {
  18455. return getElementFromPosition(pos).exists(isBr$4);
  18456. };
  18457. var findBr = function (forward, root, pos) {
  18458. var parentBlocks = filter$4(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
  18459. var scope = head(parentBlocks).getOr(root);
  18460. return fromPosition(forward, scope.dom, pos).filter(isBr);
  18461. };
  18462. var isBeforeBr$1 = function (root, pos) {
  18463. return getElementFromPosition(pos).exists(isBr$4) || findBr(true, root, pos).isSome();
  18464. };
  18465. var isAfterBr = function (root, pos) {
  18466. return getElementFromPrevPosition(pos).exists(isBr$4) || findBr(false, root, pos).isSome();
  18467. };
  18468. var findPreviousBr = curry(findBr, false);
  18469. var findNextBr = curry(findBr, true);
  18470. var isInMiddleOfText = function (pos) {
  18471. return CaretPosition.isTextPosition(pos) && !pos.isAtStart() && !pos.isAtEnd();
  18472. };
  18473. var getClosestBlock = function (root, pos) {
  18474. var parentBlocks = filter$4(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock$2);
  18475. return head(parentBlocks).getOr(root);
  18476. };
  18477. var hasSpaceBefore = function (root, pos) {
  18478. if (isInMiddleOfText(pos)) {
  18479. return isAfterSpace(pos);
  18480. } else {
  18481. return isAfterSpace(pos) || prevPosition(getClosestBlock(root, pos).dom, pos).exists(isAfterSpace);
  18482. }
  18483. };
  18484. var hasSpaceAfter = function (root, pos) {
  18485. if (isInMiddleOfText(pos)) {
  18486. return isBeforeSpace(pos);
  18487. } else {
  18488. return isBeforeSpace(pos) || nextPosition(getClosestBlock(root, pos).dom, pos).exists(isBeforeSpace);
  18489. }
  18490. };
  18491. var isPreValue = function (value) {
  18492. return contains$3([
  18493. 'pre',
  18494. 'pre-wrap'
  18495. ], value);
  18496. };
  18497. var isInPre = function (pos) {
  18498. return getElementFromPosition(pos).bind(function (elm) {
  18499. return closest$3(elm, isElement$6);
  18500. }).exists(function (elm) {
  18501. return isPreValue(get$5(elm, 'white-space'));
  18502. });
  18503. };
  18504. var isAtBeginningOfBody = function (root, pos) {
  18505. return prevPosition(root.dom, pos).isNone();
  18506. };
  18507. var isAtEndOfBody = function (root, pos) {
  18508. return nextPosition(root.dom, pos).isNone();
  18509. };
  18510. var isAtLineBoundary = function (root, pos) {
  18511. return isAtBeginningOfBody(root, pos) || isAtEndOfBody(root, pos) || isAtStartOfBlock(root, pos) || isAtEndOfBlock(root, pos) || isAfterBr(root, pos) || isBeforeBr$1(root, pos);
  18512. };
  18513. var needsToHaveNbsp = function (root, pos) {
  18514. if (isInPre(pos)) {
  18515. return false;
  18516. } else {
  18517. return isAtLineBoundary(root, pos) || hasSpaceBefore(root, pos) || hasSpaceAfter(root, pos);
  18518. }
  18519. };
  18520. var needsToBeNbspLeft = function (root, pos) {
  18521. if (isInPre(pos)) {
  18522. return false;
  18523. } else {
  18524. return isAtStartOfBlock(root, pos) || isBeforeBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos);
  18525. }
  18526. };
  18527. var leanRight = function (pos) {
  18528. var container = pos.container();
  18529. var offset = pos.offset();
  18530. if (isText$7(container) && offset < container.data.length) {
  18531. return CaretPosition(container, offset + 1);
  18532. } else {
  18533. return pos;
  18534. }
  18535. };
  18536. var needsToBeNbspRight = function (root, pos) {
  18537. if (isInPre(pos)) {
  18538. return false;
  18539. } else {
  18540. return isAtEndOfBlock(root, pos) || isAfterBlock(root, pos) || isBeforeBr$1(root, pos) || hasSpaceAfter(root, pos);
  18541. }
  18542. };
  18543. var needsToBeNbsp = function (root, pos) {
  18544. return needsToBeNbspLeft(root, pos) || needsToBeNbspRight(root, leanRight(pos));
  18545. };
  18546. var isNbspAt = function (text, offset) {
  18547. return isNbsp(text.charAt(offset));
  18548. };
  18549. var hasNbsp = function (pos) {
  18550. var container = pos.container();
  18551. return isText$7(container) && contains$2(container.data, nbsp);
  18552. };
  18553. var normalizeNbspMiddle = function (text) {
  18554. var chars = text.split('');
  18555. return map$3(chars, function (chr, i) {
  18556. if (isNbsp(chr) && i > 0 && i < chars.length - 1 && isContent(chars[i - 1]) && isContent(chars[i + 1])) {
  18557. return ' ';
  18558. } else {
  18559. return chr;
  18560. }
  18561. }).join('');
  18562. };
  18563. var normalizeNbspAtStart = function (root, node) {
  18564. var text = node.data;
  18565. var firstPos = CaretPosition(node, 0);
  18566. if (isNbspAt(text, 0) && !needsToBeNbsp(root, firstPos)) {
  18567. node.data = ' ' + text.slice(1);
  18568. return true;
  18569. } else {
  18570. return false;
  18571. }
  18572. };
  18573. var normalizeNbspInMiddleOfTextNode = function (node) {
  18574. var text = node.data;
  18575. var newText = normalizeNbspMiddle(text);
  18576. if (newText !== text) {
  18577. node.data = newText;
  18578. return true;
  18579. } else {
  18580. return false;
  18581. }
  18582. };
  18583. var normalizeNbspAtEnd = function (root, node) {
  18584. var text = node.data;
  18585. var lastPos = CaretPosition(node, text.length - 1);
  18586. if (isNbspAt(text, text.length - 1) && !needsToBeNbsp(root, lastPos)) {
  18587. node.data = text.slice(0, -1) + ' ';
  18588. return true;
  18589. } else {
  18590. return false;
  18591. }
  18592. };
  18593. var normalizeNbsps = function (root, pos) {
  18594. return Optional.some(pos).filter(hasNbsp).bind(function (pos) {
  18595. var container = pos.container();
  18596. var normalized = normalizeNbspAtStart(root, container) || normalizeNbspInMiddleOfTextNode(container) || normalizeNbspAtEnd(root, container);
  18597. return normalized ? Optional.some(pos) : Optional.none();
  18598. });
  18599. };
  18600. var normalizeNbspsInEditor = function (editor) {
  18601. var root = SugarElement.fromDom(editor.getBody());
  18602. if (editor.selection.isCollapsed()) {
  18603. normalizeNbsps(root, CaretPosition.fromRangeStart(editor.selection.getRng())).each(function (pos) {
  18604. editor.selection.setRng(pos.toRange());
  18605. });
  18606. }
  18607. };
  18608. var normalizeContent = function (content, isStartOfContent, isEndOfContent) {
  18609. var result = foldl(content, function (acc, c) {
  18610. if (isWhiteSpace(c) || isNbsp(c)) {
  18611. if (acc.previousCharIsSpace || acc.str === '' && isStartOfContent || acc.str.length === content.length - 1 && isEndOfContent) {
  18612. return {
  18613. previousCharIsSpace: false,
  18614. str: acc.str + nbsp
  18615. };
  18616. } else {
  18617. return {
  18618. previousCharIsSpace: true,
  18619. str: acc.str + ' '
  18620. };
  18621. }
  18622. } else {
  18623. return {
  18624. previousCharIsSpace: false,
  18625. str: acc.str + c
  18626. };
  18627. }
  18628. }, {
  18629. previousCharIsSpace: false,
  18630. str: ''
  18631. });
  18632. return result.str;
  18633. };
  18634. var normalize$1 = function (node, offset, count) {
  18635. if (count === 0) {
  18636. return;
  18637. }
  18638. var elm = SugarElement.fromDom(node);
  18639. var root = ancestor$3(elm, isBlock$2).getOr(elm);
  18640. var whitespace = node.data.slice(offset, offset + count);
  18641. var isEndOfContent = offset + count >= node.data.length && needsToBeNbspRight(root, CaretPosition(node, node.data.length));
  18642. var isStartOfContent = offset === 0 && needsToBeNbspLeft(root, CaretPosition(node, 0));
  18643. node.replaceData(offset, count, normalizeContent(whitespace, isStartOfContent, isEndOfContent));
  18644. };
  18645. var normalizeWhitespaceAfter = function (node, offset) {
  18646. var content = node.data.slice(offset);
  18647. var whitespaceCount = content.length - lTrim(content).length;
  18648. normalize$1(node, offset, whitespaceCount);
  18649. };
  18650. var normalizeWhitespaceBefore = function (node, offset) {
  18651. var content = node.data.slice(0, offset);
  18652. var whitespaceCount = content.length - rTrim(content).length;
  18653. normalize$1(node, offset - whitespaceCount, whitespaceCount);
  18654. };
  18655. var mergeTextNodes = function (prevNode, nextNode, normalizeWhitespace, mergeToPrev) {
  18656. if (mergeToPrev === void 0) {
  18657. mergeToPrev = true;
  18658. }
  18659. var whitespaceOffset = rTrim(prevNode.data).length;
  18660. var newNode = mergeToPrev ? prevNode : nextNode;
  18661. var removeNode = mergeToPrev ? nextNode : prevNode;
  18662. if (mergeToPrev) {
  18663. newNode.appendData(removeNode.data);
  18664. } else {
  18665. newNode.insertData(0, removeNode.data);
  18666. }
  18667. remove$7(SugarElement.fromDom(removeNode));
  18668. if (normalizeWhitespace) {
  18669. normalizeWhitespaceAfter(newNode, whitespaceOffset);
  18670. }
  18671. return newNode;
  18672. };
  18673. var needsReposition = function (pos, elm) {
  18674. var container = pos.container();
  18675. var offset = pos.offset();
  18676. return CaretPosition.isTextPosition(pos) === false && container === elm.parentNode && offset > CaretPosition.before(elm).offset();
  18677. };
  18678. var reposition = function (elm, pos) {
  18679. return needsReposition(pos, elm) ? CaretPosition(pos.container(), pos.offset() - 1) : pos;
  18680. };
  18681. var beforeOrStartOf = function (node) {
  18682. return isText$7(node) ? CaretPosition(node, 0) : CaretPosition.before(node);
  18683. };
  18684. var afterOrEndOf = function (node) {
  18685. return isText$7(node) ? CaretPosition(node, node.data.length) : CaretPosition.after(node);
  18686. };
  18687. var getPreviousSiblingCaretPosition = function (elm) {
  18688. if (isCaretCandidate$3(elm.previousSibling)) {
  18689. return Optional.some(afterOrEndOf(elm.previousSibling));
  18690. } else {
  18691. return elm.previousSibling ? lastPositionIn(elm.previousSibling) : Optional.none();
  18692. }
  18693. };
  18694. var getNextSiblingCaretPosition = function (elm) {
  18695. if (isCaretCandidate$3(elm.nextSibling)) {
  18696. return Optional.some(beforeOrStartOf(elm.nextSibling));
  18697. } else {
  18698. return elm.nextSibling ? firstPositionIn(elm.nextSibling) : Optional.none();
  18699. }
  18700. };
  18701. var findCaretPositionBackwardsFromElm = function (rootElement, elm) {
  18702. var startPosition = CaretPosition.before(elm.previousSibling ? elm.previousSibling : elm.parentNode);
  18703. return prevPosition(rootElement, startPosition).fold(function () {
  18704. return nextPosition(rootElement, CaretPosition.after(elm));
  18705. }, Optional.some);
  18706. };
  18707. var findCaretPositionForwardsFromElm = function (rootElement, elm) {
  18708. return nextPosition(rootElement, CaretPosition.after(elm)).fold(function () {
  18709. return prevPosition(rootElement, CaretPosition.before(elm));
  18710. }, Optional.some);
  18711. };
  18712. var findCaretPositionBackwards = function (rootElement, elm) {
  18713. return getPreviousSiblingCaretPosition(elm).orThunk(function () {
  18714. return getNextSiblingCaretPosition(elm);
  18715. }).orThunk(function () {
  18716. return findCaretPositionBackwardsFromElm(rootElement, elm);
  18717. });
  18718. };
  18719. var findCaretPositionForward = function (rootElement, elm) {
  18720. return getNextSiblingCaretPosition(elm).orThunk(function () {
  18721. return getPreviousSiblingCaretPosition(elm);
  18722. }).orThunk(function () {
  18723. return findCaretPositionForwardsFromElm(rootElement, elm);
  18724. });
  18725. };
  18726. var findCaretPosition = function (forward, rootElement, elm) {
  18727. return forward ? findCaretPositionForward(rootElement, elm) : findCaretPositionBackwards(rootElement, elm);
  18728. };
  18729. var findCaretPosOutsideElmAfterDelete = function (forward, rootElement, elm) {
  18730. return findCaretPosition(forward, rootElement, elm).map(curry(reposition, elm));
  18731. };
  18732. var setSelection$1 = function (editor, forward, pos) {
  18733. pos.fold(function () {
  18734. editor.focus();
  18735. }, function (pos) {
  18736. editor.selection.setRng(pos.toRange(), forward);
  18737. });
  18738. };
  18739. var eqRawNode = function (rawNode) {
  18740. return function (elm) {
  18741. return elm.dom === rawNode;
  18742. };
  18743. };
  18744. var isBlock = function (editor, elm) {
  18745. return elm && has$2(editor.schema.getBlockElements(), name(elm));
  18746. };
  18747. var paddEmptyBlock = function (elm) {
  18748. if (isEmpty$2(elm)) {
  18749. var br = SugarElement.fromHtml('<br data-mce-bogus="1">');
  18750. empty(elm);
  18751. append$1(elm, br);
  18752. return Optional.some(CaretPosition.before(br.dom));
  18753. } else {
  18754. return Optional.none();
  18755. }
  18756. };
  18757. var deleteNormalized = function (elm, afterDeletePosOpt, normalizeWhitespace) {
  18758. var prevTextOpt = prevSibling(elm).filter(isText$8);
  18759. var nextTextOpt = nextSibling(elm).filter(isText$8);
  18760. remove$7(elm);
  18761. return lift3(prevTextOpt, nextTextOpt, afterDeletePosOpt, function (prev, next, pos) {
  18762. var prevNode = prev.dom, nextNode = next.dom;
  18763. var offset = prevNode.data.length;
  18764. mergeTextNodes(prevNode, nextNode, normalizeWhitespace);
  18765. return pos.container() === nextNode ? CaretPosition(prevNode, offset) : pos;
  18766. }).orThunk(function () {
  18767. if (normalizeWhitespace) {
  18768. prevTextOpt.each(function (elm) {
  18769. return normalizeWhitespaceBefore(elm.dom, elm.dom.length);
  18770. });
  18771. nextTextOpt.each(function (elm) {
  18772. return normalizeWhitespaceAfter(elm.dom, 0);
  18773. });
  18774. }
  18775. return afterDeletePosOpt;
  18776. });
  18777. };
  18778. var isInlineElement = function (editor, element) {
  18779. return has$2(editor.schema.getTextInlineElements(), name(element));
  18780. };
  18781. var deleteElement$2 = function (editor, forward, elm, moveCaret) {
  18782. if (moveCaret === void 0) {
  18783. moveCaret = true;
  18784. }
  18785. var afterDeletePos = findCaretPosOutsideElmAfterDelete(forward, editor.getBody(), elm.dom);
  18786. var parentBlock = ancestor$3(elm, curry(isBlock, editor), eqRawNode(editor.getBody()));
  18787. var normalizedAfterDeletePos = deleteNormalized(elm, afterDeletePos, isInlineElement(editor, elm));
  18788. if (editor.dom.isEmpty(editor.getBody())) {
  18789. editor.setContent('');
  18790. editor.selection.setCursorLocation();
  18791. } else {
  18792. parentBlock.bind(paddEmptyBlock).fold(function () {
  18793. if (moveCaret) {
  18794. setSelection$1(editor, forward, normalizedAfterDeletePos);
  18795. }
  18796. }, function (paddPos) {
  18797. if (moveCaret) {
  18798. setSelection$1(editor, forward, Optional.some(paddPos));
  18799. }
  18800. });
  18801. }
  18802. };
  18803. var isRootFromElement = function (root) {
  18804. return function (cur) {
  18805. return eq(root, cur);
  18806. };
  18807. };
  18808. var getTableCells = function (table) {
  18809. return descendants(table, 'td,th');
  18810. };
  18811. var getTableDetailsFromRange = function (rng, isRoot) {
  18812. var getTable = function (node) {
  18813. return getClosestTable(SugarElement.fromDom(node), isRoot);
  18814. };
  18815. var startTable = getTable(rng.startContainer);
  18816. var endTable = getTable(rng.endContainer);
  18817. var isStartInTable = startTable.isSome();
  18818. var isEndInTable = endTable.isSome();
  18819. var isSameTable = lift2(startTable, endTable, eq).getOr(false);
  18820. var isMultiTable = !isSameTable && isStartInTable && isEndInTable;
  18821. return {
  18822. startTable: startTable,
  18823. endTable: endTable,
  18824. isStartInTable: isStartInTable,
  18825. isEndInTable: isEndInTable,
  18826. isSameTable: isSameTable,
  18827. isMultiTable: isMultiTable
  18828. };
  18829. };
  18830. var tableCellRng = function (start, end) {
  18831. return {
  18832. start: start,
  18833. end: end
  18834. };
  18835. };
  18836. var tableSelection = function (rng, table, cells) {
  18837. return {
  18838. rng: rng,
  18839. table: table,
  18840. cells: cells
  18841. };
  18842. };
  18843. var deleteAction = Adt.generate([
  18844. {
  18845. singleCellTable: [
  18846. 'rng',
  18847. 'cell'
  18848. ]
  18849. },
  18850. { fullTable: ['table'] },
  18851. {
  18852. partialTable: [
  18853. 'cells',
  18854. 'outsideDetails'
  18855. ]
  18856. },
  18857. {
  18858. multiTable: [
  18859. 'startTableCells',
  18860. 'endTableCells',
  18861. 'betweenRng'
  18862. ]
  18863. }
  18864. ]);
  18865. var getClosestCell$1 = function (container, isRoot) {
  18866. return closest$2(SugarElement.fromDom(container), 'td,th', isRoot);
  18867. };
  18868. var isExpandedCellRng = function (cellRng) {
  18869. return !eq(cellRng.start, cellRng.end);
  18870. };
  18871. var getTableFromCellRng = function (cellRng, isRoot) {
  18872. return getClosestTable(cellRng.start, isRoot).bind(function (startParentTable) {
  18873. return getClosestTable(cellRng.end, isRoot).bind(function (endParentTable) {
  18874. return someIf(eq(startParentTable, endParentTable), startParentTable);
  18875. });
  18876. });
  18877. };
  18878. var isSingleCellTable = function (cellRng, isRoot) {
  18879. return !isExpandedCellRng(cellRng) && getTableFromCellRng(cellRng, isRoot).exists(function (table) {
  18880. var rows = table.dom.rows;
  18881. return rows.length === 1 && rows[0].cells.length === 1;
  18882. });
  18883. };
  18884. var getCellRng = function (rng, isRoot) {
  18885. var startCell = getClosestCell$1(rng.startContainer, isRoot);
  18886. var endCell = getClosestCell$1(rng.endContainer, isRoot);
  18887. return lift2(startCell, endCell, tableCellRng);
  18888. };
  18889. var getCellRangeFromStartTable = function (isRoot) {
  18890. return function (startCell) {
  18891. return getClosestTable(startCell, isRoot).bind(function (table) {
  18892. return last$2(getTableCells(table)).map(function (endCell) {
  18893. return tableCellRng(startCell, endCell);
  18894. });
  18895. });
  18896. };
  18897. };
  18898. var getCellRangeFromEndTable = function (isRoot) {
  18899. return function (endCell) {
  18900. return getClosestTable(endCell, isRoot).bind(function (table) {
  18901. return head(getTableCells(table)).map(function (startCell) {
  18902. return tableCellRng(startCell, endCell);
  18903. });
  18904. });
  18905. };
  18906. };
  18907. var getTableSelectionFromCellRng = function (isRoot) {
  18908. return function (cellRng) {
  18909. return getTableFromCellRng(cellRng, isRoot).map(function (table) {
  18910. return tableSelection(cellRng, table, getTableCells(table));
  18911. });
  18912. };
  18913. };
  18914. var getTableSelections = function (cellRng, selectionDetails, rng, isRoot) {
  18915. if (rng.collapsed || !cellRng.forall(isExpandedCellRng)) {
  18916. return Optional.none();
  18917. } else if (selectionDetails.isSameTable) {
  18918. var sameTableSelection = cellRng.bind(getTableSelectionFromCellRng(isRoot));
  18919. return Optional.some({
  18920. start: sameTableSelection,
  18921. end: sameTableSelection
  18922. });
  18923. } else {
  18924. var startCell = getClosestCell$1(rng.startContainer, isRoot);
  18925. var endCell = getClosestCell$1(rng.endContainer, isRoot);
  18926. var startTableSelection = startCell.bind(getCellRangeFromStartTable(isRoot)).bind(getTableSelectionFromCellRng(isRoot));
  18927. var endTableSelection = endCell.bind(getCellRangeFromEndTable(isRoot)).bind(getTableSelectionFromCellRng(isRoot));
  18928. return Optional.some({
  18929. start: startTableSelection,
  18930. end: endTableSelection
  18931. });
  18932. }
  18933. };
  18934. var getCellIndex = function (cells, cell) {
  18935. return findIndex$2(cells, function (x) {
  18936. return eq(x, cell);
  18937. });
  18938. };
  18939. var getSelectedCells = function (tableSelection) {
  18940. return lift2(getCellIndex(tableSelection.cells, tableSelection.rng.start), getCellIndex(tableSelection.cells, tableSelection.rng.end), function (startIndex, endIndex) {
  18941. return tableSelection.cells.slice(startIndex, endIndex + 1);
  18942. });
  18943. };
  18944. var isSingleCellTableContentSelected = function (optCellRng, rng, isRoot) {
  18945. return optCellRng.exists(function (cellRng) {
  18946. return isSingleCellTable(cellRng, isRoot) && hasAllContentsSelected(cellRng.start, rng);
  18947. });
  18948. };
  18949. var unselectCells = function (rng, selectionDetails) {
  18950. var startTable = selectionDetails.startTable, endTable = selectionDetails.endTable;
  18951. var otherContentRng = rng.cloneRange();
  18952. startTable.each(function (table) {
  18953. return otherContentRng.setStartAfter(table.dom);
  18954. });
  18955. endTable.each(function (table) {
  18956. return otherContentRng.setEndBefore(table.dom);
  18957. });
  18958. return otherContentRng;
  18959. };
  18960. var handleSingleTable = function (cellRng, selectionDetails, rng, isRoot) {
  18961. return getTableSelections(cellRng, selectionDetails, rng, isRoot).bind(function (_a) {
  18962. var start = _a.start, end = _a.end;
  18963. return start.or(end);
  18964. }).bind(function (tableSelection) {
  18965. var isSameTable = selectionDetails.isSameTable;
  18966. var selectedCells = getSelectedCells(tableSelection).getOr([]);
  18967. if (isSameTable && tableSelection.cells.length === selectedCells.length) {
  18968. return Optional.some(deleteAction.fullTable(tableSelection.table));
  18969. } else if (selectedCells.length > 0) {
  18970. if (isSameTable) {
  18971. return Optional.some(deleteAction.partialTable(selectedCells, Optional.none()));
  18972. } else {
  18973. var otherContentRng = unselectCells(rng, selectionDetails);
  18974. return Optional.some(deleteAction.partialTable(selectedCells, Optional.some(__assign(__assign({}, selectionDetails), { rng: otherContentRng }))));
  18975. }
  18976. } else {
  18977. return Optional.none();
  18978. }
  18979. });
  18980. };
  18981. var handleMultiTable = function (cellRng, selectionDetails, rng, isRoot) {
  18982. return getTableSelections(cellRng, selectionDetails, rng, isRoot).bind(function (_a) {
  18983. var start = _a.start, end = _a.end;
  18984. var startTableSelectedCells = start.bind(getSelectedCells).getOr([]);
  18985. var endTableSelectedCells = end.bind(getSelectedCells).getOr([]);
  18986. if (startTableSelectedCells.length > 0 && endTableSelectedCells.length > 0) {
  18987. var otherContentRng = unselectCells(rng, selectionDetails);
  18988. return Optional.some(deleteAction.multiTable(startTableSelectedCells, endTableSelectedCells, otherContentRng));
  18989. } else {
  18990. return Optional.none();
  18991. }
  18992. });
  18993. };
  18994. var getActionFromRange = function (root, rng) {
  18995. var isRoot = isRootFromElement(root);
  18996. var optCellRng = getCellRng(rng, isRoot);
  18997. var selectionDetails = getTableDetailsFromRange(rng, isRoot);
  18998. if (isSingleCellTableContentSelected(optCellRng, rng, isRoot)) {
  18999. return optCellRng.map(function (cellRng) {
  19000. return deleteAction.singleCellTable(rng, cellRng.start);
  19001. });
  19002. } else if (selectionDetails.isMultiTable) {
  19003. return handleMultiTable(optCellRng, selectionDetails, rng, isRoot);
  19004. } else {
  19005. return handleSingleTable(optCellRng, selectionDetails, rng, isRoot);
  19006. }
  19007. };
  19008. var freefallRtl = function (root) {
  19009. var child = isComment$1(root) ? prevSibling(root) : lastChild(root);
  19010. return child.bind(freefallRtl).orThunk(function () {
  19011. return Optional.some(root);
  19012. });
  19013. };
  19014. var cleanCells = function (cells) {
  19015. return each$k(cells, function (cell) {
  19016. remove$6(cell, 'contenteditable');
  19017. fillWithPaddingBr(cell);
  19018. });
  19019. };
  19020. var getOutsideBlock = function (editor, container) {
  19021. return Optional.from(editor.dom.getParent(container, editor.dom.isBlock)).map(SugarElement.fromDom);
  19022. };
  19023. var handleEmptyBlock = function (editor, startInTable, emptyBlock) {
  19024. emptyBlock.each(function (block) {
  19025. if (startInTable) {
  19026. remove$7(block);
  19027. } else {
  19028. fillWithPaddingBr(block);
  19029. editor.selection.setCursorLocation(block.dom, 0);
  19030. }
  19031. });
  19032. };
  19033. var deleteContentInsideCell = function (editor, cell, rng, isFirstCellInSelection) {
  19034. var insideTableRng = rng.cloneRange();
  19035. if (isFirstCellInSelection) {
  19036. insideTableRng.setStart(rng.startContainer, rng.startOffset);
  19037. insideTableRng.setEndAfter(cell.dom.lastChild);
  19038. } else {
  19039. insideTableRng.setStartBefore(cell.dom.firstChild);
  19040. insideTableRng.setEnd(rng.endContainer, rng.endOffset);
  19041. }
  19042. deleteCellContents(editor, insideTableRng, cell, false);
  19043. };
  19044. var collapseAndRestoreCellSelection = function (editor) {
  19045. var selectedCells = getCellsFromEditor(editor);
  19046. var selectedNode = SugarElement.fromDom(editor.selection.getNode());
  19047. if (isTableCell$5(selectedNode.dom) && isEmpty$2(selectedNode)) {
  19048. editor.selection.setCursorLocation(selectedNode.dom, 0);
  19049. } else {
  19050. editor.selection.collapse(true);
  19051. }
  19052. if (selectedCells.length > 1 && exists(selectedCells, function (cell) {
  19053. return eq(cell, selectedNode);
  19054. })) {
  19055. set$1(selectedNode, 'data-mce-selected', '1');
  19056. }
  19057. };
  19058. var emptySingleTableCells = function (editor, cells, outsideDetails) {
  19059. var editorRng = editor.selection.getRng();
  19060. var cellsToClean = outsideDetails.bind(function (_a) {
  19061. var rng = _a.rng, isStartInTable = _a.isStartInTable;
  19062. var outsideBlock = getOutsideBlock(editor, isStartInTable ? rng.endContainer : rng.startContainer);
  19063. rng.deleteContents();
  19064. handleEmptyBlock(editor, isStartInTable, outsideBlock.filter(isEmpty$2));
  19065. var endPointCell = isStartInTable ? cells[0] : cells[cells.length - 1];
  19066. deleteContentInsideCell(editor, endPointCell, editorRng, isStartInTable);
  19067. if (!isEmpty$2(endPointCell)) {
  19068. return Optional.some(isStartInTable ? cells.slice(1) : cells.slice(0, -1));
  19069. } else {
  19070. return Optional.none();
  19071. }
  19072. }).getOr(cells);
  19073. cleanCells(cellsToClean);
  19074. collapseAndRestoreCellSelection(editor);
  19075. return true;
  19076. };
  19077. var emptyMultiTableCells = function (editor, startTableCells, endTableCells, betweenRng) {
  19078. var rng = editor.selection.getRng();
  19079. var startCell = startTableCells[0];
  19080. var endCell = endTableCells[endTableCells.length - 1];
  19081. deleteContentInsideCell(editor, startCell, rng, true);
  19082. deleteContentInsideCell(editor, endCell, rng, false);
  19083. var startTableCellsToClean = isEmpty$2(startCell) ? startTableCells : startTableCells.slice(1);
  19084. var endTableCellsToClean = isEmpty$2(endCell) ? endTableCells : endTableCells.slice(0, -1);
  19085. cleanCells(startTableCellsToClean.concat(endTableCellsToClean));
  19086. betweenRng.deleteContents();
  19087. collapseAndRestoreCellSelection(editor);
  19088. return true;
  19089. };
  19090. var deleteCellContents = function (editor, rng, cell, moveSelection) {
  19091. if (moveSelection === void 0) {
  19092. moveSelection = true;
  19093. }
  19094. rng.deleteContents();
  19095. var lastNode = freefallRtl(cell).getOr(cell);
  19096. var lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock));
  19097. if (isEmpty$2(lastBlock)) {
  19098. fillWithPaddingBr(lastBlock);
  19099. if (moveSelection) {
  19100. editor.selection.setCursorLocation(lastBlock.dom, 0);
  19101. }
  19102. }
  19103. if (!eq(cell, lastBlock)) {
  19104. var additionalCleanupNodes = is$1(parent(lastBlock), cell) ? [] : siblings(lastBlock);
  19105. each$k(additionalCleanupNodes.concat(children(cell)), function (node) {
  19106. if (!eq(node, lastBlock) && !contains$1(node, lastBlock) && isEmpty$2(node)) {
  19107. remove$7(node);
  19108. }
  19109. });
  19110. }
  19111. return true;
  19112. };
  19113. var deleteTableElement = function (editor, table) {
  19114. deleteElement$2(editor, false, table);
  19115. return true;
  19116. };
  19117. var deleteCellRange = function (editor, rootElm, rng) {
  19118. return getActionFromRange(rootElm, rng).map(function (action) {
  19119. return action.fold(curry(deleteCellContents, editor), curry(deleteTableElement, editor), curry(emptySingleTableCells, editor), curry(emptyMultiTableCells, editor));
  19120. });
  19121. };
  19122. var deleteCaptionRange = function (editor, caption) {
  19123. return emptyElement(editor, caption);
  19124. };
  19125. var deleteTableRange = function (editor, rootElm, rng, startElm) {
  19126. return getParentCaption(rootElm, startElm).fold(function () {
  19127. return deleteCellRange(editor, rootElm, rng);
  19128. }, function (caption) {
  19129. return deleteCaptionRange(editor, caption);
  19130. }).getOr(false);
  19131. };
  19132. var deleteRange$2 = function (editor, startElm, selectedCells) {
  19133. var rootNode = SugarElement.fromDom(editor.getBody());
  19134. var rng = editor.selection.getRng();
  19135. return selectedCells.length !== 0 ? emptySingleTableCells(editor, selectedCells, Optional.none()) : deleteTableRange(editor, rootNode, rng, startElm);
  19136. };
  19137. var getParentCell = function (rootElm, elm) {
  19138. return find$3(parentsAndSelf(elm, rootElm), isTableCell$4);
  19139. };
  19140. var getParentCaption = function (rootElm, elm) {
  19141. return find$3(parentsAndSelf(elm, rootElm), isTag('caption'));
  19142. };
  19143. var deleteBetweenCells = function (editor, rootElm, forward, fromCell, from) {
  19144. return navigate(forward, editor.getBody(), from).bind(function (to) {
  19145. return getParentCell(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCell) {
  19146. return eq(toCell, fromCell) === false;
  19147. });
  19148. });
  19149. };
  19150. var emptyElement = function (editor, elm) {
  19151. fillWithPaddingBr(elm);
  19152. editor.selection.setCursorLocation(elm.dom, 0);
  19153. return Optional.some(true);
  19154. };
  19155. var isDeleteOfLastCharPos = function (fromCaption, forward, from, to) {
  19156. return firstPositionIn(fromCaption.dom).bind(function (first) {
  19157. return lastPositionIn(fromCaption.dom).map(function (last) {
  19158. return forward ? from.isEqual(first) && to.isEqual(last) : from.isEqual(last) && to.isEqual(first);
  19159. });
  19160. }).getOr(true);
  19161. };
  19162. var emptyCaretCaption = function (editor, elm) {
  19163. return emptyElement(editor, elm);
  19164. };
  19165. var validateCaretCaption = function (rootElm, fromCaption, to) {
  19166. return getParentCaption(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCaption) {
  19167. return eq(toCaption, fromCaption) === false;
  19168. });
  19169. };
  19170. var deleteCaretInsideCaption = function (editor, rootElm, forward, fromCaption, from) {
  19171. return navigate(forward, editor.getBody(), from).bind(function (to) {
  19172. return isDeleteOfLastCharPos(fromCaption, forward, from, to) ? emptyCaretCaption(editor, fromCaption) : validateCaretCaption(rootElm, fromCaption, to);
  19173. }).or(Optional.some(true));
  19174. };
  19175. var deleteCaretCells = function (editor, forward, rootElm, startElm) {
  19176. var from = CaretPosition.fromRangeStart(editor.selection.getRng());
  19177. return getParentCell(rootElm, startElm).bind(function (fromCell) {
  19178. return isEmpty$2(fromCell) ? emptyElement(editor, fromCell) : deleteBetweenCells(editor, rootElm, forward, fromCell, from);
  19179. }).getOr(false);
  19180. };
  19181. var deleteCaretCaption = function (editor, forward, rootElm, fromCaption) {
  19182. var from = CaretPosition.fromRangeStart(editor.selection.getRng());
  19183. return isEmpty$2(fromCaption) ? emptyElement(editor, fromCaption) : deleteCaretInsideCaption(editor, rootElm, forward, fromCaption, from);
  19184. };
  19185. var isNearTable = function (forward, pos) {
  19186. return forward ? isBeforeTable(pos) : isAfterTable(pos);
  19187. };
  19188. var isBeforeOrAfterTable = function (editor, forward) {
  19189. var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
  19190. return isNearTable(forward, fromPos) || fromPosition(forward, editor.getBody(), fromPos).exists(function (pos) {
  19191. return isNearTable(forward, pos);
  19192. });
  19193. };
  19194. var deleteCaret$3 = function (editor, forward, startElm) {
  19195. var rootElm = SugarElement.fromDom(editor.getBody());
  19196. return getParentCaption(rootElm, startElm).fold(function () {
  19197. return deleteCaretCells(editor, forward, rootElm, startElm) || isBeforeOrAfterTable(editor, forward);
  19198. }, function (fromCaption) {
  19199. return deleteCaretCaption(editor, forward, rootElm, fromCaption).getOr(false);
  19200. });
  19201. };
  19202. var backspaceDelete$9 = function (editor, forward) {
  19203. var startElm = SugarElement.fromDom(editor.selection.getStart(true));
  19204. var cells = getCellsFromEditor(editor);
  19205. return editor.selection.isCollapsed() && cells.length === 0 ? deleteCaret$3(editor, forward, startElm) : deleteRange$2(editor, startElm, cells);
  19206. };
  19207. var createRange = function (sc, so, ec, eo) {
  19208. var rng = document.createRange();
  19209. rng.setStart(sc, so);
  19210. rng.setEnd(ec, eo);
  19211. return rng;
  19212. };
  19213. var normalizeBlockSelectionRange = function (rng) {
  19214. var startPos = CaretPosition.fromRangeStart(rng);
  19215. var endPos = CaretPosition.fromRangeEnd(rng);
  19216. var rootNode = rng.commonAncestorContainer;
  19217. return fromPosition(false, rootNode, endPos).map(function (newEndPos) {
  19218. if (!isInSameBlock(startPos, endPos, rootNode) && isInSameBlock(startPos, newEndPos, rootNode)) {
  19219. return createRange(startPos.container(), startPos.offset(), newEndPos.container(), newEndPos.offset());
  19220. } else {
  19221. return rng;
  19222. }
  19223. }).getOr(rng);
  19224. };
  19225. var normalize = function (rng) {
  19226. return rng.collapsed ? rng : normalizeBlockSelectionRange(rng);
  19227. };
  19228. var hasOnlyOneChild$1 = function (node) {
  19229. return node.firstChild && node.firstChild === node.lastChild;
  19230. };
  19231. var isPaddingNode = function (node) {
  19232. return node.name === 'br' || node.value === nbsp;
  19233. };
  19234. var isPaddedEmptyBlock = function (schema, node) {
  19235. var blockElements = schema.getBlockElements();
  19236. return blockElements[node.name] && hasOnlyOneChild$1(node) && isPaddingNode(node.firstChild);
  19237. };
  19238. var isEmptyFragmentElement = function (schema, node) {
  19239. var nonEmptyElements = schema.getNonEmptyElements();
  19240. return node && (node.isEmpty(nonEmptyElements) || isPaddedEmptyBlock(schema, node));
  19241. };
  19242. var isListFragment = function (schema, fragment) {
  19243. var firstChild = fragment.firstChild;
  19244. var lastChild = fragment.lastChild;
  19245. if (firstChild && firstChild.name === 'meta') {
  19246. firstChild = firstChild.next;
  19247. }
  19248. if (lastChild && lastChild.attr('id') === 'mce_marker') {
  19249. lastChild = lastChild.prev;
  19250. }
  19251. if (isEmptyFragmentElement(schema, lastChild)) {
  19252. lastChild = lastChild.prev;
  19253. }
  19254. if (!firstChild || firstChild !== lastChild) {
  19255. return false;
  19256. }
  19257. return firstChild.name === 'ul' || firstChild.name === 'ol';
  19258. };
  19259. var cleanupDomFragment = function (domFragment) {
  19260. var firstChild = domFragment.firstChild;
  19261. var lastChild = domFragment.lastChild;
  19262. if (firstChild && firstChild.nodeName === 'META') {
  19263. firstChild.parentNode.removeChild(firstChild);
  19264. }
  19265. if (lastChild && lastChild.id === 'mce_marker') {
  19266. lastChild.parentNode.removeChild(lastChild);
  19267. }
  19268. return domFragment;
  19269. };
  19270. var toDomFragment = function (dom, serializer, fragment) {
  19271. var html = serializer.serialize(fragment);
  19272. var domFragment = dom.createFragment(html);
  19273. return cleanupDomFragment(domFragment);
  19274. };
  19275. var listItems = function (elm) {
  19276. return filter$4(elm.childNodes, function (child) {
  19277. return child.nodeName === 'LI';
  19278. });
  19279. };
  19280. var isPadding = function (node) {
  19281. return node.data === nbsp || isBr$5(node);
  19282. };
  19283. var isListItemPadded = function (node) {
  19284. return node && node.firstChild && node.firstChild === node.lastChild && isPadding(node.firstChild);
  19285. };
  19286. var isEmptyOrPadded = function (elm) {
  19287. return !elm.firstChild || isListItemPadded(elm);
  19288. };
  19289. var trimListItems = function (elms) {
  19290. return elms.length > 0 && isEmptyOrPadded(elms[elms.length - 1]) ? elms.slice(0, -1) : elms;
  19291. };
  19292. var getParentLi = function (dom, node) {
  19293. var parentBlock = dom.getParent(node, dom.isBlock);
  19294. return parentBlock && parentBlock.nodeName === 'LI' ? parentBlock : null;
  19295. };
  19296. var isParentBlockLi = function (dom, node) {
  19297. return !!getParentLi(dom, node);
  19298. };
  19299. var getSplit = function (parentNode, rng) {
  19300. var beforeRng = rng.cloneRange();
  19301. var afterRng = rng.cloneRange();
  19302. beforeRng.setStartBefore(parentNode);
  19303. afterRng.setEndAfter(parentNode);
  19304. return [
  19305. beforeRng.cloneContents(),
  19306. afterRng.cloneContents()
  19307. ];
  19308. };
  19309. var findFirstIn = function (node, rootNode) {
  19310. var caretPos = CaretPosition.before(node);
  19311. var caretWalker = CaretWalker(rootNode);
  19312. var newCaretPos = caretWalker.next(caretPos);
  19313. return newCaretPos ? newCaretPos.toRange() : null;
  19314. };
  19315. var findLastOf = function (node, rootNode) {
  19316. var caretPos = CaretPosition.after(node);
  19317. var caretWalker = CaretWalker(rootNode);
  19318. var newCaretPos = caretWalker.prev(caretPos);
  19319. return newCaretPos ? newCaretPos.toRange() : null;
  19320. };
  19321. var insertMiddle = function (target, elms, rootNode, rng) {
  19322. var parts = getSplit(target, rng);
  19323. var parentElm = target.parentNode;
  19324. parentElm.insertBefore(parts[0], target);
  19325. Tools.each(elms, function (li) {
  19326. parentElm.insertBefore(li, target);
  19327. });
  19328. parentElm.insertBefore(parts[1], target);
  19329. parentElm.removeChild(target);
  19330. return findLastOf(elms[elms.length - 1], rootNode);
  19331. };
  19332. var insertBefore$1 = function (target, elms, rootNode) {
  19333. var parentElm = target.parentNode;
  19334. Tools.each(elms, function (elm) {
  19335. parentElm.insertBefore(elm, target);
  19336. });
  19337. return findFirstIn(target, rootNode);
  19338. };
  19339. var insertAfter$1 = function (target, elms, rootNode, dom) {
  19340. dom.insertAfter(elms.reverse(), target);
  19341. return findLastOf(elms[0], rootNode);
  19342. };
  19343. var insertAtCaret$1 = function (serializer, dom, rng, fragment) {
  19344. var domFragment = toDomFragment(dom, serializer, fragment);
  19345. var liTarget = getParentLi(dom, rng.startContainer);
  19346. var liElms = trimListItems(listItems(domFragment.firstChild));
  19347. var BEGINNING = 1, END = 2;
  19348. var rootNode = dom.getRoot();
  19349. var isAt = function (location) {
  19350. var caretPos = CaretPosition.fromRangeStart(rng);
  19351. var caretWalker = CaretWalker(dom.getRoot());
  19352. var newPos = location === BEGINNING ? caretWalker.prev(caretPos) : caretWalker.next(caretPos);
  19353. return newPos ? getParentLi(dom, newPos.getNode()) !== liTarget : true;
  19354. };
  19355. if (isAt(BEGINNING)) {
  19356. return insertBefore$1(liTarget, liElms, rootNode);
  19357. } else if (isAt(END)) {
  19358. return insertAfter$1(liTarget, liElms, rootNode, dom);
  19359. }
  19360. return insertMiddle(liTarget, liElms, rootNode, rng);
  19361. };
  19362. var trimOrPadLeftRight = function (dom, rng, html) {
  19363. var root = SugarElement.fromDom(dom.getRoot());
  19364. if (needsToBeNbspLeft(root, CaretPosition.fromRangeStart(rng))) {
  19365. html = html.replace(/^ /, '&nbsp;');
  19366. } else {
  19367. html = html.replace(/^&nbsp;/, ' ');
  19368. }
  19369. if (needsToBeNbspRight(root, CaretPosition.fromRangeEnd(rng))) {
  19370. html = html.replace(/(&nbsp;| )(<br( \/)>)?$/, '&nbsp;');
  19371. } else {
  19372. html = html.replace(/&nbsp;(<br( \/)?>)?$/, ' ');
  19373. }
  19374. return html;
  19375. };
  19376. var isTableCell$1 = isTableCell$5;
  19377. var isTableCellContentSelected = function (dom, rng, cell) {
  19378. if (cell !== null) {
  19379. var endCell = dom.getParent(rng.endContainer, isTableCell$1);
  19380. return cell === endCell && hasAllContentsSelected(SugarElement.fromDom(cell), rng);
  19381. } else {
  19382. return false;
  19383. }
  19384. };
  19385. var validInsertion = function (editor, value, parentNode) {
  19386. if (parentNode.getAttribute('data-mce-bogus') === 'all') {
  19387. parentNode.parentNode.insertBefore(editor.dom.createFragment(value), parentNode);
  19388. } else {
  19389. var node = parentNode.firstChild;
  19390. var node2 = parentNode.lastChild;
  19391. if (!node || node === node2 && node.nodeName === 'BR') {
  19392. editor.dom.setHTML(parentNode, value);
  19393. } else {
  19394. editor.selection.setContent(value);
  19395. }
  19396. }
  19397. };
  19398. var trimBrsFromTableCell = function (dom, elm) {
  19399. Optional.from(dom.getParent(elm, 'td,th')).map(SugarElement.fromDom).each(trimBlockTrailingBr);
  19400. };
  19401. var reduceInlineTextElements = function (editor, merge) {
  19402. var textInlineElements = editor.schema.getTextInlineElements();
  19403. var dom = editor.dom;
  19404. if (merge) {
  19405. var root_1 = editor.getBody();
  19406. var elementUtils_1 = ElementUtils(dom);
  19407. Tools.each(dom.select('*[data-mce-fragment]'), function (node) {
  19408. var isInline = isNonNullable(textInlineElements[node.nodeName.toLowerCase()]);
  19409. if (isInline && hasInheritableStyles(dom, node)) {
  19410. for (var parentNode = node.parentNode; isNonNullable(parentNode) && parentNode !== root_1; parentNode = parentNode.parentNode) {
  19411. var styleConflict = hasStyleConflict(dom, node, parentNode);
  19412. if (styleConflict) {
  19413. break;
  19414. }
  19415. if (elementUtils_1.compare(parentNode, node)) {
  19416. dom.remove(node, true);
  19417. break;
  19418. }
  19419. }
  19420. }
  19421. });
  19422. }
  19423. };
  19424. var markFragmentElements = function (fragment) {
  19425. var node = fragment;
  19426. while (node = node.walk()) {
  19427. if (node.type === 1) {
  19428. node.attr('data-mce-fragment', '1');
  19429. }
  19430. }
  19431. };
  19432. var unmarkFragmentElements = function (elm) {
  19433. Tools.each(elm.getElementsByTagName('*'), function (elm) {
  19434. elm.removeAttribute('data-mce-fragment');
  19435. });
  19436. };
  19437. var isPartOfFragment = function (node) {
  19438. return !!node.getAttribute('data-mce-fragment');
  19439. };
  19440. var canHaveChildren = function (editor, node) {
  19441. return node && !editor.schema.getShortEndedElements()[node.nodeName];
  19442. };
  19443. var moveSelectionToMarker = function (editor, marker) {
  19444. var nextRng;
  19445. var dom = editor.dom;
  19446. var selection = editor.selection;
  19447. if (!marker) {
  19448. return;
  19449. }
  19450. selection.scrollIntoView(marker);
  19451. var parentEditableElm = getContentEditableRoot$1(editor.getBody(), marker);
  19452. if (dom.getContentEditable(parentEditableElm) === 'false') {
  19453. dom.remove(marker);
  19454. selection.select(parentEditableElm);
  19455. return;
  19456. }
  19457. var rng = dom.createRng();
  19458. var node = marker.previousSibling;
  19459. if (isText$7(node)) {
  19460. rng.setStart(node, node.nodeValue.length);
  19461. if (!Env.ie) {
  19462. var node2 = marker.nextSibling;
  19463. if (isText$7(node2)) {
  19464. node.appendData(node2.data);
  19465. node2.parentNode.removeChild(node2);
  19466. }
  19467. }
  19468. } else {
  19469. rng.setStartBefore(marker);
  19470. rng.setEndBefore(marker);
  19471. }
  19472. var findNextCaretRng = function (rng) {
  19473. var caretPos = CaretPosition.fromRangeStart(rng);
  19474. var caretWalker = CaretWalker(editor.getBody());
  19475. caretPos = caretWalker.next(caretPos);
  19476. if (caretPos) {
  19477. return caretPos.toRange();
  19478. }
  19479. };
  19480. var parentBlock = dom.getParent(marker, dom.isBlock);
  19481. dom.remove(marker);
  19482. if (parentBlock && dom.isEmpty(parentBlock)) {
  19483. editor.$(parentBlock).empty();
  19484. rng.setStart(parentBlock, 0);
  19485. rng.setEnd(parentBlock, 0);
  19486. if (!isTableCell$1(parentBlock) && !isPartOfFragment(parentBlock) && (nextRng = findNextCaretRng(rng))) {
  19487. rng = nextRng;
  19488. dom.remove(parentBlock);
  19489. } else {
  19490. dom.add(parentBlock, dom.create('br', { 'data-mce-bogus': '1' }));
  19491. }
  19492. }
  19493. selection.setRng(rng);
  19494. };
  19495. var deleteSelectedContent = function (editor) {
  19496. var dom = editor.dom;
  19497. var rng = normalize(editor.selection.getRng());
  19498. editor.selection.setRng(rng);
  19499. var startCell = dom.getParent(rng.startContainer, isTableCell$1);
  19500. if (isTableCellContentSelected(dom, rng, startCell)) {
  19501. deleteCellContents(editor, rng, SugarElement.fromDom(startCell));
  19502. } else {
  19503. editor.getDoc().execCommand('Delete', false, null);
  19504. }
  19505. };
  19506. var insertHtmlAtCaret = function (editor, value, details) {
  19507. var parentNode;
  19508. var rng, node;
  19509. var selection = editor.selection;
  19510. var dom = editor.dom;
  19511. if (/^ | $/.test(value)) {
  19512. value = trimOrPadLeftRight(dom, selection.getRng(), value);
  19513. }
  19514. var parser = editor.parser;
  19515. var merge = details.merge;
  19516. var serializer = HtmlSerializer({ validate: shouldValidate(editor) }, editor.schema);
  19517. var bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">&#xFEFF;</span>';
  19518. var args = editor.fire('BeforeSetContent', {
  19519. content: value,
  19520. format: 'html',
  19521. selection: true,
  19522. paste: details.paste
  19523. });
  19524. if (args.isDefaultPrevented()) {
  19525. editor.fire('SetContent', {
  19526. content: args.content,
  19527. format: 'html',
  19528. selection: true,
  19529. paste: details.paste
  19530. });
  19531. return;
  19532. }
  19533. value = args.content;
  19534. if (value.indexOf('{$caret}') === -1) {
  19535. value += '{$caret}';
  19536. }
  19537. value = value.replace(/\{\$caret\}/, bookmarkHtml);
  19538. rng = selection.getRng();
  19539. var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
  19540. var body = editor.getBody();
  19541. if (caretElement === body && selection.isCollapsed()) {
  19542. if (dom.isBlock(body.firstChild) && canHaveChildren(editor, body.firstChild) && dom.isEmpty(body.firstChild)) {
  19543. rng = dom.createRng();
  19544. rng.setStart(body.firstChild, 0);
  19545. rng.setEnd(body.firstChild, 0);
  19546. selection.setRng(rng);
  19547. }
  19548. }
  19549. if (!selection.isCollapsed()) {
  19550. deleteSelectedContent(editor);
  19551. }
  19552. parentNode = selection.getNode();
  19553. var parserArgs = {
  19554. context: parentNode.nodeName.toLowerCase(),
  19555. data: details.data,
  19556. insert: true
  19557. };
  19558. var fragment = parser.parse(value, parserArgs);
  19559. if (details.paste === true && isListFragment(editor.schema, fragment) && isParentBlockLi(dom, parentNode)) {
  19560. rng = insertAtCaret$1(serializer, dom, selection.getRng(), fragment);
  19561. selection.setRng(rng);
  19562. editor.fire('SetContent', args);
  19563. return;
  19564. }
  19565. markFragmentElements(fragment);
  19566. node = fragment.lastChild;
  19567. if (node.attr('id') === 'mce_marker') {
  19568. var marker = node;
  19569. for (node = node.prev; node; node = node.walk(true)) {
  19570. if (node.type === 3 || !dom.isBlock(node.name)) {
  19571. if (editor.schema.isValidChild(node.parent.name, 'span')) {
  19572. node.parent.insert(marker, node, node.name === 'br');
  19573. }
  19574. break;
  19575. }
  19576. }
  19577. }
  19578. editor._selectionOverrides.showBlockCaretContainer(parentNode);
  19579. if (!parserArgs.invalid) {
  19580. value = serializer.serialize(fragment);
  19581. validInsertion(editor, value, parentNode);
  19582. } else {
  19583. editor.selection.setContent(bookmarkHtml);
  19584. parentNode = selection.getNode();
  19585. var rootNode = editor.getBody();
  19586. if (parentNode.nodeType === 9) {
  19587. parentNode = node = rootNode;
  19588. } else {
  19589. node = parentNode;
  19590. }
  19591. while (node !== rootNode) {
  19592. parentNode = node;
  19593. node = node.parentNode;
  19594. }
  19595. value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
  19596. value = serializer.serialize(parser.parse(value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function () {
  19597. return serializer.serialize(fragment);
  19598. })));
  19599. if (parentNode === rootNode) {
  19600. dom.setHTML(rootNode, value);
  19601. } else {
  19602. dom.setOuterHTML(parentNode, value);
  19603. }
  19604. }
  19605. reduceInlineTextElements(editor, merge);
  19606. moveSelectionToMarker(editor, dom.get('mce_marker'));
  19607. unmarkFragmentElements(editor.getBody());
  19608. trimBrsFromTableCell(dom, selection.getStart());
  19609. editor.fire('SetContent', args);
  19610. editor.addVisual();
  19611. };
  19612. var traverse = function (node, fn) {
  19613. fn(node);
  19614. if (node.firstChild) {
  19615. traverse(node.firstChild, fn);
  19616. }
  19617. if (node.next) {
  19618. traverse(node.next, fn);
  19619. }
  19620. };
  19621. var findMatchingNodes = function (nodeFilters, attributeFilters, node) {
  19622. var nodeMatches = {};
  19623. var attrMatches = {};
  19624. var matches = [];
  19625. if (node.firstChild) {
  19626. traverse(node.firstChild, function (node) {
  19627. each$k(nodeFilters, function (filter) {
  19628. if (filter.name === node.name) {
  19629. if (nodeMatches[filter.name]) {
  19630. nodeMatches[filter.name].nodes.push(node);
  19631. } else {
  19632. nodeMatches[filter.name] = {
  19633. filter: filter,
  19634. nodes: [node]
  19635. };
  19636. }
  19637. }
  19638. });
  19639. each$k(attributeFilters, function (filter) {
  19640. if (typeof node.attr(filter.name) === 'string') {
  19641. if (attrMatches[filter.name]) {
  19642. attrMatches[filter.name].nodes.push(node);
  19643. } else {
  19644. attrMatches[filter.name] = {
  19645. filter: filter,
  19646. nodes: [node]
  19647. };
  19648. }
  19649. }
  19650. });
  19651. });
  19652. }
  19653. for (var name_1 in nodeMatches) {
  19654. if (has$2(nodeMatches, name_1)) {
  19655. matches.push(nodeMatches[name_1]);
  19656. }
  19657. }
  19658. for (var name_2 in attrMatches) {
  19659. if (has$2(attrMatches, name_2)) {
  19660. matches.push(attrMatches[name_2]);
  19661. }
  19662. }
  19663. return matches;
  19664. };
  19665. var filter$1 = function (nodeFilters, attributeFilters, node) {
  19666. var matches = findMatchingNodes(nodeFilters, attributeFilters, node);
  19667. each$k(matches, function (match) {
  19668. each$k(match.filter.callbacks, function (callback) {
  19669. callback(match.nodes, match.filter.name, {});
  19670. });
  19671. });
  19672. };
  19673. var defaultFormat$1 = 'html';
  19674. var isTreeNode = function (content) {
  19675. return content instanceof AstNode;
  19676. };
  19677. var moveSelection = function (editor) {
  19678. if (hasFocus(editor)) {
  19679. firstPositionIn(editor.getBody()).each(function (pos) {
  19680. var node = pos.getNode();
  19681. var caretPos = isTable$3(node) ? firstPositionIn(node).getOr(pos) : pos;
  19682. editor.selection.setRng(caretPos.toRange());
  19683. });
  19684. }
  19685. };
  19686. var setEditorHtml = function (editor, html, noSelection) {
  19687. editor.dom.setHTML(editor.getBody(), html);
  19688. if (noSelection !== true) {
  19689. moveSelection(editor);
  19690. }
  19691. };
  19692. var setContentString = function (editor, body, content, args) {
  19693. if (content.length === 0 || /^\s+$/.test(content)) {
  19694. var padd = '<br data-mce-bogus="1">';
  19695. if (body.nodeName === 'TABLE') {
  19696. content = '<tr><td>' + padd + '</td></tr>';
  19697. } else if (/^(UL|OL)$/.test(body.nodeName)) {
  19698. content = '<li>' + padd + '</li>';
  19699. }
  19700. var forcedRootBlockName = getForcedRootBlock(editor);
  19701. if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
  19702. content = padd;
  19703. content = editor.dom.createHTML(forcedRootBlockName, getForcedRootBlockAttrs(editor), content);
  19704. } else if (!content) {
  19705. content = '<br data-mce-bogus="1">';
  19706. }
  19707. setEditorHtml(editor, content, args.no_selection);
  19708. editor.fire('SetContent', args);
  19709. } else {
  19710. if (args.format !== 'raw') {
  19711. content = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, {
  19712. isRootContent: true,
  19713. insert: true
  19714. }));
  19715. }
  19716. args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? content : Tools.trim(content);
  19717. setEditorHtml(editor, args.content, args.no_selection);
  19718. if (!args.no_events) {
  19719. editor.fire('SetContent', args);
  19720. }
  19721. }
  19722. return args.content;
  19723. };
  19724. var setContentTree = function (editor, body, content, args) {
  19725. filter$1(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content);
  19726. var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content);
  19727. args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html);
  19728. setEditorHtml(editor, args.content, args.no_selection);
  19729. if (!args.no_events) {
  19730. editor.fire('SetContent', args);
  19731. }
  19732. return content;
  19733. };
  19734. var setupArgs$2 = function (args, content) {
  19735. return __assign(__assign({ format: defaultFormat$1 }, args), {
  19736. set: true,
  19737. content: isTreeNode(content) ? '' : content
  19738. });
  19739. };
  19740. var setContentInternal = function (editor, content, args) {
  19741. var defaultedArgs = setupArgs$2(args, content);
  19742. var updatedArgs = args.no_events ? defaultedArgs : editor.fire('BeforeSetContent', defaultedArgs);
  19743. if (!isTreeNode(content)) {
  19744. content = updatedArgs.content;
  19745. }
  19746. return Optional.from(editor.getBody()).fold(constant(content), function (body) {
  19747. return isTreeNode(content) ? setContentTree(editor, body, content, updatedArgs) : setContentString(editor, body, content, updatedArgs);
  19748. });
  19749. };
  19750. var sibling = function (scope, predicate) {
  19751. return sibling$2(scope, predicate).isSome();
  19752. };
  19753. var ensureIsRoot = function (isRoot) {
  19754. return isFunction(isRoot) ? isRoot : never;
  19755. };
  19756. var ancestor = function (scope, transform, isRoot) {
  19757. var element = scope.dom;
  19758. var stop = ensureIsRoot(isRoot);
  19759. while (element.parentNode) {
  19760. element = element.parentNode;
  19761. var el = SugarElement.fromDom(element);
  19762. var transformed = transform(el);
  19763. if (transformed.isSome()) {
  19764. return transformed;
  19765. } else if (stop(el)) {
  19766. break;
  19767. }
  19768. }
  19769. return Optional.none();
  19770. };
  19771. var closest$1 = function (scope, transform, isRoot) {
  19772. var current = transform(scope);
  19773. var stop = ensureIsRoot(isRoot);
  19774. return current.orThunk(function () {
  19775. return stop(scope) ? Optional.none() : ancestor(scope, transform, stop);
  19776. });
  19777. };
  19778. var isEq$3 = isEq$5;
  19779. var matchesUnInheritedFormatSelector = function (ed, node, name) {
  19780. var formatList = ed.formatter.get(name);
  19781. if (formatList) {
  19782. for (var i = 0; i < formatList.length; i++) {
  19783. var format = formatList[i];
  19784. if (isSelectorFormat(format) && format.inherit === false && ed.dom.is(node, format.selector)) {
  19785. return true;
  19786. }
  19787. }
  19788. }
  19789. return false;
  19790. };
  19791. var matchParents = function (editor, node, name, vars, similar) {
  19792. var root = editor.dom.getRoot();
  19793. if (node === root) {
  19794. return false;
  19795. }
  19796. node = editor.dom.getParent(node, function (node) {
  19797. if (matchesUnInheritedFormatSelector(editor, node, name)) {
  19798. return true;
  19799. }
  19800. return node.parentNode === root || !!matchNode(editor, node, name, vars, true);
  19801. });
  19802. return !!matchNode(editor, node, name, vars, similar);
  19803. };
  19804. var matchName$1 = function (dom, node, format) {
  19805. if (isEq$3(node, format.inline)) {
  19806. return true;
  19807. }
  19808. if (isEq$3(node, format.block)) {
  19809. return true;
  19810. }
  19811. if (format.selector) {
  19812. return node.nodeType === 1 && dom.is(node, format.selector);
  19813. }
  19814. };
  19815. var matchItems = function (dom, node, format, itemName, similar, vars) {
  19816. var items = format[itemName];
  19817. if (isFunction(format.onmatch)) {
  19818. return format.onmatch(node, format, itemName);
  19819. }
  19820. if (items) {
  19821. if (isUndefined(items.length)) {
  19822. for (var key in items) {
  19823. if (has$2(items, key)) {
  19824. var value = itemName === 'attributes' ? dom.getAttrib(node, key) : getStyle(dom, node, key);
  19825. var expectedValue = replaceVars(items[key], vars);
  19826. var isEmptyValue = isNullable(value) || isEmpty$3(value);
  19827. if (isEmptyValue && isNullable(expectedValue)) {
  19828. continue;
  19829. }
  19830. if (similar && isEmptyValue && !format.exact) {
  19831. return false;
  19832. }
  19833. if ((!similar || format.exact) && !isEq$3(value, normalizeStyleValue(dom, expectedValue, key))) {
  19834. return false;
  19835. }
  19836. }
  19837. }
  19838. } else {
  19839. for (var i = 0; i < items.length; i++) {
  19840. if (itemName === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(dom, node, items[i])) {
  19841. return true;
  19842. }
  19843. }
  19844. }
  19845. }
  19846. return true;
  19847. };
  19848. var matchNode = function (ed, node, name, vars, similar) {
  19849. var formatList = ed.formatter.get(name);
  19850. var dom = ed.dom;
  19851. if (formatList && node) {
  19852. for (var i = 0; i < formatList.length; i++) {
  19853. var format = formatList[i];
  19854. if (matchName$1(ed.dom, node, format) && matchItems(dom, node, format, 'attributes', similar, vars) && matchItems(dom, node, format, 'styles', similar, vars)) {
  19855. var classes = format.classes;
  19856. if (classes) {
  19857. for (var x = 0; x < classes.length; x++) {
  19858. if (!ed.dom.hasClass(node, replaceVars(classes[x], vars))) {
  19859. return;
  19860. }
  19861. }
  19862. }
  19863. return format;
  19864. }
  19865. }
  19866. }
  19867. };
  19868. var match$2 = function (editor, name, vars, node, similar) {
  19869. if (node) {
  19870. return matchParents(editor, node, name, vars, similar);
  19871. }
  19872. node = editor.selection.getNode();
  19873. if (matchParents(editor, node, name, vars, similar)) {
  19874. return true;
  19875. }
  19876. var startNode = editor.selection.getStart();
  19877. if (startNode !== node) {
  19878. if (matchParents(editor, startNode, name, vars, similar)) {
  19879. return true;
  19880. }
  19881. }
  19882. return false;
  19883. };
  19884. var matchAll = function (editor, names, vars) {
  19885. var matchedFormatNames = [];
  19886. var checkedMap = {};
  19887. var startElement = editor.selection.getStart();
  19888. editor.dom.getParent(startElement, function (node) {
  19889. for (var i = 0; i < names.length; i++) {
  19890. var name_1 = names[i];
  19891. if (!checkedMap[name_1] && matchNode(editor, node, name_1, vars)) {
  19892. checkedMap[name_1] = true;
  19893. matchedFormatNames.push(name_1);
  19894. }
  19895. }
  19896. }, editor.dom.getRoot());
  19897. return matchedFormatNames;
  19898. };
  19899. var closest = function (editor, names) {
  19900. var isRoot = function (elm) {
  19901. return eq(elm, SugarElement.fromDom(editor.getBody()));
  19902. };
  19903. var match = function (elm, name) {
  19904. return matchNode(editor, elm.dom, name) ? Optional.some(name) : Optional.none();
  19905. };
  19906. return Optional.from(editor.selection.getStart(true)).bind(function (rawElm) {
  19907. return closest$1(SugarElement.fromDom(rawElm), function (elm) {
  19908. return findMap(names, function (name) {
  19909. return match(elm, name);
  19910. });
  19911. }, isRoot);
  19912. }).getOrNull();
  19913. };
  19914. var canApply = function (editor, name) {
  19915. var formatList = editor.formatter.get(name);
  19916. var dom = editor.dom;
  19917. if (formatList) {
  19918. var startNode = editor.selection.getStart();
  19919. var parents = getParents$2(dom, startNode);
  19920. for (var x = formatList.length - 1; x >= 0; x--) {
  19921. var format = formatList[x];
  19922. if (!isSelectorFormat(format) || isNonNullable(format.defaultBlock)) {
  19923. return true;
  19924. }
  19925. for (var i = parents.length - 1; i >= 0; i--) {
  19926. if (dom.is(parents[i], format.selector)) {
  19927. return true;
  19928. }
  19929. }
  19930. }
  19931. }
  19932. return false;
  19933. };
  19934. var matchAllOnNode = function (editor, node, formatNames) {
  19935. return foldl(formatNames, function (acc, name) {
  19936. var matchSimilar = isVariableFormatName(editor, name);
  19937. if (editor.formatter.matchNode(node, name, {}, matchSimilar)) {
  19938. return acc.concat([name]);
  19939. } else {
  19940. return acc;
  19941. }
  19942. }, []);
  19943. };
  19944. var ZWSP = ZWSP$1, CARET_ID = '_mce_caret';
  19945. var importNode = function (ownerDocument, node) {
  19946. return ownerDocument.importNode(node, true);
  19947. };
  19948. var getEmptyCaretContainers = function (node) {
  19949. var nodes = [];
  19950. while (node) {
  19951. if (node.nodeType === 3 && node.nodeValue !== ZWSP || node.childNodes.length > 1) {
  19952. return [];
  19953. }
  19954. if (node.nodeType === 1) {
  19955. nodes.push(node);
  19956. }
  19957. node = node.firstChild;
  19958. }
  19959. return nodes;
  19960. };
  19961. var isCaretContainerEmpty = function (node) {
  19962. return getEmptyCaretContainers(node).length > 0;
  19963. };
  19964. var findFirstTextNode = function (node) {
  19965. if (node) {
  19966. var walker = new DomTreeWalker(node, node);
  19967. for (node = walker.current(); node; node = walker.next()) {
  19968. if (isText$7(node)) {
  19969. return node;
  19970. }
  19971. }
  19972. }
  19973. return null;
  19974. };
  19975. var createCaretContainer = function (fill) {
  19976. var caretContainer = SugarElement.fromTag('span');
  19977. setAll$1(caretContainer, {
  19978. 'id': CARET_ID,
  19979. 'data-mce-bogus': '1',
  19980. 'data-mce-type': 'format-caret'
  19981. });
  19982. if (fill) {
  19983. append$1(caretContainer, SugarElement.fromText(ZWSP));
  19984. }
  19985. return caretContainer;
  19986. };
  19987. var trimZwspFromCaretContainer = function (caretContainerNode) {
  19988. var textNode = findFirstTextNode(caretContainerNode);
  19989. if (textNode && textNode.nodeValue.charAt(0) === ZWSP) {
  19990. textNode.deleteData(0, 1);
  19991. }
  19992. return textNode;
  19993. };
  19994. var removeCaretContainerNode = function (editor, node, moveCaret) {
  19995. if (moveCaret === void 0) {
  19996. moveCaret = true;
  19997. }
  19998. var dom = editor.dom, selection = editor.selection;
  19999. if (isCaretContainerEmpty(node)) {
  20000. deleteElement$2(editor, false, SugarElement.fromDom(node), moveCaret);
  20001. } else {
  20002. var rng = selection.getRng();
  20003. var block = dom.getParent(node, dom.isBlock);
  20004. var startContainer = rng.startContainer;
  20005. var startOffset = rng.startOffset;
  20006. var endContainer = rng.endContainer;
  20007. var endOffset = rng.endOffset;
  20008. var textNode = trimZwspFromCaretContainer(node);
  20009. dom.remove(node, true);
  20010. if (startContainer === textNode && startOffset > 0) {
  20011. rng.setStart(textNode, startOffset - 1);
  20012. }
  20013. if (endContainer === textNode && endOffset > 0) {
  20014. rng.setEnd(textNode, endOffset - 1);
  20015. }
  20016. if (block && dom.isEmpty(block)) {
  20017. fillWithPaddingBr(SugarElement.fromDom(block));
  20018. }
  20019. selection.setRng(rng);
  20020. }
  20021. };
  20022. var removeCaretContainer = function (editor, node, moveCaret) {
  20023. if (moveCaret === void 0) {
  20024. moveCaret = true;
  20025. }
  20026. var dom = editor.dom, selection = editor.selection;
  20027. if (!node) {
  20028. node = getParentCaretContainer(editor.getBody(), selection.getStart());
  20029. if (!node) {
  20030. while (node = dom.get(CARET_ID)) {
  20031. removeCaretContainerNode(editor, node, false);
  20032. }
  20033. }
  20034. } else {
  20035. removeCaretContainerNode(editor, node, moveCaret);
  20036. }
  20037. };
  20038. var insertCaretContainerNode = function (editor, caretContainer, formatNode) {
  20039. var dom = editor.dom, block = dom.getParent(formatNode, curry(isTextBlock$1, editor));
  20040. if (block && dom.isEmpty(block)) {
  20041. formatNode.parentNode.replaceChild(caretContainer, formatNode);
  20042. } else {
  20043. removeTrailingBr(SugarElement.fromDom(formatNode));
  20044. if (dom.isEmpty(formatNode)) {
  20045. formatNode.parentNode.replaceChild(caretContainer, formatNode);
  20046. } else {
  20047. dom.insertAfter(caretContainer, formatNode);
  20048. }
  20049. }
  20050. };
  20051. var appendNode = function (parentNode, node) {
  20052. parentNode.appendChild(node);
  20053. return node;
  20054. };
  20055. var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) {
  20056. var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) {
  20057. return appendNode(parentNode, formatNode.cloneNode(false));
  20058. }, caretContainer);
  20059. return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP));
  20060. };
  20061. var cleanFormatNode = function (editor, caretContainer, formatNode, name, vars, similar) {
  20062. var formatter = editor.formatter;
  20063. var dom = editor.dom;
  20064. var validFormats = filter$4(keys(formatter.get()), function (formatName) {
  20065. return formatName !== name && !contains$2(formatName, 'removeformat');
  20066. });
  20067. var matchedFormats = matchAllOnNode(editor, formatNode, validFormats);
  20068. var uniqueFormats = filter$4(matchedFormats, function (fmtName) {
  20069. return !areSimilarFormats(editor, fmtName, name);
  20070. });
  20071. if (uniqueFormats.length > 0) {
  20072. var clonedFormatNode = formatNode.cloneNode(false);
  20073. dom.add(caretContainer, clonedFormatNode);
  20074. formatter.remove(name, vars, clonedFormatNode, similar);
  20075. dom.remove(clonedFormatNode);
  20076. return Optional.some(clonedFormatNode);
  20077. } else {
  20078. return Optional.none();
  20079. }
  20080. };
  20081. var applyCaretFormat = function (editor, name, vars) {
  20082. var caretContainer, textNode;
  20083. var selection = editor.selection;
  20084. var selectionRng = selection.getRng();
  20085. var offset = selectionRng.startOffset;
  20086. var container = selectionRng.startContainer;
  20087. var text = container.nodeValue;
  20088. caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart());
  20089. if (caretContainer) {
  20090. textNode = findFirstTextNode(caretContainer);
  20091. }
  20092. var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/;
  20093. if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) {
  20094. var bookmark = selection.getBookmark();
  20095. selectionRng.collapse(true);
  20096. var rng = expandRng(editor, selectionRng, editor.formatter.get(name));
  20097. rng = split(rng);
  20098. editor.formatter.apply(name, vars, rng);
  20099. selection.moveToBookmark(bookmark);
  20100. } else {
  20101. if (!caretContainer || textNode.nodeValue !== ZWSP) {
  20102. caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom);
  20103. textNode = caretContainer.firstChild;
  20104. selectionRng.insertNode(caretContainer);
  20105. offset = 1;
  20106. editor.formatter.apply(name, vars, caretContainer);
  20107. } else {
  20108. editor.formatter.apply(name, vars, caretContainer);
  20109. }
  20110. selection.setCursorLocation(textNode, offset);
  20111. }
  20112. };
  20113. var removeCaretFormat = function (editor, name, vars, similar) {
  20114. var dom = editor.dom;
  20115. var selection = editor.selection;
  20116. var hasContentAfter, node, formatNode;
  20117. var parents = [];
  20118. var rng = selection.getRng();
  20119. var container = rng.startContainer;
  20120. var offset = rng.startOffset;
  20121. node = container;
  20122. if (container.nodeType === 3) {
  20123. if (offset !== container.nodeValue.length) {
  20124. hasContentAfter = true;
  20125. }
  20126. node = node.parentNode;
  20127. }
  20128. while (node) {
  20129. if (matchNode(editor, node, name, vars, similar)) {
  20130. formatNode = node;
  20131. break;
  20132. }
  20133. if (node.nextSibling) {
  20134. hasContentAfter = true;
  20135. }
  20136. parents.push(node);
  20137. node = node.parentNode;
  20138. }
  20139. if (!formatNode) {
  20140. return;
  20141. }
  20142. if (hasContentAfter) {
  20143. var bookmark = selection.getBookmark();
  20144. rng.collapse(true);
  20145. var expandedRng = expandRng(editor, rng, editor.formatter.get(name), true);
  20146. expandedRng = split(expandedRng);
  20147. editor.formatter.remove(name, vars, expandedRng, similar);
  20148. selection.moveToBookmark(bookmark);
  20149. } else {
  20150. var caretContainer = getParentCaretContainer(editor.getBody(), formatNode);
  20151. var newCaretContainer = createCaretContainer(false).dom;
  20152. insertCaretContainerNode(editor, newCaretContainer, caretContainer !== null ? caretContainer : formatNode);
  20153. var cleanedFormatNode = cleanFormatNode(editor, newCaretContainer, formatNode, name, vars, similar);
  20154. var caretTextNode = insertFormatNodesIntoCaretContainer(parents.concat(cleanedFormatNode.toArray()), newCaretContainer);
  20155. removeCaretContainerNode(editor, caretContainer, false);
  20156. selection.setCursorLocation(caretTextNode, 1);
  20157. if (dom.isEmpty(formatNode)) {
  20158. dom.remove(formatNode);
  20159. }
  20160. }
  20161. };
  20162. var disableCaretContainer = function (editor, keyCode) {
  20163. var selection = editor.selection, body = editor.getBody();
  20164. removeCaretContainer(editor, null, false);
  20165. if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP) {
  20166. removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
  20167. }
  20168. if (keyCode === 37 || keyCode === 39) {
  20169. removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
  20170. }
  20171. };
  20172. var setup$k = function (editor) {
  20173. editor.on('mouseup keydown', function (e) {
  20174. disableCaretContainer(editor, e.keyCode);
  20175. });
  20176. };
  20177. var replaceWithCaretFormat = function (targetNode, formatNodes) {
  20178. var caretContainer = createCaretContainer(false);
  20179. var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom);
  20180. before$4(SugarElement.fromDom(targetNode), caretContainer);
  20181. remove$7(SugarElement.fromDom(targetNode));
  20182. return CaretPosition(innerMost, 0);
  20183. };
  20184. var isFormatElement = function (editor, element) {
  20185. var inlineElements = editor.schema.getTextInlineElements();
  20186. return has$2(inlineElements, name(element)) && !isCaretNode(element.dom) && !isBogus$2(element.dom);
  20187. };
  20188. var isEmptyCaretFormatElement = function (element) {
  20189. return isCaretNode(element.dom) && isCaretContainerEmpty(element.dom);
  20190. };
  20191. var postProcessHooks = {};
  20192. var filter = filter$2;
  20193. var each$b = each$i;
  20194. var addPostProcessHook = function (name, hook) {
  20195. var hooks = postProcessHooks[name];
  20196. if (!hooks) {
  20197. postProcessHooks[name] = [];
  20198. }
  20199. postProcessHooks[name].push(hook);
  20200. };
  20201. var postProcess$1 = function (name, editor) {
  20202. each$b(postProcessHooks[name], function (hook) {
  20203. hook(editor);
  20204. });
  20205. };
  20206. addPostProcessHook('pre', function (editor) {
  20207. var rng = editor.selection.getRng();
  20208. var blocks;
  20209. var hasPreSibling = function (pre) {
  20210. return isPre(pre.previousSibling) && indexOf$1(blocks, pre.previousSibling) !== -1;
  20211. };
  20212. var joinPre = function (pre1, pre2) {
  20213. DomQuery(pre2).remove();
  20214. DomQuery(pre1).append('<br><br>').append(pre2.childNodes);
  20215. };
  20216. var isPre = matchNodeNames(['pre']);
  20217. if (!rng.collapsed) {
  20218. blocks = editor.selection.getSelectedBlocks();
  20219. each$b(filter(filter(blocks, isPre), hasPreSibling), function (pre) {
  20220. joinPre(pre.previousSibling, pre);
  20221. });
  20222. }
  20223. });
  20224. var each$a = Tools.each;
  20225. var isElementNode$1 = function (node) {
  20226. return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
  20227. };
  20228. var findElementSibling = function (node, siblingName) {
  20229. for (var sibling = node; sibling; sibling = sibling[siblingName]) {
  20230. if (isText$7(sibling) && isNotEmpty(sibling.data)) {
  20231. return node;
  20232. }
  20233. if (isElement$5(sibling) && !isBookmarkNode$1(sibling)) {
  20234. return sibling;
  20235. }
  20236. }
  20237. return node;
  20238. };
  20239. var mergeSiblingsNodes = function (dom, prev, next) {
  20240. var elementUtils = ElementUtils(dom);
  20241. if (prev && next) {
  20242. prev = findElementSibling(prev, 'previousSibling');
  20243. next = findElementSibling(next, 'nextSibling');
  20244. if (elementUtils.compare(prev, next)) {
  20245. for (var sibling = prev.nextSibling; sibling && sibling !== next;) {
  20246. var tmpSibling = sibling;
  20247. sibling = sibling.nextSibling;
  20248. prev.appendChild(tmpSibling);
  20249. }
  20250. dom.remove(next);
  20251. Tools.each(Tools.grep(next.childNodes), function (node) {
  20252. prev.appendChild(node);
  20253. });
  20254. return prev;
  20255. }
  20256. }
  20257. return next;
  20258. };
  20259. var mergeSiblings = function (dom, format, vars, node) {
  20260. if (node && format.merge_siblings !== false) {
  20261. var newNode = mergeSiblingsNodes(dom, getNonWhiteSpaceSibling(node), node);
  20262. mergeSiblingsNodes(dom, newNode, getNonWhiteSpaceSibling(newNode, true));
  20263. }
  20264. };
  20265. var clearChildStyles = function (dom, format, node) {
  20266. if (format.clear_child_styles) {
  20267. var selector = format.links ? '*:not(a)' : '*';
  20268. each$a(dom.select(selector, node), function (node) {
  20269. if (isElementNode$1(node)) {
  20270. each$a(format.styles, function (value, name) {
  20271. dom.setStyle(node, name, '');
  20272. });
  20273. }
  20274. });
  20275. }
  20276. };
  20277. var processChildElements = function (node, filter, process) {
  20278. each$a(node.childNodes, function (node) {
  20279. if (isElementNode$1(node)) {
  20280. if (filter(node)) {
  20281. process(node);
  20282. }
  20283. if (node.hasChildNodes()) {
  20284. processChildElements(node, filter, process);
  20285. }
  20286. }
  20287. });
  20288. };
  20289. var unwrapEmptySpan = function (dom, node) {
  20290. if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) {
  20291. dom.remove(node, true);
  20292. }
  20293. };
  20294. var hasStyle = function (dom, name) {
  20295. return function (node) {
  20296. return !!(node && getStyle(dom, node, name));
  20297. };
  20298. };
  20299. var applyStyle = function (dom, name, value) {
  20300. return function (node) {
  20301. dom.setStyle(node, name, value);
  20302. if (node.getAttribute('style') === '') {
  20303. node.removeAttribute('style');
  20304. }
  20305. unwrapEmptySpan(dom, node);
  20306. };
  20307. };
  20308. var removeResult = Adt.generate([
  20309. { keep: [] },
  20310. { rename: ['name'] },
  20311. { removed: [] }
  20312. ]);
  20313. var MCE_ATTR_RE = /^(src|href|style)$/;
  20314. var each$9 = Tools.each;
  20315. var isEq$2 = isEq$5;
  20316. var isTableCellOrRow = function (node) {
  20317. return /^(TR|TH|TD)$/.test(node.nodeName);
  20318. };
  20319. var isChildOfInlineParent = function (dom, node, parent) {
  20320. return dom.isChildOf(node, parent) && node !== parent && !dom.isBlock(parent);
  20321. };
  20322. var getContainer = function (ed, rng, start) {
  20323. var container = rng[start ? 'startContainer' : 'endContainer'];
  20324. var offset = rng[start ? 'startOffset' : 'endOffset'];
  20325. if (isElement$5(container)) {
  20326. var lastIdx = container.childNodes.length - 1;
  20327. if (!start && offset) {
  20328. offset--;
  20329. }
  20330. container = container.childNodes[offset > lastIdx ? lastIdx : offset];
  20331. }
  20332. if (isText$7(container) && start && offset >= container.nodeValue.length) {
  20333. container = new DomTreeWalker(container, ed.getBody()).next() || container;
  20334. }
  20335. if (isText$7(container) && !start && offset === 0) {
  20336. container = new DomTreeWalker(container, ed.getBody()).prev() || container;
  20337. }
  20338. return container;
  20339. };
  20340. var normalizeTableSelection = function (node, start) {
  20341. var prop = start ? 'firstChild' : 'lastChild';
  20342. if (isTableCellOrRow(node) && node[prop]) {
  20343. var childNode = node[prop];
  20344. if (node.nodeName === 'TR') {
  20345. return childNode[prop] || childNode;
  20346. } else {
  20347. return childNode;
  20348. }
  20349. }
  20350. return node;
  20351. };
  20352. var wrap$1 = function (dom, node, name, attrs) {
  20353. var wrapper = dom.create(name, attrs);
  20354. node.parentNode.insertBefore(wrapper, node);
  20355. wrapper.appendChild(node);
  20356. return wrapper;
  20357. };
  20358. var wrapWithSiblings = function (dom, node, next, name, attrs) {
  20359. var start = SugarElement.fromDom(node);
  20360. var wrapper = SugarElement.fromDom(dom.create(name, attrs));
  20361. var siblings = next ? nextSiblings(start) : prevSiblings(start);
  20362. append(wrapper, siblings);
  20363. if (next) {
  20364. before$4(start, wrapper);
  20365. prepend(wrapper, start);
  20366. } else {
  20367. after$3(start, wrapper);
  20368. append$1(wrapper, start);
  20369. }
  20370. return wrapper.dom;
  20371. };
  20372. var matchName = function (dom, node, format) {
  20373. if (isInlineFormat(format) && isEq$2(node, format.inline)) {
  20374. return true;
  20375. }
  20376. if (isBlockFormat(format) && isEq$2(node, format.block)) {
  20377. return true;
  20378. }
  20379. if (isSelectorFormat(format)) {
  20380. return isElement$5(node) && dom.is(node, format.selector);
  20381. }
  20382. };
  20383. var isColorFormatAndAnchor = function (node, format) {
  20384. return format.links && node.nodeName === 'A';
  20385. };
  20386. var find = function (dom, node, next, inc) {
  20387. var sibling = getNonWhiteSpaceSibling(node, next, inc);
  20388. return isNullable(sibling) || sibling.nodeName === 'BR' || dom.isBlock(sibling);
  20389. };
  20390. var removeNode = function (ed, node, format) {
  20391. var parentNode = node.parentNode;
  20392. var rootBlockElm;
  20393. var dom = ed.dom, forcedRootBlock = getForcedRootBlock(ed);
  20394. if (isBlockFormat(format)) {
  20395. if (!forcedRootBlock) {
  20396. if (dom.isBlock(node) && !dom.isBlock(parentNode)) {
  20397. if (!find(dom, node, false) && !find(dom, node.firstChild, true, true)) {
  20398. node.insertBefore(dom.create('br'), node.firstChild);
  20399. }
  20400. if (!find(dom, node, true) && !find(dom, node.lastChild, false, true)) {
  20401. node.appendChild(dom.create('br'));
  20402. }
  20403. }
  20404. } else {
  20405. if (parentNode === dom.getRoot()) {
  20406. if (!format.list_block || !isEq$2(node, format.list_block)) {
  20407. each$k(from(node.childNodes), function (node) {
  20408. if (isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) {
  20409. if (!rootBlockElm) {
  20410. rootBlockElm = wrap$1(dom, node, forcedRootBlock);
  20411. dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
  20412. } else {
  20413. rootBlockElm.appendChild(node);
  20414. }
  20415. } else {
  20416. rootBlockElm = null;
  20417. }
  20418. });
  20419. }
  20420. }
  20421. }
  20422. }
  20423. if (isMixedFormat(format) && !isEq$2(format.inline, node)) {
  20424. return;
  20425. }
  20426. dom.remove(node, true);
  20427. };
  20428. var removeFormatInternal = function (ed, format, vars, node, compareNode) {
  20429. var stylesModified;
  20430. var dom = ed.dom;
  20431. if (!matchName(dom, node, format) && !isColorFormatAndAnchor(node, format)) {
  20432. return removeResult.keep();
  20433. }
  20434. var elm = node;
  20435. if (isInlineFormat(format) && format.remove === 'all' && isArray$1(format.preserve_attributes)) {
  20436. var attrsToPreserve = filter$4(dom.getAttribs(elm), function (attr) {
  20437. return contains$3(format.preserve_attributes, attr.name.toLowerCase());
  20438. });
  20439. dom.removeAllAttribs(elm);
  20440. each$k(attrsToPreserve, function (attr) {
  20441. return dom.setAttrib(elm, attr.name, attr.value);
  20442. });
  20443. if (attrsToPreserve.length > 0) {
  20444. return removeResult.rename('span');
  20445. }
  20446. }
  20447. if (format.remove !== 'all') {
  20448. each$9(format.styles, function (value, name) {
  20449. value = normalizeStyleValue(dom, replaceVars(value, vars), name + '');
  20450. if (isNumber(name)) {
  20451. name = value;
  20452. compareNode = null;
  20453. }
  20454. if (format.remove_similar || (!compareNode || isEq$2(getStyle(dom, compareNode, name), value))) {
  20455. dom.setStyle(elm, name, '');
  20456. }
  20457. stylesModified = true;
  20458. });
  20459. if (stylesModified && dom.getAttrib(elm, 'style') === '') {
  20460. elm.removeAttribute('style');
  20461. elm.removeAttribute('data-mce-style');
  20462. }
  20463. each$9(format.attributes, function (value, name) {
  20464. var valueOut;
  20465. value = replaceVars(value, vars);
  20466. if (isNumber(name)) {
  20467. name = value;
  20468. compareNode = null;
  20469. }
  20470. if (format.remove_similar || (!compareNode || isEq$2(dom.getAttrib(compareNode, name), value))) {
  20471. if (name === 'class') {
  20472. value = dom.getAttrib(elm, name);
  20473. if (value) {
  20474. valueOut = '';
  20475. each$k(value.split(/\s+/), function (cls) {
  20476. if (/mce\-\w+/.test(cls)) {
  20477. valueOut += (valueOut ? ' ' : '') + cls;
  20478. }
  20479. });
  20480. if (valueOut) {
  20481. dom.setAttrib(elm, name, valueOut);
  20482. return;
  20483. }
  20484. }
  20485. }
  20486. if (MCE_ATTR_RE.test(name)) {
  20487. elm.removeAttribute('data-mce-' + name);
  20488. }
  20489. if (name === 'style' && matchNodeNames(['li'])(elm) && dom.getStyle(elm, 'list-style-type') === 'none') {
  20490. elm.removeAttribute(name);
  20491. dom.setStyle(elm, 'list-style-type', 'none');
  20492. return;
  20493. }
  20494. if (name === 'class') {
  20495. elm.removeAttribute('className');
  20496. }
  20497. elm.removeAttribute(name);
  20498. }
  20499. });
  20500. each$9(format.classes, function (value) {
  20501. value = replaceVars(value, vars);
  20502. if (!compareNode || dom.hasClass(compareNode, value)) {
  20503. dom.removeClass(elm, value);
  20504. }
  20505. });
  20506. var attrs = dom.getAttribs(elm);
  20507. for (var i = 0; i < attrs.length; i++) {
  20508. var attrName = attrs[i].nodeName;
  20509. if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) {
  20510. return removeResult.keep();
  20511. }
  20512. }
  20513. }
  20514. if (format.remove !== 'none') {
  20515. removeNode(ed, elm, format);
  20516. return removeResult.removed();
  20517. }
  20518. return removeResult.keep();
  20519. };
  20520. var removeFormat$1 = function (ed, format, vars, node, compareNode) {
  20521. return removeFormatInternal(ed, format, vars, node, compareNode).fold(never, function (newName) {
  20522. ed.dom.rename(node, newName);
  20523. return true;
  20524. }, always);
  20525. };
  20526. var findFormatRoot = function (editor, container, name, vars, similar) {
  20527. var formatRoot;
  20528. each$k(getParents$2(editor.dom, container.parentNode).reverse(), function (parent) {
  20529. if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') {
  20530. var format = matchNode(editor, parent, name, vars, similar);
  20531. if (format && format.split !== false) {
  20532. formatRoot = parent;
  20533. }
  20534. }
  20535. });
  20536. return formatRoot;
  20537. };
  20538. var removeFormatFromClone = function (editor, format, vars, clone) {
  20539. return removeFormatInternal(editor, format, vars, clone, clone).fold(constant(clone), function (newName) {
  20540. var fragment = editor.dom.createFragment();
  20541. fragment.appendChild(clone);
  20542. return editor.dom.rename(clone, newName);
  20543. }, constant(null));
  20544. };
  20545. var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) {
  20546. var clone, lastClone, firstClone;
  20547. var dom = editor.dom;
  20548. if (formatRoot) {
  20549. var formatRootParent = formatRoot.parentNode;
  20550. for (var parent_1 = container.parentNode; parent_1 && parent_1 !== formatRootParent; parent_1 = parent_1.parentNode) {
  20551. clone = dom.clone(parent_1, false);
  20552. for (var i = 0; i < formatList.length; i++) {
  20553. clone = removeFormatFromClone(editor, formatList[i], vars, clone);
  20554. if (clone === null) {
  20555. break;
  20556. }
  20557. }
  20558. if (clone) {
  20559. if (lastClone) {
  20560. clone.appendChild(lastClone);
  20561. }
  20562. if (!firstClone) {
  20563. firstClone = clone;
  20564. }
  20565. lastClone = clone;
  20566. }
  20567. }
  20568. if (split && (!format.mixed || !dom.isBlock(formatRoot))) {
  20569. container = dom.split(formatRoot, container);
  20570. }
  20571. if (lastClone) {
  20572. target.parentNode.insertBefore(lastClone, target);
  20573. firstClone.appendChild(target);
  20574. if (isInlineFormat(format)) {
  20575. mergeSiblings(dom, format, vars, lastClone);
  20576. }
  20577. }
  20578. }
  20579. return container;
  20580. };
  20581. var remove$1 = function (ed, name, vars, node, similar) {
  20582. var formatList = ed.formatter.get(name);
  20583. var format = formatList[0];
  20584. var contentEditable = true;
  20585. var dom = ed.dom;
  20586. var selection = ed.selection;
  20587. var splitToFormatRoot = function (container) {
  20588. var formatRoot = findFormatRoot(ed, container, name, vars, similar);
  20589. return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars);
  20590. };
  20591. var isRemoveBookmarkNode = function (node) {
  20592. return isBookmarkNode$1(node) && isElement$5(node) && (node.id === '_start' || node.id === '_end');
  20593. };
  20594. var removeNodeFormat = function (node) {
  20595. return exists(formatList, function (fmt) {
  20596. return removeFormat$1(ed, fmt, vars, node, node);
  20597. });
  20598. };
  20599. var process = function (node) {
  20600. var lastContentEditable = true;
  20601. var hasContentEditableState = false;
  20602. if (isElement$5(node) && dom.getContentEditable(node)) {
  20603. lastContentEditable = contentEditable;
  20604. contentEditable = dom.getContentEditable(node) === 'true';
  20605. hasContentEditableState = true;
  20606. }
  20607. var children = from(node.childNodes);
  20608. if (contentEditable && !hasContentEditableState) {
  20609. var removed = removeNodeFormat(node);
  20610. var currentNodeMatches = removed || exists(formatList, function (f) {
  20611. return matchName$1(dom, node, f);
  20612. });
  20613. var parentNode = node.parentNode;
  20614. if (!currentNodeMatches && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
  20615. removeNodeFormat(parentNode);
  20616. }
  20617. }
  20618. if (format.deep) {
  20619. if (children.length) {
  20620. for (var i = 0; i < children.length; i++) {
  20621. process(children[i]);
  20622. }
  20623. if (hasContentEditableState) {
  20624. contentEditable = lastContentEditable;
  20625. }
  20626. }
  20627. }
  20628. var textDecorations = [
  20629. 'underline',
  20630. 'line-through',
  20631. 'overline'
  20632. ];
  20633. each$k(textDecorations, function (decoration) {
  20634. if (isElement$5(node) && ed.dom.getStyle(node, 'text-decoration') === decoration && node.parentNode && getTextDecoration(dom, node.parentNode) === decoration) {
  20635. removeFormat$1(ed, {
  20636. deep: false,
  20637. exact: true,
  20638. inline: 'span',
  20639. styles: { textDecoration: decoration }
  20640. }, null, node);
  20641. }
  20642. });
  20643. };
  20644. var unwrap = function (start) {
  20645. var node = dom.get(start ? '_start' : '_end');
  20646. var out = node[start ? 'firstChild' : 'lastChild'];
  20647. if (isRemoveBookmarkNode(out)) {
  20648. out = out[start ? 'firstChild' : 'lastChild'];
  20649. }
  20650. if (isText$7(out) && out.data.length === 0) {
  20651. out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
  20652. }
  20653. dom.remove(node, true);
  20654. return out;
  20655. };
  20656. var removeRngStyle = function (rng) {
  20657. var startContainer, endContainer;
  20658. var expandedRng = expandRng(ed, rng, formatList, rng.collapsed);
  20659. if (format.split) {
  20660. expandedRng = split(expandedRng);
  20661. startContainer = getContainer(ed, expandedRng, true);
  20662. endContainer = getContainer(ed, expandedRng);
  20663. if (startContainer !== endContainer) {
  20664. startContainer = normalizeTableSelection(startContainer, true);
  20665. endContainer = normalizeTableSelection(endContainer, false);
  20666. if (isChildOfInlineParent(dom, startContainer, endContainer)) {
  20667. var marker = Optional.from(startContainer.firstChild).getOr(startContainer);
  20668. splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', {
  20669. 'id': '_start',
  20670. 'data-mce-type': 'bookmark'
  20671. }));
  20672. unwrap(true);
  20673. return;
  20674. }
  20675. if (isChildOfInlineParent(dom, endContainer, startContainer)) {
  20676. var marker = Optional.from(endContainer.lastChild).getOr(endContainer);
  20677. splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', {
  20678. 'id': '_end',
  20679. 'data-mce-type': 'bookmark'
  20680. }));
  20681. unwrap(false);
  20682. return;
  20683. }
  20684. startContainer = wrap$1(dom, startContainer, 'span', {
  20685. 'id': '_start',
  20686. 'data-mce-type': 'bookmark'
  20687. });
  20688. endContainer = wrap$1(dom, endContainer, 'span', {
  20689. 'id': '_end',
  20690. 'data-mce-type': 'bookmark'
  20691. });
  20692. var newRng = dom.createRng();
  20693. newRng.setStartAfter(startContainer);
  20694. newRng.setEndBefore(endContainer);
  20695. walk$2(dom, newRng, function (nodes) {
  20696. each$k(nodes, function (n) {
  20697. if (!isBookmarkNode$1(n) && !isBookmarkNode$1(n.parentNode)) {
  20698. splitToFormatRoot(n);
  20699. }
  20700. });
  20701. });
  20702. splitToFormatRoot(startContainer);
  20703. splitToFormatRoot(endContainer);
  20704. startContainer = unwrap(true);
  20705. endContainer = unwrap();
  20706. } else {
  20707. startContainer = endContainer = splitToFormatRoot(startContainer);
  20708. }
  20709. expandedRng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
  20710. expandedRng.startOffset = dom.nodeIndex(startContainer);
  20711. expandedRng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
  20712. expandedRng.endOffset = dom.nodeIndex(endContainer) + 1;
  20713. }
  20714. walk$2(dom, expandedRng, function (nodes) {
  20715. each$k(nodes, process);
  20716. });
  20717. };
  20718. if (node) {
  20719. if (isNode(node)) {
  20720. var rng = dom.createRng();
  20721. rng.setStartBefore(node);
  20722. rng.setEndAfter(node);
  20723. removeRngStyle(rng);
  20724. } else {
  20725. removeRngStyle(node);
  20726. }
  20727. fireFormatRemove(ed, name, node, vars);
  20728. return;
  20729. }
  20730. if (dom.getContentEditable(selection.getNode()) === 'false') {
  20731. node = selection.getNode();
  20732. for (var i = 0; i < formatList.length; i++) {
  20733. if (formatList[i].ceFalseOverride) {
  20734. if (removeFormat$1(ed, formatList[i], vars, node, node)) {
  20735. break;
  20736. }
  20737. }
  20738. }
  20739. fireFormatRemove(ed, name, node, vars);
  20740. return;
  20741. }
  20742. if (!selection.isCollapsed() || !isInlineFormat(format) || getCellsFromEditor(ed).length) {
  20743. preserve(selection, true, function () {
  20744. runOnRanges(ed, removeRngStyle);
  20745. });
  20746. if (isInlineFormat(format) && match$2(ed, name, vars, selection.getStart())) {
  20747. moveStart(dom, selection, selection.getRng());
  20748. }
  20749. ed.nodeChanged();
  20750. } else {
  20751. removeCaretFormat(ed, name, vars, similar);
  20752. }
  20753. fireFormatRemove(ed, name, node, vars);
  20754. };
  20755. var each$8 = Tools.each;
  20756. var mergeTextDecorationsAndColor = function (dom, format, vars, node) {
  20757. var processTextDecorationsAndColor = function (n) {
  20758. if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) {
  20759. var textDecoration = getTextDecoration(dom, n.parentNode);
  20760. if (dom.getStyle(n, 'color') && textDecoration) {
  20761. dom.setStyle(n, 'text-decoration', textDecoration);
  20762. } else if (dom.getStyle(n, 'text-decoration') === textDecoration) {
  20763. dom.setStyle(n, 'text-decoration', null);
  20764. }
  20765. }
  20766. };
  20767. if (format.styles && (format.styles.color || format.styles.textDecoration)) {
  20768. Tools.walk(node, processTextDecorationsAndColor, 'childNodes');
  20769. processTextDecorationsAndColor(node);
  20770. }
  20771. };
  20772. var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) {
  20773. if (format.styles && format.styles.backgroundColor) {
  20774. processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', replaceVars(format.styles.backgroundColor, vars)));
  20775. }
  20776. };
  20777. var mergeSubSup = function (dom, format, vars, node) {
  20778. if (isInlineFormat(format) && (format.inline === 'sub' || format.inline === 'sup')) {
  20779. processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', ''));
  20780. dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true);
  20781. }
  20782. };
  20783. var mergeWithChildren = function (editor, formatList, vars, node) {
  20784. each$8(formatList, function (format) {
  20785. if (isInlineFormat(format)) {
  20786. each$8(editor.dom.select(format.inline, node), function (child) {
  20787. if (!isElementNode$1(child)) {
  20788. return;
  20789. }
  20790. removeFormat$1(editor, format, vars, child, format.exact ? child : null);
  20791. });
  20792. }
  20793. clearChildStyles(editor.dom, format, node);
  20794. });
  20795. };
  20796. var mergeWithParents = function (editor, format, name, vars, node) {
  20797. if (matchNode(editor, node.parentNode, name, vars)) {
  20798. if (removeFormat$1(editor, format, vars, node)) {
  20799. return;
  20800. }
  20801. }
  20802. if (format.merge_with_parents) {
  20803. editor.dom.getParent(node.parentNode, function (parent) {
  20804. if (matchNode(editor, parent, name, vars)) {
  20805. removeFormat$1(editor, format, vars, node);
  20806. return true;
  20807. }
  20808. });
  20809. }
  20810. };
  20811. var each$7 = Tools.each;
  20812. var isElementNode = function (node) {
  20813. return isElement$5(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus$2(node);
  20814. };
  20815. var canFormatBR = function (editor, format, node, parentName) {
  20816. if (canFormatEmptyLines(editor) && isInlineFormat(format)) {
  20817. var validBRParentElements = __assign(__assign({}, editor.schema.getTextBlockElements()), {
  20818. td: {},
  20819. th: {},
  20820. li: {},
  20821. dt: {},
  20822. dd: {},
  20823. figcaption: {},
  20824. caption: {},
  20825. details: {},
  20826. summary: {}
  20827. });
  20828. var hasCaretNodeSibling = sibling(SugarElement.fromDom(node), function (sibling) {
  20829. return isCaretNode(sibling.dom);
  20830. });
  20831. return hasNonNullableKey(validBRParentElements, parentName) && isEmpty$2(SugarElement.fromDom(node.parentNode), false) && !hasCaretNodeSibling;
  20832. } else {
  20833. return false;
  20834. }
  20835. };
  20836. var applyFormat$1 = function (ed, name, vars, node) {
  20837. var formatList = ed.formatter.get(name);
  20838. var format = formatList[0];
  20839. var isCollapsed = !node && ed.selection.isCollapsed();
  20840. var dom = ed.dom;
  20841. var selection = ed.selection;
  20842. var setElementFormat = function (elm, fmt) {
  20843. if (fmt === void 0) {
  20844. fmt = format;
  20845. }
  20846. if (isFunction(fmt.onformat)) {
  20847. fmt.onformat(elm, fmt, vars, node);
  20848. }
  20849. each$7(fmt.styles, function (value, name) {
  20850. dom.setStyle(elm, name, replaceVars(value, vars));
  20851. });
  20852. if (fmt.styles) {
  20853. var styleVal = dom.getAttrib(elm, 'style');
  20854. if (styleVal) {
  20855. dom.setAttrib(elm, 'data-mce-style', styleVal);
  20856. }
  20857. }
  20858. each$7(fmt.attributes, function (value, name) {
  20859. dom.setAttrib(elm, name, replaceVars(value, vars));
  20860. });
  20861. each$7(fmt.classes, function (value) {
  20862. value = replaceVars(value, vars);
  20863. if (!dom.hasClass(elm, value)) {
  20864. dom.addClass(elm, value);
  20865. }
  20866. });
  20867. };
  20868. var applyNodeStyle = function (formatList, node) {
  20869. var found = false;
  20870. each$7(formatList, function (format) {
  20871. if (!isSelectorFormat(format)) {
  20872. return false;
  20873. }
  20874. if (isNonNullable(format.collapsed) && format.collapsed !== isCollapsed) {
  20875. return;
  20876. }
  20877. if (dom.is(node, format.selector) && !isCaretNode(node)) {
  20878. setElementFormat(node, format);
  20879. found = true;
  20880. return false;
  20881. }
  20882. });
  20883. return found;
  20884. };
  20885. var createWrapElement = function (wrapName) {
  20886. if (isString$1(wrapName)) {
  20887. var wrapElm = dom.create(wrapName);
  20888. setElementFormat(wrapElm);
  20889. return wrapElm;
  20890. } else {
  20891. return null;
  20892. }
  20893. };
  20894. var applyRngStyle = function (dom, rng, nodeSpecific) {
  20895. var newWrappers = [];
  20896. var contentEditable = true;
  20897. var wrapName = format.inline || format.block;
  20898. var wrapElm = createWrapElement(wrapName);
  20899. walk$2(dom, rng, function (nodes) {
  20900. var currentWrapElm;
  20901. var process = function (node) {
  20902. var hasContentEditableState = false;
  20903. var lastContentEditable = contentEditable;
  20904. var nodeName = node.nodeName.toLowerCase();
  20905. var parentNode = node.parentNode;
  20906. var parentName = parentNode.nodeName.toLowerCase();
  20907. if (isElement$5(node) && dom.getContentEditable(node)) {
  20908. lastContentEditable = contentEditable;
  20909. contentEditable = dom.getContentEditable(node) === 'true';
  20910. hasContentEditableState = true;
  20911. }
  20912. if (isBr$5(node) && !canFormatBR(ed, format, node, parentName)) {
  20913. currentWrapElm = null;
  20914. if (isBlockFormat(format)) {
  20915. dom.remove(node);
  20916. }
  20917. return;
  20918. }
  20919. if (isBlockFormat(format) && format.wrapper && matchNode(ed, node, name, vars)) {
  20920. currentWrapElm = null;
  20921. return;
  20922. }
  20923. if (contentEditable && !hasContentEditableState && isBlockFormat(format) && !format.wrapper && isTextBlock$1(ed, nodeName) && isValid(ed, parentName, wrapName)) {
  20924. var elm = dom.rename(node, wrapName);
  20925. setElementFormat(elm);
  20926. newWrappers.push(elm);
  20927. currentWrapElm = null;
  20928. return;
  20929. }
  20930. if (isSelectorFormat(format)) {
  20931. var found = applyNodeStyle(formatList, node);
  20932. if (!found && isNonNullable(parentNode) && shouldExpandToSelector(format)) {
  20933. found = applyNodeStyle(formatList, parentNode);
  20934. }
  20935. if (!isInlineFormat(format) || found) {
  20936. currentWrapElm = null;
  20937. return;
  20938. }
  20939. }
  20940. if (contentEditable && !hasContentEditableState && isValid(ed, wrapName, nodeName) && isValid(ed, parentName, wrapName) && !(!nodeSpecific && isText$7(node) && isZwsp(node.data)) && !isCaretNode(node) && (!isInlineFormat(format) || !dom.isBlock(node))) {
  20941. if (!currentWrapElm) {
  20942. currentWrapElm = dom.clone(wrapElm, false);
  20943. node.parentNode.insertBefore(currentWrapElm, node);
  20944. newWrappers.push(currentWrapElm);
  20945. }
  20946. currentWrapElm.appendChild(node);
  20947. } else {
  20948. currentWrapElm = null;
  20949. each$k(from(node.childNodes), process);
  20950. if (hasContentEditableState) {
  20951. contentEditable = lastContentEditable;
  20952. }
  20953. currentWrapElm = null;
  20954. }
  20955. };
  20956. each$k(nodes, process);
  20957. });
  20958. if (format.links === true) {
  20959. each$k(newWrappers, function (node) {
  20960. var process = function (node) {
  20961. if (node.nodeName === 'A') {
  20962. setElementFormat(node, format);
  20963. }
  20964. each$k(from(node.childNodes), process);
  20965. };
  20966. process(node);
  20967. });
  20968. }
  20969. each$k(newWrappers, function (node) {
  20970. var getChildCount = function (node) {
  20971. var count = 0;
  20972. each$k(node.childNodes, function (node) {
  20973. if (!isEmptyTextNode$1(node) && !isBookmarkNode$1(node)) {
  20974. count++;
  20975. }
  20976. });
  20977. return count;
  20978. };
  20979. var mergeStyles = function (node) {
  20980. var childElement = find$3(node.childNodes, isElementNode).filter(function (child) {
  20981. return matchName$1(dom, child, format);
  20982. });
  20983. return childElement.map(function (child) {
  20984. var clone = dom.clone(child, false);
  20985. setElementFormat(clone);
  20986. dom.replace(clone, node, true);
  20987. dom.remove(child, true);
  20988. return clone;
  20989. }).getOr(node);
  20990. };
  20991. var childCount = getChildCount(node);
  20992. if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) {
  20993. dom.remove(node, true);
  20994. return;
  20995. }
  20996. if (isInlineFormat(format) || isBlockFormat(format) && format.wrapper) {
  20997. if (!format.exact && childCount === 1) {
  20998. node = mergeStyles(node);
  20999. }
  21000. mergeWithChildren(ed, formatList, vars, node);
  21001. mergeWithParents(ed, format, name, vars, node);
  21002. mergeBackgroundColorAndFontSize(dom, format, vars, node);
  21003. mergeTextDecorationsAndColor(dom, format, vars, node);
  21004. mergeSubSup(dom, format, vars, node);
  21005. mergeSiblings(dom, format, vars, node);
  21006. }
  21007. });
  21008. };
  21009. if (dom.getContentEditable(selection.getNode()) === 'false') {
  21010. node = selection.getNode();
  21011. for (var i = 0, l = formatList.length; i < l; i++) {
  21012. var formatItem = formatList[i];
  21013. if (formatItem.ceFalseOverride && isSelectorFormat(formatItem) && dom.is(node, formatItem.selector)) {
  21014. setElementFormat(node, formatItem);
  21015. break;
  21016. }
  21017. }
  21018. fireFormatApply(ed, name, node, vars);
  21019. return;
  21020. }
  21021. if (format) {
  21022. if (node) {
  21023. if (isNode(node)) {
  21024. if (!applyNodeStyle(formatList, node)) {
  21025. var rng = dom.createRng();
  21026. rng.setStartBefore(node);
  21027. rng.setEndAfter(node);
  21028. applyRngStyle(dom, expandRng(ed, rng, formatList), true);
  21029. }
  21030. } else {
  21031. applyRngStyle(dom, node, true);
  21032. }
  21033. } else {
  21034. if (!isCollapsed || !isInlineFormat(format) || getCellsFromEditor(ed).length) {
  21035. var curSelNode = selection.getNode();
  21036. var firstFormat = formatList[0];
  21037. if (!ed.settings.forced_root_block && firstFormat.defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
  21038. applyFormat$1(ed, firstFormat.defaultBlock);
  21039. }
  21040. selection.setRng(normalize(selection.getRng()));
  21041. preserve(selection, true, function () {
  21042. runOnRanges(ed, function (selectionRng, fake) {
  21043. var expandedRng = fake ? selectionRng : expandRng(ed, selectionRng, formatList);
  21044. applyRngStyle(dom, expandedRng, false);
  21045. });
  21046. });
  21047. moveStart(dom, selection, selection.getRng());
  21048. ed.nodeChanged();
  21049. } else {
  21050. applyCaretFormat(ed, name, vars);
  21051. }
  21052. }
  21053. postProcess$1(name, ed);
  21054. }
  21055. fireFormatApply(ed, name, node, vars);
  21056. };
  21057. var hasVars = function (value) {
  21058. return has$2(value, 'vars');
  21059. };
  21060. var setup$j = function (registeredFormatListeners, editor) {
  21061. registeredFormatListeners.set({});
  21062. editor.on('NodeChange', function (e) {
  21063. updateAndFireChangeCallbacks(editor, e.element, registeredFormatListeners.get());
  21064. });
  21065. editor.on('FormatApply FormatRemove', function (e) {
  21066. var element = Optional.from(e.node).map(function (nodeOrRange) {
  21067. return isNode(nodeOrRange) ? nodeOrRange : nodeOrRange.startContainer;
  21068. }).bind(function (node) {
  21069. return isElement$5(node) ? Optional.some(node) : Optional.from(node.parentElement);
  21070. }).getOrThunk(function () {
  21071. return fallbackElement(editor);
  21072. });
  21073. updateAndFireChangeCallbacks(editor, element, registeredFormatListeners.get());
  21074. });
  21075. };
  21076. var fallbackElement = function (editor) {
  21077. return editor.selection.getStart();
  21078. };
  21079. var matchingNode = function (editor, parents, format, similar, vars) {
  21080. var isMatchingNode = function (node) {
  21081. var matchingFormat = editor.formatter.matchNode(node, format, vars !== null && vars !== void 0 ? vars : {}, similar);
  21082. return !isUndefined(matchingFormat);
  21083. };
  21084. var isUnableToMatch = function (node) {
  21085. if (matchesUnInheritedFormatSelector(editor, node, format)) {
  21086. return true;
  21087. } else {
  21088. if (!similar) {
  21089. return isNonNullable(editor.formatter.matchNode(node, format, vars, true));
  21090. } else {
  21091. return false;
  21092. }
  21093. }
  21094. };
  21095. return findUntil$1(parents, isMatchingNode, isUnableToMatch);
  21096. };
  21097. var getParents = function (editor, elm) {
  21098. var element = elm !== null && elm !== void 0 ? elm : fallbackElement(editor);
  21099. return filter$4(getParents$2(editor.dom, element), function (node) {
  21100. return isElement$5(node) && !isBogus$2(node);
  21101. });
  21102. };
  21103. var updateAndFireChangeCallbacks = function (editor, elm, registeredCallbacks) {
  21104. var parents = getParents(editor, elm);
  21105. each$j(registeredCallbacks, function (data, format) {
  21106. var runIfChanged = function (spec) {
  21107. var match = matchingNode(editor, parents, format, spec.similar, hasVars(spec) ? spec.vars : undefined);
  21108. var isSet = match.isSome();
  21109. if (spec.state.get() !== isSet) {
  21110. spec.state.set(isSet);
  21111. var node_1 = match.getOr(elm);
  21112. if (hasVars(spec)) {
  21113. spec.callback(isSet, {
  21114. node: node_1,
  21115. format: format,
  21116. parents: parents
  21117. });
  21118. } else {
  21119. each$k(spec.callbacks, function (callback) {
  21120. return callback(isSet, {
  21121. node: node_1,
  21122. format: format,
  21123. parents: parents
  21124. });
  21125. });
  21126. }
  21127. }
  21128. };
  21129. each$k([
  21130. data.withSimilar,
  21131. data.withoutSimilar
  21132. ], runIfChanged);
  21133. each$k(data.withVars, runIfChanged);
  21134. });
  21135. };
  21136. var addListeners = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
  21137. var formatChangeItems = registeredFormatListeners.get();
  21138. each$k(formats.split(','), function (format) {
  21139. var group = get$9(formatChangeItems, format).getOrThunk(function () {
  21140. var base = {
  21141. withSimilar: {
  21142. state: Cell(false),
  21143. similar: true,
  21144. callbacks: []
  21145. },
  21146. withoutSimilar: {
  21147. state: Cell(false),
  21148. similar: false,
  21149. callbacks: []
  21150. },
  21151. withVars: []
  21152. };
  21153. formatChangeItems[format] = base;
  21154. return base;
  21155. });
  21156. var getCurrent = function () {
  21157. var parents = getParents(editor);
  21158. return matchingNode(editor, parents, format, similar, vars).isSome();
  21159. };
  21160. if (isUndefined(vars)) {
  21161. var toAppendTo = similar ? group.withSimilar : group.withoutSimilar;
  21162. toAppendTo.callbacks.push(callback);
  21163. if (toAppendTo.callbacks.length === 1) {
  21164. toAppendTo.state.set(getCurrent());
  21165. }
  21166. } else {
  21167. group.withVars.push({
  21168. state: Cell(getCurrent()),
  21169. similar: similar,
  21170. vars: vars,
  21171. callback: callback
  21172. });
  21173. }
  21174. });
  21175. registeredFormatListeners.set(formatChangeItems);
  21176. };
  21177. var removeListeners = function (registeredFormatListeners, formats, callback) {
  21178. var formatChangeItems = registeredFormatListeners.get();
  21179. each$k(formats.split(','), function (format) {
  21180. return get$9(formatChangeItems, format).each(function (group) {
  21181. formatChangeItems[format] = {
  21182. withSimilar: __assign(__assign({}, group.withSimilar), {
  21183. callbacks: filter$4(group.withSimilar.callbacks, function (cb) {
  21184. return cb !== callback;
  21185. })
  21186. }),
  21187. withoutSimilar: __assign(__assign({}, group.withoutSimilar), {
  21188. callbacks: filter$4(group.withoutSimilar.callbacks, function (cb) {
  21189. return cb !== callback;
  21190. })
  21191. }),
  21192. withVars: filter$4(group.withVars, function (item) {
  21193. return item.callback !== callback;
  21194. })
  21195. };
  21196. });
  21197. });
  21198. registeredFormatListeners.set(formatChangeItems);
  21199. };
  21200. var formatChangedInternal = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
  21201. if (registeredFormatListeners.get() === null) {
  21202. setup$j(registeredFormatListeners, editor);
  21203. }
  21204. addListeners(editor, registeredFormatListeners, formats, callback, similar, vars);
  21205. return {
  21206. unbind: function () {
  21207. return removeListeners(registeredFormatListeners, formats, callback);
  21208. }
  21209. };
  21210. };
  21211. var toggle = function (editor, name, vars, node) {
  21212. var fmt = editor.formatter.get(name);
  21213. if (match$2(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
  21214. remove$1(editor, name, vars, node);
  21215. } else {
  21216. applyFormat$1(editor, name, vars, node);
  21217. }
  21218. };
  21219. var fromElements = function (elements, scope) {
  21220. var doc = scope || document;
  21221. var fragment = doc.createDocumentFragment();
  21222. each$k(elements, function (element) {
  21223. fragment.appendChild(element.dom);
  21224. });
  21225. return SugarElement.fromDom(fragment);
  21226. };
  21227. var tableModel = function (element, width, rows) {
  21228. return {
  21229. element: element,
  21230. width: width,
  21231. rows: rows
  21232. };
  21233. };
  21234. var tableRow = function (element, cells) {
  21235. return {
  21236. element: element,
  21237. cells: cells
  21238. };
  21239. };
  21240. var cellPosition = function (x, y) {
  21241. return {
  21242. x: x,
  21243. y: y
  21244. };
  21245. };
  21246. var getSpan = function (td, key) {
  21247. var value = parseInt(get$6(td, key), 10);
  21248. return isNaN(value) ? 1 : value;
  21249. };
  21250. var fillout = function (table, x, y, tr, td) {
  21251. var rowspan = getSpan(td, 'rowspan');
  21252. var colspan = getSpan(td, 'colspan');
  21253. var rows = table.rows;
  21254. for (var y2 = y; y2 < y + rowspan; y2++) {
  21255. if (!rows[y2]) {
  21256. rows[y2] = tableRow(deep$1(tr), []);
  21257. }
  21258. for (var x2 = x; x2 < x + colspan; x2++) {
  21259. var cells = rows[y2].cells;
  21260. cells[x2] = y2 === y && x2 === x ? td : shallow(td);
  21261. }
  21262. }
  21263. };
  21264. var cellExists = function (table, x, y) {
  21265. var rows = table.rows;
  21266. var cells = rows[y] ? rows[y].cells : [];
  21267. return !!cells[x];
  21268. };
  21269. var skipCellsX = function (table, x, y) {
  21270. while (cellExists(table, x, y)) {
  21271. x++;
  21272. }
  21273. return x;
  21274. };
  21275. var getWidth = function (rows) {
  21276. return foldl(rows, function (acc, row) {
  21277. return row.cells.length > acc ? row.cells.length : acc;
  21278. }, 0);
  21279. };
  21280. var findElementPos = function (table, element) {
  21281. var rows = table.rows;
  21282. for (var y = 0; y < rows.length; y++) {
  21283. var cells = rows[y].cells;
  21284. for (var x = 0; x < cells.length; x++) {
  21285. if (eq(cells[x], element)) {
  21286. return Optional.some(cellPosition(x, y));
  21287. }
  21288. }
  21289. }
  21290. return Optional.none();
  21291. };
  21292. var extractRows = function (table, sx, sy, ex, ey) {
  21293. var newRows = [];
  21294. var rows = table.rows;
  21295. for (var y = sy; y <= ey; y++) {
  21296. var cells = rows[y].cells;
  21297. var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1);
  21298. newRows.push(tableRow(rows[y].element, slice));
  21299. }
  21300. return newRows;
  21301. };
  21302. var subTable = function (table, startPos, endPos) {
  21303. var sx = startPos.x, sy = startPos.y;
  21304. var ex = endPos.x, ey = endPos.y;
  21305. var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy);
  21306. return tableModel(table.element, getWidth(newRows), newRows);
  21307. };
  21308. var createDomTable = function (table, rows) {
  21309. var tableElement = shallow(table.element);
  21310. var tableBody = SugarElement.fromTag('tbody');
  21311. append(tableBody, rows);
  21312. append$1(tableElement, tableBody);
  21313. return tableElement;
  21314. };
  21315. var modelRowsToDomRows = function (table) {
  21316. return map$3(table.rows, function (row) {
  21317. var cells = map$3(row.cells, function (cell) {
  21318. var td = deep$1(cell);
  21319. remove$6(td, 'colspan');
  21320. remove$6(td, 'rowspan');
  21321. return td;
  21322. });
  21323. var tr = shallow(row.element);
  21324. append(tr, cells);
  21325. return tr;
  21326. });
  21327. };
  21328. var fromDom = function (tableElm) {
  21329. var table = tableModel(shallow(tableElm), 0, []);
  21330. each$k(descendants(tableElm, 'tr'), function (tr, y) {
  21331. each$k(descendants(tr, 'td,th'), function (td, x) {
  21332. fillout(table, skipCellsX(table, x, y), y, tr, td);
  21333. });
  21334. });
  21335. return tableModel(table.element, getWidth(table.rows), table.rows);
  21336. };
  21337. var toDom = function (table) {
  21338. return createDomTable(table, modelRowsToDomRows(table));
  21339. };
  21340. var subsection = function (table, startElement, endElement) {
  21341. return findElementPos(table, startElement).bind(function (startPos) {
  21342. return findElementPos(table, endElement).map(function (endPos) {
  21343. return subTable(table, startPos, endPos);
  21344. });
  21345. });
  21346. };
  21347. var findParentListContainer = function (parents) {
  21348. return find$3(parents, function (elm) {
  21349. return name(elm) === 'ul' || name(elm) === 'ol';
  21350. });
  21351. };
  21352. var getFullySelectedListWrappers = function (parents, rng) {
  21353. return find$3(parents, function (elm) {
  21354. return name(elm) === 'li' && hasAllContentsSelected(elm, rng);
  21355. }).fold(constant([]), function (_li) {
  21356. return findParentListContainer(parents).map(function (listCont) {
  21357. var listElm = SugarElement.fromTag(name(listCont));
  21358. var listStyles = filter$3(getAllRaw(listCont), function (_style, name) {
  21359. return startsWith(name, 'list-style');
  21360. });
  21361. setAll(listElm, listStyles);
  21362. return [
  21363. SugarElement.fromTag('li'),
  21364. listElm
  21365. ];
  21366. }).getOr([]);
  21367. });
  21368. };
  21369. var wrap = function (innerElm, elms) {
  21370. var wrapped = foldl(elms, function (acc, elm) {
  21371. append$1(elm, acc);
  21372. return elm;
  21373. }, innerElm);
  21374. return elms.length > 0 ? fromElements([wrapped]) : wrapped;
  21375. };
  21376. var directListWrappers = function (commonAnchorContainer) {
  21377. if (isListItem(commonAnchorContainer)) {
  21378. return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) {
  21379. return [
  21380. commonAnchorContainer,
  21381. listElm
  21382. ];
  21383. });
  21384. } else {
  21385. return isList(commonAnchorContainer) ? [commonAnchorContainer] : [];
  21386. }
  21387. };
  21388. var getWrapElements = function (rootNode, rng) {
  21389. var commonAnchorContainer = SugarElement.fromDom(rng.commonAncestorContainer);
  21390. var parents = parentsAndSelf(commonAnchorContainer, rootNode);
  21391. var wrapElements = filter$4(parents, function (elm) {
  21392. return isInline$1(elm) || isHeading(elm);
  21393. });
  21394. var listWrappers = getFullySelectedListWrappers(parents, rng);
  21395. var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer));
  21396. return map$3(allWrappers, shallow);
  21397. };
  21398. var emptyFragment = function () {
  21399. return fromElements([]);
  21400. };
  21401. var getFragmentFromRange = function (rootNode, rng) {
  21402. return wrap(SugarElement.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng));
  21403. };
  21404. var getParentTable = function (rootElm, cell) {
  21405. return ancestor$2(cell, 'table', curry(eq, rootElm));
  21406. };
  21407. var getTableFragment = function (rootNode, selectedTableCells) {
  21408. return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) {
  21409. var firstCell = selectedTableCells[0];
  21410. var lastCell = selectedTableCells[selectedTableCells.length - 1];
  21411. var fullTableModel = fromDom(tableElm);
  21412. return subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) {
  21413. return fromElements([toDom(sectionedTableModel)]);
  21414. });
  21415. }).getOrThunk(emptyFragment);
  21416. };
  21417. var getSelectionFragment = function (rootNode, ranges) {
  21418. return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]);
  21419. };
  21420. var read$3 = function (rootNode, ranges) {
  21421. var selectedCells = getCellsFromElementOrRanges(ranges, rootNode);
  21422. return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges);
  21423. };
  21424. var trimLeadingCollapsibleText = function (text) {
  21425. return text.replace(/^[ \f\n\r\t\v]+/, '');
  21426. };
  21427. var isCollapsibleWhitespace = function (text, index) {
  21428. return index >= 0 && index < text.length && isWhiteSpace(text.charAt(index));
  21429. };
  21430. var getInnerText = function (bin, shouldTrim) {
  21431. var text = trim$2(bin.innerText);
  21432. return shouldTrim ? trimLeadingCollapsibleText(text) : text;
  21433. };
  21434. var getContextNodeName = function (parentBlockOpt) {
  21435. return parentBlockOpt.map(function (block) {
  21436. return block.nodeName;
  21437. }).getOr('div').toLowerCase();
  21438. };
  21439. var getTextContent = function (editor) {
  21440. return Optional.from(editor.selection.getRng()).map(function (rng) {
  21441. var parentBlockOpt = Optional.from(editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock));
  21442. var body = editor.getBody();
  21443. var contextNodeName = getContextNodeName(parentBlockOpt);
  21444. var shouldTrimSpaces = Env.browser.isIE() && contextNodeName !== 'pre';
  21445. var bin = editor.dom.add(body, contextNodeName, {
  21446. 'data-mce-bogus': 'all',
  21447. 'style': 'overflow: hidden; opacity: 0;'
  21448. }, rng.cloneContents());
  21449. var text = getInnerText(bin, shouldTrimSpaces);
  21450. var nonRenderedText = trim$2(bin.textContent);
  21451. editor.dom.remove(bin);
  21452. if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) {
  21453. var parentBlock = parentBlockOpt.getOr(body);
  21454. var parentBlockText = getInnerText(parentBlock, shouldTrimSpaces);
  21455. var textIndex = parentBlockText.indexOf(text);
  21456. if (textIndex === -1) {
  21457. return text;
  21458. } else {
  21459. var hasProceedingSpace = isCollapsibleWhitespace(parentBlockText, textIndex - 1);
  21460. var hasTrailingSpace = isCollapsibleWhitespace(parentBlockText, textIndex + text.length);
  21461. return (hasProceedingSpace ? ' ' : '') + text + (hasTrailingSpace ? ' ' : '');
  21462. }
  21463. } else {
  21464. return text;
  21465. }
  21466. }).getOr('');
  21467. };
  21468. var getSerializedContent = function (editor, args) {
  21469. var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body');
  21470. var sel = editor.selection.getSel();
  21471. var ranges = processRanges(editor, getRanges(sel));
  21472. var fragment = args.contextual ? read$3(SugarElement.fromDom(editor.getBody()), ranges).dom : rng.cloneContents();
  21473. if (fragment) {
  21474. tmpElm.appendChild(fragment);
  21475. }
  21476. return editor.selection.serializer.serialize(tmpElm, args);
  21477. };
  21478. var setupArgs$1 = function (args, format) {
  21479. return __assign(__assign({}, args), {
  21480. format: format,
  21481. get: true,
  21482. selection: true
  21483. });
  21484. };
  21485. var getSelectedContentInternal = function (editor, format, args) {
  21486. if (args === void 0) {
  21487. args = {};
  21488. }
  21489. var defaultedArgs = setupArgs$1(args, format);
  21490. var updatedArgs = editor.fire('BeforeGetContent', defaultedArgs);
  21491. if (updatedArgs.isDefaultPrevented()) {
  21492. editor.fire('GetContent', updatedArgs);
  21493. return updatedArgs.content;
  21494. }
  21495. if (updatedArgs.format === 'text') {
  21496. return getTextContent(editor);
  21497. } else {
  21498. updatedArgs.getInner = true;
  21499. var content = getSerializedContent(editor, updatedArgs);
  21500. if (updatedArgs.format === 'tree') {
  21501. return content;
  21502. } else {
  21503. updatedArgs.content = editor.selection.isCollapsed() ? '' : content;
  21504. editor.fire('GetContent', updatedArgs);
  21505. return updatedArgs.content;
  21506. }
  21507. }
  21508. };
  21509. var KEEP = 0, INSERT = 1, DELETE = 2;
  21510. var diff = function (left, right) {
  21511. var size = left.length + right.length + 2;
  21512. var vDown = new Array(size);
  21513. var vUp = new Array(size);
  21514. var snake = function (start, end, diag) {
  21515. return {
  21516. start: start,
  21517. end: end,
  21518. diag: diag
  21519. };
  21520. };
  21521. var buildScript = function (start1, end1, start2, end2, script) {
  21522. var middle = getMiddleSnake(start1, end1, start2, end2);
  21523. if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) {
  21524. var i = start1;
  21525. var j = start2;
  21526. while (i < end1 || j < end2) {
  21527. if (i < end1 && j < end2 && left[i] === right[j]) {
  21528. script.push([
  21529. KEEP,
  21530. left[i]
  21531. ]);
  21532. ++i;
  21533. ++j;
  21534. } else {
  21535. if (end1 - start1 > end2 - start2) {
  21536. script.push([
  21537. DELETE,
  21538. left[i]
  21539. ]);
  21540. ++i;
  21541. } else {
  21542. script.push([
  21543. INSERT,
  21544. right[j]
  21545. ]);
  21546. ++j;
  21547. }
  21548. }
  21549. }
  21550. } else {
  21551. buildScript(start1, middle.start, start2, middle.start - middle.diag, script);
  21552. for (var i2 = middle.start; i2 < middle.end; ++i2) {
  21553. script.push([
  21554. KEEP,
  21555. left[i2]
  21556. ]);
  21557. }
  21558. buildScript(middle.end, end1, middle.end - middle.diag, end2, script);
  21559. }
  21560. };
  21561. var buildSnake = function (start, diag, end1, end2) {
  21562. var end = start;
  21563. while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) {
  21564. ++end;
  21565. }
  21566. return snake(start, end, diag);
  21567. };
  21568. var getMiddleSnake = function (start1, end1, start2, end2) {
  21569. var m = end1 - start1;
  21570. var n = end2 - start2;
  21571. if (m === 0 || n === 0) {
  21572. return null;
  21573. }
  21574. var delta = m - n;
  21575. var sum = n + m;
  21576. var offset = (sum % 2 === 0 ? sum : sum + 1) / 2;
  21577. vDown[1 + offset] = start1;
  21578. vUp[1 + offset] = end1 + 1;
  21579. var d, k, i, x, y;
  21580. for (d = 0; d <= offset; ++d) {
  21581. for (k = -d; k <= d; k += 2) {
  21582. i = k + offset;
  21583. if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) {
  21584. vDown[i] = vDown[i + 1];
  21585. } else {
  21586. vDown[i] = vDown[i - 1] + 1;
  21587. }
  21588. x = vDown[i];
  21589. y = x - start1 + start2 - k;
  21590. while (x < end1 && y < end2 && left[x] === right[y]) {
  21591. vDown[i] = ++x;
  21592. ++y;
  21593. }
  21594. if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) {
  21595. if (vUp[i - delta] <= vDown[i]) {
  21596. return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2);
  21597. }
  21598. }
  21599. }
  21600. for (k = delta - d; k <= delta + d; k += 2) {
  21601. i = k + offset - delta;
  21602. if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) {
  21603. vUp[i] = vUp[i + 1] - 1;
  21604. } else {
  21605. vUp[i] = vUp[i - 1];
  21606. }
  21607. x = vUp[i] - 1;
  21608. y = x - start1 + start2 - k;
  21609. while (x >= start1 && y >= start2 && left[x] === right[y]) {
  21610. vUp[i] = x--;
  21611. y--;
  21612. }
  21613. if (delta % 2 === 0 && -d <= k && k <= d) {
  21614. if (vUp[i] <= vDown[i + delta]) {
  21615. return buildSnake(vUp[i], k + start1 - start2, end1, end2);
  21616. }
  21617. }
  21618. }
  21619. }
  21620. };
  21621. var script = [];
  21622. buildScript(0, left.length, 0, right.length, script);
  21623. return script;
  21624. };
  21625. var getOuterHtml = function (elm) {
  21626. if (isElement$5(elm)) {
  21627. return elm.outerHTML;
  21628. } else if (isText$7(elm)) {
  21629. return Entities.encodeRaw(elm.data, false);
  21630. } else if (isComment(elm)) {
  21631. return '<!--' + elm.data + '-->';
  21632. }
  21633. return '';
  21634. };
  21635. var createFragment = function (html) {
  21636. var node;
  21637. var container = document.createElement('div');
  21638. var frag = document.createDocumentFragment();
  21639. if (html) {
  21640. container.innerHTML = html;
  21641. }
  21642. while (node = container.firstChild) {
  21643. frag.appendChild(node);
  21644. }
  21645. return frag;
  21646. };
  21647. var insertAt = function (elm, html, index) {
  21648. var fragment = createFragment(html);
  21649. if (elm.hasChildNodes() && index < elm.childNodes.length) {
  21650. var target = elm.childNodes[index];
  21651. target.parentNode.insertBefore(fragment, target);
  21652. } else {
  21653. elm.appendChild(fragment);
  21654. }
  21655. };
  21656. var removeAt = function (elm, index) {
  21657. if (elm.hasChildNodes() && index < elm.childNodes.length) {
  21658. var target = elm.childNodes[index];
  21659. target.parentNode.removeChild(target);
  21660. }
  21661. };
  21662. var applyDiff = function (diff, elm) {
  21663. var index = 0;
  21664. each$k(diff, function (action) {
  21665. if (action[0] === KEEP) {
  21666. index++;
  21667. } else if (action[0] === INSERT) {
  21668. insertAt(elm, action[1], index);
  21669. index++;
  21670. } else if (action[0] === DELETE) {
  21671. removeAt(elm, index);
  21672. }
  21673. });
  21674. };
  21675. var read$2 = function (elm) {
  21676. return filter$4(map$3(from(elm.childNodes), getOuterHtml), function (item) {
  21677. return item.length > 0;
  21678. });
  21679. };
  21680. var write = function (fragments, elm) {
  21681. var currentFragments = map$3(from(elm.childNodes), getOuterHtml);
  21682. applyDiff(diff(currentFragments, fragments), elm);
  21683. return elm;
  21684. };
  21685. var lazyTempDocument = cached(function () {
  21686. return document.implementation.createHTMLDocument('undo');
  21687. });
  21688. var hasIframes = function (html) {
  21689. return html.indexOf('</iframe>') !== -1;
  21690. };
  21691. var createFragmentedLevel = function (fragments) {
  21692. return {
  21693. type: 'fragmented',
  21694. fragments: fragments,
  21695. content: '',
  21696. bookmark: null,
  21697. beforeBookmark: null
  21698. };
  21699. };
  21700. var createCompleteLevel = function (content) {
  21701. return {
  21702. type: 'complete',
  21703. fragments: null,
  21704. content: content,
  21705. bookmark: null,
  21706. beforeBookmark: null
  21707. };
  21708. };
  21709. var createFromEditor = function (editor) {
  21710. var fragments = read$2(editor.getBody());
  21711. var trimmedFragments = bind(fragments, function (html) {
  21712. var trimmed = trimInternal(editor.serializer, html);
  21713. return trimmed.length > 0 ? [trimmed] : [];
  21714. });
  21715. var content = trimmedFragments.join('');
  21716. return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
  21717. };
  21718. var applyToEditor = function (editor, level, before) {
  21719. var bookmark = before ? level.beforeBookmark : level.bookmark;
  21720. if (level.type === 'fragmented') {
  21721. write(level.fragments, editor.getBody());
  21722. } else {
  21723. editor.setContent(level.content, {
  21724. format: 'raw',
  21725. no_selection: isNonNullable(bookmark) && isPathBookmark(bookmark) ? !bookmark.isFakeCaret : true
  21726. });
  21727. }
  21728. editor.selection.moveToBookmark(bookmark);
  21729. };
  21730. var getLevelContent = function (level) {
  21731. return level.type === 'fragmented' ? level.fragments.join('') : level.content;
  21732. };
  21733. var getCleanLevelContent = function (level) {
  21734. var elm = SugarElement.fromTag('body', lazyTempDocument());
  21735. set(elm, getLevelContent(level));
  21736. each$k(descendants(elm, '*[data-mce-bogus]'), unwrap);
  21737. return get$3(elm);
  21738. };
  21739. var hasEqualContent = function (level1, level2) {
  21740. return getLevelContent(level1) === getLevelContent(level2);
  21741. };
  21742. var hasEqualCleanedContent = function (level1, level2) {
  21743. return getCleanLevelContent(level1) === getCleanLevelContent(level2);
  21744. };
  21745. var isEq$1 = function (level1, level2) {
  21746. if (!level1 || !level2) {
  21747. return false;
  21748. } else if (hasEqualContent(level1, level2)) {
  21749. return true;
  21750. } else {
  21751. return hasEqualCleanedContent(level1, level2);
  21752. }
  21753. };
  21754. var isUnlocked = function (locks) {
  21755. return locks.get() === 0;
  21756. };
  21757. var setTyping = function (undoManager, typing, locks) {
  21758. if (isUnlocked(locks)) {
  21759. undoManager.typing = typing;
  21760. }
  21761. };
  21762. var endTyping = function (undoManager, locks) {
  21763. if (undoManager.typing) {
  21764. setTyping(undoManager, false, locks);
  21765. undoManager.add();
  21766. }
  21767. };
  21768. var endTypingLevelIgnoreLocks = function (undoManager) {
  21769. if (undoManager.typing) {
  21770. undoManager.typing = false;
  21771. undoManager.add();
  21772. }
  21773. };
  21774. var beforeChange$1 = function (editor, locks, beforeBookmark) {
  21775. if (isUnlocked(locks)) {
  21776. beforeBookmark.set(getUndoBookmark(editor.selection));
  21777. }
  21778. };
  21779. var addUndoLevel$1 = function (editor, undoManager, index, locks, beforeBookmark, level, event) {
  21780. var currentLevel = createFromEditor(editor);
  21781. level = level || {};
  21782. level = Tools.extend(level, currentLevel);
  21783. if (isUnlocked(locks) === false || editor.removed) {
  21784. return null;
  21785. }
  21786. var lastLevel = undoManager.data[index.get()];
  21787. if (editor.fire('BeforeAddUndo', {
  21788. level: level,
  21789. lastLevel: lastLevel,
  21790. originalEvent: event
  21791. }).isDefaultPrevented()) {
  21792. return null;
  21793. }
  21794. if (lastLevel && isEq$1(lastLevel, level)) {
  21795. return null;
  21796. }
  21797. if (undoManager.data[index.get()]) {
  21798. beforeBookmark.get().each(function (bm) {
  21799. undoManager.data[index.get()].beforeBookmark = bm;
  21800. });
  21801. }
  21802. var customUndoRedoLevels = getCustomUndoRedoLevels(editor);
  21803. if (customUndoRedoLevels) {
  21804. if (undoManager.data.length > customUndoRedoLevels) {
  21805. for (var i = 0; i < undoManager.data.length - 1; i++) {
  21806. undoManager.data[i] = undoManager.data[i + 1];
  21807. }
  21808. undoManager.data.length--;
  21809. index.set(undoManager.data.length);
  21810. }
  21811. }
  21812. level.bookmark = getUndoBookmark(editor.selection);
  21813. if (index.get() < undoManager.data.length - 1) {
  21814. undoManager.data.length = index.get() + 1;
  21815. }
  21816. undoManager.data.push(level);
  21817. index.set(undoManager.data.length - 1);
  21818. var args = {
  21819. level: level,
  21820. lastLevel: lastLevel,
  21821. originalEvent: event
  21822. };
  21823. if (index.get() > 0) {
  21824. editor.setDirty(true);
  21825. editor.fire('AddUndo', args);
  21826. editor.fire('change', args);
  21827. } else {
  21828. editor.fire('AddUndo', args);
  21829. }
  21830. return level;
  21831. };
  21832. var clear$1 = function (editor, undoManager, index) {
  21833. undoManager.data = [];
  21834. index.set(0);
  21835. undoManager.typing = false;
  21836. editor.fire('ClearUndos');
  21837. };
  21838. var extra$1 = function (editor, undoManager, index, callback1, callback2) {
  21839. if (undoManager.transact(callback1)) {
  21840. var bookmark = undoManager.data[index.get()].bookmark;
  21841. var lastLevel = undoManager.data[index.get() - 1];
  21842. applyToEditor(editor, lastLevel, true);
  21843. if (undoManager.transact(callback2)) {
  21844. undoManager.data[index.get() - 1].beforeBookmark = bookmark;
  21845. }
  21846. }
  21847. };
  21848. var redo$1 = function (editor, index, data) {
  21849. var level;
  21850. if (index.get() < data.length - 1) {
  21851. index.set(index.get() + 1);
  21852. level = data[index.get()];
  21853. applyToEditor(editor, level, false);
  21854. editor.setDirty(true);
  21855. editor.fire('Redo', { level: level });
  21856. }
  21857. return level;
  21858. };
  21859. var undo$1 = function (editor, undoManager, locks, index) {
  21860. var level;
  21861. if (undoManager.typing) {
  21862. undoManager.add();
  21863. undoManager.typing = false;
  21864. setTyping(undoManager, false, locks);
  21865. }
  21866. if (index.get() > 0) {
  21867. index.set(index.get() - 1);
  21868. level = undoManager.data[index.get()];
  21869. applyToEditor(editor, level, true);
  21870. editor.setDirty(true);
  21871. editor.fire('Undo', { level: level });
  21872. }
  21873. return level;
  21874. };
  21875. var reset$1 = function (undoManager) {
  21876. undoManager.clear();
  21877. undoManager.add();
  21878. };
  21879. var hasUndo$1 = function (editor, undoManager, index) {
  21880. return index.get() > 0 || undoManager.typing && undoManager.data[0] && !isEq$1(createFromEditor(editor), undoManager.data[0]);
  21881. };
  21882. var hasRedo$1 = function (undoManager, index) {
  21883. return index.get() < undoManager.data.length - 1 && !undoManager.typing;
  21884. };
  21885. var transact$1 = function (undoManager, locks, callback) {
  21886. endTyping(undoManager, locks);
  21887. undoManager.beforeChange();
  21888. undoManager.ignore(callback);
  21889. return undoManager.add();
  21890. };
  21891. var ignore$1 = function (locks, callback) {
  21892. try {
  21893. locks.set(locks.get() + 1);
  21894. callback();
  21895. } finally {
  21896. locks.set(locks.get() - 1);
  21897. }
  21898. };
  21899. var addVisualInternal = function (editor, elm) {
  21900. var dom = editor.dom;
  21901. var scope = isNonNullable(elm) ? elm : editor.getBody();
  21902. if (isUndefined(editor.hasVisual)) {
  21903. editor.hasVisual = isVisualAidsEnabled(editor);
  21904. }
  21905. each$k(dom.select('table,a', scope), function (matchedElm) {
  21906. switch (matchedElm.nodeName) {
  21907. case 'TABLE':
  21908. var cls = getVisualAidsTableClass(editor);
  21909. var value = dom.getAttrib(matchedElm, 'border');
  21910. if ((!value || value === '0') && editor.hasVisual) {
  21911. dom.addClass(matchedElm, cls);
  21912. } else {
  21913. dom.removeClass(matchedElm, cls);
  21914. }
  21915. break;
  21916. case 'A':
  21917. if (!dom.getAttrib(matchedElm, 'href')) {
  21918. var value_1 = dom.getAttrib(matchedElm, 'name') || matchedElm.id;
  21919. var cls_1 = getVisualAidsAnchorClass(editor);
  21920. if (value_1 && editor.hasVisual) {
  21921. dom.addClass(matchedElm, cls_1);
  21922. } else {
  21923. dom.removeClass(matchedElm, cls_1);
  21924. }
  21925. }
  21926. break;
  21927. }
  21928. });
  21929. editor.fire('VisualAid', {
  21930. element: elm,
  21931. hasVisual: editor.hasVisual
  21932. });
  21933. };
  21934. var makePlainAdaptor = function (editor) {
  21935. return {
  21936. undoManager: {
  21937. beforeChange: function (locks, beforeBookmark) {
  21938. return beforeChange$1(editor, locks, beforeBookmark);
  21939. },
  21940. add: function (undoManager, index, locks, beforeBookmark, level, event) {
  21941. return addUndoLevel$1(editor, undoManager, index, locks, beforeBookmark, level, event);
  21942. },
  21943. undo: function (undoManager, locks, index) {
  21944. return undo$1(editor, undoManager, locks, index);
  21945. },
  21946. redo: function (index, data) {
  21947. return redo$1(editor, index, data);
  21948. },
  21949. clear: function (undoManager, index) {
  21950. return clear$1(editor, undoManager, index);
  21951. },
  21952. reset: function (undoManager) {
  21953. return reset$1(undoManager);
  21954. },
  21955. hasUndo: function (undoManager, index) {
  21956. return hasUndo$1(editor, undoManager, index);
  21957. },
  21958. hasRedo: function (undoManager, index) {
  21959. return hasRedo$1(undoManager, index);
  21960. },
  21961. transact: function (undoManager, locks, callback) {
  21962. return transact$1(undoManager, locks, callback);
  21963. },
  21964. ignore: function (locks, callback) {
  21965. return ignore$1(locks, callback);
  21966. },
  21967. extra: function (undoManager, index, callback1, callback2) {
  21968. return extra$1(editor, undoManager, index, callback1, callback2);
  21969. }
  21970. },
  21971. formatter: {
  21972. match: function (name, vars, node, similar) {
  21973. return match$2(editor, name, vars, node, similar);
  21974. },
  21975. matchAll: function (names, vars) {
  21976. return matchAll(editor, names, vars);
  21977. },
  21978. matchNode: function (node, name, vars, similar) {
  21979. return matchNode(editor, node, name, vars, similar);
  21980. },
  21981. canApply: function (name) {
  21982. return canApply(editor, name);
  21983. },
  21984. closest: function (names) {
  21985. return closest(editor, names);
  21986. },
  21987. apply: function (name, vars, node) {
  21988. return applyFormat$1(editor, name, vars, node);
  21989. },
  21990. remove: function (name, vars, node, similar) {
  21991. return remove$1(editor, name, vars, node, similar);
  21992. },
  21993. toggle: function (name, vars, node) {
  21994. return toggle(editor, name, vars, node);
  21995. },
  21996. formatChanged: function (registeredFormatListeners, formats, callback, similar, vars) {
  21997. return formatChangedInternal(editor, registeredFormatListeners, formats, callback, similar, vars);
  21998. }
  21999. },
  22000. editor: {
  22001. getContent: function (args, format) {
  22002. return getContentInternal(editor, args, format);
  22003. },
  22004. setContent: function (content, args) {
  22005. return setContentInternal(editor, content, args);
  22006. },
  22007. insertContent: function (value, details) {
  22008. return insertHtmlAtCaret(editor, value, details);
  22009. },
  22010. addVisual: function (elm) {
  22011. return addVisualInternal(editor, elm);
  22012. }
  22013. },
  22014. selection: {
  22015. getContent: function (format, args) {
  22016. return getSelectedContentInternal(editor, format, args);
  22017. }
  22018. },
  22019. raw: {
  22020. getModel: function () {
  22021. return Optional.none();
  22022. }
  22023. }
  22024. };
  22025. };
  22026. var makeRtcAdaptor = function (rtcEditor) {
  22027. var defaultVars = function (vars) {
  22028. return isObject(vars) ? vars : {};
  22029. };
  22030. var undoManager = rtcEditor.undoManager, formatter = rtcEditor.formatter, editor = rtcEditor.editor, selection = rtcEditor.selection, raw = rtcEditor.raw;
  22031. return {
  22032. undoManager: {
  22033. beforeChange: undoManager.beforeChange,
  22034. add: undoManager.add,
  22035. undo: undoManager.undo,
  22036. redo: undoManager.redo,
  22037. clear: undoManager.clear,
  22038. reset: undoManager.reset,
  22039. hasUndo: undoManager.hasUndo,
  22040. hasRedo: undoManager.hasRedo,
  22041. transact: function (_undoManager, _locks, fn) {
  22042. return undoManager.transact(fn);
  22043. },
  22044. ignore: function (_locks, callback) {
  22045. return undoManager.ignore(callback);
  22046. },
  22047. extra: function (_undoManager, _index, callback1, callback2) {
  22048. return undoManager.extra(callback1, callback2);
  22049. }
  22050. },
  22051. formatter: {
  22052. match: function (name, vars, _node, similar) {
  22053. return formatter.match(name, defaultVars(vars), similar);
  22054. },
  22055. matchAll: formatter.matchAll,
  22056. matchNode: formatter.matchNode,
  22057. canApply: function (name) {
  22058. return formatter.canApply(name);
  22059. },
  22060. closest: function (names) {
  22061. return formatter.closest(names);
  22062. },
  22063. apply: function (name, vars, _node) {
  22064. return formatter.apply(name, defaultVars(vars));
  22065. },
  22066. remove: function (name, vars, _node, _similar) {
  22067. return formatter.remove(name, defaultVars(vars));
  22068. },
  22069. toggle: function (name, vars, _node) {
  22070. return formatter.toggle(name, defaultVars(vars));
  22071. },
  22072. formatChanged: function (_rfl, formats, callback, similar, vars) {
  22073. return formatter.formatChanged(formats, callback, similar, vars);
  22074. }
  22075. },
  22076. editor: {
  22077. getContent: function (args, _format) {
  22078. return editor.getContent(args);
  22079. },
  22080. setContent: function (content, args) {
  22081. return editor.setContent(content, args);
  22082. },
  22083. insertContent: function (content, _details) {
  22084. return editor.insertContent(content);
  22085. },
  22086. addVisual: editor.addVisual
  22087. },
  22088. selection: {
  22089. getContent: function (_format, args) {
  22090. return selection.getContent(args);
  22091. }
  22092. },
  22093. raw: {
  22094. getModel: function () {
  22095. return Optional.some(raw.getRawModel());
  22096. }
  22097. }
  22098. };
  22099. };
  22100. var makeNoopAdaptor = function () {
  22101. var nul = constant(null);
  22102. var empty = constant('');
  22103. return {
  22104. undoManager: {
  22105. beforeChange: noop,
  22106. add: nul,
  22107. undo: nul,
  22108. redo: nul,
  22109. clear: noop,
  22110. reset: noop,
  22111. hasUndo: never,
  22112. hasRedo: never,
  22113. transact: nul,
  22114. ignore: noop,
  22115. extra: noop
  22116. },
  22117. formatter: {
  22118. match: never,
  22119. matchAll: constant([]),
  22120. matchNode: constant(undefined),
  22121. canApply: never,
  22122. closest: empty,
  22123. apply: noop,
  22124. remove: noop,
  22125. toggle: noop,
  22126. formatChanged: constant({ unbind: noop })
  22127. },
  22128. editor: {
  22129. getContent: empty,
  22130. setContent: empty,
  22131. insertContent: noop,
  22132. addVisual: noop
  22133. },
  22134. selection: { getContent: empty },
  22135. raw: { getModel: constant(Optional.none()) }
  22136. };
  22137. };
  22138. var isRtc = function (editor) {
  22139. return has$2(editor.plugins, 'rtc');
  22140. };
  22141. var getRtcSetup = function (editor) {
  22142. return get$9(editor.plugins, 'rtc').bind(function (rtcPlugin) {
  22143. return Optional.from(rtcPlugin.setup);
  22144. });
  22145. };
  22146. var setup$i = function (editor) {
  22147. var editorCast = editor;
  22148. return getRtcSetup(editor).fold(function () {
  22149. editorCast.rtcInstance = makePlainAdaptor(editor);
  22150. return Optional.none();
  22151. }, function (setup) {
  22152. editorCast.rtcInstance = makeNoopAdaptor();
  22153. return Optional.some(function () {
  22154. return setup().then(function (rtcEditor) {
  22155. editorCast.rtcInstance = makeRtcAdaptor(rtcEditor);
  22156. return rtcEditor.rtc.isRemote;
  22157. });
  22158. });
  22159. });
  22160. };
  22161. var getRtcInstanceWithFallback = function (editor) {
  22162. return editor.rtcInstance ? editor.rtcInstance : makePlainAdaptor(editor);
  22163. };
  22164. var getRtcInstanceWithError = function (editor) {
  22165. var rtcInstance = editor.rtcInstance;
  22166. if (!rtcInstance) {
  22167. throw new Error('Failed to get RTC instance not yet initialized.');
  22168. } else {
  22169. return rtcInstance;
  22170. }
  22171. };
  22172. var beforeChange = function (editor, locks, beforeBookmark) {
  22173. getRtcInstanceWithError(editor).undoManager.beforeChange(locks, beforeBookmark);
  22174. };
  22175. var addUndoLevel = function (editor, undoManager, index, locks, beforeBookmark, level, event) {
  22176. return getRtcInstanceWithError(editor).undoManager.add(undoManager, index, locks, beforeBookmark, level, event);
  22177. };
  22178. var undo = function (editor, undoManager, locks, index) {
  22179. return getRtcInstanceWithError(editor).undoManager.undo(undoManager, locks, index);
  22180. };
  22181. var redo = function (editor, index, data) {
  22182. return getRtcInstanceWithError(editor).undoManager.redo(index, data);
  22183. };
  22184. var clear = function (editor, undoManager, index) {
  22185. getRtcInstanceWithError(editor).undoManager.clear(undoManager, index);
  22186. };
  22187. var reset = function (editor, undoManager) {
  22188. getRtcInstanceWithError(editor).undoManager.reset(undoManager);
  22189. };
  22190. var hasUndo = function (editor, undoManager, index) {
  22191. return getRtcInstanceWithError(editor).undoManager.hasUndo(undoManager, index);
  22192. };
  22193. var hasRedo = function (editor, undoManager, index) {
  22194. return getRtcInstanceWithError(editor).undoManager.hasRedo(undoManager, index);
  22195. };
  22196. var transact = function (editor, undoManager, locks, callback) {
  22197. return getRtcInstanceWithError(editor).undoManager.transact(undoManager, locks, callback);
  22198. };
  22199. var ignore = function (editor, locks, callback) {
  22200. getRtcInstanceWithError(editor).undoManager.ignore(locks, callback);
  22201. };
  22202. var extra = function (editor, undoManager, index, callback1, callback2) {
  22203. getRtcInstanceWithError(editor).undoManager.extra(undoManager, index, callback1, callback2);
  22204. };
  22205. var matchFormat = function (editor, name, vars, node, similar) {
  22206. return getRtcInstanceWithError(editor).formatter.match(name, vars, node, similar);
  22207. };
  22208. var matchAllFormats = function (editor, names, vars) {
  22209. return getRtcInstanceWithError(editor).formatter.matchAll(names, vars);
  22210. };
  22211. var matchNodeFormat = function (editor, node, name, vars, similar) {
  22212. return getRtcInstanceWithError(editor).formatter.matchNode(node, name, vars, similar);
  22213. };
  22214. var canApplyFormat = function (editor, name) {
  22215. return getRtcInstanceWithError(editor).formatter.canApply(name);
  22216. };
  22217. var closestFormat = function (editor, names) {
  22218. return getRtcInstanceWithError(editor).formatter.closest(names);
  22219. };
  22220. var applyFormat = function (editor, name, vars, node) {
  22221. getRtcInstanceWithError(editor).formatter.apply(name, vars, node);
  22222. };
  22223. var removeFormat = function (editor, name, vars, node, similar) {
  22224. getRtcInstanceWithError(editor).formatter.remove(name, vars, node, similar);
  22225. };
  22226. var toggleFormat = function (editor, name, vars, node) {
  22227. getRtcInstanceWithError(editor).formatter.toggle(name, vars, node);
  22228. };
  22229. var formatChanged = function (editor, registeredFormatListeners, formats, callback, similar, vars) {
  22230. return getRtcInstanceWithError(editor).formatter.formatChanged(registeredFormatListeners, formats, callback, similar, vars);
  22231. };
  22232. var getContent$2 = function (editor, args, format) {
  22233. return getRtcInstanceWithFallback(editor).editor.getContent(args, format);
  22234. };
  22235. var setContent$2 = function (editor, content, args) {
  22236. return getRtcInstanceWithFallback(editor).editor.setContent(content, args);
  22237. };
  22238. var insertContent = function (editor, value, details) {
  22239. return getRtcInstanceWithFallback(editor).editor.insertContent(value, details);
  22240. };
  22241. var getSelectedContent = function (editor, format, args) {
  22242. return getRtcInstanceWithError(editor).selection.getContent(format, args);
  22243. };
  22244. var addVisual$1 = function (editor, elm) {
  22245. return getRtcInstanceWithError(editor).editor.addVisual(elm);
  22246. };
  22247. var getContent$1 = function (editor, args) {
  22248. if (args === void 0) {
  22249. args = {};
  22250. }
  22251. var format = args.format ? args.format : 'html';
  22252. return getSelectedContent(editor, format, args);
  22253. };
  22254. var removeEmpty = function (text) {
  22255. if (text.dom.length === 0) {
  22256. remove$7(text);
  22257. return Optional.none();
  22258. } else {
  22259. return Optional.some(text);
  22260. }
  22261. };
  22262. var walkPastBookmark = function (node, start) {
  22263. return node.filter(function (elm) {
  22264. return BookmarkManager.isBookmarkNode(elm.dom);
  22265. }).bind(start ? nextSibling : prevSibling);
  22266. };
  22267. var merge = function (outer, inner, rng, start) {
  22268. var outerElm = outer.dom;
  22269. var innerElm = inner.dom;
  22270. var oldLength = start ? outerElm.length : innerElm.length;
  22271. if (start) {
  22272. mergeTextNodes(outerElm, innerElm, false, !start);
  22273. rng.setStart(innerElm, oldLength);
  22274. } else {
  22275. mergeTextNodes(innerElm, outerElm, false, !start);
  22276. rng.setEnd(innerElm, oldLength);
  22277. }
  22278. };
  22279. var normalizeTextIfRequired = function (inner, start) {
  22280. parent(inner).each(function (root) {
  22281. var text = inner.dom;
  22282. if (start && needsToBeNbspLeft(root, CaretPosition(text, 0))) {
  22283. normalizeWhitespaceAfter(text, 0);
  22284. } else if (!start && needsToBeNbspRight(root, CaretPosition(text, text.length))) {
  22285. normalizeWhitespaceBefore(text, text.length);
  22286. }
  22287. });
  22288. };
  22289. var mergeAndNormalizeText = function (outerNode, innerNode, rng, start) {
  22290. outerNode.bind(function (outer) {
  22291. var normalizer = start ? normalizeWhitespaceBefore : normalizeWhitespaceAfter;
  22292. normalizer(outer.dom, start ? outer.dom.length : 0);
  22293. return innerNode.filter(isText$8).map(function (inner) {
  22294. return merge(outer, inner, rng, start);
  22295. });
  22296. }).orThunk(function () {
  22297. var innerTextNode = walkPastBookmark(innerNode, start).or(innerNode).filter(isText$8);
  22298. return innerTextNode.map(function (inner) {
  22299. return normalizeTextIfRequired(inner, start);
  22300. });
  22301. });
  22302. };
  22303. var rngSetContent = function (rng, fragment) {
  22304. var firstChild = Optional.from(fragment.firstChild).map(SugarElement.fromDom);
  22305. var lastChild = Optional.from(fragment.lastChild).map(SugarElement.fromDom);
  22306. rng.deleteContents();
  22307. rng.insertNode(fragment);
  22308. var prevText = firstChild.bind(prevSibling).filter(isText$8).bind(removeEmpty);
  22309. var nextText = lastChild.bind(nextSibling).filter(isText$8).bind(removeEmpty);
  22310. mergeAndNormalizeText(prevText, firstChild, rng, true);
  22311. mergeAndNormalizeText(nextText, lastChild, rng, false);
  22312. rng.collapse(false);
  22313. };
  22314. var setupArgs = function (args, content) {
  22315. return __assign(__assign({ format: 'html' }, args), {
  22316. set: true,
  22317. selection: true,
  22318. content: content
  22319. });
  22320. };
  22321. var cleanContent = function (editor, args) {
  22322. if (args.format !== 'raw') {
  22323. var rng = editor.selection.getRng();
  22324. var contextBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock);
  22325. var contextArgs = contextBlock ? { context: contextBlock.nodeName.toLowerCase() } : {};
  22326. var node = editor.parser.parse(args.content, __assign(__assign({
  22327. isRootContent: true,
  22328. forced_root_block: false
  22329. }, contextArgs), args));
  22330. return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node);
  22331. } else {
  22332. return args.content;
  22333. }
  22334. };
  22335. var setContent$1 = function (editor, content, args) {
  22336. if (args === void 0) {
  22337. args = {};
  22338. }
  22339. var defaultedArgs = setupArgs(args, content);
  22340. var updatedArgs = defaultedArgs;
  22341. if (!defaultedArgs.no_events) {
  22342. var eventArgs = editor.fire('BeforeSetContent', defaultedArgs);
  22343. if (eventArgs.isDefaultPrevented()) {
  22344. editor.fire('SetContent', eventArgs);
  22345. return;
  22346. } else {
  22347. updatedArgs = eventArgs;
  22348. }
  22349. }
  22350. updatedArgs.content = cleanContent(editor, updatedArgs);
  22351. var rng = editor.selection.getRng();
  22352. rngSetContent(rng, rng.createContextualFragment(updatedArgs.content));
  22353. editor.selection.setRng(rng);
  22354. scrollRangeIntoView(editor, rng);
  22355. if (!updatedArgs.no_events) {
  22356. editor.fire('SetContent', updatedArgs);
  22357. }
  22358. };
  22359. var deleteFromCallbackMap = function (callbackMap, selector, callback) {
  22360. if (callbackMap && has$2(callbackMap, selector)) {
  22361. var newCallbacks = filter$4(callbackMap[selector], function (cb) {
  22362. return cb !== callback;
  22363. });
  22364. if (newCallbacks.length === 0) {
  22365. delete callbackMap[selector];
  22366. } else {
  22367. callbackMap[selector] = newCallbacks;
  22368. }
  22369. }
  22370. };
  22371. function SelectorChanged (dom, editor) {
  22372. var selectorChangedData;
  22373. var currentSelectors;
  22374. var findMatchingNode = function (selector, nodes) {
  22375. return find$3(nodes, function (node) {
  22376. return dom.is(node, selector);
  22377. });
  22378. };
  22379. var getParents = function (elem) {
  22380. return dom.getParents(elem, null, dom.getRoot());
  22381. };
  22382. return {
  22383. selectorChangedWithUnbind: function (selector, callback) {
  22384. if (!selectorChangedData) {
  22385. selectorChangedData = {};
  22386. currentSelectors = {};
  22387. editor.on('NodeChange', function (e) {
  22388. var node = e.element;
  22389. var parents = getParents(node);
  22390. var matchedSelectors = {};
  22391. Tools.each(selectorChangedData, function (callbacks, selector) {
  22392. findMatchingNode(selector, parents).each(function (node) {
  22393. if (!currentSelectors[selector]) {
  22394. each$k(callbacks, function (callback) {
  22395. callback(true, {
  22396. node: node,
  22397. selector: selector,
  22398. parents: parents
  22399. });
  22400. });
  22401. currentSelectors[selector] = callbacks;
  22402. }
  22403. matchedSelectors[selector] = callbacks;
  22404. });
  22405. });
  22406. Tools.each(currentSelectors, function (callbacks, selector) {
  22407. if (!matchedSelectors[selector]) {
  22408. delete currentSelectors[selector];
  22409. Tools.each(callbacks, function (callback) {
  22410. callback(false, {
  22411. node: node,
  22412. selector: selector,
  22413. parents: parents
  22414. });
  22415. });
  22416. }
  22417. });
  22418. });
  22419. }
  22420. if (!selectorChangedData[selector]) {
  22421. selectorChangedData[selector] = [];
  22422. }
  22423. selectorChangedData[selector].push(callback);
  22424. findMatchingNode(selector, getParents(editor.selection.getStart())).each(function () {
  22425. currentSelectors[selector] = selectorChangedData[selector];
  22426. });
  22427. return {
  22428. unbind: function () {
  22429. deleteFromCallbackMap(selectorChangedData, selector, callback);
  22430. deleteFromCallbackMap(currentSelectors, selector, callback);
  22431. }
  22432. };
  22433. }
  22434. };
  22435. }
  22436. var isNativeIeSelection = function (rng) {
  22437. return !!rng.select;
  22438. };
  22439. var isAttachedToDom = function (node) {
  22440. return !!(node && node.ownerDocument) && contains$1(SugarElement.fromDom(node.ownerDocument), SugarElement.fromDom(node));
  22441. };
  22442. var isValidRange = function (rng) {
  22443. if (!rng) {
  22444. return false;
  22445. } else if (isNativeIeSelection(rng)) {
  22446. return true;
  22447. } else {
  22448. return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer);
  22449. }
  22450. };
  22451. var EditorSelection = function (dom, win, serializer, editor) {
  22452. var selectedRange;
  22453. var explicitRange;
  22454. var selectorChangedWithUnbind = SelectorChanged(dom, editor).selectorChangedWithUnbind;
  22455. var setCursorLocation = function (node, offset) {
  22456. var rng = dom.createRng();
  22457. if (isNonNullable(node) && isNonNullable(offset)) {
  22458. rng.setStart(node, offset);
  22459. rng.setEnd(node, offset);
  22460. setRng(rng);
  22461. collapse(false);
  22462. } else {
  22463. moveEndPoint(dom, rng, editor.getBody(), true);
  22464. setRng(rng);
  22465. }
  22466. };
  22467. var getContent = function (args) {
  22468. return getContent$1(editor, args);
  22469. };
  22470. var setContent = function (content, args) {
  22471. return setContent$1(editor, content, args);
  22472. };
  22473. var getStart$1 = function (real) {
  22474. return getStart(editor.getBody(), getRng$1(), real);
  22475. };
  22476. var getEnd$1 = function (real) {
  22477. return getEnd(editor.getBody(), getRng$1(), real);
  22478. };
  22479. var getBookmark = function (type, normalized) {
  22480. return bookmarkManager.getBookmark(type, normalized);
  22481. };
  22482. var moveToBookmark = function (bookmark) {
  22483. return bookmarkManager.moveToBookmark(bookmark);
  22484. };
  22485. var select$1 = function (node, content) {
  22486. select(dom, node, content).each(setRng);
  22487. return node;
  22488. };
  22489. var isCollapsed = function () {
  22490. var rng = getRng$1(), sel = getSel();
  22491. if (!rng || rng.item) {
  22492. return false;
  22493. }
  22494. if (rng.compareEndPoints) {
  22495. return rng.compareEndPoints('StartToEnd', rng) === 0;
  22496. }
  22497. return !sel || rng.collapsed;
  22498. };
  22499. var collapse = function (toStart) {
  22500. var rng = getRng$1();
  22501. rng.collapse(!!toStart);
  22502. setRng(rng);
  22503. };
  22504. var getSel = function () {
  22505. return win.getSelection ? win.getSelection() : win.document.selection;
  22506. };
  22507. var getRng$1 = function () {
  22508. var selection, rng, elm;
  22509. var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) {
  22510. try {
  22511. return sourceRange.compareBoundaryPoints(how, destinationRange);
  22512. } catch (ex) {
  22513. return -1;
  22514. }
  22515. };
  22516. var doc = win.document;
  22517. if (editor.bookmark !== undefined && hasFocus(editor) === false) {
  22518. var bookmark = getRng(editor);
  22519. if (bookmark.isSome()) {
  22520. return bookmark.map(function (r) {
  22521. return processRanges(editor, [r])[0];
  22522. }).getOr(doc.createRange());
  22523. }
  22524. }
  22525. try {
  22526. if ((selection = getSel()) && !isRestrictedNode(selection.anchorNode)) {
  22527. if (selection.rangeCount > 0) {
  22528. rng = selection.getRangeAt(0);
  22529. } else {
  22530. rng = selection.createRange ? selection.createRange() : doc.createRange();
  22531. }
  22532. rng = processRanges(editor, [rng])[0];
  22533. }
  22534. } catch (ex) {
  22535. }
  22536. if (!rng) {
  22537. rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
  22538. }
  22539. if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
  22540. elm = dom.getRoot();
  22541. rng.setStart(elm, 0);
  22542. rng.setEnd(elm, 0);
  22543. }
  22544. if (selectedRange && explicitRange) {
  22545. if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) {
  22546. rng = explicitRange;
  22547. } else {
  22548. selectedRange = null;
  22549. explicitRange = null;
  22550. }
  22551. }
  22552. return rng;
  22553. };
  22554. var setRng = function (rng, forward) {
  22555. var node;
  22556. if (!isValidRange(rng)) {
  22557. return;
  22558. }
  22559. var ieRange = isNativeIeSelection(rng) ? rng : null;
  22560. if (ieRange) {
  22561. explicitRange = null;
  22562. try {
  22563. ieRange.select();
  22564. } catch (ex) {
  22565. }
  22566. return;
  22567. }
  22568. var sel = getSel();
  22569. var evt = editor.fire('SetSelectionRange', {
  22570. range: rng,
  22571. forward: forward
  22572. });
  22573. rng = evt.range;
  22574. if (sel) {
  22575. explicitRange = rng;
  22576. try {
  22577. sel.removeAllRanges();
  22578. sel.addRange(rng);
  22579. } catch (ex) {
  22580. }
  22581. if (forward === false && sel.extend) {
  22582. sel.collapse(rng.endContainer, rng.endOffset);
  22583. sel.extend(rng.startContainer, rng.startOffset);
  22584. }
  22585. selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
  22586. }
  22587. if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) {
  22588. if (rng.endOffset - rng.startOffset < 2) {
  22589. if (rng.startContainer.hasChildNodes()) {
  22590. node = rng.startContainer.childNodes[rng.startOffset];
  22591. if (node && node.tagName === 'IMG') {
  22592. sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset);
  22593. if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) {
  22594. sel.setBaseAndExtent(node, 0, node, 1);
  22595. }
  22596. }
  22597. }
  22598. }
  22599. }
  22600. editor.fire('AfterSetSelectionRange', {
  22601. range: rng,
  22602. forward: forward
  22603. });
  22604. };
  22605. var setNode = function (elm) {
  22606. setContent(dom.getOuterHTML(elm));
  22607. return elm;
  22608. };
  22609. var getNode$1 = function () {
  22610. return getNode(editor.getBody(), getRng$1());
  22611. };
  22612. var getSelectedBlocks$1 = function (startElm, endElm) {
  22613. return getSelectedBlocks(dom, getRng$1(), startElm, endElm);
  22614. };
  22615. var isForward = function () {
  22616. var sel = getSel();
  22617. var anchorNode = sel === null || sel === void 0 ? void 0 : sel.anchorNode;
  22618. var focusNode = sel === null || sel === void 0 ? void 0 : sel.focusNode;
  22619. if (!sel || !anchorNode || !focusNode || isRestrictedNode(anchorNode) || isRestrictedNode(focusNode)) {
  22620. return true;
  22621. }
  22622. var anchorRange = dom.createRng();
  22623. anchorRange.setStart(anchorNode, sel.anchorOffset);
  22624. anchorRange.collapse(true);
  22625. var focusRange = dom.createRng();
  22626. focusRange.setStart(focusNode, sel.focusOffset);
  22627. focusRange.collapse(true);
  22628. return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
  22629. };
  22630. var normalize = function () {
  22631. var rng = getRng$1();
  22632. var sel = getSel();
  22633. if (!hasMultipleRanges(sel) && hasAnyRanges(editor)) {
  22634. var normRng = normalize$2(dom, rng);
  22635. normRng.each(function (normRng) {
  22636. setRng(normRng, isForward());
  22637. });
  22638. return normRng.getOr(rng);
  22639. }
  22640. return rng;
  22641. };
  22642. var selectorChanged = function (selector, callback) {
  22643. selectorChangedWithUnbind(selector, callback);
  22644. return exports;
  22645. };
  22646. var getScrollContainer = function () {
  22647. var scrollContainer;
  22648. var node = dom.getRoot();
  22649. while (node && node.nodeName !== 'BODY') {
  22650. if (node.scrollHeight > node.clientHeight) {
  22651. scrollContainer = node;
  22652. break;
  22653. }
  22654. node = node.parentNode;
  22655. }
  22656. return scrollContainer;
  22657. };
  22658. var scrollIntoView = function (elm, alignToTop) {
  22659. if (isNonNullable(elm)) {
  22660. scrollElementIntoView(editor, elm, alignToTop);
  22661. } else {
  22662. scrollRangeIntoView(editor, getRng$1(), alignToTop);
  22663. }
  22664. };
  22665. var placeCaretAt = function (clientX, clientY) {
  22666. return setRng(fromPoint(clientX, clientY, editor.getDoc()));
  22667. };
  22668. var getBoundingClientRect = function () {
  22669. var rng = getRng$1();
  22670. return rng.collapsed ? CaretPosition.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect();
  22671. };
  22672. var destroy = function () {
  22673. win = selectedRange = explicitRange = null;
  22674. controlSelection.destroy();
  22675. };
  22676. var exports = {
  22677. bookmarkManager: null,
  22678. controlSelection: null,
  22679. dom: dom,
  22680. win: win,
  22681. serializer: serializer,
  22682. editor: editor,
  22683. collapse: collapse,
  22684. setCursorLocation: setCursorLocation,
  22685. getContent: getContent,
  22686. setContent: setContent,
  22687. getBookmark: getBookmark,
  22688. moveToBookmark: moveToBookmark,
  22689. select: select$1,
  22690. isCollapsed: isCollapsed,
  22691. isForward: isForward,
  22692. setNode: setNode,
  22693. getNode: getNode$1,
  22694. getSel: getSel,
  22695. setRng: setRng,
  22696. getRng: getRng$1,
  22697. getStart: getStart$1,
  22698. getEnd: getEnd$1,
  22699. getSelectedBlocks: getSelectedBlocks$1,
  22700. normalize: normalize,
  22701. selectorChanged: selectorChanged,
  22702. selectorChangedWithUnbind: selectorChangedWithUnbind,
  22703. getScrollContainer: getScrollContainer,
  22704. scrollIntoView: scrollIntoView,
  22705. placeCaretAt: placeCaretAt,
  22706. getBoundingClientRect: getBoundingClientRect,
  22707. destroy: destroy
  22708. };
  22709. var bookmarkManager = BookmarkManager(exports);
  22710. var controlSelection = ControlSelection(exports, editor);
  22711. exports.bookmarkManager = bookmarkManager;
  22712. exports.controlSelection = controlSelection;
  22713. return exports;
  22714. };
  22715. var removeAttrs = function (node, names) {
  22716. each$k(names, function (name) {
  22717. node.attr(name, null);
  22718. });
  22719. };
  22720. var addFontToSpansFilter = function (domParser, styles, fontSizes) {
  22721. domParser.addNodeFilter('font', function (nodes) {
  22722. each$k(nodes, function (node) {
  22723. var props = styles.parse(node.attr('style'));
  22724. var color = node.attr('color');
  22725. var face = node.attr('face');
  22726. var size = node.attr('size');
  22727. if (color) {
  22728. props.color = color;
  22729. }
  22730. if (face) {
  22731. props['font-family'] = face;
  22732. }
  22733. if (size) {
  22734. props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1];
  22735. }
  22736. node.name = 'span';
  22737. node.attr('style', styles.serialize(props));
  22738. removeAttrs(node, [
  22739. 'color',
  22740. 'face',
  22741. 'size'
  22742. ]);
  22743. });
  22744. });
  22745. };
  22746. var addStrikeToSpanFilter = function (domParser, styles) {
  22747. domParser.addNodeFilter('strike', function (nodes) {
  22748. each$k(nodes, function (node) {
  22749. var props = styles.parse(node.attr('style'));
  22750. props['text-decoration'] = 'line-through';
  22751. node.name = 'span';
  22752. node.attr('style', styles.serialize(props));
  22753. });
  22754. });
  22755. };
  22756. var addFilters = function (domParser, settings) {
  22757. var styles = Styles();
  22758. if (settings.convert_fonts_to_spans) {
  22759. addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values));
  22760. }
  22761. addStrikeToSpanFilter(domParser, styles);
  22762. };
  22763. var register$2 = function (domParser, settings) {
  22764. if (settings.inline_styles) {
  22765. addFilters(domParser, settings);
  22766. }
  22767. };
  22768. var blobUriToBlob = function (url) {
  22769. return new promiseObj(function (resolve, reject) {
  22770. var rejectWithError = function () {
  22771. reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.');
  22772. };
  22773. try {
  22774. var xhr_1 = new XMLHttpRequest();
  22775. xhr_1.open('GET', url, true);
  22776. xhr_1.responseType = 'blob';
  22777. xhr_1.onload = function () {
  22778. if (xhr_1.status === 200) {
  22779. resolve(xhr_1.response);
  22780. } else {
  22781. rejectWithError();
  22782. }
  22783. };
  22784. xhr_1.onerror = rejectWithError;
  22785. xhr_1.send();
  22786. } catch (ex) {
  22787. rejectWithError();
  22788. }
  22789. });
  22790. };
  22791. var parseDataUri = function (uri) {
  22792. var type;
  22793. var uriParts = decodeURIComponent(uri).split(',');
  22794. var matches = /data:([^;]+)/.exec(uriParts[0]);
  22795. if (matches) {
  22796. type = matches[1];
  22797. }
  22798. return {
  22799. type: type,
  22800. data: uriParts[1]
  22801. };
  22802. };
  22803. var buildBlob = function (type, data) {
  22804. var str;
  22805. try {
  22806. str = atob(data);
  22807. } catch (e) {
  22808. return Optional.none();
  22809. }
  22810. var arr = new Uint8Array(str.length);
  22811. for (var i = 0; i < arr.length; i++) {
  22812. arr[i] = str.charCodeAt(i);
  22813. }
  22814. return Optional.some(new Blob([arr], { type: type }));
  22815. };
  22816. var dataUriToBlob = function (uri) {
  22817. return new promiseObj(function (resolve) {
  22818. var _a = parseDataUri(uri), type = _a.type, data = _a.data;
  22819. buildBlob(type, data).fold(function () {
  22820. return resolve(new Blob([]));
  22821. }, resolve);
  22822. });
  22823. };
  22824. var uriToBlob = function (url) {
  22825. if (url.indexOf('blob:') === 0) {
  22826. return blobUriToBlob(url);
  22827. }
  22828. if (url.indexOf('data:') === 0) {
  22829. return dataUriToBlob(url);
  22830. }
  22831. return null;
  22832. };
  22833. var blobToDataUri = function (blob) {
  22834. return new promiseObj(function (resolve) {
  22835. var reader = new FileReader();
  22836. reader.onloadend = function () {
  22837. resolve(reader.result);
  22838. };
  22839. reader.readAsDataURL(blob);
  22840. });
  22841. };
  22842. var count$1 = 0;
  22843. var uniqueId = function (prefix) {
  22844. return (prefix || 'blobid') + count$1++;
  22845. };
  22846. var imageToBlobInfo = function (blobCache, img, resolve, reject) {
  22847. var base64, blobInfo;
  22848. if (img.src.indexOf('blob:') === 0) {
  22849. blobInfo = blobCache.getByUri(img.src);
  22850. if (blobInfo) {
  22851. resolve({
  22852. image: img,
  22853. blobInfo: blobInfo
  22854. });
  22855. } else {
  22856. uriToBlob(img.src).then(function (blob) {
  22857. blobToDataUri(blob).then(function (dataUri) {
  22858. base64 = parseDataUri(dataUri).data;
  22859. blobInfo = blobCache.create(uniqueId(), blob, base64);
  22860. blobCache.add(blobInfo);
  22861. resolve({
  22862. image: img,
  22863. blobInfo: blobInfo
  22864. });
  22865. });
  22866. }, function (err) {
  22867. reject(err);
  22868. });
  22869. }
  22870. return;
  22871. }
  22872. var _a = parseDataUri(img.src), data = _a.data, type = _a.type;
  22873. base64 = data;
  22874. blobInfo = blobCache.getByData(base64, type);
  22875. if (blobInfo) {
  22876. resolve({
  22877. image: img,
  22878. blobInfo: blobInfo
  22879. });
  22880. } else {
  22881. uriToBlob(img.src).then(function (blob) {
  22882. blobInfo = blobCache.create(uniqueId(), blob, base64);
  22883. blobCache.add(blobInfo);
  22884. resolve({
  22885. image: img,
  22886. blobInfo: blobInfo
  22887. });
  22888. }, function (err) {
  22889. reject(err);
  22890. });
  22891. }
  22892. };
  22893. var getAllImages = function (elm) {
  22894. return elm ? from(elm.getElementsByTagName('img')) : [];
  22895. };
  22896. var ImageScanner = function (uploadStatus, blobCache) {
  22897. var cachedPromises = {};
  22898. var findAll = function (elm, predicate) {
  22899. if (!predicate) {
  22900. predicate = always;
  22901. }
  22902. var images = filter$4(getAllImages(elm), function (img) {
  22903. var src = img.src;
  22904. if (!Env.fileApi) {
  22905. return false;
  22906. }
  22907. if (img.hasAttribute('data-mce-bogus')) {
  22908. return false;
  22909. }
  22910. if (img.hasAttribute('data-mce-placeholder')) {
  22911. return false;
  22912. }
  22913. if (!src || src === Env.transparentSrc) {
  22914. return false;
  22915. }
  22916. if (src.indexOf('blob:') === 0) {
  22917. return !uploadStatus.isUploaded(src) && predicate(img);
  22918. }
  22919. if (src.indexOf('data:') === 0) {
  22920. return predicate(img);
  22921. }
  22922. return false;
  22923. });
  22924. var promises = map$3(images, function (img) {
  22925. if (cachedPromises[img.src] !== undefined) {
  22926. return new promiseObj(function (resolve) {
  22927. cachedPromises[img.src].then(function (imageInfo) {
  22928. if (typeof imageInfo === 'string') {
  22929. return imageInfo;
  22930. }
  22931. resolve({
  22932. image: img,
  22933. blobInfo: imageInfo.blobInfo
  22934. });
  22935. });
  22936. });
  22937. }
  22938. var newPromise = new promiseObj(function (resolve, reject) {
  22939. imageToBlobInfo(blobCache, img, resolve, reject);
  22940. }).then(function (result) {
  22941. delete cachedPromises[result.image.src];
  22942. return result;
  22943. }).catch(function (error) {
  22944. delete cachedPromises[img.src];
  22945. return error;
  22946. });
  22947. cachedPromises[img.src] = newPromise;
  22948. return newPromise;
  22949. });
  22950. return promiseObj.all(promises);
  22951. };
  22952. return { findAll: findAll };
  22953. };
  22954. var paddEmptyNode = function (settings, args, blockElements, node) {
  22955. var brPreferred = settings.padd_empty_with_br || args.insert;
  22956. if (brPreferred && blockElements[node.name]) {
  22957. node.empty().append(new AstNode('br', 1)).shortEnded = true;
  22958. } else {
  22959. node.empty().append(new AstNode('#text', 3)).value = nbsp;
  22960. }
  22961. };
  22962. var isPaddedWithNbsp = function (node) {
  22963. return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp;
  22964. };
  22965. var hasOnlyChild = function (node, name) {
  22966. return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
  22967. };
  22968. var isPadded = function (schema, node) {
  22969. var rule = schema.getElementRule(node.name);
  22970. return rule && rule.paddEmpty;
  22971. };
  22972. var isEmpty = function (schema, nonEmptyElements, whitespaceElements, node) {
  22973. return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) {
  22974. return isPadded(schema, node);
  22975. });
  22976. };
  22977. var isLineBreakNode = function (node, blockElements) {
  22978. return node && (has$2(blockElements, node.name) || node.name === 'br');
  22979. };
  22980. var isBogusImage = function (img) {
  22981. return isNonNullable(img.attr('data-mce-bogus'));
  22982. };
  22983. var isInternalImageSource = function (img) {
  22984. return img.attr('src') === Env.transparentSrc || isNonNullable(img.attr('data-mce-placeholder'));
  22985. };
  22986. var isValidDataImg = function (img, settings) {
  22987. if (settings.images_dataimg_filter) {
  22988. var imgElem_1 = new Image();
  22989. imgElem_1.src = img.attr('src');
  22990. each$j(img.attributes.map, function (value, key) {
  22991. imgElem_1.setAttribute(key, value);
  22992. });
  22993. return settings.images_dataimg_filter(imgElem_1);
  22994. } else {
  22995. return true;
  22996. }
  22997. };
  22998. var registerBase64ImageFilter = function (parser, settings) {
  22999. var blobCache = settings.blob_cache;
  23000. var processImage = function (img) {
  23001. var inputSrc = img.attr('src');
  23002. if (isInternalImageSource(img) || isBogusImage(img)) {
  23003. return;
  23004. }
  23005. parseDataUri$1(inputSrc).filter(function () {
  23006. return isValidDataImg(img, settings);
  23007. }).bind(function (_a) {
  23008. var type = _a.type, data = _a.data;
  23009. return Optional.from(blobCache.getByData(data, type)).orThunk(function () {
  23010. return buildBlob(type, data).map(function (blob) {
  23011. var blobInfo = blobCache.create(uniqueId(), blob, data);
  23012. blobCache.add(blobInfo);
  23013. return blobInfo;
  23014. });
  23015. });
  23016. }).each(function (blobInfo) {
  23017. img.attr('src', blobInfo.blobUri());
  23018. });
  23019. };
  23020. if (blobCache) {
  23021. parser.addAttributeFilter('src', function (nodes) {
  23022. return each$k(nodes, processImage);
  23023. });
  23024. }
  23025. };
  23026. var register$1 = function (parser, settings) {
  23027. var schema = parser.schema;
  23028. if (settings.remove_trailing_brs) {
  23029. parser.addNodeFilter('br', function (nodes, _, args) {
  23030. var i;
  23031. var l = nodes.length;
  23032. var node;
  23033. var blockElements = Tools.extend({}, schema.getBlockElements());
  23034. var nonEmptyElements = schema.getNonEmptyElements();
  23035. var parent, lastParent, prev, prevName;
  23036. var whiteSpaceElements = schema.getWhiteSpaceElements();
  23037. var elementRule, textNode;
  23038. blockElements.body = 1;
  23039. for (i = 0; i < l; i++) {
  23040. node = nodes[i];
  23041. parent = node.parent;
  23042. if (blockElements[node.parent.name] && node === parent.lastChild) {
  23043. prev = node.prev;
  23044. while (prev) {
  23045. prevName = prev.name;
  23046. if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') {
  23047. if (prevName === 'br') {
  23048. node = null;
  23049. }
  23050. break;
  23051. }
  23052. prev = prev.prev;
  23053. }
  23054. if (node) {
  23055. node.remove();
  23056. if (isEmpty(schema, nonEmptyElements, whiteSpaceElements, parent)) {
  23057. elementRule = schema.getElementRule(parent.name);
  23058. if (elementRule) {
  23059. if (elementRule.removeEmpty) {
  23060. parent.remove();
  23061. } else if (elementRule.paddEmpty) {
  23062. paddEmptyNode(settings, args, blockElements, parent);
  23063. }
  23064. }
  23065. }
  23066. }
  23067. } else {
  23068. lastParent = node;
  23069. while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
  23070. lastParent = parent;
  23071. if (blockElements[parent.name]) {
  23072. break;
  23073. }
  23074. parent = parent.parent;
  23075. }
  23076. if (lastParent === parent && settings.padd_empty_with_br !== true) {
  23077. textNode = new AstNode('#text', 3);
  23078. textNode.value = nbsp;
  23079. node.replace(textNode);
  23080. }
  23081. }
  23082. }
  23083. });
  23084. }
  23085. parser.addAttributeFilter('href', function (nodes) {
  23086. var i = nodes.length;
  23087. var appendRel = function (rel) {
  23088. var parts = rel.split(' ').filter(function (p) {
  23089. return p.length > 0;
  23090. });
  23091. return parts.concat(['noopener']).sort().join(' ');
  23092. };
  23093. var addNoOpener = function (rel) {
  23094. var newRel = rel ? Tools.trim(rel) : '';
  23095. if (!/\b(noopener)\b/g.test(newRel)) {
  23096. return appendRel(newRel);
  23097. } else {
  23098. return newRel;
  23099. }
  23100. };
  23101. if (!settings.allow_unsafe_link_target) {
  23102. while (i--) {
  23103. var node = nodes[i];
  23104. if (node.name === 'a' && node.attr('target') === '_blank') {
  23105. node.attr('rel', addNoOpener(node.attr('rel')));
  23106. }
  23107. }
  23108. }
  23109. });
  23110. if (!settings.allow_html_in_named_anchor) {
  23111. parser.addAttributeFilter('id,name', function (nodes) {
  23112. var i = nodes.length, sibling, prevSibling, parent, node;
  23113. while (i--) {
  23114. node = nodes[i];
  23115. if (node.name === 'a' && node.firstChild && !node.attr('href')) {
  23116. parent = node.parent;
  23117. sibling = node.lastChild;
  23118. do {
  23119. prevSibling = sibling.prev;
  23120. parent.insert(sibling, node);
  23121. sibling = prevSibling;
  23122. } while (sibling);
  23123. }
  23124. }
  23125. });
  23126. }
  23127. if (settings.fix_list_elements) {
  23128. parser.addNodeFilter('ul,ol', function (nodes) {
  23129. var i = nodes.length, node, parentNode;
  23130. while (i--) {
  23131. node = nodes[i];
  23132. parentNode = node.parent;
  23133. if (parentNode.name === 'ul' || parentNode.name === 'ol') {
  23134. if (node.prev && node.prev.name === 'li') {
  23135. node.prev.append(node);
  23136. } else {
  23137. var li = new AstNode('li', 1);
  23138. li.attr('style', 'list-style-type: none');
  23139. node.wrap(li);
  23140. }
  23141. }
  23142. }
  23143. });
  23144. }
  23145. if (settings.validate && schema.getValidClasses()) {
  23146. parser.addAttributeFilter('class', function (nodes) {
  23147. var validClasses = schema.getValidClasses();
  23148. var i = nodes.length;
  23149. while (i--) {
  23150. var node = nodes[i];
  23151. var classList = node.attr('class').split(' ');
  23152. var classValue = '';
  23153. for (var ci = 0; ci < classList.length; ci++) {
  23154. var className = classList[ci];
  23155. var valid = false;
  23156. var validClassesMap = validClasses['*'];
  23157. if (validClassesMap && validClassesMap[className]) {
  23158. valid = true;
  23159. }
  23160. validClassesMap = validClasses[node.name];
  23161. if (!valid && validClassesMap && validClassesMap[className]) {
  23162. valid = true;
  23163. }
  23164. if (valid) {
  23165. if (classValue) {
  23166. classValue += ' ';
  23167. }
  23168. classValue += className;
  23169. }
  23170. }
  23171. if (!classValue.length) {
  23172. classValue = null;
  23173. }
  23174. node.attr('class', classValue);
  23175. }
  23176. });
  23177. }
  23178. registerBase64ImageFilter(parser, settings);
  23179. };
  23180. var makeMap = Tools.makeMap, each$6 = Tools.each, explode$2 = Tools.explode, extend$4 = Tools.extend;
  23181. var DomParser = function (settings, schema) {
  23182. if (schema === void 0) {
  23183. schema = Schema();
  23184. }
  23185. var nodeFilters = {};
  23186. var attributeFilters = [];
  23187. var matchedNodes = {};
  23188. var matchedAttributes = {};
  23189. settings = settings || {};
  23190. settings.validate = 'validate' in settings ? settings.validate : true;
  23191. settings.root_name = settings.root_name || 'body';
  23192. var fixInvalidChildren = function (nodes) {
  23193. var nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
  23194. var nonEmptyElements = schema.getNonEmptyElements();
  23195. var whitespaceElements = schema.getWhiteSpaceElements();
  23196. var textBlockElements = schema.getTextBlockElements();
  23197. var specialElements = schema.getSpecialElements();
  23198. var removeOrUnwrapInvalidNode = function (node, originalNodeParent) {
  23199. if (originalNodeParent === void 0) {
  23200. originalNodeParent = node.parent;
  23201. }
  23202. if (specialElements[node.name]) {
  23203. node.empty().remove();
  23204. } else {
  23205. var children = node.children();
  23206. for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
  23207. var childNode = children_1[_i];
  23208. if (!schema.isValidChild(originalNodeParent.name, childNode.name)) {
  23209. removeOrUnwrapInvalidNode(childNode, originalNodeParent);
  23210. }
  23211. }
  23212. node.unwrap();
  23213. }
  23214. };
  23215. for (var ni = 0; ni < nodes.length; ni++) {
  23216. var node = nodes[ni];
  23217. var parent_1 = void 0, newParent = void 0, tempNode = void 0;
  23218. if (!node.parent || node.fixed) {
  23219. continue;
  23220. }
  23221. if (textBlockElements[node.name] && node.parent.name === 'li') {
  23222. var sibling = node.next;
  23223. while (sibling) {
  23224. if (textBlockElements[sibling.name]) {
  23225. sibling.name = 'li';
  23226. sibling.fixed = true;
  23227. node.parent.insert(sibling, node.parent);
  23228. } else {
  23229. break;
  23230. }
  23231. sibling = sibling.next;
  23232. }
  23233. node.unwrap();
  23234. continue;
  23235. }
  23236. var parents = [node];
  23237. for (parent_1 = node.parent; parent_1 && !schema.isValidChild(parent_1.name, node.name) && !nonSplitableElements[parent_1.name]; parent_1 = parent_1.parent) {
  23238. parents.push(parent_1);
  23239. }
  23240. if (parent_1 && parents.length > 1) {
  23241. if (schema.isValidChild(parent_1.name, node.name)) {
  23242. parents.reverse();
  23243. newParent = filterNode(parents[0].clone());
  23244. var currentNode = newParent;
  23245. for (var i = 0; i < parents.length - 1; i++) {
  23246. if (schema.isValidChild(currentNode.name, parents[i].name)) {
  23247. tempNode = filterNode(parents[i].clone());
  23248. currentNode.append(tempNode);
  23249. } else {
  23250. tempNode = currentNode;
  23251. }
  23252. for (var childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) {
  23253. var nextNode = childNode.next;
  23254. tempNode.append(childNode);
  23255. childNode = nextNode;
  23256. }
  23257. currentNode = tempNode;
  23258. }
  23259. if (!isEmpty(schema, nonEmptyElements, whitespaceElements, newParent)) {
  23260. parent_1.insert(newParent, parents[0], true);
  23261. parent_1.insert(node, newParent);
  23262. } else {
  23263. parent_1.insert(node, parents[0], true);
  23264. }
  23265. parent_1 = parents[0];
  23266. if (isEmpty(schema, nonEmptyElements, whitespaceElements, parent_1) || hasOnlyChild(parent_1, 'br')) {
  23267. parent_1.empty().remove();
  23268. }
  23269. } else {
  23270. removeOrUnwrapInvalidNode(node);
  23271. }
  23272. } else if (node.parent) {
  23273. if (node.name === 'li') {
  23274. var sibling = node.prev;
  23275. if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) {
  23276. sibling.append(node);
  23277. continue;
  23278. }
  23279. sibling = node.next;
  23280. if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) {
  23281. sibling.insert(node, sibling.firstChild, true);
  23282. continue;
  23283. }
  23284. node.wrap(filterNode(new AstNode('ul', 1)));
  23285. continue;
  23286. }
  23287. if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
  23288. node.wrap(filterNode(new AstNode('div', 1)));
  23289. } else {
  23290. removeOrUnwrapInvalidNode(node);
  23291. }
  23292. }
  23293. }
  23294. };
  23295. var filterNode = function (node) {
  23296. var name = node.name;
  23297. if (name in nodeFilters) {
  23298. var list = matchedNodes[name];
  23299. if (list) {
  23300. list.push(node);
  23301. } else {
  23302. matchedNodes[name] = [node];
  23303. }
  23304. }
  23305. var i = attributeFilters.length;
  23306. while (i--) {
  23307. var attrName = attributeFilters[i].name;
  23308. if (attrName in node.attributes.map) {
  23309. var list = matchedAttributes[attrName];
  23310. if (list) {
  23311. list.push(node);
  23312. } else {
  23313. matchedAttributes[attrName] = [node];
  23314. }
  23315. }
  23316. }
  23317. return node;
  23318. };
  23319. var addNodeFilter = function (name, callback) {
  23320. each$6(explode$2(name), function (name) {
  23321. var list = nodeFilters[name];
  23322. if (!list) {
  23323. nodeFilters[name] = list = [];
  23324. }
  23325. list.push(callback);
  23326. });
  23327. };
  23328. var getNodeFilters = function () {
  23329. var out = [];
  23330. for (var name_1 in nodeFilters) {
  23331. if (has$2(nodeFilters, name_1)) {
  23332. out.push({
  23333. name: name_1,
  23334. callbacks: nodeFilters[name_1]
  23335. });
  23336. }
  23337. }
  23338. return out;
  23339. };
  23340. var addAttributeFilter = function (name, callback) {
  23341. each$6(explode$2(name), function (name) {
  23342. var i;
  23343. for (i = 0; i < attributeFilters.length; i++) {
  23344. if (attributeFilters[i].name === name) {
  23345. attributeFilters[i].callbacks.push(callback);
  23346. return;
  23347. }
  23348. }
  23349. attributeFilters.push({
  23350. name: name,
  23351. callbacks: [callback]
  23352. });
  23353. });
  23354. };
  23355. var getAttributeFilters = function () {
  23356. return [].concat(attributeFilters);
  23357. };
  23358. var parse = function (html, args) {
  23359. var nodes, i, l, fi, fl, list, name;
  23360. var invalidChildren = [];
  23361. var node;
  23362. var getRootBlockName = function (name) {
  23363. if (name === false) {
  23364. return '';
  23365. } else if (name === true) {
  23366. return 'p';
  23367. } else {
  23368. return name;
  23369. }
  23370. };
  23371. args = args || {};
  23372. matchedNodes = {};
  23373. matchedAttributes = {};
  23374. var blockElements = extend$4(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
  23375. var nonEmptyElements = schema.getNonEmptyElements();
  23376. var children = schema.children;
  23377. var validate = settings.validate;
  23378. var forcedRootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block;
  23379. var rootBlockName = getRootBlockName(forcedRootBlockName);
  23380. var whiteSpaceElements = schema.getWhiteSpaceElements();
  23381. var startWhiteSpaceRegExp = /^[ \t\r\n]+/;
  23382. var endWhiteSpaceRegExp = /[ \t\r\n]+$/;
  23383. var allWhiteSpaceRegExp = /[ \t\r\n]+/g;
  23384. var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
  23385. var isInWhiteSpacePreservedElement = has$2(whiteSpaceElements, args.context) || has$2(whiteSpaceElements, settings.root_name);
  23386. var addRootBlocks = function () {
  23387. var node = rootNode.firstChild, rootBlockNode = null;
  23388. var trim = function (rootBlock) {
  23389. if (rootBlock) {
  23390. node = rootBlock.firstChild;
  23391. if (node && node.type === 3) {
  23392. node.value = node.value.replace(startWhiteSpaceRegExp, '');
  23393. }
  23394. node = rootBlock.lastChild;
  23395. if (node && node.type === 3) {
  23396. node.value = node.value.replace(endWhiteSpaceRegExp, '');
  23397. }
  23398. }
  23399. };
  23400. if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
  23401. return;
  23402. }
  23403. while (node) {
  23404. var next = node.next;
  23405. if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) {
  23406. if (!rootBlockNode) {
  23407. rootBlockNode = createNode(rootBlockName, 1);
  23408. rootBlockNode.attr(settings.forced_root_block_attrs);
  23409. rootNode.insert(rootBlockNode, node);
  23410. rootBlockNode.append(node);
  23411. } else {
  23412. rootBlockNode.append(node);
  23413. }
  23414. } else {
  23415. trim(rootBlockNode);
  23416. rootBlockNode = null;
  23417. }
  23418. node = next;
  23419. }
  23420. trim(rootBlockNode);
  23421. };
  23422. var createNode = function (name, type) {
  23423. var node = new AstNode(name, type);
  23424. var list;
  23425. if (name in nodeFilters) {
  23426. list = matchedNodes[name];
  23427. if (list) {
  23428. list.push(node);
  23429. } else {
  23430. matchedNodes[name] = [node];
  23431. }
  23432. }
  23433. return node;
  23434. };
  23435. var removeWhitespaceBefore = function (node) {
  23436. var blockElements = schema.getBlockElements();
  23437. for (var textNode = node.prev; textNode && textNode.type === 3;) {
  23438. var textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
  23439. if (textVal.length > 0) {
  23440. textNode.value = textVal;
  23441. return;
  23442. }
  23443. var textNodeNext = textNode.next;
  23444. if (textNodeNext) {
  23445. if (textNodeNext.type === 3 && textNodeNext.value.length) {
  23446. textNode = textNode.prev;
  23447. continue;
  23448. }
  23449. if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') {
  23450. textNode = textNode.prev;
  23451. continue;
  23452. }
  23453. }
  23454. var sibling = textNode.prev;
  23455. textNode.remove();
  23456. textNode = sibling;
  23457. }
  23458. };
  23459. var cloneAndExcludeBlocks = function (input) {
  23460. var output = {};
  23461. for (var name_2 in input) {
  23462. if (name_2 !== 'li' && name_2 !== 'p') {
  23463. output[name_2] = input[name_2];
  23464. }
  23465. }
  23466. return output;
  23467. };
  23468. var parser = SaxParser({
  23469. validate: validate,
  23470. document: settings.document,
  23471. allow_html_data_urls: settings.allow_html_data_urls,
  23472. allow_svg_data_urls: settings.allow_svg_data_urls,
  23473. allow_script_urls: settings.allow_script_urls,
  23474. allow_conditional_comments: settings.allow_conditional_comments,
  23475. preserve_cdata: settings.preserve_cdata,
  23476. self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
  23477. cdata: function (text) {
  23478. node.append(createNode('#cdata', 4)).value = text;
  23479. },
  23480. text: function (text, raw) {
  23481. var textNode;
  23482. if (!isInWhiteSpacePreservedElement) {
  23483. text = text.replace(allWhiteSpaceRegExp, ' ');
  23484. if (isLineBreakNode(node.lastChild, blockElements)) {
  23485. text = text.replace(startWhiteSpaceRegExp, '');
  23486. }
  23487. }
  23488. if (text.length !== 0) {
  23489. textNode = createNode('#text', 3);
  23490. textNode.raw = !!raw;
  23491. node.append(textNode).value = text;
  23492. }
  23493. },
  23494. comment: function (text) {
  23495. node.append(createNode('#comment', 8)).value = text;
  23496. },
  23497. pi: function (name, text) {
  23498. node.append(createNode(name, 7)).value = text;
  23499. removeWhitespaceBefore(node);
  23500. },
  23501. doctype: function (text) {
  23502. var newNode = node.append(createNode('#doctype', 10));
  23503. newNode.value = text;
  23504. removeWhitespaceBefore(node);
  23505. },
  23506. start: function (name, attrs, empty) {
  23507. var elementRule = validate ? schema.getElementRule(name) : {};
  23508. if (elementRule) {
  23509. var newNode = createNode(elementRule.outputName || name, 1);
  23510. newNode.attributes = attrs;
  23511. newNode.shortEnded = empty;
  23512. node.append(newNode);
  23513. var parent_2 = children[node.name];
  23514. if (parent_2 && children[newNode.name] && !parent_2[newNode.name]) {
  23515. invalidChildren.push(newNode);
  23516. }
  23517. var attrFiltersLen = attributeFilters.length;
  23518. while (attrFiltersLen--) {
  23519. var attrName = attributeFilters[attrFiltersLen].name;
  23520. if (attrName in attrs.map) {
  23521. list = matchedAttributes[attrName];
  23522. if (list) {
  23523. list.push(newNode);
  23524. } else {
  23525. matchedAttributes[attrName] = [newNode];
  23526. }
  23527. }
  23528. }
  23529. if (blockElements[name]) {
  23530. removeWhitespaceBefore(newNode);
  23531. }
  23532. if (!empty) {
  23533. node = newNode;
  23534. }
  23535. if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
  23536. isInWhiteSpacePreservedElement = true;
  23537. }
  23538. }
  23539. },
  23540. end: function (name) {
  23541. var textNode, text, sibling, tempNode;
  23542. var elementRule = validate ? schema.getElementRule(name) : {};
  23543. if (elementRule) {
  23544. if (blockElements[name]) {
  23545. if (!isInWhiteSpacePreservedElement) {
  23546. textNode = node.firstChild;
  23547. if (textNode && textNode.type === 3) {
  23548. text = textNode.value.replace(startWhiteSpaceRegExp, '');
  23549. if (text.length > 0) {
  23550. textNode.value = text;
  23551. textNode = textNode.next;
  23552. } else {
  23553. sibling = textNode.next;
  23554. textNode.remove();
  23555. textNode = sibling;
  23556. while (textNode && textNode.type === 3) {
  23557. text = textNode.value;
  23558. sibling = textNode.next;
  23559. if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
  23560. textNode.remove();
  23561. textNode = sibling;
  23562. }
  23563. textNode = sibling;
  23564. }
  23565. }
  23566. }
  23567. textNode = node.lastChild;
  23568. if (textNode && textNode.type === 3) {
  23569. text = textNode.value.replace(endWhiteSpaceRegExp, '');
  23570. if (text.length > 0) {
  23571. textNode.value = text;
  23572. textNode = textNode.prev;
  23573. } else {
  23574. sibling = textNode.prev;
  23575. textNode.remove();
  23576. textNode = sibling;
  23577. while (textNode && textNode.type === 3) {
  23578. text = textNode.value;
  23579. sibling = textNode.prev;
  23580. if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
  23581. textNode.remove();
  23582. textNode = sibling;
  23583. }
  23584. textNode = sibling;
  23585. }
  23586. }
  23587. }
  23588. }
  23589. }
  23590. if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
  23591. isInWhiteSpacePreservedElement = false;
  23592. }
  23593. if (elementRule.removeEmpty && isEmpty(schema, nonEmptyElements, whiteSpaceElements, node)) {
  23594. tempNode = node.parent;
  23595. if (blockElements[node.name]) {
  23596. node.empty().remove();
  23597. } else {
  23598. node.unwrap();
  23599. }
  23600. node = tempNode;
  23601. return;
  23602. }
  23603. if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty(schema, nonEmptyElements, whiteSpaceElements, node))) {
  23604. paddEmptyNode(settings, args, blockElements, node);
  23605. }
  23606. node = node.parent;
  23607. }
  23608. }
  23609. }, schema);
  23610. var rootNode = node = new AstNode(args.context || settings.root_name, 11);
  23611. parser.parse(html, args.format);
  23612. if (validate && invalidChildren.length) {
  23613. if (!args.context) {
  23614. fixInvalidChildren(invalidChildren);
  23615. } else {
  23616. args.invalid = true;
  23617. }
  23618. }
  23619. if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) {
  23620. addRootBlocks();
  23621. }
  23622. if (!args.invalid) {
  23623. for (name in matchedNodes) {
  23624. if (!has$2(matchedNodes, name)) {
  23625. continue;
  23626. }
  23627. list = nodeFilters[name];
  23628. nodes = matchedNodes[name];
  23629. fi = nodes.length;
  23630. while (fi--) {
  23631. if (!nodes[fi].parent) {
  23632. nodes.splice(fi, 1);
  23633. }
  23634. }
  23635. for (i = 0, l = list.length; i < l; i++) {
  23636. list[i](nodes, name, args);
  23637. }
  23638. }
  23639. for (i = 0, l = attributeFilters.length; i < l; i++) {
  23640. list = attributeFilters[i];
  23641. if (list.name in matchedAttributes) {
  23642. nodes = matchedAttributes[list.name];
  23643. fi = nodes.length;
  23644. while (fi--) {
  23645. if (!nodes[fi].parent) {
  23646. nodes.splice(fi, 1);
  23647. }
  23648. }
  23649. for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
  23650. list.callbacks[fi](nodes, list.name, args);
  23651. }
  23652. }
  23653. }
  23654. }
  23655. return rootNode;
  23656. };
  23657. var exports = {
  23658. schema: schema,
  23659. addAttributeFilter: addAttributeFilter,
  23660. getAttributeFilters: getAttributeFilters,
  23661. addNodeFilter: addNodeFilter,
  23662. getNodeFilters: getNodeFilters,
  23663. filterNode: filterNode,
  23664. parse: parse
  23665. };
  23666. register$1(exports, settings);
  23667. register$2(exports, settings);
  23668. return exports;
  23669. };
  23670. var register = function (htmlParser, settings, dom) {
  23671. htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) {
  23672. var i = nodes.length;
  23673. while (i--) {
  23674. var node = nodes[i];
  23675. node.attr('tabindex', node.attr('data-mce-tabindex'));
  23676. node.attr(name, null);
  23677. }
  23678. });
  23679. htmlParser.addAttributeFilter('src,href,style', function (nodes, name) {
  23680. var internalName = 'data-mce-' + name;
  23681. var urlConverter = settings.url_converter;
  23682. var urlConverterScope = settings.url_converter_scope;
  23683. var i = nodes.length;
  23684. while (i--) {
  23685. var node = nodes[i];
  23686. var value = node.attr(internalName);
  23687. if (value !== undefined) {
  23688. node.attr(name, value.length > 0 ? value : null);
  23689. node.attr(internalName, null);
  23690. } else {
  23691. value = node.attr(name);
  23692. if (name === 'style') {
  23693. value = dom.serializeStyle(dom.parseStyle(value), node.name);
  23694. } else if (urlConverter) {
  23695. value = urlConverter.call(urlConverterScope, value, name, node.name);
  23696. }
  23697. node.attr(name, value.length > 0 ? value : null);
  23698. }
  23699. }
  23700. });
  23701. htmlParser.addAttributeFilter('class', function (nodes) {
  23702. var i = nodes.length;
  23703. while (i--) {
  23704. var node = nodes[i];
  23705. var value = node.attr('class');
  23706. if (value) {
  23707. value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
  23708. node.attr('class', value.length > 0 ? value : null);
  23709. }
  23710. }
  23711. });
  23712. htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) {
  23713. var i = nodes.length;
  23714. while (i--) {
  23715. var node = nodes[i];
  23716. if (node.attr('data-mce-type') === 'bookmark' && !args.cleanup) {
  23717. var hasChildren = Optional.from(node.firstChild).exists(function (firstChild) {
  23718. return !isZwsp(firstChild.value);
  23719. });
  23720. if (hasChildren) {
  23721. node.unwrap();
  23722. } else {
  23723. node.remove();
  23724. }
  23725. }
  23726. }
  23727. });
  23728. htmlParser.addNodeFilter('noscript', function (nodes) {
  23729. var i = nodes.length;
  23730. while (i--) {
  23731. var node = nodes[i].firstChild;
  23732. if (node) {
  23733. node.value = Entities.decode(node.value);
  23734. }
  23735. }
  23736. });
  23737. htmlParser.addNodeFilter('script,style', function (nodes, name) {
  23738. var trim = function (value) {
  23739. return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '').replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');
  23740. };
  23741. var i = nodes.length;
  23742. while (i--) {
  23743. var node = nodes[i];
  23744. var value = node.firstChild ? node.firstChild.value : '';
  23745. if (name === 'script') {
  23746. var type = node.attr('type');
  23747. if (type) {
  23748. node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
  23749. }
  23750. if (settings.element_format === 'xhtml' && value.length > 0) {
  23751. node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
  23752. }
  23753. } else {
  23754. if (settings.element_format === 'xhtml' && value.length > 0) {
  23755. node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
  23756. }
  23757. }
  23758. }
  23759. });
  23760. htmlParser.addNodeFilter('#comment', function (nodes) {
  23761. var i = nodes.length;
  23762. while (i--) {
  23763. var node = nodes[i];
  23764. if (settings.preserve_cdata && node.value.indexOf('[CDATA[') === 0) {
  23765. node.name = '#cdata';
  23766. node.type = 4;
  23767. node.value = dom.decode(node.value.replace(/^\[CDATA\[|\]\]$/g, ''));
  23768. } else if (node.value.indexOf('mce:protected ') === 0) {
  23769. node.name = '#text';
  23770. node.type = 3;
  23771. node.raw = true;
  23772. node.value = unescape(node.value).substr(14);
  23773. }
  23774. }
  23775. });
  23776. htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) {
  23777. var i = nodes.length;
  23778. while (i--) {
  23779. var node = nodes[i];
  23780. if (node.type === 7) {
  23781. node.remove();
  23782. } else if (node.type === 1) {
  23783. if (name === 'input' && !node.attr('type')) {
  23784. node.attr('type', 'text');
  23785. }
  23786. }
  23787. }
  23788. });
  23789. htmlParser.addAttributeFilter('data-mce-type', function (nodes) {
  23790. each$k(nodes, function (node) {
  23791. if (node.attr('data-mce-type') === 'format-caret') {
  23792. if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) {
  23793. node.remove();
  23794. } else {
  23795. node.unwrap();
  23796. }
  23797. }
  23798. });
  23799. });
  23800. htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize,data-mce-placeholder', function (nodes, name) {
  23801. var i = nodes.length;
  23802. while (i--) {
  23803. nodes[i].attr(name, null);
  23804. }
  23805. });
  23806. };
  23807. var trimTrailingBr = function (rootNode) {
  23808. var isBr = function (node) {
  23809. return node && node.name === 'br';
  23810. };
  23811. var brNode1 = rootNode.lastChild;
  23812. if (isBr(brNode1)) {
  23813. var brNode2 = brNode1.prev;
  23814. if (isBr(brNode2)) {
  23815. brNode1.remove();
  23816. brNode2.remove();
  23817. }
  23818. }
  23819. };
  23820. var preProcess = function (editor, node, args) {
  23821. var oldDoc;
  23822. var dom = editor.dom;
  23823. var clonedNode = node.cloneNode(true);
  23824. var impl = document.implementation;
  23825. if (impl.createHTMLDocument) {
  23826. var doc_1 = impl.createHTMLDocument('');
  23827. Tools.each(clonedNode.nodeName === 'BODY' ? clonedNode.childNodes : [clonedNode], function (node) {
  23828. doc_1.body.appendChild(doc_1.importNode(node, true));
  23829. });
  23830. if (clonedNode.nodeName !== 'BODY') {
  23831. clonedNode = doc_1.body.firstChild;
  23832. } else {
  23833. clonedNode = doc_1.body;
  23834. }
  23835. oldDoc = dom.doc;
  23836. dom.doc = doc_1;
  23837. }
  23838. firePreProcess(editor, __assign(__assign({}, args), { node: clonedNode }));
  23839. if (oldDoc) {
  23840. dom.doc = oldDoc;
  23841. }
  23842. return clonedNode;
  23843. };
  23844. var shouldFireEvent = function (editor, args) {
  23845. return editor && editor.hasEventListeners('PreProcess') && !args.no_events;
  23846. };
  23847. var process = function (editor, node, args) {
  23848. return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node;
  23849. };
  23850. var addTempAttr = function (htmlParser, tempAttrs, name) {
  23851. if (Tools.inArray(tempAttrs, name) === -1) {
  23852. htmlParser.addAttributeFilter(name, function (nodes, name) {
  23853. var i = nodes.length;
  23854. while (i--) {
  23855. nodes[i].attr(name, null);
  23856. }
  23857. });
  23858. tempAttrs.push(name);
  23859. }
  23860. };
  23861. var postProcess = function (editor, args, content) {
  23862. if (!args.no_events && editor) {
  23863. var outArgs = firePostProcess(editor, __assign(__assign({}, args), { content: content }));
  23864. return outArgs.content;
  23865. } else {
  23866. return content;
  23867. }
  23868. };
  23869. var getHtmlFromNode = function (dom, node, args) {
  23870. var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
  23871. return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html);
  23872. };
  23873. var parseHtml = function (htmlParser, html, args) {
  23874. var parserArgs = args.selection ? __assign({ forced_root_block: false }, args) : args;
  23875. var rootNode = htmlParser.parse(html, parserArgs);
  23876. trimTrailingBr(rootNode);
  23877. return rootNode;
  23878. };
  23879. var serializeNode = function (settings, schema, node) {
  23880. var htmlSerializer = HtmlSerializer(settings, schema);
  23881. return htmlSerializer.serialize(node);
  23882. };
  23883. var toHtml = function (editor, settings, schema, rootNode, args) {
  23884. var content = serializeNode(settings, schema, rootNode);
  23885. return postProcess(editor, args, content);
  23886. };
  23887. var DomSerializerImpl = function (settings, editor) {
  23888. var tempAttrs = ['data-mce-selected'];
  23889. var dom = editor && editor.dom ? editor.dom : DOMUtils.DOM;
  23890. var schema = editor && editor.schema ? editor.schema : Schema(settings);
  23891. settings.entity_encoding = settings.entity_encoding || 'named';
  23892. settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true;
  23893. var htmlParser = DomParser(settings, schema);
  23894. register(htmlParser, settings, dom);
  23895. var serialize = function (node, parserArgs) {
  23896. if (parserArgs === void 0) {
  23897. parserArgs = {};
  23898. }
  23899. var args = __assign({ format: 'html' }, parserArgs);
  23900. var targetNode = process(editor, node, args);
  23901. var html = getHtmlFromNode(dom, targetNode, args);
  23902. var rootNode = parseHtml(htmlParser, html, args);
  23903. return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args);
  23904. };
  23905. return {
  23906. schema: schema,
  23907. addNodeFilter: htmlParser.addNodeFilter,
  23908. addAttributeFilter: htmlParser.addAttributeFilter,
  23909. serialize: serialize,
  23910. addRules: schema.addValidElements,
  23911. setRules: schema.setValidElements,
  23912. addTempAttr: curry(addTempAttr, htmlParser, tempAttrs),
  23913. getTempAttrs: constant(tempAttrs),
  23914. getNodeFilters: htmlParser.getNodeFilters,
  23915. getAttributeFilters: htmlParser.getAttributeFilters
  23916. };
  23917. };
  23918. var DomSerializer = function (settings, editor) {
  23919. var domSerializer = DomSerializerImpl(settings, editor);
  23920. return {
  23921. schema: domSerializer.schema,
  23922. addNodeFilter: domSerializer.addNodeFilter,
  23923. addAttributeFilter: domSerializer.addAttributeFilter,
  23924. serialize: domSerializer.serialize,
  23925. addRules: domSerializer.addRules,
  23926. setRules: domSerializer.setRules,
  23927. addTempAttr: domSerializer.addTempAttr,
  23928. getTempAttrs: domSerializer.getTempAttrs,
  23929. getNodeFilters: domSerializer.getNodeFilters,
  23930. getAttributeFilters: domSerializer.getAttributeFilters
  23931. };
  23932. };
  23933. var defaultFormat = 'html';
  23934. var getContent = function (editor, args) {
  23935. if (args === void 0) {
  23936. args = {};
  23937. }
  23938. var format = args.format ? args.format : defaultFormat;
  23939. return getContent$2(editor, args, format);
  23940. };
  23941. var setContent = function (editor, content, args) {
  23942. if (args === void 0) {
  23943. args = {};
  23944. }
  23945. return setContent$2(editor, content, args);
  23946. };
  23947. var DOM$7 = DOMUtils.DOM;
  23948. var restoreOriginalStyles = function (editor) {
  23949. DOM$7.setStyle(editor.id, 'display', editor.orgDisplay);
  23950. };
  23951. var safeDestroy = function (x) {
  23952. return Optional.from(x).each(function (x) {
  23953. return x.destroy();
  23954. });
  23955. };
  23956. var clearDomReferences = function (editor) {
  23957. editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null;
  23958. editor.bodyElement = editor.contentDocument = editor.contentWindow = null;
  23959. editor.iframeElement = editor.targetElm = null;
  23960. if (editor.selection) {
  23961. editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null;
  23962. }
  23963. };
  23964. var restoreForm = function (editor) {
  23965. var form = editor.formElement;
  23966. if (form) {
  23967. if (form._mceOldSubmit) {
  23968. form.submit = form._mceOldSubmit;
  23969. form._mceOldSubmit = null;
  23970. }
  23971. DOM$7.unbind(form, 'submit reset', editor.formEventDelegate);
  23972. }
  23973. };
  23974. var remove = function (editor) {
  23975. if (!editor.removed) {
  23976. var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload;
  23977. var body = editor.getBody();
  23978. var element = editor.getElement();
  23979. if (body) {
  23980. editor.save({ is_removing: true });
  23981. }
  23982. editor.removed = true;
  23983. editor.unbindAllNativeEvents();
  23984. if (editor.hasHiddenInput && element) {
  23985. DOM$7.remove(element.nextSibling);
  23986. }
  23987. fireRemove(editor);
  23988. editor.editorManager.remove(editor);
  23989. if (!editor.inline && body) {
  23990. restoreOriginalStyles(editor);
  23991. }
  23992. fireDetach(editor);
  23993. DOM$7.remove(editor.getContainer());
  23994. safeDestroy(_selectionOverrides);
  23995. safeDestroy(editorUpload);
  23996. editor.destroy();
  23997. }
  23998. };
  23999. var destroy = function (editor, automatic) {
  24000. var selection = editor.selection, dom = editor.dom;
  24001. if (editor.destroyed) {
  24002. return;
  24003. }
  24004. if (!automatic && !editor.removed) {
  24005. editor.remove();
  24006. return;
  24007. }
  24008. if (!automatic) {
  24009. editor.editorManager.off('beforeunload', editor._beforeUnload);
  24010. if (editor.theme && editor.theme.destroy) {
  24011. editor.theme.destroy();
  24012. }
  24013. safeDestroy(selection);
  24014. safeDestroy(dom);
  24015. }
  24016. restoreForm(editor);
  24017. clearDomReferences(editor);
  24018. editor.destroyed = true;
  24019. };
  24020. var deep = function (old, nu) {
  24021. var bothObjects = isObject(old) && isObject(nu);
  24022. return bothObjects ? deepMerge(old, nu) : nu;
  24023. };
  24024. var baseMerge = function (merger) {
  24025. return function () {
  24026. var objects = [];
  24027. for (var _i = 0; _i < arguments.length; _i++) {
  24028. objects[_i] = arguments[_i];
  24029. }
  24030. if (objects.length === 0) {
  24031. throw new Error('Can\'t merge zero objects');
  24032. }
  24033. var ret = {};
  24034. for (var j = 0; j < objects.length; j++) {
  24035. var curObject = objects[j];
  24036. for (var key in curObject) {
  24037. if (has$2(curObject, key)) {
  24038. ret[key] = merger(ret[key], curObject[key]);
  24039. }
  24040. }
  24041. }
  24042. return ret;
  24043. };
  24044. };
  24045. var deepMerge = baseMerge(deep);
  24046. var deprecatedSettings = ('autoresize_on_init,content_editable_state,convert_fonts_to_spans,inline_styles,padd_empty_with_br,block_elements,' + 'boolean_attributes,editor_deselector,editor_selector,elements,file_browser_callback_types,filepicker_validator_handler,' + 'force_hex_style_colors,force_p_newlines,gecko_spellcheck,images_dataimg_filter,media_scripts,mode,move_caret_before_on_enter_elements,' + 'non_empty_elements,self_closing_elements,short_ended_elements,special,spellchecker_select_languages,spellchecker_whitelist,' + 'tab_focus,table_responsive_width,text_block_elements,text_inline_elements,toolbar_drawer,types,validate,whitespace_elements,' + 'paste_word_valid_elements,paste_retain_style_properties,paste_convert_word_fake_lists').split(',');
  24047. var deprecatedPlugins = 'bbcode,colorpicker,contextmenu,fullpage,legacyoutput,spellchecker,textcolor'.split(',');
  24048. var movedToPremiumPlugins = 'imagetools,toc'.split(',');
  24049. var getDeprecatedSettings = function (settings) {
  24050. var settingNames = filter$4(deprecatedSettings, function (setting) {
  24051. return has$2(settings, setting);
  24052. });
  24053. var forcedRootBlock = settings.forced_root_block;
  24054. if (forcedRootBlock === false || forcedRootBlock === '') {
  24055. settingNames.push('forced_root_block (false only)');
  24056. }
  24057. return sort(settingNames);
  24058. };
  24059. var getDeprecatedPlugins = function (settings) {
  24060. var plugins = Tools.makeMap(settings.plugins, ' ');
  24061. var hasPlugin = function (plugin) {
  24062. return has$2(plugins, plugin);
  24063. };
  24064. var pluginNames = __spreadArray(__spreadArray([], filter$4(deprecatedPlugins, hasPlugin), true), bind(movedToPremiumPlugins, function (plugin) {
  24065. return hasPlugin(plugin) ? [plugin + ' (moving to premium)'] : [];
  24066. }), true);
  24067. return sort(pluginNames);
  24068. };
  24069. var logDeprecationsWarning = function (rawSettings, finalSettings) {
  24070. var deprecatedSettings = getDeprecatedSettings(rawSettings);
  24071. var deprecatedPlugins = getDeprecatedPlugins(finalSettings);
  24072. var hasDeprecatedPlugins = deprecatedPlugins.length > 0;
  24073. var hasDeprecatedSettings = deprecatedSettings.length > 0;
  24074. var isLegacyMobileTheme = finalSettings.theme === 'mobile';
  24075. if (hasDeprecatedPlugins || hasDeprecatedSettings || isLegacyMobileTheme) {
  24076. var listJoiner = '\n- ';
  24077. var themesMessage = isLegacyMobileTheme ? '\n\nThemes:' + listJoiner + 'mobile' : '';
  24078. var pluginsMessage = hasDeprecatedPlugins ? '\n\nPlugins:' + listJoiner + deprecatedPlugins.join(listJoiner) : '';
  24079. var settingsMessage = hasDeprecatedSettings ? '\n\nSettings:' + listJoiner + deprecatedSettings.join(listJoiner) : '';
  24080. console.warn('The following deprecated features are currently enabled, these will be removed in TinyMCE 6.0. ' + 'See https://www.tiny.cloud/docs/release-notes/6.0-upcoming-changes/ for more information.' + themesMessage + pluginsMessage + settingsMessage);
  24081. }
  24082. };
  24083. var sectionResult = function (sections, settings) {
  24084. return {
  24085. sections: constant(sections),
  24086. settings: constant(settings)
  24087. };
  24088. };
  24089. var deviceDetection = detect().deviceType;
  24090. var isTouch = deviceDetection.isTouch();
  24091. var isPhone = deviceDetection.isPhone();
  24092. var isTablet = deviceDetection.isTablet();
  24093. var legacyMobilePlugins = [
  24094. 'lists',
  24095. 'autolink',
  24096. 'autosave'
  24097. ];
  24098. var defaultTouchSettings = {
  24099. table_grid: false,
  24100. object_resizing: false,
  24101. resize: false
  24102. };
  24103. var normalizePlugins = function (plugins) {
  24104. var pluginNames = isArray$1(plugins) ? plugins.join(' ') : plugins;
  24105. var trimmedPlugins = map$3(isString$1(pluginNames) ? pluginNames.split(' ') : [], trim$4);
  24106. return filter$4(trimmedPlugins, function (item) {
  24107. return item.length > 0;
  24108. });
  24109. };
  24110. var filterLegacyMobilePlugins = function (plugins) {
  24111. return filter$4(plugins, curry(contains$3, legacyMobilePlugins));
  24112. };
  24113. var extractSections = function (keys, settings) {
  24114. var result = bifilter(settings, function (value, key) {
  24115. return contains$3(keys, key);
  24116. });
  24117. return sectionResult(result.t, result.f);
  24118. };
  24119. var getSection = function (sectionResult, name, defaults) {
  24120. if (defaults === void 0) {
  24121. defaults = {};
  24122. }
  24123. var sections = sectionResult.sections();
  24124. var sectionSettings = get$9(sections, name).getOr({});
  24125. return Tools.extend({}, defaults, sectionSettings);
  24126. };
  24127. var hasSection = function (sectionResult, name) {
  24128. return has$2(sectionResult.sections(), name);
  24129. };
  24130. var isSectionTheme = function (sectionResult, name, theme) {
  24131. var section = sectionResult.sections();
  24132. return hasSection(sectionResult, name) && section[name].theme === theme;
  24133. };
  24134. var getSectionConfig = function (sectionResult, name) {
  24135. return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {};
  24136. };
  24137. var getToolbarMode = function (settings, defaultVal) {
  24138. return get$9(settings, 'toolbar_mode').orThunk(function () {
  24139. return get$9(settings, 'toolbar_drawer').map(function (val) {
  24140. return val === false ? 'wrap' : val;
  24141. });
  24142. }).getOr(defaultVal);
  24143. };
  24144. var getDefaultSettings = function (settings, id, documentBaseUrl, isTouch, editor) {
  24145. var baseDefaults = {
  24146. id: id,
  24147. theme: 'silver',
  24148. toolbar_mode: getToolbarMode(settings, 'floating'),
  24149. plugins: '',
  24150. document_base_url: documentBaseUrl,
  24151. add_form_submit_trigger: true,
  24152. submit_patch: true,
  24153. add_unload_trigger: true,
  24154. convert_urls: true,
  24155. relative_urls: true,
  24156. remove_script_host: true,
  24157. object_resizing: true,
  24158. doctype: '<!DOCTYPE html>',
  24159. visual: true,
  24160. font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
  24161. forced_root_block: 'p',
  24162. hidden_input: true,
  24163. inline_styles: true,
  24164. convert_fonts_to_spans: true,
  24165. indent: true,
  24166. indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
  24167. indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
  24168. entity_encoding: 'named',
  24169. url_converter: editor.convertURL,
  24170. url_converter_scope: editor
  24171. };
  24172. return __assign(__assign({}, baseDefaults), isTouch ? defaultTouchSettings : {});
  24173. };
  24174. var getDefaultMobileSettings = function (mobileSettings, isPhone) {
  24175. var defaultMobileSettings = {
  24176. resize: false,
  24177. toolbar_mode: getToolbarMode(mobileSettings, 'scrolling'),
  24178. toolbar_sticky: false
  24179. };
  24180. var defaultPhoneSettings = { menubar: false };
  24181. return __assign(__assign(__assign({}, defaultTouchSettings), defaultMobileSettings), isPhone ? defaultPhoneSettings : {});
  24182. };
  24183. var getExternalPlugins = function (overrideSettings, settings) {
  24184. var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {};
  24185. if (overrideSettings && overrideSettings.external_plugins) {
  24186. return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins);
  24187. } else {
  24188. return userDefinedExternalPlugins;
  24189. }
  24190. };
  24191. var combinePlugins = function (forcedPlugins, plugins) {
  24192. return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins));
  24193. };
  24194. var getPlatformPlugins = function (isMobileDevice, sectionResult, desktopPlugins, mobilePlugins) {
  24195. if (isMobileDevice && isSectionTheme(sectionResult, 'mobile', 'mobile')) {
  24196. return filterLegacyMobilePlugins(mobilePlugins);
  24197. } else if (isMobileDevice && hasSection(sectionResult, 'mobile')) {
  24198. return mobilePlugins;
  24199. } else {
  24200. return desktopPlugins;
  24201. }
  24202. };
  24203. var processPlugins = function (isMobileDevice, sectionResult, defaultOverrideSettings, settings) {
  24204. var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
  24205. var desktopPlugins = normalizePlugins(settings.plugins);
  24206. var mobileConfig = getSectionConfig(sectionResult, 'mobile');
  24207. var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins;
  24208. var platformPlugins = getPlatformPlugins(isMobileDevice, sectionResult, desktopPlugins, mobilePlugins);
  24209. var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
  24210. if (Env.browser.isIE() && contains$3(combinedPlugins, 'rtc')) {
  24211. throw new Error('RTC plugin is not supported on IE 11.');
  24212. }
  24213. return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
  24214. };
  24215. var isOnMobile = function (isMobileDevice, sectionResult) {
  24216. return isMobileDevice && hasSection(sectionResult, 'mobile');
  24217. };
  24218. var combineSettings = function (isMobileDevice, isPhone, defaultSettings, defaultOverrideSettings, settings) {
  24219. var defaultDeviceSettings = isMobileDevice ? { mobile: getDefaultMobileSettings(settings.mobile || {}, isPhone) } : {};
  24220. var sectionResult = extractSections(['mobile'], deepMerge(defaultDeviceSettings, settings));
  24221. var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isMobileDevice, sectionResult) ? getSection(sectionResult, 'mobile') : {}, {
  24222. validate: true,
  24223. external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
  24224. });
  24225. return processPlugins(isMobileDevice, sectionResult, defaultOverrideSettings, extendedSettings);
  24226. };
  24227. var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
  24228. var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor);
  24229. var finalSettings = combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings);
  24230. if (finalSettings.deprecation_warnings !== false) {
  24231. logDeprecationsWarning(settings, finalSettings);
  24232. }
  24233. return finalSettings;
  24234. };
  24235. var getFiltered = function (predicate, editor, name) {
  24236. return Optional.from(editor.settings[name]).filter(predicate);
  24237. };
  24238. var getParamObject = function (value) {
  24239. var output = {};
  24240. if (typeof value === 'string') {
  24241. each$k(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
  24242. var arr = val.split('=');
  24243. if (arr.length > 1) {
  24244. output[Tools.trim(arr[0])] = Tools.trim(arr[1]);
  24245. } else {
  24246. output[Tools.trim(arr[0])] = Tools.trim(arr[0]);
  24247. }
  24248. });
  24249. } else {
  24250. output = value;
  24251. }
  24252. return output;
  24253. };
  24254. var isArrayOf = function (p) {
  24255. return function (a) {
  24256. return isArray$1(a) && forall(a, p);
  24257. };
  24258. };
  24259. var getParam = function (editor, name, defaultVal, type) {
  24260. var value = name in editor.settings ? editor.settings[name] : defaultVal;
  24261. if (type === 'hash') {
  24262. return getParamObject(value);
  24263. } else if (type === 'string') {
  24264. return getFiltered(isString$1, editor, name).getOr(defaultVal);
  24265. } else if (type === 'number') {
  24266. return getFiltered(isNumber, editor, name).getOr(defaultVal);
  24267. } else if (type === 'boolean') {
  24268. return getFiltered(isBoolean, editor, name).getOr(defaultVal);
  24269. } else if (type === 'object') {
  24270. return getFiltered(isObject, editor, name).getOr(defaultVal);
  24271. } else if (type === 'array') {
  24272. return getFiltered(isArray$1, editor, name).getOr(defaultVal);
  24273. } else if (type === 'string[]') {
  24274. return getFiltered(isArrayOf(isString$1), editor, name).getOr(defaultVal);
  24275. } else if (type === 'function') {
  24276. return getFiltered(isFunction, editor, name).getOr(defaultVal);
  24277. } else {
  24278. return value;
  24279. }
  24280. };
  24281. var CreateIconManager = function () {
  24282. var lookup = {};
  24283. var add = function (id, iconPack) {
  24284. lookup[id] = iconPack;
  24285. };
  24286. var get = function (id) {
  24287. if (lookup[id]) {
  24288. return lookup[id];
  24289. }
  24290. return { icons: {} };
  24291. };
  24292. var has = function (id) {
  24293. return has$2(lookup, id);
  24294. };
  24295. return {
  24296. add: add,
  24297. get: get,
  24298. has: has
  24299. };
  24300. };
  24301. var IconManager = CreateIconManager();
  24302. var getProp = function (propName, elm) {
  24303. var rawElm = elm.dom;
  24304. return rawElm[propName];
  24305. };
  24306. var getComputedSizeProp = function (propName, elm) {
  24307. return parseInt(get$5(elm, propName), 10);
  24308. };
  24309. var getClientWidth = curry(getProp, 'clientWidth');
  24310. var getClientHeight = curry(getProp, 'clientHeight');
  24311. var getMarginTop = curry(getComputedSizeProp, 'margin-top');
  24312. var getMarginLeft = curry(getComputedSizeProp, 'margin-left');
  24313. var getBoundingClientRect = function (elm) {
  24314. return elm.dom.getBoundingClientRect();
  24315. };
  24316. var isInsideElementContentArea = function (bodyElm, clientX, clientY) {
  24317. var clientWidth = getClientWidth(bodyElm);
  24318. var clientHeight = getClientHeight(bodyElm);
  24319. return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight;
  24320. };
  24321. var transpose = function (inline, elm, clientX, clientY) {
  24322. var clientRect = getBoundingClientRect(elm);
  24323. var deltaX = inline ? clientRect.left + elm.dom.clientLeft + getMarginLeft(elm) : 0;
  24324. var deltaY = inline ? clientRect.top + elm.dom.clientTop + getMarginTop(elm) : 0;
  24325. var x = clientX - deltaX;
  24326. var y = clientY - deltaY;
  24327. return {
  24328. x: x,
  24329. y: y
  24330. };
  24331. };
  24332. var isXYInContentArea = function (editor, clientX, clientY) {
  24333. var bodyElm = SugarElement.fromDom(editor.getBody());
  24334. var targetElm = editor.inline ? bodyElm : documentElement(bodyElm);
  24335. var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY);
  24336. return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y);
  24337. };
  24338. var fromDomSafe = function (node) {
  24339. return Optional.from(node).map(SugarElement.fromDom);
  24340. };
  24341. var isEditorAttachedToDom = function (editor) {
  24342. var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer();
  24343. return fromDomSafe(rawContainer).map(inBody).getOr(false);
  24344. };
  24345. var NotificationManagerImpl = function () {
  24346. var unimplemented = function () {
  24347. throw new Error('Theme did not provide a NotificationManager implementation.');
  24348. };
  24349. return {
  24350. open: unimplemented,
  24351. close: unimplemented,
  24352. reposition: unimplemented,
  24353. getArgs: unimplemented
  24354. };
  24355. };
  24356. var NotificationManager = function (editor) {
  24357. var notifications = [];
  24358. var getImplementation = function () {
  24359. var theme = editor.theme;
  24360. return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl();
  24361. };
  24362. var getTopNotification = function () {
  24363. return Optional.from(notifications[0]);
  24364. };
  24365. var isEqual = function (a, b) {
  24366. return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout;
  24367. };
  24368. var reposition = function () {
  24369. if (notifications.length > 0) {
  24370. getImplementation().reposition(notifications);
  24371. }
  24372. };
  24373. var addNotification = function (notification) {
  24374. notifications.push(notification);
  24375. };
  24376. var closeNotification = function (notification) {
  24377. findIndex$2(notifications, function (otherNotification) {
  24378. return otherNotification === notification;
  24379. }).each(function (index) {
  24380. notifications.splice(index, 1);
  24381. });
  24382. };
  24383. var open = function (spec, fireEvent) {
  24384. if (fireEvent === void 0) {
  24385. fireEvent = true;
  24386. }
  24387. if (editor.removed || !isEditorAttachedToDom(editor)) {
  24388. return;
  24389. }
  24390. if (fireEvent) {
  24391. editor.fire('BeforeOpenNotification', { notification: spec });
  24392. }
  24393. return find$3(notifications, function (notification) {
  24394. return isEqual(getImplementation().getArgs(notification), spec);
  24395. }).getOrThunk(function () {
  24396. editor.editorManager.setActive(editor);
  24397. var notification = getImplementation().open(spec, function () {
  24398. closeNotification(notification);
  24399. reposition();
  24400. getTopNotification().fold(function () {
  24401. return editor.focus();
  24402. }, function (top) {
  24403. return focus$1(SugarElement.fromDom(top.getEl()));
  24404. });
  24405. });
  24406. addNotification(notification);
  24407. reposition();
  24408. editor.fire('OpenNotification', { notification: __assign({}, notification) });
  24409. return notification;
  24410. });
  24411. };
  24412. var close = function () {
  24413. getTopNotification().each(function (notification) {
  24414. getImplementation().close(notification);
  24415. closeNotification(notification);
  24416. reposition();
  24417. });
  24418. };
  24419. var getNotifications = constant(notifications);
  24420. var registerEvents = function (editor) {
  24421. editor.on('SkinLoaded', function () {
  24422. var serviceMessage = getServiceMessage(editor);
  24423. if (serviceMessage) {
  24424. open({
  24425. text: serviceMessage,
  24426. type: 'warning',
  24427. timeout: 0
  24428. }, false);
  24429. }
  24430. reposition();
  24431. });
  24432. editor.on('show ResizeEditor ResizeWindow NodeChange', function () {
  24433. Delay.requestAnimationFrame(reposition);
  24434. });
  24435. editor.on('remove', function () {
  24436. each$k(notifications.slice(), function (notification) {
  24437. getImplementation().close(notification);
  24438. });
  24439. });
  24440. };
  24441. registerEvents(editor);
  24442. return {
  24443. open: open,
  24444. close: close,
  24445. getNotifications: getNotifications
  24446. };
  24447. };
  24448. var PluginManager = AddOnManager.PluginManager;
  24449. var ThemeManager = AddOnManager.ThemeManager;
  24450. function WindowManagerImpl () {
  24451. var unimplemented = function () {
  24452. throw new Error('Theme did not provide a WindowManager implementation.');
  24453. };
  24454. return {
  24455. open: unimplemented,
  24456. openUrl: unimplemented,
  24457. alert: unimplemented,
  24458. confirm: unimplemented,
  24459. close: unimplemented,
  24460. getParams: unimplemented,
  24461. setParams: unimplemented
  24462. };
  24463. }
  24464. var WindowManager = function (editor) {
  24465. var dialogs = [];
  24466. var getImplementation = function () {
  24467. var theme = editor.theme;
  24468. return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl();
  24469. };
  24470. var funcBind = function (scope, f) {
  24471. return function () {
  24472. var args = [];
  24473. for (var _i = 0; _i < arguments.length; _i++) {
  24474. args[_i] = arguments[_i];
  24475. }
  24476. return f ? f.apply(scope, args) : undefined;
  24477. };
  24478. };
  24479. var fireOpenEvent = function (dialog) {
  24480. editor.fire('OpenWindow', { dialog: dialog });
  24481. };
  24482. var fireCloseEvent = function (dialog) {
  24483. editor.fire('CloseWindow', { dialog: dialog });
  24484. };
  24485. var addDialog = function (dialog) {
  24486. dialogs.push(dialog);
  24487. fireOpenEvent(dialog);
  24488. };
  24489. var closeDialog = function (dialog) {
  24490. fireCloseEvent(dialog);
  24491. dialogs = filter$4(dialogs, function (otherDialog) {
  24492. return otherDialog !== dialog;
  24493. });
  24494. if (dialogs.length === 0) {
  24495. editor.focus();
  24496. }
  24497. };
  24498. var getTopDialog = function () {
  24499. return Optional.from(dialogs[dialogs.length - 1]);
  24500. };
  24501. var storeSelectionAndOpenDialog = function (openDialog) {
  24502. editor.editorManager.setActive(editor);
  24503. store(editor);
  24504. var dialog = openDialog();
  24505. addDialog(dialog);
  24506. return dialog;
  24507. };
  24508. var open = function (args, params) {
  24509. return storeSelectionAndOpenDialog(function () {
  24510. return getImplementation().open(args, params, closeDialog);
  24511. });
  24512. };
  24513. var openUrl = function (args) {
  24514. return storeSelectionAndOpenDialog(function () {
  24515. return getImplementation().openUrl(args, closeDialog);
  24516. });
  24517. };
  24518. var alert = function (message, callback, scope) {
  24519. var windowManagerImpl = getImplementation();
  24520. windowManagerImpl.alert(message, funcBind(scope ? scope : windowManagerImpl, callback));
  24521. };
  24522. var confirm = function (message, callback, scope) {
  24523. var windowManagerImpl = getImplementation();
  24524. windowManagerImpl.confirm(message, funcBind(scope ? scope : windowManagerImpl, callback));
  24525. };
  24526. var close = function () {
  24527. getTopDialog().each(function (dialog) {
  24528. getImplementation().close(dialog);
  24529. closeDialog(dialog);
  24530. });
  24531. };
  24532. editor.on('remove', function () {
  24533. each$k(dialogs, function (dialog) {
  24534. getImplementation().close(dialog);
  24535. });
  24536. });
  24537. return {
  24538. open: open,
  24539. openUrl: openUrl,
  24540. alert: alert,
  24541. confirm: confirm,
  24542. close: close
  24543. };
  24544. };
  24545. var displayNotification = function (editor, message) {
  24546. editor.notificationManager.open({
  24547. type: 'error',
  24548. text: message
  24549. });
  24550. };
  24551. var displayError = function (editor, message) {
  24552. if (editor._skinLoaded) {
  24553. displayNotification(editor, message);
  24554. } else {
  24555. editor.on('SkinLoaded', function () {
  24556. displayNotification(editor, message);
  24557. });
  24558. }
  24559. };
  24560. var uploadError = function (editor, message) {
  24561. displayError(editor, I18n.translate([
  24562. 'Failed to upload image: {0}',
  24563. message
  24564. ]));
  24565. };
  24566. var logError = function (editor, errorType, msg) {
  24567. fireError(editor, errorType, { message: msg });
  24568. console.error(msg);
  24569. };
  24570. var createLoadError = function (type, url, name) {
  24571. return name ? 'Failed to load ' + type + ': ' + name + ' from url ' + url : 'Failed to load ' + type + ' url: ' + url;
  24572. };
  24573. var pluginLoadError = function (editor, url, name) {
  24574. logError(editor, 'PluginLoadError', createLoadError('plugin', url, name));
  24575. };
  24576. var iconsLoadError = function (editor, url, name) {
  24577. logError(editor, 'IconsLoadError', createLoadError('icons', url, name));
  24578. };
  24579. var languageLoadError = function (editor, url, name) {
  24580. logError(editor, 'LanguageLoadError', createLoadError('language', url, name));
  24581. };
  24582. var pluginInitError = function (editor, name, err) {
  24583. var message = I18n.translate([
  24584. 'Failed to initialize plugin: {0}',
  24585. name
  24586. ]);
  24587. fireError(editor, 'PluginLoadError', { message: message });
  24588. initError(message, err);
  24589. displayError(editor, message);
  24590. };
  24591. var initError = function (message) {
  24592. var x = [];
  24593. for (var _i = 1; _i < arguments.length; _i++) {
  24594. x[_i - 1] = arguments[_i];
  24595. }
  24596. var console = window.console;
  24597. if (console) {
  24598. if (console.error) {
  24599. console.error.apply(console, __spreadArray([message], x, false));
  24600. } else {
  24601. console.log.apply(console, __spreadArray([message], x, false));
  24602. }
  24603. }
  24604. };
  24605. var isContentCssSkinName = function (url) {
  24606. return /^[a-z0-9\-]+$/i.test(url);
  24607. };
  24608. var getContentCssUrls = function (editor) {
  24609. return transformToUrls(editor, getContentCss(editor));
  24610. };
  24611. var getFontCssUrls = function (editor) {
  24612. return transformToUrls(editor, getFontCss(editor));
  24613. };
  24614. var transformToUrls = function (editor, cssLinks) {
  24615. var skinUrl = editor.editorManager.baseURL + '/skins/content';
  24616. var suffix = editor.editorManager.suffix;
  24617. var contentCssFile = 'content' + suffix + '.css';
  24618. var inline = editor.inline === true;
  24619. return map$3(cssLinks, function (url) {
  24620. if (isContentCssSkinName(url) && !inline) {
  24621. return skinUrl + '/' + url + '/' + contentCssFile;
  24622. } else {
  24623. return editor.documentBaseURI.toAbsolute(url);
  24624. }
  24625. });
  24626. };
  24627. var appendContentCssFromSettings = function (editor) {
  24628. editor.contentCSS = editor.contentCSS.concat(getContentCssUrls(editor), getFontCssUrls(editor));
  24629. };
  24630. var UploadStatus = function () {
  24631. var PENDING = 1, UPLOADED = 2;
  24632. var blobUriStatuses = {};
  24633. var createStatus = function (status, resultUri) {
  24634. return {
  24635. status: status,
  24636. resultUri: resultUri
  24637. };
  24638. };
  24639. var hasBlobUri = function (blobUri) {
  24640. return blobUri in blobUriStatuses;
  24641. };
  24642. var getResultUri = function (blobUri) {
  24643. var result = blobUriStatuses[blobUri];
  24644. return result ? result.resultUri : null;
  24645. };
  24646. var isPending = function (blobUri) {
  24647. return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false;
  24648. };
  24649. var isUploaded = function (blobUri) {
  24650. return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false;
  24651. };
  24652. var markPending = function (blobUri) {
  24653. blobUriStatuses[blobUri] = createStatus(PENDING, null);
  24654. };
  24655. var markUploaded = function (blobUri, resultUri) {
  24656. blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri);
  24657. };
  24658. var removeFailed = function (blobUri) {
  24659. delete blobUriStatuses[blobUri];
  24660. };
  24661. var destroy = function () {
  24662. blobUriStatuses = {};
  24663. };
  24664. return {
  24665. hasBlobUri: hasBlobUri,
  24666. getResultUri: getResultUri,
  24667. isPending: isPending,
  24668. isUploaded: isUploaded,
  24669. markPending: markPending,
  24670. markUploaded: markUploaded,
  24671. removeFailed: removeFailed,
  24672. destroy: destroy
  24673. };
  24674. };
  24675. var count = 0;
  24676. var seed = function () {
  24677. var rnd = function () {
  24678. return Math.round(Math.random() * 4294967295).toString(36);
  24679. };
  24680. var now = new Date().getTime();
  24681. return 's' + now.toString(36) + rnd() + rnd() + rnd();
  24682. };
  24683. var uuid = function (prefix) {
  24684. return prefix + count++ + seed();
  24685. };
  24686. var BlobCache = function () {
  24687. var cache = [];
  24688. var mimeToExt = function (mime) {
  24689. var mimes = {
  24690. 'image/jpeg': 'jpg',
  24691. 'image/jpg': 'jpg',
  24692. 'image/gif': 'gif',
  24693. 'image/png': 'png',
  24694. 'image/apng': 'apng',
  24695. 'image/avif': 'avif',
  24696. 'image/svg+xml': 'svg',
  24697. 'image/webp': 'webp',
  24698. 'image/bmp': 'bmp',
  24699. 'image/tiff': 'tiff'
  24700. };
  24701. return mimes[mime.toLowerCase()] || 'dat';
  24702. };
  24703. var create = function (o, blob, base64, name, filename) {
  24704. if (isString$1(o)) {
  24705. var id = o;
  24706. return toBlobInfo({
  24707. id: id,
  24708. name: name,
  24709. filename: filename,
  24710. blob: blob,
  24711. base64: base64
  24712. });
  24713. } else if (isObject(o)) {
  24714. return toBlobInfo(o);
  24715. } else {
  24716. throw new Error('Unknown input type');
  24717. }
  24718. };
  24719. var toBlobInfo = function (o) {
  24720. if (!o.blob || !o.base64) {
  24721. throw new Error('blob and base64 representations of the image are required for BlobInfo to be created');
  24722. }
  24723. var id = o.id || uuid('blobid');
  24724. var name = o.name || id;
  24725. var blob = o.blob;
  24726. return {
  24727. id: constant(id),
  24728. name: constant(name),
  24729. filename: constant(o.filename || name + '.' + mimeToExt(blob.type)),
  24730. blob: constant(blob),
  24731. base64: constant(o.base64),
  24732. blobUri: constant(o.blobUri || URL.createObjectURL(blob)),
  24733. uri: constant(o.uri)
  24734. };
  24735. };
  24736. var add = function (blobInfo) {
  24737. if (!get(blobInfo.id())) {
  24738. cache.push(blobInfo);
  24739. }
  24740. };
  24741. var findFirst = function (predicate) {
  24742. return find$3(cache, predicate).getOrUndefined();
  24743. };
  24744. var get = function (id) {
  24745. return findFirst(function (cachedBlobInfo) {
  24746. return cachedBlobInfo.id() === id;
  24747. });
  24748. };
  24749. var getByUri = function (blobUri) {
  24750. return findFirst(function (blobInfo) {
  24751. return blobInfo.blobUri() === blobUri;
  24752. });
  24753. };
  24754. var getByData = function (base64, type) {
  24755. return findFirst(function (blobInfo) {
  24756. return blobInfo.base64() === base64 && blobInfo.blob().type === type;
  24757. });
  24758. };
  24759. var removeByUri = function (blobUri) {
  24760. cache = filter$4(cache, function (blobInfo) {
  24761. if (blobInfo.blobUri() === blobUri) {
  24762. URL.revokeObjectURL(blobInfo.blobUri());
  24763. return false;
  24764. }
  24765. return true;
  24766. });
  24767. };
  24768. var destroy = function () {
  24769. each$k(cache, function (cachedBlobInfo) {
  24770. URL.revokeObjectURL(cachedBlobInfo.blobUri());
  24771. });
  24772. cache = [];
  24773. };
  24774. return {
  24775. create: create,
  24776. add: add,
  24777. get: get,
  24778. getByUri: getByUri,
  24779. getByData: getByData,
  24780. findFirst: findFirst,
  24781. removeByUri: removeByUri,
  24782. destroy: destroy
  24783. };
  24784. };
  24785. var Uploader = function (uploadStatus, settings) {
  24786. var pendingPromises = {};
  24787. var pathJoin = function (path1, path2) {
  24788. if (path1) {
  24789. return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
  24790. }
  24791. return path2;
  24792. };
  24793. var defaultHandler = function (blobInfo, success, failure, progress) {
  24794. var xhr = new XMLHttpRequest();
  24795. xhr.open('POST', settings.url);
  24796. xhr.withCredentials = settings.credentials;
  24797. xhr.upload.onprogress = function (e) {
  24798. progress(e.loaded / e.total * 100);
  24799. };
  24800. xhr.onerror = function () {
  24801. failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
  24802. };
  24803. xhr.onload = function () {
  24804. if (xhr.status < 200 || xhr.status >= 300) {
  24805. failure('HTTP Error: ' + xhr.status);
  24806. return;
  24807. }
  24808. var json = JSON.parse(xhr.responseText);
  24809. if (!json || typeof json.location !== 'string') {
  24810. failure('Invalid JSON: ' + xhr.responseText);
  24811. return;
  24812. }
  24813. success(pathJoin(settings.basePath, json.location));
  24814. };
  24815. var formData = new FormData();
  24816. formData.append('file', blobInfo.blob(), blobInfo.filename());
  24817. xhr.send(formData);
  24818. };
  24819. var noUpload = function () {
  24820. return new promiseObj(function (resolve) {
  24821. resolve([]);
  24822. });
  24823. };
  24824. var handlerSuccess = function (blobInfo, url) {
  24825. return {
  24826. url: url,
  24827. blobInfo: blobInfo,
  24828. status: true
  24829. };
  24830. };
  24831. var handlerFailure = function (blobInfo, message, options) {
  24832. return {
  24833. url: '',
  24834. blobInfo: blobInfo,
  24835. status: false,
  24836. error: {
  24837. message: message,
  24838. options: options
  24839. }
  24840. };
  24841. };
  24842. var resolvePending = function (blobUri, result) {
  24843. Tools.each(pendingPromises[blobUri], function (resolve) {
  24844. resolve(result);
  24845. });
  24846. delete pendingPromises[blobUri];
  24847. };
  24848. var uploadBlobInfo = function (blobInfo, handler, openNotification) {
  24849. uploadStatus.markPending(blobInfo.blobUri());
  24850. return new promiseObj(function (resolve) {
  24851. var notification, progress;
  24852. try {
  24853. var closeNotification_1 = function () {
  24854. if (notification) {
  24855. notification.close();
  24856. progress = noop;
  24857. }
  24858. };
  24859. var success = function (url) {
  24860. closeNotification_1();
  24861. uploadStatus.markUploaded(blobInfo.blobUri(), url);
  24862. resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url));
  24863. resolve(handlerSuccess(blobInfo, url));
  24864. };
  24865. var failure = function (error, options) {
  24866. var failureOptions = options ? options : {};
  24867. closeNotification_1();
  24868. uploadStatus.removeFailed(blobInfo.blobUri());
  24869. resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error, failureOptions));
  24870. resolve(handlerFailure(blobInfo, error, failureOptions));
  24871. };
  24872. progress = function (percent) {
  24873. if (percent < 0 || percent > 100) {
  24874. return;
  24875. }
  24876. Optional.from(notification).orThunk(function () {
  24877. return Optional.from(openNotification).map(apply);
  24878. }).each(function (n) {
  24879. notification = n;
  24880. n.progressBar.value(percent);
  24881. });
  24882. };
  24883. handler(blobInfo, success, failure, progress);
  24884. } catch (ex) {
  24885. resolve(handlerFailure(blobInfo, ex.message, {}));
  24886. }
  24887. });
  24888. };
  24889. var isDefaultHandler = function (handler) {
  24890. return handler === defaultHandler;
  24891. };
  24892. var pendingUploadBlobInfo = function (blobInfo) {
  24893. var blobUri = blobInfo.blobUri();
  24894. return new promiseObj(function (resolve) {
  24895. pendingPromises[blobUri] = pendingPromises[blobUri] || [];
  24896. pendingPromises[blobUri].push(resolve);
  24897. });
  24898. };
  24899. var uploadBlobs = function (blobInfos, openNotification) {
  24900. blobInfos = Tools.grep(blobInfos, function (blobInfo) {
  24901. return !uploadStatus.isUploaded(blobInfo.blobUri());
  24902. });
  24903. return promiseObj.all(Tools.map(blobInfos, function (blobInfo) {
  24904. return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification);
  24905. }));
  24906. };
  24907. var upload = function (blobInfos, openNotification) {
  24908. return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification);
  24909. };
  24910. if (isFunction(settings.handler) === false) {
  24911. settings.handler = defaultHandler;
  24912. }
  24913. return { upload: upload };
  24914. };
  24915. var openNotification = function (editor) {
  24916. return function () {
  24917. return editor.notificationManager.open({
  24918. text: editor.translate('Image uploading...'),
  24919. type: 'info',
  24920. timeout: -1,
  24921. progressBar: true
  24922. });
  24923. };
  24924. };
  24925. var createUploader = function (editor, uploadStatus) {
  24926. return Uploader(uploadStatus, {
  24927. url: getImageUploadUrl(editor),
  24928. basePath: getImageUploadBasePath(editor),
  24929. credentials: getImagesUploadCredentials(editor),
  24930. handler: getImagesUploadHandler(editor)
  24931. });
  24932. };
  24933. var ImageUploader = function (editor) {
  24934. var uploadStatus = UploadStatus();
  24935. var uploader = createUploader(editor, uploadStatus);
  24936. return {
  24937. upload: function (blobInfos, showNotification) {
  24938. if (showNotification === void 0) {
  24939. showNotification = true;
  24940. }
  24941. return uploader.upload(blobInfos, showNotification ? openNotification(editor) : undefined);
  24942. }
  24943. };
  24944. };
  24945. var UploadChangeHandler = function (editor) {
  24946. var lastChangedLevel = Cell(null);
  24947. editor.on('change AddUndo', function (e) {
  24948. lastChangedLevel.set(__assign({}, e.level));
  24949. });
  24950. var fireIfChanged = function () {
  24951. var data = editor.undoManager.data;
  24952. last$2(data).filter(function (level) {
  24953. return !isEq$1(lastChangedLevel.get(), level);
  24954. }).each(function (level) {
  24955. editor.setDirty(true);
  24956. editor.fire('change', {
  24957. level: level,
  24958. lastLevel: get$a(data, data.length - 2).getOrNull()
  24959. });
  24960. });
  24961. };
  24962. return { fireIfChanged: fireIfChanged };
  24963. };
  24964. var EditorUpload = function (editor) {
  24965. var blobCache = BlobCache();
  24966. var uploader, imageScanner;
  24967. var uploadStatus = UploadStatus();
  24968. var urlFilters = [];
  24969. var changeHandler = UploadChangeHandler(editor);
  24970. var aliveGuard = function (callback) {
  24971. return function (result) {
  24972. if (editor.selection) {
  24973. return callback(result);
  24974. }
  24975. return [];
  24976. };
  24977. };
  24978. var cacheInvalidator = function (url) {
  24979. return url + (url.indexOf('?') === -1 ? '?' : '&') + new Date().getTime();
  24980. };
  24981. var replaceString = function (content, search, replace) {
  24982. var index = 0;
  24983. do {
  24984. index = content.indexOf(search, index);
  24985. if (index !== -1) {
  24986. content = content.substring(0, index) + replace + content.substr(index + search.length);
  24987. index += replace.length - search.length + 1;
  24988. }
  24989. } while (index !== -1);
  24990. return content;
  24991. };
  24992. var replaceImageUrl = function (content, targetUrl, replacementUrl) {
  24993. var replacementString = 'src="' + replacementUrl + '"' + (replacementUrl === Env.transparentSrc ? ' data-mce-placeholder="1"' : '');
  24994. content = replaceString(content, 'src="' + targetUrl + '"', replacementString);
  24995. content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
  24996. return content;
  24997. };
  24998. var replaceUrlInUndoStack = function (targetUrl, replacementUrl) {
  24999. each$k(editor.undoManager.data, function (level) {
  25000. if (level.type === 'fragmented') {
  25001. level.fragments = map$3(level.fragments, function (fragment) {
  25002. return replaceImageUrl(fragment, targetUrl, replacementUrl);
  25003. });
  25004. } else {
  25005. level.content = replaceImageUrl(level.content, targetUrl, replacementUrl);
  25006. }
  25007. });
  25008. };
  25009. var replaceImageUriInView = function (image, resultUri) {
  25010. var src = editor.convertURL(resultUri, 'src');
  25011. replaceUrlInUndoStack(image.src, resultUri);
  25012. editor.$(image).attr({
  25013. 'src': shouldReuseFileName(editor) ? cacheInvalidator(resultUri) : resultUri,
  25014. 'data-mce-src': src
  25015. });
  25016. };
  25017. var uploadImages = function (callback) {
  25018. if (!uploader) {
  25019. uploader = createUploader(editor, uploadStatus);
  25020. }
  25021. return scanForImages().then(aliveGuard(function (imageInfos) {
  25022. var blobInfos = map$3(imageInfos, function (imageInfo) {
  25023. return imageInfo.blobInfo;
  25024. });
  25025. return uploader.upload(blobInfos, openNotification(editor)).then(aliveGuard(function (result) {
  25026. var imagesToRemove = [];
  25027. var filteredResult = map$3(result, function (uploadInfo, index) {
  25028. var blobInfo = imageInfos[index].blobInfo;
  25029. var image = imageInfos[index].image;
  25030. if (uploadInfo.status && shouldReplaceBlobUris(editor)) {
  25031. blobCache.removeByUri(image.src);
  25032. if (isRtc(editor)) ; else {
  25033. replaceImageUriInView(image, uploadInfo.url);
  25034. }
  25035. } else if (uploadInfo.error) {
  25036. if (uploadInfo.error.options.remove) {
  25037. replaceUrlInUndoStack(image.getAttribute('src'), Env.transparentSrc);
  25038. imagesToRemove.push(image);
  25039. }
  25040. uploadError(editor, uploadInfo.error.message);
  25041. }
  25042. return {
  25043. element: image,
  25044. status: uploadInfo.status,
  25045. uploadUri: uploadInfo.url,
  25046. blobInfo: blobInfo
  25047. };
  25048. });
  25049. if (filteredResult.length > 0) {
  25050. changeHandler.fireIfChanged();
  25051. }
  25052. if (imagesToRemove.length > 0) {
  25053. if (isRtc(editor)) {
  25054. console.error('Removing images on failed uploads is currently unsupported for RTC');
  25055. } else {
  25056. editor.undoManager.transact(function () {
  25057. each$k(imagesToRemove, function (element) {
  25058. editor.dom.remove(element);
  25059. blobCache.removeByUri(element.src);
  25060. });
  25061. });
  25062. }
  25063. }
  25064. if (callback) {
  25065. callback(filteredResult);
  25066. }
  25067. return filteredResult;
  25068. }));
  25069. }));
  25070. };
  25071. var uploadImagesAuto = function (callback) {
  25072. if (isAutomaticUploadsEnabled(editor)) {
  25073. return uploadImages(callback);
  25074. }
  25075. };
  25076. var isValidDataUriImage = function (imgElm) {
  25077. if (forall(urlFilters, function (filter) {
  25078. return filter(imgElm);
  25079. }) === false) {
  25080. return false;
  25081. }
  25082. if (imgElm.getAttribute('src').indexOf('data:') === 0) {
  25083. var dataImgFilter = getImagesDataImgFilter(editor);
  25084. return dataImgFilter(imgElm);
  25085. }
  25086. return true;
  25087. };
  25088. var addFilter = function (filter) {
  25089. urlFilters.push(filter);
  25090. };
  25091. var scanForImages = function () {
  25092. if (!imageScanner) {
  25093. imageScanner = ImageScanner(uploadStatus, blobCache);
  25094. }
  25095. return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) {
  25096. result = filter$4(result, function (resultItem) {
  25097. if (typeof resultItem === 'string') {
  25098. displayError(editor, resultItem);
  25099. return false;
  25100. }
  25101. return true;
  25102. });
  25103. if (isRtc(editor)) ; else {
  25104. each$k(result, function (resultItem) {
  25105. replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());
  25106. resultItem.image.src = resultItem.blobInfo.blobUri();
  25107. resultItem.image.removeAttribute('data-mce-src');
  25108. });
  25109. }
  25110. return result;
  25111. }));
  25112. };
  25113. var destroy = function () {
  25114. blobCache.destroy();
  25115. uploadStatus.destroy();
  25116. imageScanner = uploader = null;
  25117. };
  25118. var replaceBlobUris = function (content) {
  25119. return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) {
  25120. var resultUri = uploadStatus.getResultUri(blobUri);
  25121. if (resultUri) {
  25122. return 'src="' + resultUri + '"';
  25123. }
  25124. var blobInfo = blobCache.getByUri(blobUri);
  25125. if (!blobInfo) {
  25126. blobInfo = foldl(editor.editorManager.get(), function (result, editor) {
  25127. return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri);
  25128. }, null);
  25129. }
  25130. if (blobInfo) {
  25131. var blob = blobInfo.blob();
  25132. return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"';
  25133. }
  25134. return match;
  25135. });
  25136. };
  25137. editor.on('SetContent', function () {
  25138. if (isAutomaticUploadsEnabled(editor)) {
  25139. uploadImagesAuto();
  25140. } else {
  25141. scanForImages();
  25142. }
  25143. });
  25144. editor.on('RawSaveContent', function (e) {
  25145. e.content = replaceBlobUris(e.content);
  25146. });
  25147. editor.on('GetContent', function (e) {
  25148. if (e.source_view || e.format === 'raw' || e.format === 'tree') {
  25149. return;
  25150. }
  25151. e.content = replaceBlobUris(e.content);
  25152. });
  25153. editor.on('PostRender', function () {
  25154. editor.parser.addNodeFilter('img', function (images) {
  25155. each$k(images, function (img) {
  25156. var src = img.attr('src');
  25157. if (blobCache.getByUri(src)) {
  25158. return;
  25159. }
  25160. var resultUri = uploadStatus.getResultUri(src);
  25161. if (resultUri) {
  25162. img.attr('src', resultUri);
  25163. }
  25164. });
  25165. });
  25166. });
  25167. return {
  25168. blobCache: blobCache,
  25169. addFilter: addFilter,
  25170. uploadImages: uploadImages,
  25171. uploadImagesAuto: uploadImagesAuto,
  25172. scanForImages: scanForImages,
  25173. destroy: destroy
  25174. };
  25175. };
  25176. var get = function (dom) {
  25177. var formats = {
  25178. valigntop: [{
  25179. selector: 'td,th',
  25180. styles: { verticalAlign: 'top' }
  25181. }],
  25182. valignmiddle: [{
  25183. selector: 'td,th',
  25184. styles: { verticalAlign: 'middle' }
  25185. }],
  25186. valignbottom: [{
  25187. selector: 'td,th',
  25188. styles: { verticalAlign: 'bottom' }
  25189. }],
  25190. alignleft: [
  25191. {
  25192. selector: 'figure.image',
  25193. collapsed: false,
  25194. classes: 'align-left',
  25195. ceFalseOverride: true,
  25196. preview: 'font-family font-size'
  25197. },
  25198. {
  25199. selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
  25200. styles: { textAlign: 'left' },
  25201. inherit: false,
  25202. preview: false,
  25203. defaultBlock: 'div'
  25204. },
  25205. {
  25206. selector: 'img,table,audio,video',
  25207. collapsed: false,
  25208. styles: { float: 'left' },
  25209. preview: 'font-family font-size'
  25210. }
  25211. ],
  25212. aligncenter: [
  25213. {
  25214. selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
  25215. styles: { textAlign: 'center' },
  25216. inherit: false,
  25217. preview: 'font-family font-size',
  25218. defaultBlock: 'div'
  25219. },
  25220. {
  25221. selector: 'figure.image',
  25222. collapsed: false,
  25223. classes: 'align-center',
  25224. ceFalseOverride: true,
  25225. preview: 'font-family font-size'
  25226. },
  25227. {
  25228. selector: 'img,audio,video',
  25229. collapsed: false,
  25230. styles: {
  25231. display: 'block',
  25232. marginLeft: 'auto',
  25233. marginRight: 'auto'
  25234. },
  25235. preview: false
  25236. },
  25237. {
  25238. selector: 'table',
  25239. collapsed: false,
  25240. styles: {
  25241. marginLeft: 'auto',
  25242. marginRight: 'auto'
  25243. },
  25244. preview: 'font-family font-size'
  25245. }
  25246. ],
  25247. alignright: [
  25248. {
  25249. selector: 'figure.image',
  25250. collapsed: false,
  25251. classes: 'align-right',
  25252. ceFalseOverride: true,
  25253. preview: 'font-family font-size'
  25254. },
  25255. {
  25256. selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
  25257. styles: { textAlign: 'right' },
  25258. inherit: false,
  25259. preview: 'font-family font-size',
  25260. defaultBlock: 'div'
  25261. },
  25262. {
  25263. selector: 'img,table,audio,video',
  25264. collapsed: false,
  25265. styles: { float: 'right' },
  25266. preview: 'font-family font-size'
  25267. }
  25268. ],
  25269. alignjustify: [{
  25270. selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
  25271. styles: { textAlign: 'justify' },
  25272. inherit: false,
  25273. defaultBlock: 'div',
  25274. preview: 'font-family font-size'
  25275. }],
  25276. bold: [
  25277. {
  25278. inline: 'strong',
  25279. remove: 'all',
  25280. preserve_attributes: [
  25281. 'class',
  25282. 'style'
  25283. ]
  25284. },
  25285. {
  25286. inline: 'span',
  25287. styles: { fontWeight: 'bold' }
  25288. },
  25289. {
  25290. inline: 'b',
  25291. remove: 'all',
  25292. preserve_attributes: [
  25293. 'class',
  25294. 'style'
  25295. ]
  25296. }
  25297. ],
  25298. italic: [
  25299. {
  25300. inline: 'em',
  25301. remove: 'all',
  25302. preserve_attributes: [
  25303. 'class',
  25304. 'style'
  25305. ]
  25306. },
  25307. {
  25308. inline: 'span',
  25309. styles: { fontStyle: 'italic' }
  25310. },
  25311. {
  25312. inline: 'i',
  25313. remove: 'all',
  25314. preserve_attributes: [
  25315. 'class',
  25316. 'style'
  25317. ]
  25318. }
  25319. ],
  25320. underline: [
  25321. {
  25322. inline: 'span',
  25323. styles: { textDecoration: 'underline' },
  25324. exact: true
  25325. },
  25326. {
  25327. inline: 'u',
  25328. remove: 'all',
  25329. preserve_attributes: [
  25330. 'class',
  25331. 'style'
  25332. ]
  25333. }
  25334. ],
  25335. strikethrough: [
  25336. {
  25337. inline: 'span',
  25338. styles: { textDecoration: 'line-through' },
  25339. exact: true
  25340. },
  25341. {
  25342. inline: 'strike',
  25343. remove: 'all',
  25344. preserve_attributes: [
  25345. 'class',
  25346. 'style'
  25347. ]
  25348. },
  25349. {
  25350. inline: 's',
  25351. remove: 'all',
  25352. preserve_attributes: [
  25353. 'class',
  25354. 'style'
  25355. ]
  25356. }
  25357. ],
  25358. forecolor: {
  25359. inline: 'span',
  25360. styles: { color: '%value' },
  25361. links: true,
  25362. remove_similar: true,
  25363. clear_child_styles: true
  25364. },
  25365. hilitecolor: {
  25366. inline: 'span',
  25367. styles: { backgroundColor: '%value' },
  25368. links: true,
  25369. remove_similar: true,
  25370. clear_child_styles: true
  25371. },
  25372. fontname: {
  25373. inline: 'span',
  25374. toggle: false,
  25375. styles: { fontFamily: '%value' },
  25376. clear_child_styles: true
  25377. },
  25378. fontsize: {
  25379. inline: 'span',
  25380. toggle: false,
  25381. styles: { fontSize: '%value' },
  25382. clear_child_styles: true
  25383. },
  25384. lineheight: {
  25385. selector: 'h1,h2,h3,h4,h5,h6,p,li,td,th,div',
  25386. defaultBlock: 'p',
  25387. styles: { lineHeight: '%value' }
  25388. },
  25389. fontsize_class: {
  25390. inline: 'span',
  25391. attributes: { class: '%value' }
  25392. },
  25393. blockquote: {
  25394. block: 'blockquote',
  25395. wrapper: true,
  25396. remove: 'all'
  25397. },
  25398. subscript: { inline: 'sub' },
  25399. superscript: { inline: 'sup' },
  25400. code: { inline: 'code' },
  25401. link: {
  25402. inline: 'a',
  25403. selector: 'a',
  25404. remove: 'all',
  25405. split: true,
  25406. deep: true,
  25407. onmatch: function (node, _fmt, _itemName) {
  25408. return isElement$5(node) && node.hasAttribute('href');
  25409. },
  25410. onformat: function (elm, _fmt, vars) {
  25411. Tools.each(vars, function (value, key) {
  25412. dom.setAttrib(elm, key, value);
  25413. });
  25414. }
  25415. },
  25416. lang: {
  25417. inline: 'span',
  25418. clear_child_styles: true,
  25419. remove_similar: true,
  25420. attributes: {
  25421. 'lang': '%value',
  25422. 'data-mce-lang': function (vars) {
  25423. var _a;
  25424. return (_a = vars === null || vars === void 0 ? void 0 : vars.customValue) !== null && _a !== void 0 ? _a : null;
  25425. }
  25426. }
  25427. },
  25428. removeformat: [
  25429. {
  25430. selector: 'b,strong,em,i,font,u,strike,s,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins,small',
  25431. remove: 'all',
  25432. split: true,
  25433. expand: false,
  25434. block_expand: true,
  25435. deep: true
  25436. },
  25437. {
  25438. selector: 'span',
  25439. attributes: [
  25440. 'style',
  25441. 'class'
  25442. ],
  25443. remove: 'empty',
  25444. split: true,
  25445. expand: false,
  25446. deep: true
  25447. },
  25448. {
  25449. selector: '*',
  25450. attributes: [
  25451. 'style',
  25452. 'class'
  25453. ],
  25454. split: false,
  25455. expand: false,
  25456. deep: true
  25457. }
  25458. ]
  25459. };
  25460. Tools.each('p h1 h2 h3 h4 h5 h6 div address pre dt dd samp'.split(/\s/), function (name) {
  25461. formats[name] = {
  25462. block: name,
  25463. remove: 'all'
  25464. };
  25465. });
  25466. return formats;
  25467. };
  25468. var FormatRegistry = function (editor) {
  25469. var formats = {};
  25470. var get$1 = function (name) {
  25471. return isNonNullable(name) ? formats[name] : formats;
  25472. };
  25473. var has = function (name) {
  25474. return has$2(formats, name);
  25475. };
  25476. var register = function (name, format) {
  25477. if (name) {
  25478. if (!isString$1(name)) {
  25479. each$j(name, function (format, name) {
  25480. register(name, format);
  25481. });
  25482. } else {
  25483. if (!isArray$1(format)) {
  25484. format = [format];
  25485. }
  25486. each$k(format, function (format) {
  25487. if (isUndefined(format.deep)) {
  25488. format.deep = !isSelectorFormat(format);
  25489. }
  25490. if (isUndefined(format.split)) {
  25491. format.split = !isSelectorFormat(format) || isInlineFormat(format);
  25492. }
  25493. if (isUndefined(format.remove) && isSelectorFormat(format) && !isInlineFormat(format)) {
  25494. format.remove = 'none';
  25495. }
  25496. if (isSelectorFormat(format) && isInlineFormat(format)) {
  25497. format.mixed = true;
  25498. format.block_expand = true;
  25499. }
  25500. if (isString$1(format.classes)) {
  25501. format.classes = format.classes.split(/\s+/);
  25502. }
  25503. });
  25504. formats[name] = format;
  25505. }
  25506. }
  25507. };
  25508. var unregister = function (name) {
  25509. if (name && formats[name]) {
  25510. delete formats[name];
  25511. }
  25512. return formats;
  25513. };
  25514. register(get(editor.dom));
  25515. register(getFormats(editor));
  25516. return {
  25517. get: get$1,
  25518. has: has,
  25519. register: register,
  25520. unregister: unregister
  25521. };
  25522. };
  25523. var each$5 = Tools.each;
  25524. var dom = DOMUtils.DOM;
  25525. var parsedSelectorToHtml = function (ancestry, editor) {
  25526. var elm, item, fragment;
  25527. var schema = editor && editor.schema || Schema({});
  25528. var decorate = function (elm, item) {
  25529. if (item.classes.length) {
  25530. dom.addClass(elm, item.classes.join(' '));
  25531. }
  25532. dom.setAttribs(elm, item.attrs);
  25533. };
  25534. var createElement = function (sItem) {
  25535. item = typeof sItem === 'string' ? {
  25536. name: sItem,
  25537. classes: [],
  25538. attrs: {}
  25539. } : sItem;
  25540. var elm = dom.create(item.name);
  25541. decorate(elm, item);
  25542. return elm;
  25543. };
  25544. var getRequiredParent = function (elm, candidate) {
  25545. var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm;
  25546. var elmRule = schema.getElementRule(name);
  25547. var parentsRequired = elmRule && elmRule.parentsRequired;
  25548. if (parentsRequired && parentsRequired.length) {
  25549. return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0];
  25550. } else {
  25551. return false;
  25552. }
  25553. };
  25554. var wrapInHtml = function (elm, ancestry, siblings) {
  25555. var parent, parentCandidate;
  25556. var ancestor = ancestry.length > 0 && ancestry[0];
  25557. var ancestorName = ancestor && ancestor.name;
  25558. var parentRequired = getRequiredParent(elm, ancestorName);
  25559. if (parentRequired) {
  25560. if (ancestorName === parentRequired) {
  25561. parentCandidate = ancestry[0];
  25562. ancestry = ancestry.slice(1);
  25563. } else {
  25564. parentCandidate = parentRequired;
  25565. }
  25566. } else if (ancestor) {
  25567. parentCandidate = ancestry[0];
  25568. ancestry = ancestry.slice(1);
  25569. } else if (!siblings) {
  25570. return elm;
  25571. }
  25572. if (parentCandidate) {
  25573. parent = createElement(parentCandidate);
  25574. parent.appendChild(elm);
  25575. }
  25576. if (siblings) {
  25577. if (!parent) {
  25578. parent = dom.create('div');
  25579. parent.appendChild(elm);
  25580. }
  25581. Tools.each(siblings, function (sibling) {
  25582. var siblingElm = createElement(sibling);
  25583. parent.insertBefore(siblingElm, elm);
  25584. });
  25585. }
  25586. return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings);
  25587. };
  25588. if (ancestry && ancestry.length) {
  25589. item = ancestry[0];
  25590. elm = createElement(item);
  25591. fragment = dom.create('div');
  25592. fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings));
  25593. return fragment;
  25594. } else {
  25595. return '';
  25596. }
  25597. };
  25598. var parseSelectorItem = function (item) {
  25599. var tagName;
  25600. var obj = {
  25601. classes: [],
  25602. attrs: {}
  25603. };
  25604. item = obj.selector = Tools.trim(item);
  25605. if (item !== '*') {
  25606. tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) {
  25607. switch ($1) {
  25608. case '#':
  25609. obj.attrs.id = $2;
  25610. break;
  25611. case '.':
  25612. obj.classes.push($2);
  25613. break;
  25614. case ':':
  25615. if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) {
  25616. obj.attrs[$2] = $2;
  25617. }
  25618. break;
  25619. }
  25620. if ($3 === '[') {
  25621. var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/);
  25622. if (m) {
  25623. obj.attrs[m[1]] = m[2];
  25624. }
  25625. }
  25626. return '';
  25627. });
  25628. }
  25629. obj.name = tagName || 'div';
  25630. return obj;
  25631. };
  25632. var parseSelector = function (selector) {
  25633. if (!selector || typeof selector !== 'string') {
  25634. return [];
  25635. }
  25636. selector = selector.split(/\s*,\s*/)[0];
  25637. selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1');
  25638. return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) {
  25639. var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem);
  25640. var obj = siblings.pop();
  25641. if (siblings.length) {
  25642. obj.siblings = siblings;
  25643. }
  25644. return obj;
  25645. }).reverse();
  25646. };
  25647. var getCssText = function (editor, format) {
  25648. var name, previewFrag;
  25649. var previewCss = '', parentFontSize;
  25650. var previewStyles = getPreviewStyles(editor);
  25651. if (previewStyles === '') {
  25652. return '';
  25653. }
  25654. var removeVars = function (val) {
  25655. return val.replace(/%(\w+)/g, '');
  25656. };
  25657. if (typeof format === 'string') {
  25658. format = editor.formatter.get(format);
  25659. if (!format) {
  25660. return;
  25661. }
  25662. format = format[0];
  25663. }
  25664. if ('preview' in format) {
  25665. var previewOpt = get$9(format, 'preview');
  25666. if (is$1(previewOpt, false)) {
  25667. return '';
  25668. } else {
  25669. previewStyles = previewOpt.getOr(previewStyles);
  25670. }
  25671. }
  25672. name = format.block || format.inline || 'span';
  25673. var items = parseSelector(format.selector);
  25674. if (items.length) {
  25675. if (!items[0].name) {
  25676. items[0].name = name;
  25677. }
  25678. name = format.selector;
  25679. previewFrag = parsedSelectorToHtml(items, editor);
  25680. } else {
  25681. previewFrag = parsedSelectorToHtml([name], editor);
  25682. }
  25683. var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
  25684. each$5(format.styles, function (value, name) {
  25685. var newValue = removeVars(value);
  25686. if (newValue) {
  25687. dom.setStyle(previewElm, name, newValue);
  25688. }
  25689. });
  25690. each$5(format.attributes, function (value, name) {
  25691. var newValue = removeVars(value);
  25692. if (newValue) {
  25693. dom.setAttrib(previewElm, name, newValue);
  25694. }
  25695. });
  25696. each$5(format.classes, function (value) {
  25697. var newValue = removeVars(value);
  25698. if (!dom.hasClass(previewElm, newValue)) {
  25699. dom.addClass(previewElm, newValue);
  25700. }
  25701. });
  25702. editor.fire('PreviewFormats');
  25703. dom.setStyles(previewFrag, {
  25704. position: 'absolute',
  25705. left: -65535
  25706. });
  25707. editor.getBody().appendChild(previewFrag);
  25708. parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
  25709. parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
  25710. each$5(previewStyles.split(' '), function (name) {
  25711. var value = dom.getStyle(previewElm, name, true);
  25712. if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
  25713. value = dom.getStyle(editor.getBody(), name, true);
  25714. if (dom.toHex(value).toLowerCase() === '#ffffff') {
  25715. return;
  25716. }
  25717. }
  25718. if (name === 'color') {
  25719. if (dom.toHex(value).toLowerCase() === '#000000') {
  25720. return;
  25721. }
  25722. }
  25723. if (name === 'font-size') {
  25724. if (/em|%$/.test(value)) {
  25725. if (parentFontSize === 0) {
  25726. return;
  25727. }
  25728. var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1);
  25729. value = numValue * parentFontSize + 'px';
  25730. }
  25731. }
  25732. if (name === 'border' && value) {
  25733. previewCss += 'padding:0 2px;';
  25734. }
  25735. previewCss += name + ':' + value + ';';
  25736. });
  25737. editor.fire('AfterPreviewFormats');
  25738. dom.remove(previewFrag);
  25739. return previewCss;
  25740. };
  25741. var setup$h = function (editor) {
  25742. editor.addShortcut('meta+b', '', 'Bold');
  25743. editor.addShortcut('meta+i', '', 'Italic');
  25744. editor.addShortcut('meta+u', '', 'Underline');
  25745. for (var i = 1; i <= 6; i++) {
  25746. editor.addShortcut('access+' + i, '', [
  25747. 'FormatBlock',
  25748. false,
  25749. 'h' + i
  25750. ]);
  25751. }
  25752. editor.addShortcut('access+7', '', [
  25753. 'FormatBlock',
  25754. false,
  25755. 'p'
  25756. ]);
  25757. editor.addShortcut('access+8', '', [
  25758. 'FormatBlock',
  25759. false,
  25760. 'div'
  25761. ]);
  25762. editor.addShortcut('access+9', '', [
  25763. 'FormatBlock',
  25764. false,
  25765. 'address'
  25766. ]);
  25767. };
  25768. var Formatter = function (editor) {
  25769. var formats = FormatRegistry(editor);
  25770. var formatChangeState = Cell(null);
  25771. setup$h(editor);
  25772. setup$k(editor);
  25773. return {
  25774. get: formats.get,
  25775. has: formats.has,
  25776. register: formats.register,
  25777. unregister: formats.unregister,
  25778. apply: function (name, vars, node) {
  25779. applyFormat(editor, name, vars, node);
  25780. },
  25781. remove: function (name, vars, node, similar) {
  25782. removeFormat(editor, name, vars, node, similar);
  25783. },
  25784. toggle: function (name, vars, node) {
  25785. toggleFormat(editor, name, vars, node);
  25786. },
  25787. match: function (name, vars, node, similar) {
  25788. return matchFormat(editor, name, vars, node, similar);
  25789. },
  25790. closest: function (names) {
  25791. return closestFormat(editor, names);
  25792. },
  25793. matchAll: function (names, vars) {
  25794. return matchAllFormats(editor, names, vars);
  25795. },
  25796. matchNode: function (node, name, vars, similar) {
  25797. return matchNodeFormat(editor, node, name, vars, similar);
  25798. },
  25799. canApply: function (name) {
  25800. return canApplyFormat(editor, name);
  25801. },
  25802. formatChanged: function (formats, callback, similar, vars) {
  25803. return formatChanged(editor, formatChangeState, formats, callback, similar, vars);
  25804. },
  25805. getCssText: curry(getCssText, editor)
  25806. };
  25807. };
  25808. var shouldIgnoreCommand = function (cmd) {
  25809. switch (cmd.toLowerCase()) {
  25810. case 'undo':
  25811. case 'redo':
  25812. case 'mcerepaint':
  25813. case 'mcefocus':
  25814. return true;
  25815. default:
  25816. return false;
  25817. }
  25818. };
  25819. var registerEvents = function (editor, undoManager, locks) {
  25820. var isFirstTypedCharacter = Cell(false);
  25821. var addNonTypingUndoLevel = function (e) {
  25822. setTyping(undoManager, false, locks);
  25823. undoManager.add({}, e);
  25824. };
  25825. editor.on('init', function () {
  25826. undoManager.add();
  25827. });
  25828. editor.on('BeforeExecCommand', function (e) {
  25829. var cmd = e.command;
  25830. if (!shouldIgnoreCommand(cmd)) {
  25831. endTyping(undoManager, locks);
  25832. undoManager.beforeChange();
  25833. }
  25834. });
  25835. editor.on('ExecCommand', function (e) {
  25836. var cmd = e.command;
  25837. if (!shouldIgnoreCommand(cmd)) {
  25838. addNonTypingUndoLevel(e);
  25839. }
  25840. });
  25841. editor.on('ObjectResizeStart cut', function () {
  25842. undoManager.beforeChange();
  25843. });
  25844. editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
  25845. editor.on('dragend', addNonTypingUndoLevel);
  25846. editor.on('keyup', function (e) {
  25847. var keyCode = e.keyCode;
  25848. if (e.isDefaultPrevented()) {
  25849. return;
  25850. }
  25851. if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) {
  25852. addNonTypingUndoLevel();
  25853. editor.nodeChanged();
  25854. }
  25855. if (keyCode === 46 || keyCode === 8) {
  25856. editor.nodeChanged();
  25857. }
  25858. if (isFirstTypedCharacter.get() && undoManager.typing && isEq$1(createFromEditor(editor), undoManager.data[0]) === false) {
  25859. if (editor.isDirty() === false) {
  25860. editor.setDirty(true);
  25861. editor.fire('change', {
  25862. level: undoManager.data[0],
  25863. lastLevel: null
  25864. });
  25865. }
  25866. editor.fire('TypingUndo');
  25867. isFirstTypedCharacter.set(false);
  25868. editor.nodeChanged();
  25869. }
  25870. });
  25871. editor.on('keydown', function (e) {
  25872. var keyCode = e.keyCode;
  25873. if (e.isDefaultPrevented()) {
  25874. return;
  25875. }
  25876. if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) {
  25877. if (undoManager.typing) {
  25878. addNonTypingUndoLevel(e);
  25879. }
  25880. return;
  25881. }
  25882. var modKey = e.ctrlKey && !e.altKey || e.metaKey;
  25883. if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !undoManager.typing && !modKey) {
  25884. undoManager.beforeChange();
  25885. setTyping(undoManager, true, locks);
  25886. undoManager.add({}, e);
  25887. isFirstTypedCharacter.set(true);
  25888. }
  25889. });
  25890. editor.on('mousedown', function (e) {
  25891. if (undoManager.typing) {
  25892. addNonTypingUndoLevel(e);
  25893. }
  25894. });
  25895. var isInsertReplacementText = function (event) {
  25896. return event.inputType === 'insertReplacementText';
  25897. };
  25898. var isInsertTextDataNull = function (event) {
  25899. return event.inputType === 'insertText' && event.data === null;
  25900. };
  25901. var isInsertFromPasteOrDrop = function (event) {
  25902. return event.inputType === 'insertFromPaste' || event.inputType === 'insertFromDrop';
  25903. };
  25904. editor.on('input', function (e) {
  25905. if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e) || isInsertFromPasteOrDrop(e))) {
  25906. addNonTypingUndoLevel(e);
  25907. }
  25908. });
  25909. editor.on('AddUndo Undo Redo ClearUndos', function (e) {
  25910. if (!e.isDefaultPrevented()) {
  25911. editor.nodeChanged();
  25912. }
  25913. });
  25914. };
  25915. var addKeyboardShortcuts = function (editor) {
  25916. editor.addShortcut('meta+z', '', 'Undo');
  25917. editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
  25918. };
  25919. var UndoManager = function (editor) {
  25920. var beforeBookmark = value();
  25921. var locks = Cell(0);
  25922. var index = Cell(0);
  25923. var undoManager = {
  25924. data: [],
  25925. typing: false,
  25926. beforeChange: function () {
  25927. beforeChange(editor, locks, beforeBookmark);
  25928. },
  25929. add: function (level, event) {
  25930. return addUndoLevel(editor, undoManager, index, locks, beforeBookmark, level, event);
  25931. },
  25932. undo: function () {
  25933. return undo(editor, undoManager, locks, index);
  25934. },
  25935. redo: function () {
  25936. return redo(editor, index, undoManager.data);
  25937. },
  25938. clear: function () {
  25939. clear(editor, undoManager, index);
  25940. },
  25941. reset: function () {
  25942. reset(editor, undoManager);
  25943. },
  25944. hasUndo: function () {
  25945. return hasUndo(editor, undoManager, index);
  25946. },
  25947. hasRedo: function () {
  25948. return hasRedo(editor, undoManager, index);
  25949. },
  25950. transact: function (callback) {
  25951. return transact(editor, undoManager, locks, callback);
  25952. },
  25953. ignore: function (callback) {
  25954. ignore(editor, locks, callback);
  25955. },
  25956. extra: function (callback1, callback2) {
  25957. extra(editor, undoManager, index, callback1, callback2);
  25958. }
  25959. };
  25960. if (!isRtc(editor)) {
  25961. registerEvents(editor, undoManager, locks);
  25962. }
  25963. addKeyboardShortcuts(editor);
  25964. return undoManager;
  25965. };
  25966. var nonTypingKeycodes = [
  25967. 9,
  25968. 27,
  25969. VK.HOME,
  25970. VK.END,
  25971. 19,
  25972. 20,
  25973. 44,
  25974. 144,
  25975. 145,
  25976. 33,
  25977. 34,
  25978. 45,
  25979. 16,
  25980. 17,
  25981. 18,
  25982. 91,
  25983. 92,
  25984. 93,
  25985. VK.DOWN,
  25986. VK.UP,
  25987. VK.LEFT,
  25988. VK.RIGHT
  25989. ].concat(Env.browser.isFirefox() ? [224] : []);
  25990. var placeholderAttr = 'data-mce-placeholder';
  25991. var isKeyboardEvent = function (e) {
  25992. return e.type === 'keydown' || e.type === 'keyup';
  25993. };
  25994. var isDeleteEvent = function (e) {
  25995. var keyCode = e.keyCode;
  25996. return keyCode === VK.BACKSPACE || keyCode === VK.DELETE;
  25997. };
  25998. var isNonTypingKeyboardEvent = function (e) {
  25999. if (isKeyboardEvent(e)) {
  26000. var keyCode = e.keyCode;
  26001. return !isDeleteEvent(e) && (VK.metaKeyPressed(e) || e.altKey || keyCode >= 112 && keyCode <= 123 || contains$3(nonTypingKeycodes, keyCode));
  26002. } else {
  26003. return false;
  26004. }
  26005. };
  26006. var isTypingKeyboardEvent = function (e) {
  26007. return isKeyboardEvent(e) && !(isDeleteEvent(e) || e.type === 'keyup' && e.keyCode === 229);
  26008. };
  26009. var isVisuallyEmpty = function (dom, rootElm, forcedRootBlock) {
  26010. if (isEmpty$2(SugarElement.fromDom(rootElm), false)) {
  26011. var isForcedRootBlockFalse = forcedRootBlock === '';
  26012. var firstElement = rootElm.firstElementChild;
  26013. if (!firstElement) {
  26014. return true;
  26015. } else if (dom.getStyle(rootElm.firstElementChild, 'padding-left') || dom.getStyle(rootElm.firstElementChild, 'padding-right')) {
  26016. return false;
  26017. } else {
  26018. return isForcedRootBlockFalse ? !dom.isBlock(firstElement) : forcedRootBlock === firstElement.nodeName.toLowerCase();
  26019. }
  26020. } else {
  26021. return false;
  26022. }
  26023. };
  26024. var setup$g = function (editor) {
  26025. var dom = editor.dom;
  26026. var rootBlock = getForcedRootBlock(editor);
  26027. var placeholder = getPlaceholder(editor);
  26028. var updatePlaceholder = function (e, initial) {
  26029. if (isNonTypingKeyboardEvent(e)) {
  26030. return;
  26031. }
  26032. var body = editor.getBody();
  26033. var showPlaceholder = isTypingKeyboardEvent(e) ? false : isVisuallyEmpty(dom, body, rootBlock);
  26034. var isPlaceholderShown = dom.getAttrib(body, placeholderAttr) !== '';
  26035. if (isPlaceholderShown !== showPlaceholder || initial) {
  26036. dom.setAttrib(body, placeholderAttr, showPlaceholder ? placeholder : null);
  26037. dom.setAttrib(body, 'aria-placeholder', showPlaceholder ? placeholder : null);
  26038. firePlaceholderToggle(editor, showPlaceholder);
  26039. editor.on(showPlaceholder ? 'keydown' : 'keyup', updatePlaceholder);
  26040. editor.off(showPlaceholder ? 'keyup' : 'keydown', updatePlaceholder);
  26041. }
  26042. };
  26043. if (placeholder) {
  26044. editor.on('init', function (e) {
  26045. updatePlaceholder(e, true);
  26046. editor.on('change SetContent ExecCommand', updatePlaceholder);
  26047. editor.on('paste', function (e) {
  26048. return Delay.setEditorTimeout(editor, function () {
  26049. return updatePlaceholder(e);
  26050. });
  26051. });
  26052. });
  26053. }
  26054. };
  26055. var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;
  26056. var hasStrongRtl = function (text) {
  26057. return strongRtl.test(text);
  26058. };
  26059. var isInlineTarget = function (editor, elm) {
  26060. return is$2(SugarElement.fromDom(elm), getInlineBoundarySelector(editor));
  26061. };
  26062. var isRtl = function (element) {
  26063. return DOMUtils.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent);
  26064. };
  26065. var findInlineParents = function (isInlineTarget, rootNode, pos) {
  26066. return filter$4(DOMUtils.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget);
  26067. };
  26068. var findRootInline = function (isInlineTarget, rootNode, pos) {
  26069. var parents = findInlineParents(isInlineTarget, rootNode, pos);
  26070. return Optional.from(parents[parents.length - 1]);
  26071. };
  26072. var hasSameParentBlock = function (rootNode, node1, node2) {
  26073. var block1 = getParentBlock$2(node1, rootNode);
  26074. var block2 = getParentBlock$2(node2, rootNode);
  26075. return block1 && block1 === block2;
  26076. };
  26077. var isAtZwsp = function (pos) {
  26078. return isBeforeInline(pos) || isAfterInline(pos);
  26079. };
  26080. var normalizePosition = function (forward, pos) {
  26081. if (!pos) {
  26082. return pos;
  26083. }
  26084. var container = pos.container(), offset = pos.offset();
  26085. if (forward) {
  26086. if (isCaretContainerInline(container)) {
  26087. if (isText$7(container.nextSibling)) {
  26088. return CaretPosition(container.nextSibling, 0);
  26089. } else {
  26090. return CaretPosition.after(container);
  26091. }
  26092. } else {
  26093. return isBeforeInline(pos) ? CaretPosition(container, offset + 1) : pos;
  26094. }
  26095. } else {
  26096. if (isCaretContainerInline(container)) {
  26097. if (isText$7(container.previousSibling)) {
  26098. return CaretPosition(container.previousSibling, container.previousSibling.data.length);
  26099. } else {
  26100. return CaretPosition.before(container);
  26101. }
  26102. } else {
  26103. return isAfterInline(pos) ? CaretPosition(container, offset - 1) : pos;
  26104. }
  26105. }
  26106. };
  26107. var normalizeForwards = curry(normalizePosition, true);
  26108. var normalizeBackwards = curry(normalizePosition, false);
  26109. var isBeforeRoot = function (rootNode) {
  26110. return function (elm) {
  26111. return eq(rootNode, SugarElement.fromDom(elm.dom.parentNode));
  26112. };
  26113. };
  26114. var isTextBlockOrListItem = function (element) {
  26115. return isTextBlock$2(element) || isListItem(element);
  26116. };
  26117. var getParentBlock$1 = function (rootNode, elm) {
  26118. if (contains$1(rootNode, elm)) {
  26119. return closest$3(elm, isTextBlockOrListItem, isBeforeRoot(rootNode));
  26120. } else {
  26121. return Optional.none();
  26122. }
  26123. };
  26124. var placeCaretInEmptyBody = function (editor) {
  26125. var body = editor.getBody();
  26126. var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body;
  26127. editor.selection.setCursorLocation(node, 0);
  26128. };
  26129. var paddEmptyBody = function (editor) {
  26130. if (editor.dom.isEmpty(editor.getBody())) {
  26131. editor.setContent('');
  26132. placeCaretInEmptyBody(editor);
  26133. }
  26134. };
  26135. var willDeleteLastPositionInElement = function (forward, fromPos, elm) {
  26136. return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) {
  26137. var normalizedFirstPos = normalizePosition(true, firstPos);
  26138. var normalizedLastPos = normalizePosition(false, lastPos);
  26139. var normalizedFromPos = normalizePosition(false, fromPos);
  26140. if (forward) {
  26141. return nextPosition(elm, normalizedFromPos).exists(function (nextPos) {
  26142. return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos);
  26143. });
  26144. } else {
  26145. return prevPosition(elm, normalizedFromPos).exists(function (prevPos) {
  26146. return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos);
  26147. });
  26148. }
  26149. }).getOr(true);
  26150. };
  26151. var blockPosition = function (block, position) {
  26152. return {
  26153. block: block,
  26154. position: position
  26155. };
  26156. };
  26157. var blockBoundary = function (from, to) {
  26158. return {
  26159. from: from,
  26160. to: to
  26161. };
  26162. };
  26163. var getBlockPosition = function (rootNode, pos) {
  26164. var rootElm = SugarElement.fromDom(rootNode);
  26165. var containerElm = SugarElement.fromDom(pos.container());
  26166. return getParentBlock$1(rootElm, containerElm).map(function (block) {
  26167. return blockPosition(block, pos);
  26168. });
  26169. };
  26170. var isDifferentBlocks = function (blockBoundary) {
  26171. return eq(blockBoundary.from.block, blockBoundary.to.block) === false;
  26172. };
  26173. var hasSameParent = function (blockBoundary) {
  26174. return parent(blockBoundary.from.block).bind(function (parent1) {
  26175. return parent(blockBoundary.to.block).filter(function (parent2) {
  26176. return eq(parent1, parent2);
  26177. });
  26178. }).isSome();
  26179. };
  26180. var isEditable$1 = function (blockBoundary) {
  26181. return isContentEditableFalse$b(blockBoundary.from.block.dom) === false && isContentEditableFalse$b(blockBoundary.to.block.dom) === false;
  26182. };
  26183. var skipLastBr = function (rootNode, forward, blockPosition) {
  26184. if (isBr$5(blockPosition.position.getNode()) && isEmpty$2(blockPosition.block) === false) {
  26185. return positionIn(false, blockPosition.block.dom).bind(function (lastPositionInBlock) {
  26186. if (lastPositionInBlock.isEqual(blockPosition.position)) {
  26187. return fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) {
  26188. return getBlockPosition(rootNode, to);
  26189. });
  26190. } else {
  26191. return Optional.some(blockPosition);
  26192. }
  26193. }).getOr(blockPosition);
  26194. } else {
  26195. return blockPosition;
  26196. }
  26197. };
  26198. var readFromRange = function (rootNode, forward, rng) {
  26199. var fromBlockPos = getBlockPosition(rootNode, CaretPosition.fromRangeStart(rng));
  26200. var toBlockPos = fromBlockPos.bind(function (blockPos) {
  26201. return fromPosition(forward, rootNode, blockPos.position).bind(function (to) {
  26202. return getBlockPosition(rootNode, to).map(function (blockPos) {
  26203. return skipLastBr(rootNode, forward, blockPos);
  26204. });
  26205. });
  26206. });
  26207. return lift2(fromBlockPos, toBlockPos, blockBoundary).filter(function (blockBoundary) {
  26208. return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable$1(blockBoundary);
  26209. });
  26210. };
  26211. var read$1 = function (rootNode, forward, rng) {
  26212. return rng.collapsed ? readFromRange(rootNode, forward, rng) : Optional.none();
  26213. };
  26214. var getChildrenUntilBlockBoundary = function (block) {
  26215. var children$1 = children(block);
  26216. return findIndex$2(children$1, isBlock$2).fold(constant(children$1), function (index) {
  26217. return children$1.slice(0, index);
  26218. });
  26219. };
  26220. var extractChildren = function (block) {
  26221. var children = getChildrenUntilBlockBoundary(block);
  26222. each$k(children, remove$7);
  26223. return children;
  26224. };
  26225. var removeEmptyRoot = function (rootNode, block) {
  26226. var parents = parentsAndSelf(block, rootNode);
  26227. return find$3(parents.reverse(), function (element) {
  26228. return isEmpty$2(element);
  26229. }).each(remove$7);
  26230. };
  26231. var isEmptyBefore = function (el) {
  26232. return filter$4(prevSiblings(el), function (el) {
  26233. return !isEmpty$2(el);
  26234. }).length === 0;
  26235. };
  26236. var nestedBlockMerge = function (rootNode, fromBlock, toBlock, insertionPoint) {
  26237. if (isEmpty$2(toBlock)) {
  26238. fillWithPaddingBr(toBlock);
  26239. return firstPositionIn(toBlock.dom);
  26240. }
  26241. if (isEmptyBefore(insertionPoint) && isEmpty$2(fromBlock)) {
  26242. before$4(insertionPoint, SugarElement.fromTag('br'));
  26243. }
  26244. var position = prevPosition(toBlock.dom, CaretPosition.before(insertionPoint.dom));
  26245. each$k(extractChildren(fromBlock), function (child) {
  26246. before$4(insertionPoint, child);
  26247. });
  26248. removeEmptyRoot(rootNode, fromBlock);
  26249. return position;
  26250. };
  26251. var sidelongBlockMerge = function (rootNode, fromBlock, toBlock) {
  26252. if (isEmpty$2(toBlock)) {
  26253. remove$7(toBlock);
  26254. if (isEmpty$2(fromBlock)) {
  26255. fillWithPaddingBr(fromBlock);
  26256. }
  26257. return firstPositionIn(fromBlock.dom);
  26258. }
  26259. var position = lastPositionIn(toBlock.dom);
  26260. each$k(extractChildren(fromBlock), function (child) {
  26261. append$1(toBlock, child);
  26262. });
  26263. removeEmptyRoot(rootNode, fromBlock);
  26264. return position;
  26265. };
  26266. var findInsertionPoint = function (toBlock, block) {
  26267. var parentsAndSelf$1 = parentsAndSelf(block, toBlock);
  26268. return Optional.from(parentsAndSelf$1[parentsAndSelf$1.length - 1]);
  26269. };
  26270. var getInsertionPoint = function (fromBlock, toBlock) {
  26271. return contains$1(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Optional.none();
  26272. };
  26273. var trimBr = function (first, block) {
  26274. positionIn(first, block.dom).map(function (position) {
  26275. return position.getNode();
  26276. }).map(SugarElement.fromDom).filter(isBr$4).each(remove$7);
  26277. };
  26278. var mergeBlockInto = function (rootNode, fromBlock, toBlock) {
  26279. trimBr(true, fromBlock);
  26280. trimBr(false, toBlock);
  26281. return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock));
  26282. };
  26283. var mergeBlocks = function (rootNode, forward, block1, block2) {
  26284. return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2);
  26285. };
  26286. var backspaceDelete$8 = function (editor, forward) {
  26287. var rootNode = SugarElement.fromDom(editor.getBody());
  26288. var position = read$1(rootNode.dom, forward, editor.selection.getRng()).bind(function (blockBoundary) {
  26289. return mergeBlocks(rootNode, forward, blockBoundary.from.block, blockBoundary.to.block);
  26290. });
  26291. position.each(function (pos) {
  26292. editor.selection.setRng(pos.toRange());
  26293. });
  26294. return position.isSome();
  26295. };
  26296. var deleteRangeMergeBlocks = function (rootNode, selection) {
  26297. var rng = selection.getRng();
  26298. return lift2(getParentBlock$1(rootNode, SugarElement.fromDom(rng.startContainer)), getParentBlock$1(rootNode, SugarElement.fromDom(rng.endContainer)), function (block1, block2) {
  26299. if (eq(block1, block2) === false) {
  26300. rng.deleteContents();
  26301. mergeBlocks(rootNode, true, block1, block2).each(function (pos) {
  26302. selection.setRng(pos.toRange());
  26303. });
  26304. return true;
  26305. } else {
  26306. return false;
  26307. }
  26308. }).getOr(false);
  26309. };
  26310. var isRawNodeInTable = function (root, rawNode) {
  26311. var node = SugarElement.fromDom(rawNode);
  26312. var isRoot = curry(eq, root);
  26313. return ancestor$3(node, isTableCell$4, isRoot).isSome();
  26314. };
  26315. var isSelectionInTable = function (root, rng) {
  26316. return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer);
  26317. };
  26318. var isEverythingSelected = function (root, rng) {
  26319. var noPrevious = prevPosition(root.dom, CaretPosition.fromRangeStart(rng)).isNone();
  26320. var noNext = nextPosition(root.dom, CaretPosition.fromRangeEnd(rng)).isNone();
  26321. return !isSelectionInTable(root, rng) && noPrevious && noNext;
  26322. };
  26323. var emptyEditor = function (editor) {
  26324. editor.setContent('');
  26325. editor.selection.setCursorLocation();
  26326. return true;
  26327. };
  26328. var deleteRange$1 = function (editor) {
  26329. var rootNode = SugarElement.fromDom(editor.getBody());
  26330. var rng = editor.selection.getRng();
  26331. return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection);
  26332. };
  26333. var backspaceDelete$7 = function (editor, _forward) {
  26334. return editor.selection.isCollapsed() ? false : deleteRange$1(editor);
  26335. };
  26336. var isContentEditableTrue$2 = isContentEditableTrue$4;
  26337. var isContentEditableFalse$4 = isContentEditableFalse$b;
  26338. var showCaret = function (direction, editor, node, before, scrollIntoView) {
  26339. return Optional.from(editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView));
  26340. };
  26341. var getNodeRange = function (node) {
  26342. var rng = node.ownerDocument.createRange();
  26343. rng.selectNode(node);
  26344. return rng;
  26345. };
  26346. var selectNode = function (editor, node) {
  26347. var e = editor.fire('BeforeObjectSelected', { target: node });
  26348. if (e.isDefaultPrevented()) {
  26349. return Optional.none();
  26350. }
  26351. return Optional.some(getNodeRange(node));
  26352. };
  26353. var renderCaretAtRange = function (editor, range, scrollIntoView) {
  26354. var normalizedRange = normalizeRange(1, editor.getBody(), range);
  26355. var caretPosition = CaretPosition.fromRangeStart(normalizedRange);
  26356. var caretPositionNode = caretPosition.getNode();
  26357. if (isInlineFakeCaretTarget(caretPositionNode)) {
  26358. return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false);
  26359. }
  26360. var caretPositionBeforeNode = caretPosition.getNode(true);
  26361. if (isInlineFakeCaretTarget(caretPositionBeforeNode)) {
  26362. return showCaret(1, editor, caretPositionBeforeNode, false, false);
  26363. }
  26364. var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) {
  26365. return isContentEditableFalse$4(node) || isContentEditableTrue$2(node);
  26366. });
  26367. if (isInlineFakeCaretTarget(ceRoot)) {
  26368. return showCaret(1, editor, ceRoot, false, scrollIntoView);
  26369. }
  26370. return Optional.none();
  26371. };
  26372. var renderRangeCaret = function (editor, range, scrollIntoView) {
  26373. return range.collapsed ? renderCaretAtRange(editor, range, scrollIntoView).getOr(range) : range;
  26374. };
  26375. var isBeforeBoundary = function (pos) {
  26376. return isBeforeContentEditableFalse(pos) || isBeforeMedia(pos);
  26377. };
  26378. var isAfterBoundary = function (pos) {
  26379. return isAfterContentEditableFalse(pos) || isAfterMedia(pos);
  26380. };
  26381. var trimEmptyTextNode = function (dom, node) {
  26382. if (isText$7(node) && node.data.length === 0) {
  26383. dom.remove(node);
  26384. }
  26385. };
  26386. var deleteContentAndShowCaret = function (editor, range, node, direction, forward, peekCaretPosition) {
  26387. showCaret(direction, editor, peekCaretPosition.getNode(!forward), forward, true).each(function (caretRange) {
  26388. if (range.collapsed) {
  26389. var deleteRange = range.cloneRange();
  26390. if (forward) {
  26391. deleteRange.setEnd(caretRange.startContainer, caretRange.startOffset);
  26392. } else {
  26393. deleteRange.setStart(caretRange.endContainer, caretRange.endOffset);
  26394. }
  26395. deleteRange.deleteContents();
  26396. } else {
  26397. range.deleteContents();
  26398. }
  26399. editor.selection.setRng(caretRange);
  26400. });
  26401. trimEmptyTextNode(editor.dom, node);
  26402. return true;
  26403. };
  26404. var deleteBoundaryText = function (editor, forward) {
  26405. var range = editor.selection.getRng();
  26406. if (!isText$7(range.commonAncestorContainer)) {
  26407. return false;
  26408. }
  26409. var direction = forward ? HDirection.Forwards : HDirection.Backwards;
  26410. var caretWalker = CaretWalker(editor.getBody());
  26411. var getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev);
  26412. var isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary;
  26413. var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
  26414. var nextCaretPosition = normalizePosition(forward, getNextPosFn(caretPosition));
  26415. if (!nextCaretPosition || !isMoveInsideSameBlock(caretPosition, nextCaretPosition)) {
  26416. return false;
  26417. } else if (isBeforeFn(nextCaretPosition)) {
  26418. return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, nextCaretPosition);
  26419. }
  26420. var peekCaretPosition = getNextPosFn(nextCaretPosition);
  26421. if (peekCaretPosition && isBeforeFn(peekCaretPosition)) {
  26422. if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) {
  26423. return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, peekCaretPosition);
  26424. }
  26425. }
  26426. return false;
  26427. };
  26428. var backspaceDelete$6 = function (editor, forward) {
  26429. return deleteBoundaryText(editor, forward);
  26430. };
  26431. var isCompoundElement = function (node) {
  26432. return isTableCell$4(SugarElement.fromDom(node)) || isListItem(SugarElement.fromDom(node));
  26433. };
  26434. var DeleteAction = Adt.generate([
  26435. { remove: ['element'] },
  26436. { moveToElement: ['element'] },
  26437. { moveToPosition: ['position'] }
  26438. ]);
  26439. var isAtContentEditableBlockCaret = function (forward, from) {
  26440. var elm = from.getNode(forward === false);
  26441. var caretLocation = forward ? 'after' : 'before';
  26442. return isElement$5(elm) && elm.getAttribute('data-mce-caret') === caretLocation;
  26443. };
  26444. var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) {
  26445. var inSameBlock = function (elm) {
  26446. return isInline$1(SugarElement.fromDom(elm)) && !isInSameBlock(from, to, root);
  26447. };
  26448. return getRelativeCefElm(!forward, from).fold(function () {
  26449. return getRelativeCefElm(forward, to).fold(never, inSameBlock);
  26450. }, inSameBlock);
  26451. };
  26452. var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) {
  26453. var toCefElm = to.getNode(forward === false);
  26454. return getParentBlock$1(SugarElement.fromDom(root), SugarElement.fromDom(from.getNode())).map(function (blockElm) {
  26455. return isEmpty$2(blockElm) ? DeleteAction.remove(blockElm.dom) : DeleteAction.moveToElement(toCefElm);
  26456. }).orThunk(function () {
  26457. return Optional.some(DeleteAction.moveToElement(toCefElm));
  26458. });
  26459. };
  26460. var findCefPosition = function (root, forward, from) {
  26461. return fromPosition(forward, root, from).bind(function (to) {
  26462. if (isCompoundElement(to.getNode())) {
  26463. return Optional.none();
  26464. } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) {
  26465. return Optional.none();
  26466. } else if (forward && isContentEditableFalse$b(to.getNode())) {
  26467. return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
  26468. } else if (forward === false && isContentEditableFalse$b(to.getNode(true))) {
  26469. return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
  26470. } else if (forward && isAfterContentEditableFalse(from)) {
  26471. return Optional.some(DeleteAction.moveToPosition(to));
  26472. } else if (forward === false && isBeforeContentEditableFalse(from)) {
  26473. return Optional.some(DeleteAction.moveToPosition(to));
  26474. } else {
  26475. return Optional.none();
  26476. }
  26477. });
  26478. };
  26479. var getContentEditableBlockAction = function (forward, elm) {
  26480. if (forward && isContentEditableFalse$b(elm.nextSibling)) {
  26481. return Optional.some(DeleteAction.moveToElement(elm.nextSibling));
  26482. } else if (forward === false && isContentEditableFalse$b(elm.previousSibling)) {
  26483. return Optional.some(DeleteAction.moveToElement(elm.previousSibling));
  26484. } else {
  26485. return Optional.none();
  26486. }
  26487. };
  26488. var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) {
  26489. return deleteAction.fold(function (elm) {
  26490. return Optional.some(DeleteAction.remove(elm));
  26491. }, function (elm) {
  26492. return Optional.some(DeleteAction.moveToElement(elm));
  26493. }, function (to) {
  26494. if (isInSameBlock(from, to, root)) {
  26495. return Optional.none();
  26496. } else {
  26497. return Optional.some(DeleteAction.moveToPosition(to));
  26498. }
  26499. });
  26500. };
  26501. var getContentEditableAction = function (root, forward, from) {
  26502. if (isAtContentEditableBlockCaret(forward, from)) {
  26503. return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () {
  26504. return findCefPosition(root, forward, from);
  26505. }, Optional.some);
  26506. } else {
  26507. return findCefPosition(root, forward, from).bind(function (deleteAction) {
  26508. return skipMoveToActionFromInlineCefToContent(root, from, deleteAction);
  26509. });
  26510. }
  26511. };
  26512. var read = function (root, forward, rng) {
  26513. var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng);
  26514. var from = CaretPosition.fromRangeStart(normalizedRange);
  26515. var rootElement = SugarElement.fromDom(root);
  26516. if (forward === false && isAfterContentEditableFalse(from)) {
  26517. return Optional.some(DeleteAction.remove(from.getNode(true)));
  26518. } else if (forward && isBeforeContentEditableFalse(from)) {
  26519. return Optional.some(DeleteAction.remove(from.getNode()));
  26520. } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) {
  26521. return findPreviousBr(rootElement, from).map(function (br) {
  26522. return DeleteAction.remove(br.getNode());
  26523. });
  26524. } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr$1(rootElement, from)) {
  26525. return findNextBr(rootElement, from).map(function (br) {
  26526. return DeleteAction.remove(br.getNode());
  26527. });
  26528. } else {
  26529. return getContentEditableAction(root, forward, from);
  26530. }
  26531. };
  26532. var deleteElement$1 = function (editor, forward) {
  26533. return function (element) {
  26534. editor._selectionOverrides.hideFakeCaret();
  26535. deleteElement$2(editor, forward, SugarElement.fromDom(element));
  26536. return true;
  26537. };
  26538. };
  26539. var moveToElement = function (editor, forward) {
  26540. return function (element) {
  26541. var pos = forward ? CaretPosition.before(element) : CaretPosition.after(element);
  26542. editor.selection.setRng(pos.toRange());
  26543. return true;
  26544. };
  26545. };
  26546. var moveToPosition = function (editor) {
  26547. return function (pos) {
  26548. editor.selection.setRng(pos.toRange());
  26549. return true;
  26550. };
  26551. };
  26552. var getAncestorCe = function (editor, node) {
  26553. return Optional.from(getContentEditableRoot$1(editor.getBody(), node));
  26554. };
  26555. var backspaceDeleteCaret = function (editor, forward) {
  26556. var selectedNode = editor.selection.getNode();
  26557. return getAncestorCe(editor, selectedNode).filter(isContentEditableFalse$b).fold(function () {
  26558. return read(editor.getBody(), forward, editor.selection.getRng()).exists(function (deleteAction) {
  26559. return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
  26560. });
  26561. }, always);
  26562. };
  26563. var deleteOffscreenSelection = function (rootElement) {
  26564. each$k(descendants(rootElement, '.mce-offscreen-selection'), remove$7);
  26565. };
  26566. var backspaceDeleteRange = function (editor, forward) {
  26567. var selectedNode = editor.selection.getNode();
  26568. if (isContentEditableFalse$b(selectedNode) && !isTableCell$5(selectedNode)) {
  26569. var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(isContentEditableFalse$b);
  26570. return hasCefAncestor.fold(function () {
  26571. deleteOffscreenSelection(SugarElement.fromDom(editor.getBody()));
  26572. deleteElement$2(editor, forward, SugarElement.fromDom(editor.selection.getNode()));
  26573. paddEmptyBody(editor);
  26574. return true;
  26575. }, always);
  26576. }
  26577. return false;
  26578. };
  26579. var paddEmptyElement = function (editor) {
  26580. var dom = editor.dom, selection = editor.selection;
  26581. var ceRoot = getContentEditableRoot$1(editor.getBody(), selection.getNode());
  26582. if (isContentEditableTrue$4(ceRoot) && dom.isBlock(ceRoot) && dom.isEmpty(ceRoot)) {
  26583. var br = dom.create('br', { 'data-mce-bogus': '1' });
  26584. dom.setHTML(ceRoot, '');
  26585. ceRoot.appendChild(br);
  26586. selection.setRng(CaretPosition.before(br).toRange());
  26587. }
  26588. return true;
  26589. };
  26590. var backspaceDelete$5 = function (editor, forward) {
  26591. if (editor.selection.isCollapsed()) {
  26592. return backspaceDeleteCaret(editor, forward);
  26593. } else {
  26594. return backspaceDeleteRange(editor, forward);
  26595. }
  26596. };
  26597. var deleteCaret$2 = function (editor, forward) {
  26598. var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
  26599. return fromPosition(forward, editor.getBody(), fromPos).filter(function (pos) {
  26600. return forward ? isBeforeImageBlock(pos) : isAfterImageBlock(pos);
  26601. }).bind(function (pos) {
  26602. return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, pos));
  26603. }).exists(function (elm) {
  26604. editor.selection.select(elm);
  26605. return true;
  26606. });
  26607. };
  26608. var backspaceDelete$4 = function (editor, forward) {
  26609. return editor.selection.isCollapsed() ? deleteCaret$2(editor, forward) : false;
  26610. };
  26611. var isText = isText$7;
  26612. var startsWithCaretContainer = function (node) {
  26613. return isText(node) && node.data[0] === ZWSP$1;
  26614. };
  26615. var endsWithCaretContainer = function (node) {
  26616. return isText(node) && node.data[node.data.length - 1] === ZWSP$1;
  26617. };
  26618. var createZwsp = function (node) {
  26619. return node.ownerDocument.createTextNode(ZWSP$1);
  26620. };
  26621. var insertBefore = function (node) {
  26622. if (isText(node.previousSibling)) {
  26623. if (endsWithCaretContainer(node.previousSibling)) {
  26624. return node.previousSibling;
  26625. } else {
  26626. node.previousSibling.appendData(ZWSP$1);
  26627. return node.previousSibling;
  26628. }
  26629. } else if (isText(node)) {
  26630. if (startsWithCaretContainer(node)) {
  26631. return node;
  26632. } else {
  26633. node.insertData(0, ZWSP$1);
  26634. return node;
  26635. }
  26636. } else {
  26637. var newNode = createZwsp(node);
  26638. node.parentNode.insertBefore(newNode, node);
  26639. return newNode;
  26640. }
  26641. };
  26642. var insertAfter = function (node) {
  26643. if (isText(node.nextSibling)) {
  26644. if (startsWithCaretContainer(node.nextSibling)) {
  26645. return node.nextSibling;
  26646. } else {
  26647. node.nextSibling.insertData(0, ZWSP$1);
  26648. return node.nextSibling;
  26649. }
  26650. } else if (isText(node)) {
  26651. if (endsWithCaretContainer(node)) {
  26652. return node;
  26653. } else {
  26654. node.appendData(ZWSP$1);
  26655. return node;
  26656. }
  26657. } else {
  26658. var newNode = createZwsp(node);
  26659. if (node.nextSibling) {
  26660. node.parentNode.insertBefore(newNode, node.nextSibling);
  26661. } else {
  26662. node.parentNode.appendChild(newNode);
  26663. }
  26664. return newNode;
  26665. }
  26666. };
  26667. var insertInline = function (before, node) {
  26668. return before ? insertBefore(node) : insertAfter(node);
  26669. };
  26670. var insertInlineBefore = curry(insertInline, true);
  26671. var insertInlineAfter = curry(insertInline, false);
  26672. var insertInlinePos = function (pos, before) {
  26673. if (isText$7(pos.container())) {
  26674. return insertInline(before, pos.container());
  26675. } else {
  26676. return insertInline(before, pos.getNode());
  26677. }
  26678. };
  26679. var isPosCaretContainer = function (pos, caret) {
  26680. var caretNode = caret.get();
  26681. return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode);
  26682. };
  26683. var renderCaret = function (caret, location) {
  26684. return location.fold(function (element) {
  26685. remove$2(caret.get());
  26686. var text = insertInlineBefore(element);
  26687. caret.set(text);
  26688. return Optional.some(CaretPosition(text, text.length - 1));
  26689. }, function (element) {
  26690. return firstPositionIn(element).map(function (pos) {
  26691. if (!isPosCaretContainer(pos, caret)) {
  26692. remove$2(caret.get());
  26693. var text = insertInlinePos(pos, true);
  26694. caret.set(text);
  26695. return CaretPosition(text, 1);
  26696. } else {
  26697. return CaretPosition(caret.get(), 1);
  26698. }
  26699. });
  26700. }, function (element) {
  26701. return lastPositionIn(element).map(function (pos) {
  26702. if (!isPosCaretContainer(pos, caret)) {
  26703. remove$2(caret.get());
  26704. var text = insertInlinePos(pos, false);
  26705. caret.set(text);
  26706. return CaretPosition(text, text.length - 1);
  26707. } else {
  26708. return CaretPosition(caret.get(), caret.get().length - 1);
  26709. }
  26710. });
  26711. }, function (element) {
  26712. remove$2(caret.get());
  26713. var text = insertInlineAfter(element);
  26714. caret.set(text);
  26715. return Optional.some(CaretPosition(text, 1));
  26716. });
  26717. };
  26718. var evaluateUntil = function (fns, args) {
  26719. for (var i = 0; i < fns.length; i++) {
  26720. var result = fns[i].apply(null, args);
  26721. if (result.isSome()) {
  26722. return result;
  26723. }
  26724. }
  26725. return Optional.none();
  26726. };
  26727. var Location = Adt.generate([
  26728. { before: ['element'] },
  26729. { start: ['element'] },
  26730. { end: ['element'] },
  26731. { after: ['element'] }
  26732. ]);
  26733. var rescope$1 = function (rootNode, node) {
  26734. var parentBlock = getParentBlock$2(node, rootNode);
  26735. return parentBlock ? parentBlock : rootNode;
  26736. };
  26737. var before = function (isInlineTarget, rootNode, pos) {
  26738. var nPos = normalizeForwards(pos);
  26739. var scope = rescope$1(rootNode, nPos.container());
  26740. return findRootInline(isInlineTarget, scope, nPos).fold(function () {
  26741. return nextPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) {
  26742. return Location.before(inline);
  26743. });
  26744. }, Optional.none);
  26745. };
  26746. var isNotInsideFormatCaretContainer = function (rootNode, elm) {
  26747. return getParentCaretContainer(rootNode, elm) === null;
  26748. };
  26749. var findInsideRootInline = function (isInlineTarget, rootNode, pos) {
  26750. return findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode));
  26751. };
  26752. var start$1 = function (isInlineTarget, rootNode, pos) {
  26753. var nPos = normalizeBackwards(pos);
  26754. return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
  26755. var prevPos = prevPosition(inline, nPos);
  26756. return prevPos.isNone() ? Optional.some(Location.start(inline)) : Optional.none();
  26757. });
  26758. };
  26759. var end = function (isInlineTarget, rootNode, pos) {
  26760. var nPos = normalizeForwards(pos);
  26761. return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
  26762. var nextPos = nextPosition(inline, nPos);
  26763. return nextPos.isNone() ? Optional.some(Location.end(inline)) : Optional.none();
  26764. });
  26765. };
  26766. var after = function (isInlineTarget, rootNode, pos) {
  26767. var nPos = normalizeBackwards(pos);
  26768. var scope = rescope$1(rootNode, nPos.container());
  26769. return findRootInline(isInlineTarget, scope, nPos).fold(function () {
  26770. return prevPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) {
  26771. return Location.after(inline);
  26772. });
  26773. }, Optional.none);
  26774. };
  26775. var isValidLocation = function (location) {
  26776. return isRtl(getElement(location)) === false;
  26777. };
  26778. var readLocation = function (isInlineTarget, rootNode, pos) {
  26779. var location = evaluateUntil([
  26780. before,
  26781. start$1,
  26782. end,
  26783. after
  26784. ], [
  26785. isInlineTarget,
  26786. rootNode,
  26787. pos
  26788. ]);
  26789. return location.filter(isValidLocation);
  26790. };
  26791. var getElement = function (location) {
  26792. return location.fold(identity, identity, identity, identity);
  26793. };
  26794. var getName = function (location) {
  26795. return location.fold(constant('before'), constant('start'), constant('end'), constant('after'));
  26796. };
  26797. var outside = function (location) {
  26798. return location.fold(Location.before, Location.before, Location.after, Location.after);
  26799. };
  26800. var inside = function (location) {
  26801. return location.fold(Location.start, Location.start, Location.end, Location.end);
  26802. };
  26803. var isEq = function (location1, location2) {
  26804. return getName(location1) === getName(location2) && getElement(location1) === getElement(location2);
  26805. };
  26806. var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) {
  26807. return lift2(findRootInline(isInlineTarget, rootNode, from), findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) {
  26808. if (fromInline !== toInline && hasSameParentBlock(rootNode, fromInline, toInline)) {
  26809. return Location.after(forward ? fromInline : toInline);
  26810. } else {
  26811. return location;
  26812. }
  26813. }).getOr(location);
  26814. };
  26815. var skipNoMovement = function (fromLocation, toLocation) {
  26816. return fromLocation.fold(always, function (fromLocation) {
  26817. return !isEq(fromLocation, toLocation);
  26818. });
  26819. };
  26820. var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) {
  26821. var from = normalizePosition(forward, pos);
  26822. var to = fromPosition(forward, rootNode, from).map(curry(normalizePosition, forward));
  26823. var location = to.fold(function () {
  26824. return fromLocation.map(outside);
  26825. }, function (to) {
  26826. return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation));
  26827. });
  26828. return location.filter(isValidLocation);
  26829. };
  26830. var findLocationSimple = function (forward, location) {
  26831. if (forward) {
  26832. return location.fold(compose(Optional.some, Location.start), Optional.none, compose(Optional.some, Location.after), Optional.none);
  26833. } else {
  26834. return location.fold(Optional.none, compose(Optional.some, Location.before), Optional.none, compose(Optional.some, Location.end));
  26835. }
  26836. };
  26837. var findLocation$1 = function (forward, isInlineTarget, rootNode, pos) {
  26838. var from = normalizePosition(forward, pos);
  26839. var fromLocation = readLocation(isInlineTarget, rootNode, from);
  26840. return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () {
  26841. return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos);
  26842. });
  26843. };
  26844. curry(findLocation$1, false);
  26845. curry(findLocation$1, true);
  26846. var hasSelectionModifyApi = function (editor) {
  26847. return isFunction(editor.selection.getSel().modify);
  26848. };
  26849. var moveRel = function (forward, selection, pos) {
  26850. var delta = forward ? 1 : -1;
  26851. selection.setRng(CaretPosition(pos.container(), pos.offset() + delta).toRange());
  26852. selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word');
  26853. return true;
  26854. };
  26855. var moveByWord = function (forward, editor) {
  26856. var rng = editor.selection.getRng();
  26857. var pos = forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng);
  26858. if (!hasSelectionModifyApi(editor)) {
  26859. return false;
  26860. } else if (forward && isBeforeInline(pos)) {
  26861. return moveRel(true, editor.selection, pos);
  26862. } else if (!forward && isAfterInline(pos)) {
  26863. return moveRel(false, editor.selection, pos);
  26864. } else {
  26865. return false;
  26866. }
  26867. };
  26868. var BreakType;
  26869. (function (BreakType) {
  26870. BreakType[BreakType['Br'] = 0] = 'Br';
  26871. BreakType[BreakType['Block'] = 1] = 'Block';
  26872. BreakType[BreakType['Wrap'] = 2] = 'Wrap';
  26873. BreakType[BreakType['Eol'] = 3] = 'Eol';
  26874. }(BreakType || (BreakType = {})));
  26875. var flip = function (direction, positions) {
  26876. return direction === HDirection.Backwards ? reverse(positions) : positions;
  26877. };
  26878. var walk = function (direction, caretWalker, pos) {
  26879. return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos);
  26880. };
  26881. var getBreakType = function (scope, direction, currentPos, nextPos) {
  26882. if (isBr$5(nextPos.getNode(direction === HDirection.Forwards))) {
  26883. return BreakType.Br;
  26884. } else if (isInSameBlock(currentPos, nextPos) === false) {
  26885. return BreakType.Block;
  26886. } else {
  26887. return BreakType.Wrap;
  26888. }
  26889. };
  26890. var getPositionsUntil = function (predicate, direction, scope, start) {
  26891. var caretWalker = CaretWalker(scope);
  26892. var currentPos = start;
  26893. var positions = [];
  26894. while (currentPos) {
  26895. var nextPos = walk(direction, caretWalker, currentPos);
  26896. if (!nextPos) {
  26897. break;
  26898. }
  26899. if (isBr$5(nextPos.getNode(false))) {
  26900. if (direction === HDirection.Forwards) {
  26901. return {
  26902. positions: flip(direction, positions).concat([nextPos]),
  26903. breakType: BreakType.Br,
  26904. breakAt: Optional.some(nextPos)
  26905. };
  26906. } else {
  26907. return {
  26908. positions: flip(direction, positions),
  26909. breakType: BreakType.Br,
  26910. breakAt: Optional.some(nextPos)
  26911. };
  26912. }
  26913. }
  26914. if (!nextPos.isVisible()) {
  26915. currentPos = nextPos;
  26916. continue;
  26917. }
  26918. if (predicate(currentPos, nextPos)) {
  26919. var breakType = getBreakType(scope, direction, currentPos, nextPos);
  26920. return {
  26921. positions: flip(direction, positions),
  26922. breakType: breakType,
  26923. breakAt: Optional.some(nextPos)
  26924. };
  26925. }
  26926. positions.push(nextPos);
  26927. currentPos = nextPos;
  26928. }
  26929. return {
  26930. positions: flip(direction, positions),
  26931. breakType: BreakType.Eol,
  26932. breakAt: Optional.none()
  26933. };
  26934. };
  26935. var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) {
  26936. return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) {
  26937. var positions = getPositionsUntilBreak(scope, pos).positions;
  26938. return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions);
  26939. }).getOr([]);
  26940. };
  26941. var findClosestHorizontalPositionFromPoint = function (positions, x) {
  26942. return foldl(positions, function (acc, newPos) {
  26943. return acc.fold(function () {
  26944. return Optional.some(newPos);
  26945. }, function (lastPos) {
  26946. return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) {
  26947. var lastDist = Math.abs(x - lastRect.left);
  26948. var newDist = Math.abs(x - newRect.left);
  26949. return newDist <= lastDist ? newPos : lastPos;
  26950. }).or(acc);
  26951. });
  26952. }, Optional.none());
  26953. };
  26954. var findClosestHorizontalPosition = function (positions, pos) {
  26955. return head(pos.getClientRects()).bind(function (targetRect) {
  26956. return findClosestHorizontalPositionFromPoint(positions, targetRect.left);
  26957. });
  26958. };
  26959. var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1);
  26960. var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1);
  26961. var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine);
  26962. var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine);
  26963. var isAtFirstLine = function (scope, pos) {
  26964. return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone();
  26965. };
  26966. var isAtLastLine = function (scope, pos) {
  26967. return getPositionsUntilNextLine(scope, pos).breakAt.isNone();
  26968. };
  26969. var getFirstLinePositions = function (scope) {
  26970. return firstPositionIn(scope).map(function (pos) {
  26971. return [pos].concat(getPositionsUntilNextLine(scope, pos).positions);
  26972. }).getOr([]);
  26973. };
  26974. var getLastLinePositions = function (scope) {
  26975. return lastPositionIn(scope).map(function (pos) {
  26976. return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos);
  26977. }).getOr([]);
  26978. };
  26979. var getNodeClientRects = function (node) {
  26980. var toArrayWithNode = function (clientRects) {
  26981. return map$3(clientRects, function (rect) {
  26982. var clientRect = clone(rect);
  26983. clientRect.node = node;
  26984. return clientRect;
  26985. });
  26986. };
  26987. if (isElement$5(node)) {
  26988. return toArrayWithNode(node.getClientRects());
  26989. }
  26990. if (isText$7(node)) {
  26991. var rng = node.ownerDocument.createRange();
  26992. rng.setStart(node, 0);
  26993. rng.setEnd(node, node.data.length);
  26994. return toArrayWithNode(rng.getClientRects());
  26995. }
  26996. };
  26997. var getClientRects = function (nodes) {
  26998. return bind(nodes, getNodeClientRects);
  26999. };
  27000. var VDirection;
  27001. (function (VDirection) {
  27002. VDirection[VDirection['Up'] = -1] = 'Up';
  27003. VDirection[VDirection['Down'] = 1] = 'Down';
  27004. }(VDirection || (VDirection = {})));
  27005. var findUntil = function (direction, root, predicateFn, node) {
  27006. while (node = findNode$1(node, direction, isEditableCaretCandidate$1, root)) {
  27007. if (predicateFn(node)) {
  27008. return;
  27009. }
  27010. }
  27011. };
  27012. var walkUntil$1 = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) {
  27013. var line = 0;
  27014. var result = [];
  27015. var add = function (node) {
  27016. var clientRects = getClientRects([node]);
  27017. if (direction === -1) {
  27018. clientRects = clientRects.reverse();
  27019. }
  27020. for (var i = 0; i < clientRects.length; i++) {
  27021. var clientRect = clientRects[i];
  27022. if (isBeflowFn(clientRect, targetClientRect)) {
  27023. continue;
  27024. }
  27025. if (result.length > 0 && isAboveFn(clientRect, last$1(result))) {
  27026. line++;
  27027. }
  27028. clientRect.line = line;
  27029. if (predicateFn(clientRect)) {
  27030. return true;
  27031. }
  27032. result.push(clientRect);
  27033. }
  27034. };
  27035. var targetClientRect = last$1(caretPosition.getClientRects());
  27036. if (!targetClientRect) {
  27037. return result;
  27038. }
  27039. var node = caretPosition.getNode();
  27040. add(node);
  27041. findUntil(direction, root, add, node);
  27042. return result;
  27043. };
  27044. var aboveLineNumber = function (lineNumber, clientRect) {
  27045. return clientRect.line > lineNumber;
  27046. };
  27047. var isLineNumber = function (lineNumber, clientRect) {
  27048. return clientRect.line === lineNumber;
  27049. };
  27050. var upUntil = curry(walkUntil$1, VDirection.Up, isAbove$1, isBelow$1);
  27051. var downUntil = curry(walkUntil$1, VDirection.Down, isBelow$1, isAbove$1);
  27052. var positionsUntil = function (direction, root, predicateFn, node) {
  27053. var caretWalker = CaretWalker(root);
  27054. var walkFn;
  27055. var isBelowFn;
  27056. var isAboveFn;
  27057. var caretPosition;
  27058. var result = [];
  27059. var line = 0;
  27060. var getClientRect = function (caretPosition) {
  27061. if (direction === 1) {
  27062. return last$1(caretPosition.getClientRects());
  27063. }
  27064. return last$1(caretPosition.getClientRects());
  27065. };
  27066. if (direction === 1) {
  27067. walkFn = caretWalker.next;
  27068. isBelowFn = isBelow$1;
  27069. isAboveFn = isAbove$1;
  27070. caretPosition = CaretPosition.after(node);
  27071. } else {
  27072. walkFn = caretWalker.prev;
  27073. isBelowFn = isAbove$1;
  27074. isAboveFn = isBelow$1;
  27075. caretPosition = CaretPosition.before(node);
  27076. }
  27077. var targetClientRect = getClientRect(caretPosition);
  27078. do {
  27079. if (!caretPosition.isVisible()) {
  27080. continue;
  27081. }
  27082. var rect = getClientRect(caretPosition);
  27083. if (isAboveFn(rect, targetClientRect)) {
  27084. continue;
  27085. }
  27086. if (result.length > 0 && isBelowFn(rect, last$1(result))) {
  27087. line++;
  27088. }
  27089. var clientRect = clone(rect);
  27090. clientRect.position = caretPosition;
  27091. clientRect.line = line;
  27092. if (predicateFn(clientRect)) {
  27093. return result;
  27094. }
  27095. result.push(clientRect);
  27096. } while (caretPosition = walkFn(caretPosition));
  27097. return result;
  27098. };
  27099. var isAboveLine = function (lineNumber) {
  27100. return function (clientRect) {
  27101. return aboveLineNumber(lineNumber, clientRect);
  27102. };
  27103. };
  27104. var isLine = function (lineNumber) {
  27105. return function (clientRect) {
  27106. return isLineNumber(lineNumber, clientRect);
  27107. };
  27108. };
  27109. var isContentEditableFalse$3 = isContentEditableFalse$b;
  27110. var findNode = findNode$1;
  27111. var distanceToRectLeft = function (clientRect, clientX) {
  27112. return Math.abs(clientRect.left - clientX);
  27113. };
  27114. var distanceToRectRight = function (clientRect, clientX) {
  27115. return Math.abs(clientRect.right - clientX);
  27116. };
  27117. var isInsideX = function (clientX, clientRect) {
  27118. return clientX >= clientRect.left && clientX <= clientRect.right;
  27119. };
  27120. var isInsideY = function (clientY, clientRect) {
  27121. return clientY >= clientRect.top && clientY <= clientRect.bottom;
  27122. };
  27123. var isNodeClientRect = function (rect) {
  27124. return hasNonNullableKey(rect, 'node');
  27125. };
  27126. var findClosestClientRect = function (clientRects, clientX, allowInside) {
  27127. if (allowInside === void 0) {
  27128. allowInside = always;
  27129. }
  27130. return reduce(clientRects, function (oldClientRect, clientRect) {
  27131. if (isInsideX(clientX, clientRect)) {
  27132. return allowInside(clientRect) ? clientRect : oldClientRect;
  27133. }
  27134. if (isInsideX(clientX, oldClientRect)) {
  27135. return allowInside(oldClientRect) ? oldClientRect : clientRect;
  27136. }
  27137. var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
  27138. var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
  27139. if (newDistance === oldDistance && isNodeClientRect(clientRect) && isContentEditableFalse$3(clientRect.node)) {
  27140. return clientRect;
  27141. }
  27142. if (newDistance < oldDistance) {
  27143. return clientRect;
  27144. }
  27145. return oldClientRect;
  27146. });
  27147. };
  27148. var walkUntil = function (direction, root, predicateFn, startNode, includeChildren) {
  27149. var node = findNode(startNode, direction, isEditableCaretCandidate$1, root, !includeChildren);
  27150. do {
  27151. if (!node || predicateFn(node)) {
  27152. return;
  27153. }
  27154. } while (node = findNode(node, direction, isEditableCaretCandidate$1, root));
  27155. };
  27156. var findLineNodeRects = function (root, targetNodeRect, includeChildren) {
  27157. if (includeChildren === void 0) {
  27158. includeChildren = true;
  27159. }
  27160. var clientRects = [];
  27161. var collect = function (checkPosFn, node) {
  27162. var lineRects = filter$4(getClientRects([node]), function (clientRect) {
  27163. return !checkPosFn(clientRect, targetNodeRect);
  27164. });
  27165. clientRects = clientRects.concat(lineRects);
  27166. return lineRects.length === 0;
  27167. };
  27168. clientRects.push(targetNodeRect);
  27169. walkUntil(VDirection.Up, root, curry(collect, isAbove$1), targetNodeRect.node, includeChildren);
  27170. walkUntil(VDirection.Down, root, curry(collect, isBelow$1), targetNodeRect.node, includeChildren);
  27171. return clientRects;
  27172. };
  27173. var getFakeCaretTargets = function (root) {
  27174. return filter$4(from(root.getElementsByTagName('*')), isFakeCaretTarget);
  27175. };
  27176. var caretInfo = function (clientRect, clientX) {
  27177. return {
  27178. node: clientRect.node,
  27179. before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
  27180. };
  27181. };
  27182. var closestFakeCaret = function (root, clientX, clientY) {
  27183. var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root));
  27184. var targetNodeRects = filter$4(fakeTargetNodeRects, curry(isInsideY, clientY));
  27185. var checkInside = function (clientRect) {
  27186. return !isTable$3(clientRect.node) && !isMedia$2(clientRect.node);
  27187. };
  27188. var closestNodeRect = findClosestClientRect(targetNodeRects, clientX, checkInside);
  27189. if (closestNodeRect) {
  27190. var includeChildren = checkInside(closestNodeRect);
  27191. closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX, checkInside);
  27192. if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
  27193. return caretInfo(closestNodeRect, clientX);
  27194. }
  27195. }
  27196. return null;
  27197. };
  27198. var moveToRange = function (editor, rng) {
  27199. editor.selection.setRng(rng);
  27200. scrollRangeIntoView(editor, editor.selection.getRng());
  27201. };
  27202. var renderRangeCaretOpt = function (editor, range, scrollIntoView) {
  27203. return Optional.some(renderRangeCaret(editor, range, scrollIntoView));
  27204. };
  27205. var moveHorizontally = function (editor, direction, range, isBefore, isAfter, isElement) {
  27206. var forwards = direction === HDirection.Forwards;
  27207. var caretWalker = CaretWalker(editor.getBody());
  27208. var getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev);
  27209. var isBeforeFn = forwards ? isBefore : isAfter;
  27210. if (!range.collapsed) {
  27211. var node = getSelectedNode(range);
  27212. if (isElement(node)) {
  27213. return showCaret(direction, editor, node, direction === HDirection.Backwards, false);
  27214. }
  27215. }
  27216. var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
  27217. if (isBeforeFn(caretPosition)) {
  27218. return selectNode(editor, caretPosition.getNode(!forwards));
  27219. }
  27220. var nextCaretPosition = normalizePosition(forwards, getNextPosFn(caretPosition));
  27221. var rangeIsInContainerBlock = isRangeInCaretContainerBlock(range);
  27222. if (!nextCaretPosition) {
  27223. return rangeIsInContainerBlock ? Optional.some(range) : Optional.none();
  27224. }
  27225. if (isBeforeFn(nextCaretPosition)) {
  27226. return showCaret(direction, editor, nextCaretPosition.getNode(!forwards), forwards, false);
  27227. }
  27228. var peekCaretPosition = getNextPosFn(nextCaretPosition);
  27229. if (peekCaretPosition && isBeforeFn(peekCaretPosition)) {
  27230. if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) {
  27231. return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, false);
  27232. }
  27233. }
  27234. if (rangeIsInContainerBlock) {
  27235. return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false);
  27236. }
  27237. return Optional.none();
  27238. };
  27239. var moveVertically = function (editor, direction, range, isBefore, isAfter, isElement) {
  27240. var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
  27241. var caretClientRect = last$1(caretPosition.getClientRects());
  27242. var forwards = direction === VDirection.Down;
  27243. if (!caretClientRect) {
  27244. return Optional.none();
  27245. }
  27246. var walkerFn = forwards ? downUntil : upUntil;
  27247. var linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition);
  27248. var nextLinePositions = filter$4(linePositions, isLine(1));
  27249. var clientX = caretClientRect.left;
  27250. var nextLineRect = findClosestClientRect(nextLinePositions, clientX);
  27251. if (nextLineRect && isElement(nextLineRect.node)) {
  27252. var dist1 = Math.abs(clientX - nextLineRect.left);
  27253. var dist2 = Math.abs(clientX - nextLineRect.right);
  27254. return showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false);
  27255. }
  27256. var currentNode;
  27257. if (isBefore(caretPosition)) {
  27258. currentNode = caretPosition.getNode();
  27259. } else if (isAfter(caretPosition)) {
  27260. currentNode = caretPosition.getNode(true);
  27261. } else {
  27262. currentNode = getSelectedNode(range);
  27263. }
  27264. if (currentNode) {
  27265. var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), currentNode);
  27266. var closestNextLineRect = findClosestClientRect(filter$4(caretPositions, isLine(1)), clientX);
  27267. if (closestNextLineRect) {
  27268. return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
  27269. }
  27270. closestNextLineRect = last$1(filter$4(caretPositions, isLine(0)));
  27271. if (closestNextLineRect) {
  27272. return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
  27273. }
  27274. }
  27275. if (nextLinePositions.length === 0) {
  27276. return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore).map(function (pos) {
  27277. return renderRangeCaret(editor, pos.toRange(), false);
  27278. });
  27279. }
  27280. return Optional.none();
  27281. };
  27282. var getLineEndPoint = function (editor, forward) {
  27283. var rng = editor.selection.getRng();
  27284. var body = editor.getBody();
  27285. if (forward) {
  27286. var from = CaretPosition.fromRangeEnd(rng);
  27287. var result = getPositionsUntilNextLine(body, from);
  27288. return last$2(result.positions);
  27289. } else {
  27290. var from = CaretPosition.fromRangeStart(rng);
  27291. var result = getPositionsUntilPreviousLine(body, from);
  27292. return head(result.positions);
  27293. }
  27294. };
  27295. var moveToLineEndPoint$3 = function (editor, forward, isElementPosition) {
  27296. return getLineEndPoint(editor, forward).filter(isElementPosition).exists(function (pos) {
  27297. editor.selection.setRng(pos.toRange());
  27298. return true;
  27299. });
  27300. };
  27301. var setCaretPosition = function (editor, pos) {
  27302. var rng = editor.dom.createRng();
  27303. rng.setStart(pos.container(), pos.offset());
  27304. rng.setEnd(pos.container(), pos.offset());
  27305. editor.selection.setRng(rng);
  27306. };
  27307. var setSelected = function (state, elm) {
  27308. if (state) {
  27309. elm.setAttribute('data-mce-selected', 'inline-boundary');
  27310. } else {
  27311. elm.removeAttribute('data-mce-selected');
  27312. }
  27313. };
  27314. var renderCaretLocation = function (editor, caret, location) {
  27315. return renderCaret(caret, location).map(function (pos) {
  27316. setCaretPosition(editor, pos);
  27317. return location;
  27318. });
  27319. };
  27320. var findLocation = function (editor, caret, forward) {
  27321. var rootNode = editor.getBody();
  27322. var from = CaretPosition.fromRangeStart(editor.selection.getRng());
  27323. var isInlineTarget$1 = curry(isInlineTarget, editor);
  27324. var location = findLocation$1(forward, isInlineTarget$1, rootNode, from);
  27325. return location.bind(function (location) {
  27326. return renderCaretLocation(editor, caret, location);
  27327. });
  27328. };
  27329. var toggleInlines = function (isInlineTarget, dom, elms) {
  27330. var inlineBoundaries = map$3(descendants(SugarElement.fromDom(dom.getRoot()), '*[data-mce-selected="inline-boundary"]'), function (e) {
  27331. return e.dom;
  27332. });
  27333. var selectedInlines = filter$4(inlineBoundaries, isInlineTarget);
  27334. var targetInlines = filter$4(elms, isInlineTarget);
  27335. each$k(difference(selectedInlines, targetInlines), curry(setSelected, false));
  27336. each$k(difference(targetInlines, selectedInlines), curry(setSelected, true));
  27337. };
  27338. var safeRemoveCaretContainer = function (editor, caret) {
  27339. if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) {
  27340. var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
  27341. if (CaretPosition.isTextPosition(pos) && isAtZwsp(pos) === false) {
  27342. setCaretPosition(editor, removeAndReposition(caret.get(), pos));
  27343. caret.set(null);
  27344. }
  27345. }
  27346. };
  27347. var renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) {
  27348. if (editor.selection.isCollapsed()) {
  27349. var inlines = filter$4(elms, isInlineTarget);
  27350. each$k(inlines, function (_inline) {
  27351. var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
  27352. readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) {
  27353. return renderCaretLocation(editor, caret, location);
  27354. });
  27355. });
  27356. }
  27357. };
  27358. var move$2 = function (editor, caret, forward) {
  27359. return isInlineBoundariesEnabled(editor) ? findLocation(editor, caret, forward).isSome() : false;
  27360. };
  27361. var moveWord = function (forward, editor, _caret) {
  27362. return isInlineBoundariesEnabled(editor) ? moveByWord(forward, editor) : false;
  27363. };
  27364. var setupSelectedState = function (editor) {
  27365. var caret = Cell(null);
  27366. var isInlineTarget$1 = curry(isInlineTarget, editor);
  27367. editor.on('NodeChange', function (e) {
  27368. if (isInlineBoundariesEnabled(editor) && !(Env.browser.isIE() && e.initial)) {
  27369. toggleInlines(isInlineTarget$1, editor.dom, e.parents);
  27370. safeRemoveCaretContainer(editor, caret);
  27371. renderInsideInlineCaret(isInlineTarget$1, editor, caret, e.parents);
  27372. }
  27373. });
  27374. return caret;
  27375. };
  27376. var moveNextWord = curry(moveWord, true);
  27377. var movePrevWord = curry(moveWord, false);
  27378. var moveToLineEndPoint$2 = function (editor, forward, caret) {
  27379. if (isInlineBoundariesEnabled(editor)) {
  27380. var linePoint = getLineEndPoint(editor, forward).getOrThunk(function () {
  27381. var rng = editor.selection.getRng();
  27382. return forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng);
  27383. });
  27384. return readLocation(curry(isInlineTarget, editor), editor.getBody(), linePoint).exists(function (loc) {
  27385. var outsideLoc = outside(loc);
  27386. return renderCaret(caret, outsideLoc).exists(function (pos) {
  27387. setCaretPosition(editor, pos);
  27388. return true;
  27389. });
  27390. });
  27391. } else {
  27392. return false;
  27393. }
  27394. };
  27395. var rangeFromPositions = function (from, to) {
  27396. var range = document.createRange();
  27397. range.setStart(from.container(), from.offset());
  27398. range.setEnd(to.container(), to.offset());
  27399. return range;
  27400. };
  27401. var hasOnlyTwoOrLessPositionsLeft = function (elm) {
  27402. return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) {
  27403. var normalizedFirstPos = normalizePosition(true, firstPos);
  27404. var normalizedLastPos = normalizePosition(false, lastPos);
  27405. return nextPosition(elm, normalizedFirstPos).forall(function (pos) {
  27406. return pos.isEqual(normalizedLastPos);
  27407. });
  27408. }).getOr(true);
  27409. };
  27410. var setCaretLocation = function (editor, caret) {
  27411. return function (location) {
  27412. return renderCaret(caret, location).exists(function (pos) {
  27413. setCaretPosition(editor, pos);
  27414. return true;
  27415. });
  27416. };
  27417. };
  27418. var deleteFromTo = function (editor, caret, from, to) {
  27419. var rootNode = editor.getBody();
  27420. var isInlineTarget$1 = curry(isInlineTarget, editor);
  27421. editor.undoManager.ignore(function () {
  27422. editor.selection.setRng(rangeFromPositions(from, to));
  27423. editor.execCommand('Delete');
  27424. readLocation(isInlineTarget$1, rootNode, CaretPosition.fromRangeStart(editor.selection.getRng())).map(inside).map(setCaretLocation(editor, caret));
  27425. });
  27426. editor.nodeChanged();
  27427. };
  27428. var rescope = function (rootNode, node) {
  27429. var parentBlock = getParentBlock$2(node, rootNode);
  27430. return parentBlock ? parentBlock : rootNode;
  27431. };
  27432. var backspaceDeleteCollapsed = function (editor, caret, forward, from) {
  27433. var rootNode = rescope(editor.getBody(), from.container());
  27434. var isInlineTarget$1 = curry(isInlineTarget, editor);
  27435. var fromLocation = readLocation(isInlineTarget$1, rootNode, from);
  27436. return fromLocation.bind(function (location) {
  27437. if (forward) {
  27438. return location.fold(constant(Optional.some(inside(location))), Optional.none, constant(Optional.some(outside(location))), Optional.none);
  27439. } else {
  27440. return location.fold(Optional.none, constant(Optional.some(outside(location))), Optional.none, constant(Optional.some(inside(location))));
  27441. }
  27442. }).map(setCaretLocation(editor, caret)).getOrThunk(function () {
  27443. var toPosition = navigate(forward, rootNode, from);
  27444. var toLocation = toPosition.bind(function (pos) {
  27445. return readLocation(isInlineTarget$1, rootNode, pos);
  27446. });
  27447. return lift2(fromLocation, toLocation, function () {
  27448. return findRootInline(isInlineTarget$1, rootNode, from).exists(function (elm) {
  27449. if (hasOnlyTwoOrLessPositionsLeft(elm)) {
  27450. deleteElement$2(editor, forward, SugarElement.fromDom(elm));
  27451. return true;
  27452. } else {
  27453. return false;
  27454. }
  27455. });
  27456. }).orThunk(function () {
  27457. return toLocation.bind(function (_) {
  27458. return toPosition.map(function (to) {
  27459. if (forward) {
  27460. deleteFromTo(editor, caret, from, to);
  27461. } else {
  27462. deleteFromTo(editor, caret, to, from);
  27463. }
  27464. return true;
  27465. });
  27466. });
  27467. }).getOr(false);
  27468. });
  27469. };
  27470. var backspaceDelete$3 = function (editor, caret, forward) {
  27471. if (editor.selection.isCollapsed() && isInlineBoundariesEnabled(editor)) {
  27472. var from = CaretPosition.fromRangeStart(editor.selection.getRng());
  27473. return backspaceDeleteCollapsed(editor, caret, forward, from);
  27474. }
  27475. return false;
  27476. };
  27477. var getParentInlines = function (rootElm, startElm) {
  27478. var parents = parentsAndSelf(startElm, rootElm);
  27479. return findIndex$2(parents, isBlock$2).fold(constant(parents), function (index) {
  27480. return parents.slice(0, index);
  27481. });
  27482. };
  27483. var hasOnlyOneChild = function (elm) {
  27484. return childNodesCount(elm) === 1;
  27485. };
  27486. var deleteLastPosition = function (forward, editor, target, parentInlines) {
  27487. var isFormatElement$1 = curry(isFormatElement, editor);
  27488. var formatNodes = map$3(filter$4(parentInlines, isFormatElement$1), function (elm) {
  27489. return elm.dom;
  27490. });
  27491. if (formatNodes.length === 0) {
  27492. deleteElement$2(editor, forward, target);
  27493. } else {
  27494. var pos = replaceWithCaretFormat(target.dom, formatNodes);
  27495. editor.selection.setRng(pos.toRange());
  27496. }
  27497. };
  27498. var deleteCaret$1 = function (editor, forward) {
  27499. var rootElm = SugarElement.fromDom(editor.getBody());
  27500. var startElm = SugarElement.fromDom(editor.selection.getStart());
  27501. var parentInlines = filter$4(getParentInlines(rootElm, startElm), hasOnlyOneChild);
  27502. return last$2(parentInlines).exists(function (target) {
  27503. var fromPos = CaretPosition.fromRangeStart(editor.selection.getRng());
  27504. if (willDeleteLastPositionInElement(forward, fromPos, target.dom) && !isEmptyCaretFormatElement(target)) {
  27505. deleteLastPosition(forward, editor, target, parentInlines);
  27506. return true;
  27507. } else {
  27508. return false;
  27509. }
  27510. });
  27511. };
  27512. var backspaceDelete$2 = function (editor, forward) {
  27513. return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false;
  27514. };
  27515. var deleteElement = function (editor, forward, element) {
  27516. editor._selectionOverrides.hideFakeCaret();
  27517. deleteElement$2(editor, forward, SugarElement.fromDom(element));
  27518. return true;
  27519. };
  27520. var deleteCaret = function (editor, forward) {
  27521. var isNearMedia = forward ? isBeforeMedia : isAfterMedia;
  27522. var direction = forward ? HDirection.Forwards : HDirection.Backwards;
  27523. var fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng());
  27524. if (isNearMedia(fromPos)) {
  27525. return deleteElement(editor, forward, fromPos.getNode(!forward));
  27526. } else {
  27527. return Optional.from(normalizePosition(forward, fromPos)).filter(function (pos) {
  27528. return isNearMedia(pos) && isMoveInsideSameBlock(fromPos, pos);
  27529. }).exists(function (pos) {
  27530. return deleteElement(editor, forward, pos.getNode(!forward));
  27531. });
  27532. }
  27533. };
  27534. var deleteRange = function (editor, forward) {
  27535. var selectedNode = editor.selection.getNode();
  27536. return isMedia$2(selectedNode) ? deleteElement(editor, forward, selectedNode) : false;
  27537. };
  27538. var backspaceDelete$1 = function (editor, forward) {
  27539. return editor.selection.isCollapsed() ? deleteCaret(editor, forward) : deleteRange(editor, forward);
  27540. };
  27541. var isEditable = function (target) {
  27542. return closest$3(target, function (elm) {
  27543. return isContentEditableTrue$4(elm.dom) || isContentEditableFalse$b(elm.dom);
  27544. }).exists(function (elm) {
  27545. return isContentEditableTrue$4(elm.dom);
  27546. });
  27547. };
  27548. var parseIndentValue = function (value) {
  27549. var number = parseInt(value, 10);
  27550. return isNaN(number) ? 0 : number;
  27551. };
  27552. var getIndentStyleName = function (useMargin, element) {
  27553. var indentStyleName = useMargin || isTable$2(element) ? 'margin' : 'padding';
  27554. var suffix = get$5(element, 'direction') === 'rtl' ? '-right' : '-left';
  27555. return indentStyleName + suffix;
  27556. };
  27557. var indentElement = function (dom, command, useMargin, value, unit, element) {
  27558. var indentStyleName = getIndentStyleName(useMargin, SugarElement.fromDom(element));
  27559. if (command === 'outdent') {
  27560. var styleValue = Math.max(0, parseIndentValue(element.style[indentStyleName]) - value);
  27561. dom.setStyle(element, indentStyleName, styleValue ? styleValue + unit : '');
  27562. } else {
  27563. var styleValue = parseIndentValue(element.style[indentStyleName]) + value + unit;
  27564. dom.setStyle(element, indentStyleName, styleValue);
  27565. }
  27566. };
  27567. var validateBlocks = function (editor, blocks) {
  27568. return forall(blocks, function (block) {
  27569. var indentStyleName = getIndentStyleName(shouldIndentUseMargin(editor), block);
  27570. var intentValue = getRaw(block, indentStyleName).map(parseIndentValue).getOr(0);
  27571. var contentEditable = editor.dom.getContentEditable(block.dom);
  27572. return contentEditable !== 'false' && intentValue > 0;
  27573. });
  27574. };
  27575. var canOutdent = function (editor) {
  27576. var blocks = getBlocksToIndent(editor);
  27577. return !editor.mode.isReadOnly() && (blocks.length > 1 || validateBlocks(editor, blocks));
  27578. };
  27579. var isListComponent = function (el) {
  27580. return isList(el) || isListItem(el);
  27581. };
  27582. var parentIsListComponent = function (el) {
  27583. return parent(el).exists(isListComponent);
  27584. };
  27585. var getBlocksToIndent = function (editor) {
  27586. return filter$4(fromDom$1(editor.selection.getSelectedBlocks()), function (el) {
  27587. return !isListComponent(el) && !parentIsListComponent(el) && isEditable(el);
  27588. });
  27589. };
  27590. var handle = function (editor, command) {
  27591. var dom = editor.dom, selection = editor.selection, formatter = editor.formatter;
  27592. var indentation = getIndentation(editor);
  27593. var indentUnit = /[a-z%]+$/i.exec(indentation)[0];
  27594. var indentValue = parseInt(indentation, 10);
  27595. var useMargin = shouldIndentUseMargin(editor);
  27596. var forcedRootBlock = getForcedRootBlock(editor);
  27597. if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) {
  27598. if (forcedRootBlock === '' && !dom.getParent(selection.getNode(), dom.isBlock)) {
  27599. formatter.apply('div');
  27600. }
  27601. }
  27602. each$k(getBlocksToIndent(editor), function (block) {
  27603. indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom);
  27604. });
  27605. };
  27606. var backspaceDelete = function (editor, _forward) {
  27607. if (editor.selection.isCollapsed() && canOutdent(editor)) {
  27608. var dom = editor.dom;
  27609. var rng = editor.selection.getRng();
  27610. var pos = CaretPosition.fromRangeStart(rng);
  27611. var block = dom.getParent(rng.startContainer, dom.isBlock);
  27612. if (block !== null && isAtStartOfBlock(SugarElement.fromDom(block), pos)) {
  27613. handle(editor, 'outdent');
  27614. return true;
  27615. }
  27616. }
  27617. return false;
  27618. };
  27619. var nativeCommand = function (editor, command) {
  27620. editor.getDoc().execCommand(command, false, null);
  27621. };
  27622. var deleteCommand = function (editor, caret) {
  27623. if (backspaceDelete(editor)) {
  27624. return;
  27625. } else if (backspaceDelete$5(editor, false)) {
  27626. return;
  27627. } else if (backspaceDelete$6(editor, false)) {
  27628. return;
  27629. } else if (backspaceDelete$3(editor, caret, false)) {
  27630. return;
  27631. } else if (backspaceDelete$8(editor, false)) {
  27632. return;
  27633. } else if (backspaceDelete$9(editor)) {
  27634. return;
  27635. } else if (backspaceDelete$4(editor, false)) {
  27636. return;
  27637. } else if (backspaceDelete$1(editor, false)) {
  27638. return;
  27639. } else if (backspaceDelete$7(editor)) {
  27640. return;
  27641. } else if (backspaceDelete$2(editor, false)) {
  27642. return;
  27643. } else {
  27644. nativeCommand(editor, 'Delete');
  27645. paddEmptyBody(editor);
  27646. }
  27647. };
  27648. var forwardDeleteCommand = function (editor, caret) {
  27649. if (backspaceDelete$5(editor, true)) {
  27650. return;
  27651. } else if (backspaceDelete$6(editor, true)) {
  27652. return;
  27653. } else if (backspaceDelete$3(editor, caret, true)) {
  27654. return;
  27655. } else if (backspaceDelete$8(editor, true)) {
  27656. return;
  27657. } else if (backspaceDelete$9(editor)) {
  27658. return;
  27659. } else if (backspaceDelete$4(editor, true)) {
  27660. return;
  27661. } else if (backspaceDelete$1(editor, true)) {
  27662. return;
  27663. } else if (backspaceDelete$7(editor)) {
  27664. return;
  27665. } else if (backspaceDelete$2(editor, true)) {
  27666. return;
  27667. } else {
  27668. nativeCommand(editor, 'ForwardDelete');
  27669. }
  27670. };
  27671. var setup$f = function (editor, caret) {
  27672. editor.addCommand('delete', function () {
  27673. deleteCommand(editor, caret);
  27674. });
  27675. editor.addCommand('forwardDelete', function () {
  27676. forwardDeleteCommand(editor, caret);
  27677. });
  27678. };
  27679. var SIGNIFICANT_MOVE = 5;
  27680. var LONGPRESS_DELAY = 400;
  27681. var getTouch = function (event) {
  27682. if (event.touches === undefined || event.touches.length !== 1) {
  27683. return Optional.none();
  27684. }
  27685. return Optional.some(event.touches[0]);
  27686. };
  27687. var isFarEnough = function (touch, data) {
  27688. var distX = Math.abs(touch.clientX - data.x);
  27689. var distY = Math.abs(touch.clientY - data.y);
  27690. return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE;
  27691. };
  27692. var setup$e = function (editor) {
  27693. var startData = value();
  27694. var longpressFired = Cell(false);
  27695. var debounceLongpress = last(function (e) {
  27696. editor.fire('longpress', __assign(__assign({}, e), { type: 'longpress' }));
  27697. longpressFired.set(true);
  27698. }, LONGPRESS_DELAY);
  27699. editor.on('touchstart', function (e) {
  27700. getTouch(e).each(function (touch) {
  27701. debounceLongpress.cancel();
  27702. var data = {
  27703. x: touch.clientX,
  27704. y: touch.clientY,
  27705. target: e.target
  27706. };
  27707. debounceLongpress.throttle(e);
  27708. longpressFired.set(false);
  27709. startData.set(data);
  27710. });
  27711. }, true);
  27712. editor.on('touchmove', function (e) {
  27713. debounceLongpress.cancel();
  27714. getTouch(e).each(function (touch) {
  27715. startData.on(function (data) {
  27716. if (isFarEnough(touch, data)) {
  27717. startData.clear();
  27718. longpressFired.set(false);
  27719. editor.fire('longpresscancel');
  27720. }
  27721. });
  27722. });
  27723. }, true);
  27724. editor.on('touchend touchcancel', function (e) {
  27725. debounceLongpress.cancel();
  27726. if (e.type === 'touchcancel') {
  27727. return;
  27728. }
  27729. startData.get().filter(function (data) {
  27730. return data.target.isEqualNode(e.target);
  27731. }).each(function () {
  27732. if (longpressFired.get()) {
  27733. e.preventDefault();
  27734. } else {
  27735. editor.fire('tap', __assign(__assign({}, e), { type: 'tap' }));
  27736. }
  27737. });
  27738. }, true);
  27739. };
  27740. var isBlockElement = function (blockElements, node) {
  27741. return has$2(blockElements, node.nodeName);
  27742. };
  27743. var isValidTarget = function (blockElements, node) {
  27744. if (isText$7(node)) {
  27745. return true;
  27746. } else if (isElement$5(node)) {
  27747. return !isBlockElement(blockElements, node) && !isBookmarkNode$1(node);
  27748. } else {
  27749. return false;
  27750. }
  27751. };
  27752. var hasBlockParent = function (blockElements, root, node) {
  27753. return exists(parents(SugarElement.fromDom(node), SugarElement.fromDom(root)), function (elm) {
  27754. return isBlockElement(blockElements, elm.dom);
  27755. });
  27756. };
  27757. var shouldRemoveTextNode = function (blockElements, node) {
  27758. if (isText$7(node)) {
  27759. if (node.nodeValue.length === 0) {
  27760. return true;
  27761. } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) {
  27762. return true;
  27763. }
  27764. }
  27765. return false;
  27766. };
  27767. var addRootBlocks = function (editor) {
  27768. var dom = editor.dom, selection = editor.selection;
  27769. var schema = editor.schema, blockElements = schema.getBlockElements();
  27770. var node = selection.getStart();
  27771. var rootNode = editor.getBody();
  27772. var rootBlockNode, tempNode, wrapped;
  27773. var forcedRootBlock = getForcedRootBlock(editor);
  27774. if (!node || !isElement$5(node) || !forcedRootBlock) {
  27775. return;
  27776. }
  27777. var rootNodeName = rootNode.nodeName.toLowerCase();
  27778. if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) {
  27779. return;
  27780. }
  27781. var rng = selection.getRng();
  27782. var startContainer = rng.startContainer;
  27783. var startOffset = rng.startOffset;
  27784. var endContainer = rng.endContainer;
  27785. var endOffset = rng.endOffset;
  27786. var restoreSelection = hasFocus(editor);
  27787. node = rootNode.firstChild;
  27788. while (node) {
  27789. if (isValidTarget(blockElements, node)) {
  27790. if (shouldRemoveTextNode(blockElements, node)) {
  27791. tempNode = node;
  27792. node = node.nextSibling;
  27793. dom.remove(tempNode);
  27794. continue;
  27795. }
  27796. if (!rootBlockNode) {
  27797. rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor));
  27798. node.parentNode.insertBefore(rootBlockNode, node);
  27799. wrapped = true;
  27800. }
  27801. tempNode = node;
  27802. node = node.nextSibling;
  27803. rootBlockNode.appendChild(tempNode);
  27804. } else {
  27805. rootBlockNode = null;
  27806. node = node.nextSibling;
  27807. }
  27808. }
  27809. if (wrapped && restoreSelection) {
  27810. rng.setStart(startContainer, startOffset);
  27811. rng.setEnd(endContainer, endOffset);
  27812. selection.setRng(rng);
  27813. editor.nodeChanged();
  27814. }
  27815. };
  27816. var setup$d = function (editor) {
  27817. if (getForcedRootBlock(editor)) {
  27818. editor.on('NodeChange', curry(addRootBlocks, editor));
  27819. }
  27820. };
  27821. var findBlockCaretContainer = function (editor) {
  27822. return descendant(SugarElement.fromDom(editor.getBody()), '*[data-mce-caret]').map(function (elm) {
  27823. return elm.dom;
  27824. }).getOrNull();
  27825. };
  27826. var removeIeControlRect = function (editor) {
  27827. editor.selection.setRng(editor.selection.getRng());
  27828. };
  27829. var showBlockCaretContainer = function (editor, blockCaretContainer) {
  27830. if (blockCaretContainer.hasAttribute('data-mce-caret')) {
  27831. showCaretContainerBlock(blockCaretContainer);
  27832. removeIeControlRect(editor);
  27833. editor.selection.scrollIntoView(blockCaretContainer);
  27834. }
  27835. };
  27836. var handleBlockContainer = function (editor, e) {
  27837. var blockCaretContainer = findBlockCaretContainer(editor);
  27838. if (!blockCaretContainer) {
  27839. return;
  27840. }
  27841. if (e.type === 'compositionstart') {
  27842. e.preventDefault();
  27843. e.stopPropagation();
  27844. showBlockCaretContainer(editor, blockCaretContainer);
  27845. return;
  27846. }
  27847. if (hasContent(blockCaretContainer)) {
  27848. showBlockCaretContainer(editor, blockCaretContainer);
  27849. editor.undoManager.add();
  27850. }
  27851. };
  27852. var setup$c = function (editor) {
  27853. editor.on('keyup compositionstart', curry(handleBlockContainer, editor));
  27854. };
  27855. var isContentEditableFalse$2 = isContentEditableFalse$b;
  27856. var moveToCeFalseHorizontally = function (direction, editor, range) {
  27857. return moveHorizontally(editor, direction, range, isBeforeContentEditableFalse, isAfterContentEditableFalse, isContentEditableFalse$2);
  27858. };
  27859. var moveToCeFalseVertically = function (direction, editor, range) {
  27860. var isBefore = function (caretPosition) {
  27861. return isBeforeContentEditableFalse(caretPosition) || isBeforeTable(caretPosition);
  27862. };
  27863. var isAfter = function (caretPosition) {
  27864. return isAfterContentEditableFalse(caretPosition) || isAfterTable(caretPosition);
  27865. };
  27866. return moveVertically(editor, direction, range, isBefore, isAfter, isContentEditableFalse$2);
  27867. };
  27868. var createTextBlock = function (editor) {
  27869. var textBlock = editor.dom.create(getForcedRootBlock(editor));
  27870. if (!Env.ie || Env.ie >= 11) {
  27871. textBlock.innerHTML = '<br data-mce-bogus="1">';
  27872. }
  27873. return textBlock;
  27874. };
  27875. var exitPreBlock = function (editor, direction, range) {
  27876. var caretWalker = CaretWalker(editor.getBody());
  27877. var getVisualCaretPosition$1 = curry(getVisualCaretPosition, direction === 1 ? caretWalker.next : caretWalker.prev);
  27878. if (range.collapsed && hasForcedRootBlock(editor)) {
  27879. var pre = editor.dom.getParent(range.startContainer, 'PRE');
  27880. if (!pre) {
  27881. return;
  27882. }
  27883. var caretPos = getVisualCaretPosition$1(CaretPosition.fromRangeStart(range));
  27884. if (!caretPos) {
  27885. var newBlock = createTextBlock(editor);
  27886. if (direction === 1) {
  27887. editor.$(pre).after(newBlock);
  27888. } else {
  27889. editor.$(pre).before(newBlock);
  27890. }
  27891. editor.selection.select(newBlock, true);
  27892. editor.selection.collapse();
  27893. }
  27894. }
  27895. };
  27896. var getHorizontalRange = function (editor, forward) {
  27897. var direction = forward ? HDirection.Forwards : HDirection.Backwards;
  27898. var range = editor.selection.getRng();
  27899. return moveToCeFalseHorizontally(direction, editor, range).orThunk(function () {
  27900. exitPreBlock(editor, direction, range);
  27901. return Optional.none();
  27902. });
  27903. };
  27904. var getVerticalRange = function (editor, down) {
  27905. var direction = down ? 1 : -1;
  27906. var range = editor.selection.getRng();
  27907. return moveToCeFalseVertically(direction, editor, range).orThunk(function () {
  27908. exitPreBlock(editor, direction, range);
  27909. return Optional.none();
  27910. });
  27911. };
  27912. var moveH$2 = function (editor, forward) {
  27913. return getHorizontalRange(editor, forward).exists(function (newRange) {
  27914. moveToRange(editor, newRange);
  27915. return true;
  27916. });
  27917. };
  27918. var moveV$3 = function (editor, down) {
  27919. return getVerticalRange(editor, down).exists(function (newRange) {
  27920. moveToRange(editor, newRange);
  27921. return true;
  27922. });
  27923. };
  27924. var moveToLineEndPoint$1 = function (editor, forward) {
  27925. var isCefPosition = forward ? isAfterContentEditableFalse : isBeforeContentEditableFalse;
  27926. return moveToLineEndPoint$3(editor, forward, isCefPosition);
  27927. };
  27928. var isTarget = function (node) {
  27929. return contains$3(['figcaption'], name(node));
  27930. };
  27931. var rangeBefore = function (target) {
  27932. var rng = document.createRange();
  27933. rng.setStartBefore(target.dom);
  27934. rng.setEndBefore(target.dom);
  27935. return rng;
  27936. };
  27937. var insertElement = function (root, elm, forward) {
  27938. if (forward) {
  27939. append$1(root, elm);
  27940. } else {
  27941. prepend(root, elm);
  27942. }
  27943. };
  27944. var insertBr = function (root, forward) {
  27945. var br = SugarElement.fromTag('br');
  27946. insertElement(root, br, forward);
  27947. return rangeBefore(br);
  27948. };
  27949. var insertBlock = function (root, forward, blockName, attrs) {
  27950. var block = SugarElement.fromTag(blockName);
  27951. var br = SugarElement.fromTag('br');
  27952. setAll$1(block, attrs);
  27953. append$1(block, br);
  27954. insertElement(root, block, forward);
  27955. return rangeBefore(br);
  27956. };
  27957. var insertEmptyLine = function (root, rootBlockName, attrs, forward) {
  27958. if (rootBlockName === '') {
  27959. return insertBr(root, forward);
  27960. } else {
  27961. return insertBlock(root, forward, rootBlockName, attrs);
  27962. }
  27963. };
  27964. var getClosestTargetBlock = function (pos, root) {
  27965. var isRoot = curry(eq, root);
  27966. return closest$3(SugarElement.fromDom(pos.container()), isBlock$2, isRoot).filter(isTarget);
  27967. };
  27968. var isAtFirstOrLastLine = function (root, forward, pos) {
  27969. return forward ? isAtLastLine(root.dom, pos) : isAtFirstLine(root.dom, pos);
  27970. };
  27971. var moveCaretToNewEmptyLine = function (editor, forward) {
  27972. var root = SugarElement.fromDom(editor.getBody());
  27973. var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
  27974. var rootBlock = getForcedRootBlock(editor);
  27975. var rootBlockAttrs = getForcedRootBlockAttrs(editor);
  27976. return getClosestTargetBlock(pos, root).exists(function () {
  27977. if (isAtFirstOrLastLine(root, forward, pos)) {
  27978. var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward);
  27979. editor.selection.setRng(rng);
  27980. return true;
  27981. } else {
  27982. return false;
  27983. }
  27984. });
  27985. };
  27986. var moveV$2 = function (editor, forward) {
  27987. if (editor.selection.isCollapsed()) {
  27988. return moveCaretToNewEmptyLine(editor, forward);
  27989. } else {
  27990. return false;
  27991. }
  27992. };
  27993. var defaultPatterns = function (patterns) {
  27994. return map$3(patterns, function (pattern) {
  27995. return __assign({
  27996. shiftKey: false,
  27997. altKey: false,
  27998. ctrlKey: false,
  27999. metaKey: false,
  28000. keyCode: 0,
  28001. action: noop
  28002. }, pattern);
  28003. });
  28004. };
  28005. var matchesEvent = function (pattern, evt) {
  28006. return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey;
  28007. };
  28008. var match$1 = function (patterns, evt) {
  28009. return bind(defaultPatterns(patterns), function (pattern) {
  28010. return matchesEvent(pattern, evt) ? [pattern] : [];
  28011. });
  28012. };
  28013. var action = function (f) {
  28014. var x = [];
  28015. for (var _i = 1; _i < arguments.length; _i++) {
  28016. x[_i - 1] = arguments[_i];
  28017. }
  28018. return function () {
  28019. return f.apply(null, x);
  28020. };
  28021. };
  28022. var execute = function (patterns, evt) {
  28023. return find$3(match$1(patterns, evt), function (pattern) {
  28024. return pattern.action();
  28025. });
  28026. };
  28027. var moveH$1 = function (editor, forward) {
  28028. var direction = forward ? HDirection.Forwards : HDirection.Backwards;
  28029. var range = editor.selection.getRng();
  28030. return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia$2).exists(function (newRange) {
  28031. moveToRange(editor, newRange);
  28032. return true;
  28033. });
  28034. };
  28035. var moveV$1 = function (editor, down) {
  28036. var direction = down ? 1 : -1;
  28037. var range = editor.selection.getRng();
  28038. return moveVertically(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia$2).exists(function (newRange) {
  28039. moveToRange(editor, newRange);
  28040. return true;
  28041. });
  28042. };
  28043. var moveToLineEndPoint = function (editor, forward) {
  28044. var isNearMedia = forward ? isAfterMedia : isBeforeMedia;
  28045. return moveToLineEndPoint$3(editor, forward, isNearMedia);
  28046. };
  28047. var deflate = function (rect, delta) {
  28048. return {
  28049. left: rect.left - delta,
  28050. top: rect.top - delta,
  28051. right: rect.right + delta * 2,
  28052. bottom: rect.bottom + delta * 2,
  28053. width: rect.width + delta,
  28054. height: rect.height + delta
  28055. };
  28056. };
  28057. var getCorners = function (getYAxisValue, tds) {
  28058. return bind(tds, function (td) {
  28059. var rect = deflate(clone(td.getBoundingClientRect()), -1);
  28060. return [
  28061. {
  28062. x: rect.left,
  28063. y: getYAxisValue(rect),
  28064. cell: td
  28065. },
  28066. {
  28067. x: rect.right,
  28068. y: getYAxisValue(rect),
  28069. cell: td
  28070. }
  28071. ];
  28072. });
  28073. };
  28074. var findClosestCorner = function (corners, x, y) {
  28075. return foldl(corners, function (acc, newCorner) {
  28076. return acc.fold(function () {
  28077. return Optional.some(newCorner);
  28078. }, function (oldCorner) {
  28079. var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y));
  28080. var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y));
  28081. return Optional.some(newDist < oldDist ? newCorner : oldCorner);
  28082. });
  28083. }, Optional.none());
  28084. };
  28085. var getClosestCell = function (getYAxisValue, isTargetCorner, table, x, y) {
  28086. var cells = descendants(SugarElement.fromDom(table), 'td,th,caption').map(function (e) {
  28087. return e.dom;
  28088. });
  28089. var corners = filter$4(getCorners(getYAxisValue, cells), function (corner) {
  28090. return isTargetCorner(corner, y);
  28091. });
  28092. return findClosestCorner(corners, x, y).map(function (corner) {
  28093. return corner.cell;
  28094. });
  28095. };
  28096. var getBottomValue = function (rect) {
  28097. return rect.bottom;
  28098. };
  28099. var getTopValue = function (rect) {
  28100. return rect.top;
  28101. };
  28102. var isAbove = function (corner, y) {
  28103. return corner.y < y;
  28104. };
  28105. var isBelow = function (corner, y) {
  28106. return corner.y > y;
  28107. };
  28108. var getClosestCellAbove = curry(getClosestCell, getBottomValue, isAbove);
  28109. var getClosestCellBelow = curry(getClosestCell, getTopValue, isBelow);
  28110. var findClosestPositionInAboveCell = function (table, pos) {
  28111. return head(pos.getClientRects()).bind(function (rect) {
  28112. return getClosestCellAbove(table, rect.left, rect.top);
  28113. }).bind(function (cell) {
  28114. return findClosestHorizontalPosition(getLastLinePositions(cell), pos);
  28115. });
  28116. };
  28117. var findClosestPositionInBelowCell = function (table, pos) {
  28118. return last$2(pos.getClientRects()).bind(function (rect) {
  28119. return getClosestCellBelow(table, rect.left, rect.top);
  28120. }).bind(function (cell) {
  28121. return findClosestHorizontalPosition(getFirstLinePositions(cell), pos);
  28122. });
  28123. };
  28124. var hasNextBreak = function (getPositionsUntil, scope, lineInfo) {
  28125. return lineInfo.breakAt.exists(function (breakPos) {
  28126. return getPositionsUntil(scope, breakPos).breakAt.isSome();
  28127. });
  28128. };
  28129. var startsWithWrapBreak = function (lineInfo) {
  28130. return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0;
  28131. };
  28132. var startsWithBrBreak = function (lineInfo) {
  28133. return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1;
  28134. };
  28135. var isAtTableCellLine = function (getPositionsUntil, scope, pos) {
  28136. var lineInfo = getPositionsUntil(scope, pos);
  28137. if (startsWithWrapBreak(lineInfo) || !isBr$5(pos.getNode()) && startsWithBrBreak(lineInfo)) {
  28138. return !hasNextBreak(getPositionsUntil, scope, lineInfo);
  28139. } else {
  28140. return lineInfo.breakAt.isNone();
  28141. }
  28142. };
  28143. var isAtFirstTableCellLine = curry(isAtTableCellLine, getPositionsUntilPreviousLine);
  28144. var isAtLastTableCellLine = curry(isAtTableCellLine, getPositionsUntilNextLine);
  28145. var isCaretAtStartOrEndOfTable = function (forward, rng, table) {
  28146. var caretPos = CaretPosition.fromRangeStart(rng);
  28147. return positionIn(!forward, table).exists(function (pos) {
  28148. return pos.isEqual(caretPos);
  28149. });
  28150. };
  28151. var navigateHorizontally = function (editor, forward, table, _td) {
  28152. var rng = editor.selection.getRng();
  28153. var direction = forward ? 1 : -1;
  28154. if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) {
  28155. showCaret(direction, editor, table, !forward, false).each(function (newRng) {
  28156. moveToRange(editor, newRng);
  28157. });
  28158. return true;
  28159. }
  28160. return false;
  28161. };
  28162. var getClosestAbovePosition = function (root, table, start) {
  28163. return findClosestPositionInAboveCell(table, start).orThunk(function () {
  28164. return head(start.getClientRects()).bind(function (rect) {
  28165. return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition.before(table)), rect.left);
  28166. });
  28167. }).getOr(CaretPosition.before(table));
  28168. };
  28169. var getClosestBelowPosition = function (root, table, start) {
  28170. return findClosestPositionInBelowCell(table, start).orThunk(function () {
  28171. return head(start.getClientRects()).bind(function (rect) {
  28172. return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition.after(table)), rect.left);
  28173. });
  28174. }).getOr(CaretPosition.after(table));
  28175. };
  28176. var getTable = function (previous, pos) {
  28177. var node = pos.getNode(previous);
  28178. return isElement$5(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none();
  28179. };
  28180. var renderBlock = function (down, editor, table, pos) {
  28181. var forcedRootBlock = getForcedRootBlock(editor);
  28182. if (forcedRootBlock) {
  28183. editor.undoManager.transact(function () {
  28184. var element = SugarElement.fromTag(forcedRootBlock);
  28185. setAll$1(element, getForcedRootBlockAttrs(editor));
  28186. append$1(element, SugarElement.fromTag('br'));
  28187. if (down) {
  28188. after$3(SugarElement.fromDom(table), element);
  28189. } else {
  28190. before$4(SugarElement.fromDom(table), element);
  28191. }
  28192. var rng = editor.dom.createRng();
  28193. rng.setStart(element.dom, 0);
  28194. rng.setEnd(element.dom, 0);
  28195. moveToRange(editor, rng);
  28196. });
  28197. } else {
  28198. moveToRange(editor, pos.toRange());
  28199. }
  28200. };
  28201. var moveCaret = function (editor, down, pos) {
  28202. var table = down ? getTable(true, pos) : getTable(false, pos);
  28203. var last = down === false;
  28204. table.fold(function () {
  28205. return moveToRange(editor, pos.toRange());
  28206. }, function (table) {
  28207. return positionIn(last, editor.getBody()).filter(function (lastPos) {
  28208. return lastPos.isEqual(pos);
  28209. }).fold(function () {
  28210. return moveToRange(editor, pos.toRange());
  28211. }, function (_) {
  28212. return renderBlock(down, editor, table, pos);
  28213. });
  28214. });
  28215. };
  28216. var navigateVertically = function (editor, down, table, td) {
  28217. var rng = editor.selection.getRng();
  28218. var pos = CaretPosition.fromRangeStart(rng);
  28219. var root = editor.getBody();
  28220. if (!down && isAtFirstTableCellLine(td, pos)) {
  28221. var newPos = getClosestAbovePosition(root, table, pos);
  28222. moveCaret(editor, down, newPos);
  28223. return true;
  28224. } else if (down && isAtLastTableCellLine(td, pos)) {
  28225. var newPos = getClosestBelowPosition(root, table, pos);
  28226. moveCaret(editor, down, newPos);
  28227. return true;
  28228. } else {
  28229. return false;
  28230. }
  28231. };
  28232. var move$1 = function (editor, forward, mover) {
  28233. return Optional.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
  28234. return Optional.from(editor.dom.getParent(td, 'table')).map(function (table) {
  28235. return mover(editor, forward, table, td);
  28236. });
  28237. }).getOr(false);
  28238. };
  28239. var moveH = function (editor, forward) {
  28240. return move$1(editor, forward, navigateHorizontally);
  28241. };
  28242. var moveV = function (editor, forward) {
  28243. return move$1(editor, forward, navigateVertically);
  28244. };
  28245. var executeKeydownOverride$3 = function (editor, caret, evt) {
  28246. var os = detect().os;
  28247. execute([
  28248. {
  28249. keyCode: VK.RIGHT,
  28250. action: action(moveH$2, editor, true)
  28251. },
  28252. {
  28253. keyCode: VK.LEFT,
  28254. action: action(moveH$2, editor, false)
  28255. },
  28256. {
  28257. keyCode: VK.UP,
  28258. action: action(moveV$3, editor, false)
  28259. },
  28260. {
  28261. keyCode: VK.DOWN,
  28262. action: action(moveV$3, editor, true)
  28263. },
  28264. {
  28265. keyCode: VK.RIGHT,
  28266. action: action(moveH, editor, true)
  28267. },
  28268. {
  28269. keyCode: VK.LEFT,
  28270. action: action(moveH, editor, false)
  28271. },
  28272. {
  28273. keyCode: VK.UP,
  28274. action: action(moveV, editor, false)
  28275. },
  28276. {
  28277. keyCode: VK.DOWN,
  28278. action: action(moveV, editor, true)
  28279. },
  28280. {
  28281. keyCode: VK.RIGHT,
  28282. action: action(moveH$1, editor, true)
  28283. },
  28284. {
  28285. keyCode: VK.LEFT,
  28286. action: action(moveH$1, editor, false)
  28287. },
  28288. {
  28289. keyCode: VK.UP,
  28290. action: action(moveV$1, editor, false)
  28291. },
  28292. {
  28293. keyCode: VK.DOWN,
  28294. action: action(moveV$1, editor, true)
  28295. },
  28296. {
  28297. keyCode: VK.RIGHT,
  28298. action: action(move$2, editor, caret, true)
  28299. },
  28300. {
  28301. keyCode: VK.LEFT,
  28302. action: action(move$2, editor, caret, false)
  28303. },
  28304. {
  28305. keyCode: VK.RIGHT,
  28306. ctrlKey: !os.isOSX(),
  28307. altKey: os.isOSX(),
  28308. action: action(moveNextWord, editor, caret)
  28309. },
  28310. {
  28311. keyCode: VK.LEFT,
  28312. ctrlKey: !os.isOSX(),
  28313. altKey: os.isOSX(),
  28314. action: action(movePrevWord, editor, caret)
  28315. },
  28316. {
  28317. keyCode: VK.UP,
  28318. action: action(moveV$2, editor, false)
  28319. },
  28320. {
  28321. keyCode: VK.DOWN,
  28322. action: action(moveV$2, editor, true)
  28323. }
  28324. ], evt).each(function (_) {
  28325. evt.preventDefault();
  28326. });
  28327. };
  28328. var setup$b = function (editor, caret) {
  28329. editor.on('keydown', function (evt) {
  28330. if (evt.isDefaultPrevented() === false) {
  28331. executeKeydownOverride$3(editor, caret, evt);
  28332. }
  28333. });
  28334. };
  28335. var executeKeydownOverride$2 = function (editor, caret, evt) {
  28336. execute([
  28337. {
  28338. keyCode: VK.BACKSPACE,
  28339. action: action(backspaceDelete, editor, false)
  28340. },
  28341. {
  28342. keyCode: VK.BACKSPACE,
  28343. action: action(backspaceDelete$5, editor, false)
  28344. },
  28345. {
  28346. keyCode: VK.DELETE,
  28347. action: action(backspaceDelete$5, editor, true)
  28348. },
  28349. {
  28350. keyCode: VK.BACKSPACE,
  28351. action: action(backspaceDelete$6, editor, false)
  28352. },
  28353. {
  28354. keyCode: VK.DELETE,
  28355. action: action(backspaceDelete$6, editor, true)
  28356. },
  28357. {
  28358. keyCode: VK.BACKSPACE,
  28359. action: action(backspaceDelete$3, editor, caret, false)
  28360. },
  28361. {
  28362. keyCode: VK.DELETE,
  28363. action: action(backspaceDelete$3, editor, caret, true)
  28364. },
  28365. {
  28366. keyCode: VK.BACKSPACE,
  28367. action: action(backspaceDelete$9, editor, false)
  28368. },
  28369. {
  28370. keyCode: VK.DELETE,
  28371. action: action(backspaceDelete$9, editor, true)
  28372. },
  28373. {
  28374. keyCode: VK.BACKSPACE,
  28375. action: action(backspaceDelete$4, editor, false)
  28376. },
  28377. {
  28378. keyCode: VK.DELETE,
  28379. action: action(backspaceDelete$4, editor, true)
  28380. },
  28381. {
  28382. keyCode: VK.BACKSPACE,
  28383. action: action(backspaceDelete$1, editor, false)
  28384. },
  28385. {
  28386. keyCode: VK.DELETE,
  28387. action: action(backspaceDelete$1, editor, true)
  28388. },
  28389. {
  28390. keyCode: VK.BACKSPACE,
  28391. action: action(backspaceDelete$7, editor, false)
  28392. },
  28393. {
  28394. keyCode: VK.DELETE,
  28395. action: action(backspaceDelete$7, editor, true)
  28396. },
  28397. {
  28398. keyCode: VK.BACKSPACE,
  28399. action: action(backspaceDelete$8, editor, false)
  28400. },
  28401. {
  28402. keyCode: VK.DELETE,
  28403. action: action(backspaceDelete$8, editor, true)
  28404. },
  28405. {
  28406. keyCode: VK.BACKSPACE,
  28407. action: action(backspaceDelete$2, editor, false)
  28408. },
  28409. {
  28410. keyCode: VK.DELETE,
  28411. action: action(backspaceDelete$2, editor, true)
  28412. }
  28413. ], evt).each(function (_) {
  28414. evt.preventDefault();
  28415. });
  28416. };
  28417. var executeKeyupOverride = function (editor, evt) {
  28418. execute([
  28419. {
  28420. keyCode: VK.BACKSPACE,
  28421. action: action(paddEmptyElement, editor)
  28422. },
  28423. {
  28424. keyCode: VK.DELETE,
  28425. action: action(paddEmptyElement, editor)
  28426. }
  28427. ], evt);
  28428. };
  28429. var setup$a = function (editor, caret) {
  28430. editor.on('keydown', function (evt) {
  28431. if (evt.isDefaultPrevented() === false) {
  28432. executeKeydownOverride$2(editor, caret, evt);
  28433. }
  28434. });
  28435. editor.on('keyup', function (evt) {
  28436. if (evt.isDefaultPrevented() === false) {
  28437. executeKeyupOverride(editor, evt);
  28438. }
  28439. });
  28440. };
  28441. var firstNonWhiteSpaceNodeSibling = function (node) {
  28442. while (node) {
  28443. if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) {
  28444. return node;
  28445. }
  28446. node = node.nextSibling;
  28447. }
  28448. };
  28449. var moveToCaretPosition = function (editor, root) {
  28450. var node, lastNode = root;
  28451. var dom = editor.dom;
  28452. var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements();
  28453. if (!root) {
  28454. return;
  28455. }
  28456. if (/^(LI|DT|DD)$/.test(root.nodeName)) {
  28457. var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
  28458. if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
  28459. root.insertBefore(dom.doc.createTextNode(nbsp), root.firstChild);
  28460. }
  28461. }
  28462. var rng = dom.createRng();
  28463. root.normalize();
  28464. if (root.hasChildNodes()) {
  28465. var walker = new DomTreeWalker(root, root);
  28466. while (node = walker.current()) {
  28467. if (isText$7(node)) {
  28468. rng.setStart(node, 0);
  28469. rng.setEnd(node, 0);
  28470. break;
  28471. }
  28472. if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
  28473. rng.setStartBefore(node);
  28474. rng.setEndBefore(node);
  28475. break;
  28476. }
  28477. lastNode = node;
  28478. node = walker.next();
  28479. }
  28480. if (!node) {
  28481. rng.setStart(lastNode, 0);
  28482. rng.setEnd(lastNode, 0);
  28483. }
  28484. } else {
  28485. if (isBr$5(root)) {
  28486. if (root.nextSibling && dom.isBlock(root.nextSibling)) {
  28487. rng.setStartBefore(root);
  28488. rng.setEndBefore(root);
  28489. } else {
  28490. rng.setStartAfter(root);
  28491. rng.setEndAfter(root);
  28492. }
  28493. } else {
  28494. rng.setStart(root, 0);
  28495. rng.setEnd(root, 0);
  28496. }
  28497. }
  28498. editor.selection.setRng(rng);
  28499. scrollRangeIntoView(editor, rng);
  28500. };
  28501. var getEditableRoot$1 = function (dom, node) {
  28502. var root = dom.getRoot();
  28503. var parent, editableRoot;
  28504. parent = node;
  28505. while (parent !== root && dom.getContentEditable(parent) !== 'false') {
  28506. if (dom.getContentEditable(parent) === 'true') {
  28507. editableRoot = parent;
  28508. }
  28509. parent = parent.parentNode;
  28510. }
  28511. return parent !== root ? editableRoot : root;
  28512. };
  28513. var getParentBlock = function (editor) {
  28514. return Optional.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock));
  28515. };
  28516. var getParentBlockName = function (editor) {
  28517. return getParentBlock(editor).fold(constant(''), function (parentBlock) {
  28518. return parentBlock.nodeName.toUpperCase();
  28519. });
  28520. };
  28521. var isListItemParentBlock = function (editor) {
  28522. return getParentBlock(editor).filter(function (elm) {
  28523. return isListItem(SugarElement.fromDom(elm));
  28524. }).isSome();
  28525. };
  28526. var hasFirstChild = function (elm, name) {
  28527. return elm.firstChild && elm.firstChild.nodeName === name;
  28528. };
  28529. var isFirstChild = function (elm) {
  28530. var _a;
  28531. return ((_a = elm.parentNode) === null || _a === void 0 ? void 0 : _a.firstChild) === elm;
  28532. };
  28533. var hasParent = function (elm, parentName) {
  28534. return elm && elm.parentNode && elm.parentNode.nodeName === parentName;
  28535. };
  28536. var isListBlock = function (elm) {
  28537. return elm && /^(OL|UL|LI)$/.test(elm.nodeName);
  28538. };
  28539. var isNestedList = function (elm) {
  28540. return isListBlock(elm) && isListBlock(elm.parentNode);
  28541. };
  28542. var getContainerBlock = function (containerBlock) {
  28543. var containerBlockParent = containerBlock.parentNode;
  28544. if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
  28545. return containerBlockParent;
  28546. }
  28547. return containerBlock;
  28548. };
  28549. var isFirstOrLastLi = function (containerBlock, parentBlock, first) {
  28550. var node = containerBlock[first ? 'firstChild' : 'lastChild'];
  28551. while (node) {
  28552. if (isElement$5(node)) {
  28553. break;
  28554. }
  28555. node = node[first ? 'nextSibling' : 'previousSibling'];
  28556. }
  28557. return node === parentBlock;
  28558. };
  28559. var insert$3 = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) {
  28560. var dom = editor.dom;
  28561. var rng = editor.selection.getRng();
  28562. if (containerBlock === editor.getBody()) {
  28563. return;
  28564. }
  28565. if (isNestedList(containerBlock)) {
  28566. newBlockName = 'LI';
  28567. }
  28568. var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
  28569. if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) {
  28570. if (hasParent(containerBlock, 'LI')) {
  28571. var containerBlockParent = getContainerBlock(containerBlock);
  28572. dom.insertAfter(newBlock, containerBlockParent);
  28573. if (isFirstChild(containerBlock)) {
  28574. dom.remove(containerBlockParent);
  28575. } else {
  28576. dom.remove(containerBlock);
  28577. }
  28578. } else {
  28579. dom.replace(newBlock, containerBlock);
  28580. }
  28581. } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) {
  28582. if (hasParent(containerBlock, 'LI')) {
  28583. dom.insertAfter(newBlock, getContainerBlock(containerBlock));
  28584. newBlock.appendChild(dom.doc.createTextNode(' '));
  28585. newBlock.appendChild(containerBlock);
  28586. } else {
  28587. containerBlock.parentNode.insertBefore(newBlock, containerBlock);
  28588. }
  28589. dom.remove(parentBlock);
  28590. } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) {
  28591. dom.insertAfter(newBlock, getContainerBlock(containerBlock));
  28592. dom.remove(parentBlock);
  28593. } else {
  28594. containerBlock = getContainerBlock(containerBlock);
  28595. var tmpRng = rng.cloneRange();
  28596. tmpRng.setStartAfter(parentBlock);
  28597. tmpRng.setEndAfter(containerBlock);
  28598. var fragment = tmpRng.extractContents();
  28599. if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) {
  28600. newBlock = fragment.firstChild;
  28601. dom.insertAfter(fragment, containerBlock);
  28602. } else {
  28603. dom.insertAfter(fragment, containerBlock);
  28604. dom.insertAfter(newBlock, containerBlock);
  28605. }
  28606. dom.remove(parentBlock);
  28607. }
  28608. moveToCaretPosition(editor, newBlock);
  28609. };
  28610. var trimZwsp = function (fragment) {
  28611. each$k(descendants$1(SugarElement.fromDom(fragment), isText$8), function (text) {
  28612. var rawNode = text.dom;
  28613. rawNode.nodeValue = trim$2(rawNode.nodeValue);
  28614. });
  28615. };
  28616. var isEmptyAnchor = function (dom, elm) {
  28617. return elm && elm.nodeName === 'A' && dom.isEmpty(elm);
  28618. };
  28619. var isTableCell = function (node) {
  28620. return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
  28621. };
  28622. var emptyBlock = function (elm) {
  28623. elm.innerHTML = '<br data-mce-bogus="1">';
  28624. };
  28625. var containerAndSiblingName = function (container, nodeName) {
  28626. return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName;
  28627. };
  28628. var canSplitBlock = function (dom, node) {
  28629. return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true';
  28630. };
  28631. var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) {
  28632. var node = block;
  28633. var firstChilds = [];
  28634. var i;
  28635. if (!node) {
  28636. return;
  28637. }
  28638. while (node = node.firstChild) {
  28639. if (dom.isBlock(node)) {
  28640. return;
  28641. }
  28642. if (isElement$5(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
  28643. firstChilds.push(node);
  28644. }
  28645. }
  28646. i = firstChilds.length;
  28647. while (i--) {
  28648. node = firstChilds[i];
  28649. if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') {
  28650. dom.remove(node);
  28651. } else {
  28652. if (isEmptyAnchor(dom, node)) {
  28653. dom.remove(node);
  28654. }
  28655. }
  28656. }
  28657. };
  28658. var normalizeZwspOffset = function (start, container, offset) {
  28659. if (isText$7(container) === false) {
  28660. return offset;
  28661. } else if (start) {
  28662. return offset === 1 && container.data.charAt(offset - 1) === ZWSP$1 ? 0 : offset;
  28663. } else {
  28664. return offset === container.data.length - 1 && container.data.charAt(offset) === ZWSP$1 ? container.data.length : offset;
  28665. }
  28666. };
  28667. var includeZwspInRange = function (rng) {
  28668. var newRng = rng.cloneRange();
  28669. newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset));
  28670. newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset));
  28671. return newRng;
  28672. };
  28673. var trimLeadingLineBreaks = function (node) {
  28674. do {
  28675. if (isText$7(node)) {
  28676. node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
  28677. }
  28678. node = node.firstChild;
  28679. } while (node);
  28680. };
  28681. var getEditableRoot = function (dom, node) {
  28682. var root = dom.getRoot();
  28683. var parent, editableRoot;
  28684. parent = node;
  28685. while (parent !== root && dom.getContentEditable(parent) !== 'false') {
  28686. if (dom.getContentEditable(parent) === 'true') {
  28687. editableRoot = parent;
  28688. }
  28689. parent = parent.parentNode;
  28690. }
  28691. return parent !== root ? editableRoot : root;
  28692. };
  28693. var applyAttributes = function (editor, node, forcedRootBlockAttrs) {
  28694. var dom = editor.dom;
  28695. Optional.from(forcedRootBlockAttrs.style).map(dom.parseStyle).each(function (attrStyles) {
  28696. var currentStyles = getAllRaw(SugarElement.fromDom(node));
  28697. var newStyles = __assign(__assign({}, currentStyles), attrStyles);
  28698. dom.setStyles(node, newStyles);
  28699. });
  28700. var attrClassesOpt = Optional.from(forcedRootBlockAttrs.class).map(function (attrClasses) {
  28701. return attrClasses.split(/\s+/);
  28702. });
  28703. var currentClassesOpt = Optional.from(node.className).map(function (currentClasses) {
  28704. return filter$4(currentClasses.split(/\s+/), function (clazz) {
  28705. return clazz !== '';
  28706. });
  28707. });
  28708. lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) {
  28709. var filteredClasses = filter$4(currentClasses, function (clazz) {
  28710. return !contains$3(attrClasses, clazz);
  28711. });
  28712. var newClasses = __spreadArray(__spreadArray([], attrClasses, true), filteredClasses, true);
  28713. dom.setAttrib(node, 'class', newClasses.join(' '));
  28714. });
  28715. var appliedAttrs = [
  28716. 'style',
  28717. 'class'
  28718. ];
  28719. var remainingAttrs = filter$3(forcedRootBlockAttrs, function (_, attrs) {
  28720. return !contains$3(appliedAttrs, attrs);
  28721. });
  28722. dom.setAttribs(node, remainingAttrs);
  28723. };
  28724. var setForcedBlockAttrs = function (editor, node) {
  28725. var forcedRootBlockName = getForcedRootBlock(editor);
  28726. if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
  28727. var forcedRootBlockAttrs = getForcedRootBlockAttrs(editor);
  28728. applyAttributes(editor, node, forcedRootBlockAttrs);
  28729. }
  28730. };
  28731. var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) {
  28732. var newBlock, parentBlock, startNode, node, next, rootBlockName;
  28733. var blockName = newBlockName || 'P';
  28734. var dom = editor.dom, editableRoot = getEditableRoot(dom, container);
  28735. parentBlock = dom.getParent(container, dom.isBlock);
  28736. if (!parentBlock || !canSplitBlock(dom, parentBlock)) {
  28737. parentBlock = parentBlock || editableRoot;
  28738. if (parentBlock === editor.getBody() || isTableCell(parentBlock)) {
  28739. rootBlockName = parentBlock.nodeName.toLowerCase();
  28740. } else {
  28741. rootBlockName = parentBlock.parentNode.nodeName.toLowerCase();
  28742. }
  28743. if (!parentBlock.hasChildNodes()) {
  28744. newBlock = dom.create(blockName);
  28745. setForcedBlockAttrs(editor, newBlock);
  28746. parentBlock.appendChild(newBlock);
  28747. rng.setStart(newBlock, 0);
  28748. rng.setEnd(newBlock, 0);
  28749. return newBlock;
  28750. }
  28751. node = container;
  28752. while (node.parentNode !== parentBlock) {
  28753. node = node.parentNode;
  28754. }
  28755. while (node && !dom.isBlock(node)) {
  28756. startNode = node;
  28757. node = node.previousSibling;
  28758. }
  28759. if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
  28760. newBlock = dom.create(blockName);
  28761. setForcedBlockAttrs(editor, newBlock);
  28762. startNode.parentNode.insertBefore(newBlock, startNode);
  28763. node = startNode;
  28764. while (node && !dom.isBlock(node)) {
  28765. next = node.nextSibling;
  28766. newBlock.appendChild(node);
  28767. node = next;
  28768. }
  28769. rng.setStart(container, offset);
  28770. rng.setEnd(container, offset);
  28771. }
  28772. }
  28773. return container;
  28774. };
  28775. var addBrToBlockIfNeeded = function (dom, block) {
  28776. block.normalize();
  28777. var lastChild = block.lastChild;
  28778. if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) {
  28779. dom.add(block, 'br');
  28780. }
  28781. };
  28782. var insert$2 = function (editor, evt) {
  28783. var tmpRng, container, offset, parentBlock;
  28784. var newBlock, fragment, containerBlock, parentBlockName, newBlockName, isAfterLastNodeInContainer;
  28785. var dom = editor.dom;
  28786. var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements();
  28787. var rng = editor.selection.getRng();
  28788. var createNewBlock = function (name) {
  28789. var node = container, block, clonedNode, caretNode;
  28790. var textInlineElements = schema.getTextInlineElements();
  28791. if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
  28792. block = dom.create(name || newBlockName);
  28793. } else {
  28794. block = parentBlock.cloneNode(false);
  28795. }
  28796. caretNode = block;
  28797. if (shouldKeepStyles(editor) === false) {
  28798. dom.setAttrib(block, 'style', null);
  28799. dom.setAttrib(block, 'class', null);
  28800. } else {
  28801. do {
  28802. if (textInlineElements[node.nodeName]) {
  28803. if (isCaretNode(node) || isBookmarkNode$1(node)) {
  28804. continue;
  28805. }
  28806. clonedNode = node.cloneNode(false);
  28807. dom.setAttrib(clonedNode, 'id', '');
  28808. if (block.hasChildNodes()) {
  28809. clonedNode.appendChild(block.firstChild);
  28810. block.appendChild(clonedNode);
  28811. } else {
  28812. caretNode = clonedNode;
  28813. block.appendChild(clonedNode);
  28814. }
  28815. }
  28816. } while ((node = node.parentNode) && node !== editableRoot);
  28817. }
  28818. setForcedBlockAttrs(editor, block);
  28819. emptyBlock(caretNode);
  28820. return block;
  28821. };
  28822. var isCaretAtStartOrEndOfBlock = function (start) {
  28823. var node, name;
  28824. var normalizedOffset = normalizeZwspOffset(start, container, offset);
  28825. if (isText$7(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) {
  28826. return false;
  28827. }
  28828. if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) {
  28829. return true;
  28830. }
  28831. if (start && isElement$5(container) && container === parentBlock.firstChild) {
  28832. return true;
  28833. }
  28834. if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) {
  28835. return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start;
  28836. }
  28837. var walker = new DomTreeWalker(container, parentBlock);
  28838. if (isText$7(container)) {
  28839. if (start && normalizedOffset === 0) {
  28840. walker.prev();
  28841. } else if (!start && normalizedOffset === container.nodeValue.length) {
  28842. walker.next();
  28843. }
  28844. }
  28845. while (node = walker.current()) {
  28846. if (isElement$5(node)) {
  28847. if (!node.getAttribute('data-mce-bogus')) {
  28848. name = node.nodeName.toLowerCase();
  28849. if (nonEmptyElementsMap[name] && name !== 'br') {
  28850. return false;
  28851. }
  28852. }
  28853. } else if (isText$7(node) && !isWhitespaceText(node.nodeValue)) {
  28854. return false;
  28855. }
  28856. if (start) {
  28857. walker.prev();
  28858. } else {
  28859. walker.next();
  28860. }
  28861. }
  28862. return true;
  28863. };
  28864. var insertNewBlockAfter = function () {
  28865. if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') {
  28866. newBlock = createNewBlock(newBlockName);
  28867. } else {
  28868. newBlock = createNewBlock();
  28869. }
  28870. if (shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) {
  28871. newBlock = dom.split(containerBlock, parentBlock);
  28872. } else {
  28873. dom.insertAfter(newBlock, parentBlock);
  28874. }
  28875. moveToCaretPosition(editor, newBlock);
  28876. };
  28877. normalize$2(dom, rng).each(function (normRng) {
  28878. rng.setStart(normRng.startContainer, normRng.startOffset);
  28879. rng.setEnd(normRng.endContainer, normRng.endOffset);
  28880. });
  28881. container = rng.startContainer;
  28882. offset = rng.startOffset;
  28883. newBlockName = getForcedRootBlock(editor);
  28884. var shiftKey = !!(evt && evt.shiftKey);
  28885. var ctrlKey = !!(evt && evt.ctrlKey);
  28886. if (isElement$5(container) && container.hasChildNodes()) {
  28887. isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
  28888. container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
  28889. if (isAfterLastNodeInContainer && isText$7(container)) {
  28890. offset = container.nodeValue.length;
  28891. } else {
  28892. offset = 0;
  28893. }
  28894. }
  28895. var editableRoot = getEditableRoot(dom, container);
  28896. if (!editableRoot) {
  28897. return;
  28898. }
  28899. if (newBlockName && !shiftKey || !newBlockName && shiftKey) {
  28900. container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset);
  28901. }
  28902. parentBlock = dom.getParent(container, dom.isBlock);
  28903. containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
  28904. parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : '';
  28905. var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
  28906. if (containerBlockName === 'LI' && !ctrlKey) {
  28907. parentBlock = containerBlock;
  28908. containerBlock = containerBlock.parentNode;
  28909. parentBlockName = containerBlockName;
  28910. }
  28911. if (/^(LI|DT|DD)$/.test(parentBlockName)) {
  28912. if (dom.isEmpty(parentBlock)) {
  28913. insert$3(editor, createNewBlock, containerBlock, parentBlock, newBlockName);
  28914. return;
  28915. }
  28916. }
  28917. if (newBlockName && parentBlock === editor.getBody()) {
  28918. return;
  28919. }
  28920. newBlockName = newBlockName || 'P';
  28921. if (isCaretContainerBlock$1(parentBlock)) {
  28922. newBlock = showCaretContainerBlock(parentBlock);
  28923. if (dom.isEmpty(parentBlock)) {
  28924. emptyBlock(parentBlock);
  28925. }
  28926. setForcedBlockAttrs(editor, newBlock);
  28927. moveToCaretPosition(editor, newBlock);
  28928. } else if (isCaretAtStartOrEndOfBlock()) {
  28929. insertNewBlockAfter();
  28930. } else if (isCaretAtStartOrEndOfBlock(true)) {
  28931. newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
  28932. moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock);
  28933. } else {
  28934. tmpRng = includeZwspInRange(rng).cloneRange();
  28935. tmpRng.setEndAfter(parentBlock);
  28936. fragment = tmpRng.extractContents();
  28937. trimZwsp(fragment);
  28938. trimLeadingLineBreaks(fragment);
  28939. newBlock = fragment.firstChild;
  28940. dom.insertAfter(fragment, parentBlock);
  28941. trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock);
  28942. addBrToBlockIfNeeded(dom, parentBlock);
  28943. if (dom.isEmpty(parentBlock)) {
  28944. emptyBlock(parentBlock);
  28945. }
  28946. newBlock.normalize();
  28947. if (dom.isEmpty(newBlock)) {
  28948. dom.remove(newBlock);
  28949. insertNewBlockAfter();
  28950. } else {
  28951. setForcedBlockAttrs(editor, newBlock);
  28952. moveToCaretPosition(editor, newBlock);
  28953. }
  28954. }
  28955. dom.setAttrib(newBlock, 'id', '');
  28956. editor.fire('NewBlock', { newBlock: newBlock });
  28957. };
  28958. var hasRightSideContent = function (schema, container, parentBlock) {
  28959. var walker = new DomTreeWalker(container, parentBlock);
  28960. var node;
  28961. var nonEmptyElementsMap = schema.getNonEmptyElements();
  28962. while (node = walker.next()) {
  28963. if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
  28964. return true;
  28965. }
  28966. }
  28967. };
  28968. var moveSelectionToBr = function (editor, brElm, extraBr) {
  28969. var rng = editor.dom.createRng();
  28970. if (!extraBr) {
  28971. rng.setStartAfter(brElm);
  28972. rng.setEndAfter(brElm);
  28973. } else {
  28974. rng.setStartBefore(brElm);
  28975. rng.setEndBefore(brElm);
  28976. }
  28977. editor.selection.setRng(rng);
  28978. scrollRangeIntoView(editor, rng);
  28979. };
  28980. var insertBrAtCaret = function (editor, evt) {
  28981. var selection = editor.selection;
  28982. var dom = editor.dom;
  28983. var rng = selection.getRng();
  28984. var brElm;
  28985. var extraBr;
  28986. normalize$2(dom, rng).each(function (normRng) {
  28987. rng.setStart(normRng.startContainer, normRng.startOffset);
  28988. rng.setEnd(normRng.endContainer, normRng.endOffset);
  28989. });
  28990. var offset = rng.startOffset;
  28991. var container = rng.startContainer;
  28992. if (container.nodeType === 1 && container.hasChildNodes()) {
  28993. var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
  28994. container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
  28995. if (isAfterLastNodeInContainer && container.nodeType === 3) {
  28996. offset = container.nodeValue.length;
  28997. } else {
  28998. offset = 0;
  28999. }
  29000. }
  29001. var parentBlock = dom.getParent(container, dom.isBlock);
  29002. var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
  29003. var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
  29004. var isControlKey = !!(evt && evt.ctrlKey);
  29005. if (containerBlockName === 'LI' && !isControlKey) {
  29006. parentBlock = containerBlock;
  29007. }
  29008. if (container && container.nodeType === 3 && offset >= container.nodeValue.length) {
  29009. if (!hasRightSideContent(editor.schema, container, parentBlock)) {
  29010. brElm = dom.create('br');
  29011. rng.insertNode(brElm);
  29012. rng.setStartAfter(brElm);
  29013. rng.setEndAfter(brElm);
  29014. extraBr = true;
  29015. }
  29016. }
  29017. brElm = dom.create('br');
  29018. rangeInsertNode(dom, rng, brElm);
  29019. moveSelectionToBr(editor, brElm, extraBr);
  29020. editor.undoManager.add();
  29021. };
  29022. var insertBrBefore = function (editor, inline) {
  29023. var br = SugarElement.fromTag('br');
  29024. before$4(SugarElement.fromDom(inline), br);
  29025. editor.undoManager.add();
  29026. };
  29027. var insertBrAfter = function (editor, inline) {
  29028. if (!hasBrAfter(editor.getBody(), inline)) {
  29029. after$3(SugarElement.fromDom(inline), SugarElement.fromTag('br'));
  29030. }
  29031. var br = SugarElement.fromTag('br');
  29032. after$3(SugarElement.fromDom(inline), br);
  29033. moveSelectionToBr(editor, br.dom, false);
  29034. editor.undoManager.add();
  29035. };
  29036. var isBeforeBr = function (pos) {
  29037. return isBr$5(pos.getNode());
  29038. };
  29039. var hasBrAfter = function (rootNode, startNode) {
  29040. if (isBeforeBr(CaretPosition.after(startNode))) {
  29041. return true;
  29042. } else {
  29043. return nextPosition(rootNode, CaretPosition.after(startNode)).map(function (pos) {
  29044. return isBr$5(pos.getNode());
  29045. }).getOr(false);
  29046. }
  29047. };
  29048. var isAnchorLink = function (elm) {
  29049. return elm && elm.nodeName === 'A' && 'href' in elm;
  29050. };
  29051. var isInsideAnchor = function (location) {
  29052. return location.fold(never, isAnchorLink, isAnchorLink, never);
  29053. };
  29054. var readInlineAnchorLocation = function (editor) {
  29055. var isInlineTarget$1 = curry(isInlineTarget, editor);
  29056. var position = CaretPosition.fromRangeStart(editor.selection.getRng());
  29057. return readLocation(isInlineTarget$1, editor.getBody(), position).filter(isInsideAnchor);
  29058. };
  29059. var insertBrOutsideAnchor = function (editor, location) {
  29060. location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop);
  29061. };
  29062. var insert$1 = function (editor, evt) {
  29063. var anchorLocation = readInlineAnchorLocation(editor);
  29064. if (anchorLocation.isSome()) {
  29065. anchorLocation.each(curry(insertBrOutsideAnchor, editor));
  29066. } else {
  29067. insertBrAtCaret(editor, evt);
  29068. }
  29069. };
  29070. var matchesSelector = function (editor, selector) {
  29071. return getParentBlock(editor).filter(function (parentBlock) {
  29072. return selector.length > 0 && is$2(SugarElement.fromDom(parentBlock), selector);
  29073. }).isSome();
  29074. };
  29075. var shouldInsertBr = function (editor) {
  29076. return matchesSelector(editor, getBrNewLineSelector(editor));
  29077. };
  29078. var shouldBlockNewLine$1 = function (editor) {
  29079. return matchesSelector(editor, getNoNewLineSelector(editor));
  29080. };
  29081. var newLineAction = Adt.generate([
  29082. { br: [] },
  29083. { block: [] },
  29084. { none: [] }
  29085. ]);
  29086. var shouldBlockNewLine = function (editor, _shiftKey) {
  29087. return shouldBlockNewLine$1(editor);
  29088. };
  29089. var isBrMode = function (requiredState) {
  29090. return function (editor, _shiftKey) {
  29091. var brMode = getForcedRootBlock(editor) === '';
  29092. return brMode === requiredState;
  29093. };
  29094. };
  29095. var inListBlock = function (requiredState) {
  29096. return function (editor, _shiftKey) {
  29097. return isListItemParentBlock(editor) === requiredState;
  29098. };
  29099. };
  29100. var inBlock = function (blockName, requiredState) {
  29101. return function (editor, _shiftKey) {
  29102. var state = getParentBlockName(editor) === blockName.toUpperCase();
  29103. return state === requiredState;
  29104. };
  29105. };
  29106. var inPreBlock = function (requiredState) {
  29107. return inBlock('pre', requiredState);
  29108. };
  29109. var inSummaryBlock = function () {
  29110. return inBlock('summary', true);
  29111. };
  29112. var shouldPutBrInPre = function (requiredState) {
  29113. return function (editor, _shiftKey) {
  29114. return shouldPutBrInPre$1(editor) === requiredState;
  29115. };
  29116. };
  29117. var inBrContext = function (editor, _shiftKey) {
  29118. return shouldInsertBr(editor);
  29119. };
  29120. var hasShiftKey = function (_editor, shiftKey) {
  29121. return shiftKey;
  29122. };
  29123. var canInsertIntoEditableRoot = function (editor) {
  29124. var forcedRootBlock = getForcedRootBlock(editor);
  29125. var rootEditable = getEditableRoot$1(editor.dom, editor.selection.getStart());
  29126. return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P');
  29127. };
  29128. var match = function (predicates, action) {
  29129. return function (editor, shiftKey) {
  29130. var isMatch = foldl(predicates, function (res, p) {
  29131. return res && p(editor, shiftKey);
  29132. }, true);
  29133. return isMatch ? Optional.some(action) : Optional.none();
  29134. };
  29135. };
  29136. var getAction = function (editor, evt) {
  29137. return evaluateUntil([
  29138. match([shouldBlockNewLine], newLineAction.none()),
  29139. match([inSummaryBlock()], newLineAction.br()),
  29140. match([
  29141. inPreBlock(true),
  29142. shouldPutBrInPre(false),
  29143. hasShiftKey
  29144. ], newLineAction.br()),
  29145. match([
  29146. inPreBlock(true),
  29147. shouldPutBrInPre(false)
  29148. ], newLineAction.block()),
  29149. match([
  29150. inPreBlock(true),
  29151. shouldPutBrInPre(true),
  29152. hasShiftKey
  29153. ], newLineAction.block()),
  29154. match([
  29155. inPreBlock(true),
  29156. shouldPutBrInPre(true)
  29157. ], newLineAction.br()),
  29158. match([
  29159. inListBlock(true),
  29160. hasShiftKey
  29161. ], newLineAction.br()),
  29162. match([inListBlock(true)], newLineAction.block()),
  29163. match([
  29164. isBrMode(true),
  29165. hasShiftKey,
  29166. canInsertIntoEditableRoot
  29167. ], newLineAction.block()),
  29168. match([isBrMode(true)], newLineAction.br()),
  29169. match([inBrContext], newLineAction.br()),
  29170. match([
  29171. isBrMode(false),
  29172. hasShiftKey
  29173. ], newLineAction.br()),
  29174. match([canInsertIntoEditableRoot], newLineAction.block())
  29175. ], [
  29176. editor,
  29177. !!(evt && evt.shiftKey)
  29178. ]).getOr(newLineAction.none());
  29179. };
  29180. var insert = function (editor, evt) {
  29181. getAction(editor, evt).fold(function () {
  29182. insert$1(editor, evt);
  29183. }, function () {
  29184. insert$2(editor, evt);
  29185. }, noop);
  29186. };
  29187. var handleEnterKeyEvent = function (editor, event) {
  29188. if (event.isDefaultPrevented()) {
  29189. return;
  29190. }
  29191. event.preventDefault();
  29192. endTypingLevelIgnoreLocks(editor.undoManager);
  29193. editor.undoManager.transact(function () {
  29194. if (editor.selection.isCollapsed() === false) {
  29195. editor.execCommand('Delete');
  29196. }
  29197. insert(editor, event);
  29198. });
  29199. };
  29200. var setup$9 = function (editor) {
  29201. editor.on('keydown', function (event) {
  29202. if (event.keyCode === VK.ENTER) {
  29203. handleEnterKeyEvent(editor, event);
  29204. }
  29205. });
  29206. };
  29207. var executeKeydownOverride$1 = function (editor, caret, evt) {
  29208. execute([
  29209. {
  29210. keyCode: VK.END,
  29211. action: action(moveToLineEndPoint$1, editor, true)
  29212. },
  29213. {
  29214. keyCode: VK.HOME,
  29215. action: action(moveToLineEndPoint$1, editor, false)
  29216. },
  29217. {
  29218. keyCode: VK.END,
  29219. action: action(moveToLineEndPoint, editor, true)
  29220. },
  29221. {
  29222. keyCode: VK.HOME,
  29223. action: action(moveToLineEndPoint, editor, false)
  29224. },
  29225. {
  29226. keyCode: VK.END,
  29227. action: action(moveToLineEndPoint$2, editor, true, caret)
  29228. },
  29229. {
  29230. keyCode: VK.HOME,
  29231. action: action(moveToLineEndPoint$2, editor, false, caret)
  29232. }
  29233. ], evt).each(function (_) {
  29234. evt.preventDefault();
  29235. });
  29236. };
  29237. var setup$8 = function (editor, caret) {
  29238. editor.on('keydown', function (evt) {
  29239. if (evt.isDefaultPrevented() === false) {
  29240. executeKeydownOverride$1(editor, caret, evt);
  29241. }
  29242. });
  29243. };
  29244. var browser = detect().browser;
  29245. var setupIeInput = function (editor) {
  29246. var keypressThrotter = first(function () {
  29247. if (!editor.composing) {
  29248. normalizeNbspsInEditor(editor);
  29249. }
  29250. }, 0);
  29251. if (browser.isIE()) {
  29252. editor.on('keypress', function (_e) {
  29253. keypressThrotter.throttle();
  29254. });
  29255. editor.on('remove', function (_e) {
  29256. keypressThrotter.cancel();
  29257. });
  29258. }
  29259. };
  29260. var setup$7 = function (editor) {
  29261. setupIeInput(editor);
  29262. editor.on('input', function (e) {
  29263. if (e.isComposing === false) {
  29264. normalizeNbspsInEditor(editor);
  29265. }
  29266. });
  29267. };
  29268. var platform = detect();
  29269. var executeKeyupAction = function (editor, caret, evt) {
  29270. execute([
  29271. {
  29272. keyCode: VK.PAGE_UP,
  29273. action: action(moveToLineEndPoint$2, editor, false, caret)
  29274. },
  29275. {
  29276. keyCode: VK.PAGE_DOWN,
  29277. action: action(moveToLineEndPoint$2, editor, true, caret)
  29278. }
  29279. ], evt);
  29280. };
  29281. var stopImmediatePropagation = function (e) {
  29282. return e.stopImmediatePropagation();
  29283. };
  29284. var isPageUpDown = function (evt) {
  29285. return evt.keyCode === VK.PAGE_UP || evt.keyCode === VK.PAGE_DOWN;
  29286. };
  29287. var setNodeChangeBlocker = function (blocked, editor, block) {
  29288. if (block && !blocked.get()) {
  29289. editor.on('NodeChange', stopImmediatePropagation, true);
  29290. } else if (!block && blocked.get()) {
  29291. editor.off('NodeChange', stopImmediatePropagation);
  29292. }
  29293. blocked.set(block);
  29294. };
  29295. var setup$6 = function (editor, caret) {
  29296. if (platform.os.isOSX()) {
  29297. return;
  29298. }
  29299. var blocked = Cell(false);
  29300. editor.on('keydown', function (evt) {
  29301. if (isPageUpDown(evt)) {
  29302. setNodeChangeBlocker(blocked, editor, true);
  29303. }
  29304. });
  29305. editor.on('keyup', function (evt) {
  29306. if (evt.isDefaultPrevented() === false) {
  29307. executeKeyupAction(editor, caret, evt);
  29308. }
  29309. if (isPageUpDown(evt) && blocked.get()) {
  29310. setNodeChangeBlocker(blocked, editor, false);
  29311. editor.nodeChanged();
  29312. }
  29313. });
  29314. };
  29315. var insertTextAtPosition = function (text, pos) {
  29316. var container = pos.container();
  29317. var offset = pos.offset();
  29318. if (isText$7(container)) {
  29319. container.insertData(offset, text);
  29320. return Optional.some(CaretPosition(container, offset + text.length));
  29321. } else {
  29322. return getElementFromPosition(pos).map(function (elm) {
  29323. var textNode = SugarElement.fromText(text);
  29324. if (pos.isAtEnd()) {
  29325. after$3(elm, textNode);
  29326. } else {
  29327. before$4(elm, textNode);
  29328. }
  29329. return CaretPosition(textNode.dom, text.length);
  29330. });
  29331. }
  29332. };
  29333. var insertNbspAtPosition = curry(insertTextAtPosition, nbsp);
  29334. var insertSpaceAtPosition = curry(insertTextAtPosition, ' ');
  29335. var locationToCaretPosition = function (root) {
  29336. return function (location) {
  29337. return location.fold(function (element) {
  29338. return prevPosition(root.dom, CaretPosition.before(element));
  29339. }, function (element) {
  29340. return firstPositionIn(element);
  29341. }, function (element) {
  29342. return lastPositionIn(element);
  29343. }, function (element) {
  29344. return nextPosition(root.dom, CaretPosition.after(element));
  29345. });
  29346. };
  29347. };
  29348. var insertInlineBoundarySpaceOrNbsp = function (root, pos) {
  29349. return function (checkPos) {
  29350. return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos);
  29351. };
  29352. };
  29353. var setSelection = function (editor) {
  29354. return function (pos) {
  29355. editor.selection.setRng(pos.toRange());
  29356. editor.nodeChanged();
  29357. return true;
  29358. };
  29359. };
  29360. var insertSpaceOrNbspAtSelection = function (editor) {
  29361. var pos = CaretPosition.fromRangeStart(editor.selection.getRng());
  29362. var root = SugarElement.fromDom(editor.getBody());
  29363. if (editor.selection.isCollapsed()) {
  29364. var isInlineTarget$1 = curry(isInlineTarget, editor);
  29365. var caretPosition = CaretPosition.fromRangeStart(editor.selection.getRng());
  29366. return readLocation(isInlineTarget$1, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection(editor));
  29367. } else {
  29368. return false;
  29369. }
  29370. };
  29371. var executeKeydownOverride = function (editor, evt) {
  29372. execute([{
  29373. keyCode: VK.SPACEBAR,
  29374. action: action(insertSpaceOrNbspAtSelection, editor)
  29375. }], evt).each(function (_) {
  29376. evt.preventDefault();
  29377. });
  29378. };
  29379. var setup$5 = function (editor) {
  29380. editor.on('keydown', function (evt) {
  29381. if (evt.isDefaultPrevented() === false) {
  29382. executeKeydownOverride(editor, evt);
  29383. }
  29384. });
  29385. };
  29386. var registerKeyboardOverrides = function (editor) {
  29387. var caret = setupSelectedState(editor);
  29388. setup$c(editor);
  29389. setup$b(editor, caret);
  29390. setup$a(editor, caret);
  29391. setup$9(editor);
  29392. setup$5(editor);
  29393. setup$7(editor);
  29394. setup$8(editor, caret);
  29395. setup$6(editor, caret);
  29396. return caret;
  29397. };
  29398. var setup$4 = function (editor) {
  29399. if (!isRtc(editor)) {
  29400. return registerKeyboardOverrides(editor);
  29401. } else {
  29402. return Cell(null);
  29403. }
  29404. };
  29405. var NodeChange = function () {
  29406. function NodeChange(editor) {
  29407. this.lastPath = [];
  29408. this.editor = editor;
  29409. var lastRng;
  29410. var self = this;
  29411. if (!('onselectionchange' in editor.getDoc())) {
  29412. editor.on('NodeChange click mouseup keyup focus', function (e) {
  29413. var nativeRng = editor.selection.getRng();
  29414. var fakeRng = {
  29415. startContainer: nativeRng.startContainer,
  29416. startOffset: nativeRng.startOffset,
  29417. endContainer: nativeRng.endContainer,
  29418. endOffset: nativeRng.endOffset
  29419. };
  29420. if (e.type === 'nodechange' || !isEq$4(fakeRng, lastRng)) {
  29421. editor.fire('SelectionChange');
  29422. }
  29423. lastRng = fakeRng;
  29424. });
  29425. }
  29426. editor.on('contextmenu', function () {
  29427. editor.fire('SelectionChange');
  29428. });
  29429. editor.on('SelectionChange', function () {
  29430. var startElm = editor.selection.getStart(true);
  29431. if (!startElm || !Env.range && editor.selection.isCollapsed()) {
  29432. return;
  29433. }
  29434. if (hasAnyRanges(editor) && !self.isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
  29435. editor.nodeChanged({ selectionChange: true });
  29436. }
  29437. });
  29438. editor.on('mouseup', function (e) {
  29439. if (!e.isDefaultPrevented() && hasAnyRanges(editor)) {
  29440. if (editor.selection.getNode().nodeName === 'IMG') {
  29441. Delay.setEditorTimeout(editor, function () {
  29442. editor.nodeChanged();
  29443. });
  29444. } else {
  29445. editor.nodeChanged();
  29446. }
  29447. }
  29448. });
  29449. }
  29450. NodeChange.prototype.nodeChanged = function (args) {
  29451. var selection = this.editor.selection;
  29452. var node, parents, root;
  29453. if (this.editor.initialized && selection && !shouldDisableNodeChange(this.editor) && !this.editor.mode.isReadOnly()) {
  29454. root = this.editor.getBody();
  29455. node = selection.getStart(true) || root;
  29456. if (node.ownerDocument !== this.editor.getDoc() || !this.editor.dom.isChildOf(node, root)) {
  29457. node = root;
  29458. }
  29459. parents = [];
  29460. this.editor.dom.getParent(node, function (node) {
  29461. if (node === root) {
  29462. return true;
  29463. }
  29464. parents.push(node);
  29465. });
  29466. args = args || {};
  29467. args.element = node;
  29468. args.parents = parents;
  29469. this.editor.fire('NodeChange', args);
  29470. }
  29471. };
  29472. NodeChange.prototype.isSameElementPath = function (startElm) {
  29473. var i;
  29474. var currentPath = this.editor.$(startElm).parentsUntil(this.editor.getBody()).add(startElm);
  29475. if (currentPath.length === this.lastPath.length) {
  29476. for (i = currentPath.length; i >= 0; i--) {
  29477. if (currentPath[i] !== this.lastPath[i]) {
  29478. break;
  29479. }
  29480. }
  29481. if (i === -1) {
  29482. this.lastPath = currentPath;
  29483. return true;
  29484. }
  29485. }
  29486. this.lastPath = currentPath;
  29487. return false;
  29488. };
  29489. return NodeChange;
  29490. }();
  29491. var preventSummaryToggle = function (editor) {
  29492. editor.on('click', function (e) {
  29493. if (editor.dom.getParent(e.target, 'details')) {
  29494. e.preventDefault();
  29495. }
  29496. });
  29497. };
  29498. var filterDetails = function (editor) {
  29499. editor.parser.addNodeFilter('details', function (elms) {
  29500. each$k(elms, function (details) {
  29501. details.attr('data-mce-open', details.attr('open'));
  29502. details.attr('open', 'open');
  29503. });
  29504. });
  29505. editor.serializer.addNodeFilter('details', function (elms) {
  29506. each$k(elms, function (details) {
  29507. var open = details.attr('data-mce-open');
  29508. details.attr('open', isString$1(open) ? open : null);
  29509. details.attr('data-mce-open', null);
  29510. });
  29511. });
  29512. };
  29513. var setup$3 = function (editor) {
  29514. preventSummaryToggle(editor);
  29515. filterDetails(editor);
  29516. };
  29517. var isTextBlockNode = function (node) {
  29518. return isElement$5(node) && isTextBlock$2(SugarElement.fromDom(node));
  29519. };
  29520. var normalizeSelection = function (editor) {
  29521. var rng = editor.selection.getRng();
  29522. var startPos = CaretPosition.fromRangeStart(rng);
  29523. var endPos = CaretPosition.fromRangeEnd(rng);
  29524. if (CaretPosition.isElementPosition(startPos)) {
  29525. var container = startPos.container();
  29526. if (isTextBlockNode(container)) {
  29527. firstPositionIn(container).each(function (pos) {
  29528. return rng.setStart(pos.container(), pos.offset());
  29529. });
  29530. }
  29531. }
  29532. if (CaretPosition.isElementPosition(endPos)) {
  29533. var container = startPos.container();
  29534. if (isTextBlockNode(container)) {
  29535. lastPositionIn(container).each(function (pos) {
  29536. return rng.setEnd(pos.container(), pos.offset());
  29537. });
  29538. }
  29539. }
  29540. editor.selection.setRng(normalize(rng));
  29541. };
  29542. var setup$2 = function (editor) {
  29543. editor.on('click', function (e) {
  29544. if (e.detail >= 3) {
  29545. normalizeSelection(editor);
  29546. }
  29547. });
  29548. };
  29549. var getAbsolutePosition = function (elm) {
  29550. var clientRect = elm.getBoundingClientRect();
  29551. var doc = elm.ownerDocument;
  29552. var docElem = doc.documentElement;
  29553. var win = doc.defaultView;
  29554. return {
  29555. top: clientRect.top + win.pageYOffset - docElem.clientTop,
  29556. left: clientRect.left + win.pageXOffset - docElem.clientLeft
  29557. };
  29558. };
  29559. var getBodyPosition = function (editor) {
  29560. return editor.inline ? getAbsolutePosition(editor.getBody()) : {
  29561. left: 0,
  29562. top: 0
  29563. };
  29564. };
  29565. var getScrollPosition = function (editor) {
  29566. var body = editor.getBody();
  29567. return editor.inline ? {
  29568. left: body.scrollLeft,
  29569. top: body.scrollTop
  29570. } : {
  29571. left: 0,
  29572. top: 0
  29573. };
  29574. };
  29575. var getBodyScroll = function (editor) {
  29576. var body = editor.getBody(), docElm = editor.getDoc().documentElement;
  29577. var inlineScroll = {
  29578. left: body.scrollLeft,
  29579. top: body.scrollTop
  29580. };
  29581. var iframeScroll = {
  29582. left: body.scrollLeft || docElm.scrollLeft,
  29583. top: body.scrollTop || docElm.scrollTop
  29584. };
  29585. return editor.inline ? inlineScroll : iframeScroll;
  29586. };
  29587. var getMousePosition = function (editor, event) {
  29588. if (event.target.ownerDocument !== editor.getDoc()) {
  29589. var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
  29590. var scrollPosition = getBodyScroll(editor);
  29591. return {
  29592. left: event.pageX - iframePosition.left + scrollPosition.left,
  29593. top: event.pageY - iframePosition.top + scrollPosition.top
  29594. };
  29595. }
  29596. return {
  29597. left: event.pageX,
  29598. top: event.pageY
  29599. };
  29600. };
  29601. var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
  29602. return {
  29603. pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
  29604. pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
  29605. };
  29606. };
  29607. var calc = function (editor, event) {
  29608. return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
  29609. };
  29610. var isContentEditableFalse$1 = isContentEditableFalse$b, isContentEditableTrue$1 = isContentEditableTrue$4;
  29611. var isDraggable = function (rootElm, elm) {
  29612. return isContentEditableFalse$1(elm) && elm !== rootElm;
  29613. };
  29614. var isValidDropTarget = function (editor, targetElement, dragElement) {
  29615. if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) {
  29616. return false;
  29617. }
  29618. return !isContentEditableFalse$1(targetElement);
  29619. };
  29620. var cloneElement = function (elm) {
  29621. var cloneElm = elm.cloneNode(true);
  29622. cloneElm.removeAttribute('data-mce-selected');
  29623. return cloneElm;
  29624. };
  29625. var createGhost = function (editor, elm, width, height) {
  29626. var dom = editor.dom;
  29627. var clonedElm = elm.cloneNode(true);
  29628. dom.setStyles(clonedElm, {
  29629. width: width,
  29630. height: height
  29631. });
  29632. dom.setAttrib(clonedElm, 'data-mce-selected', null);
  29633. var ghostElm = dom.create('div', {
  29634. 'class': 'mce-drag-container',
  29635. 'data-mce-bogus': 'all',
  29636. 'unselectable': 'on',
  29637. 'contenteditable': 'false'
  29638. });
  29639. dom.setStyles(ghostElm, {
  29640. position: 'absolute',
  29641. opacity: 0.5,
  29642. overflow: 'hidden',
  29643. border: 0,
  29644. padding: 0,
  29645. margin: 0,
  29646. width: width,
  29647. height: height
  29648. });
  29649. dom.setStyles(clonedElm, {
  29650. margin: 0,
  29651. boxSizing: 'border-box'
  29652. });
  29653. ghostElm.appendChild(clonedElm);
  29654. return ghostElm;
  29655. };
  29656. var appendGhostToBody = function (ghostElm, bodyElm) {
  29657. if (ghostElm.parentNode !== bodyElm) {
  29658. bodyElm.appendChild(ghostElm);
  29659. }
  29660. };
  29661. var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
  29662. var overflowX = 0, overflowY = 0;
  29663. ghostElm.style.left = position.pageX + 'px';
  29664. ghostElm.style.top = position.pageY + 'px';
  29665. if (position.pageX + width > maxX) {
  29666. overflowX = position.pageX + width - maxX;
  29667. }
  29668. if (position.pageY + height > maxY) {
  29669. overflowY = position.pageY + height - maxY;
  29670. }
  29671. ghostElm.style.width = width - overflowX + 'px';
  29672. ghostElm.style.height = height - overflowY + 'px';
  29673. };
  29674. var removeElement = function (elm) {
  29675. if (elm && elm.parentNode) {
  29676. elm.parentNode.removeChild(elm);
  29677. }
  29678. };
  29679. var isLeftMouseButtonPressed = function (e) {
  29680. return e.button === 0;
  29681. };
  29682. var applyRelPos = function (state, position) {
  29683. return {
  29684. pageX: position.pageX - state.relX,
  29685. pageY: position.pageY + 5
  29686. };
  29687. };
  29688. var start = function (state, editor) {
  29689. return function (e) {
  29690. if (isLeftMouseButtonPressed(e)) {
  29691. var ceElm = find$3(editor.dom.getParents(e.target), or(isContentEditableFalse$1, isContentEditableTrue$1)).getOr(null);
  29692. if (isDraggable(editor.getBody(), ceElm)) {
  29693. var elmPos = editor.dom.getPos(ceElm);
  29694. var bodyElm = editor.getBody();
  29695. var docElm = editor.getDoc().documentElement;
  29696. state.set({
  29697. element: ceElm,
  29698. dragging: false,
  29699. screenX: e.screenX,
  29700. screenY: e.screenY,
  29701. maxX: (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2,
  29702. maxY: (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2,
  29703. relX: e.pageX - elmPos.x,
  29704. relY: e.pageY - elmPos.y,
  29705. width: ceElm.offsetWidth,
  29706. height: ceElm.offsetHeight,
  29707. ghost: createGhost(editor, ceElm, ceElm.offsetWidth, ceElm.offsetHeight)
  29708. });
  29709. }
  29710. }
  29711. };
  29712. };
  29713. var move = function (state, editor) {
  29714. var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) {
  29715. editor._selectionOverrides.hideFakeCaret();
  29716. editor.selection.placeCaretAt(clientX, clientY);
  29717. }, 0);
  29718. editor.on('remove', throttledPlaceCaretAt.stop);
  29719. return function (e) {
  29720. return state.on(function (state) {
  29721. var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
  29722. if (!state.dragging && movement > 10) {
  29723. var args = editor.fire('dragstart', { target: state.element });
  29724. if (args.isDefaultPrevented()) {
  29725. return;
  29726. }
  29727. state.dragging = true;
  29728. editor.focus();
  29729. }
  29730. if (state.dragging) {
  29731. var targetPos = applyRelPos(state, calc(editor, e));
  29732. appendGhostToBody(state.ghost, editor.getBody());
  29733. moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
  29734. throttledPlaceCaretAt(e.clientX, e.clientY);
  29735. }
  29736. });
  29737. };
  29738. };
  29739. var getRawTarget = function (selection) {
  29740. var rng = selection.getSel().getRangeAt(0);
  29741. var startContainer = rng.startContainer;
  29742. return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
  29743. };
  29744. var drop = function (state, editor) {
  29745. return function (e) {
  29746. state.on(function (state) {
  29747. if (state.dragging) {
  29748. if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
  29749. var targetClone_1 = cloneElement(state.element);
  29750. var args = editor.fire('drop', {
  29751. clientX: e.clientX,
  29752. clientY: e.clientY
  29753. });
  29754. if (!args.isDefaultPrevented()) {
  29755. editor.undoManager.transact(function () {
  29756. removeElement(state.element);
  29757. editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
  29758. editor._selectionOverrides.hideFakeCaret();
  29759. });
  29760. }
  29761. }
  29762. editor.fire('dragend');
  29763. }
  29764. });
  29765. removeDragState(state);
  29766. };
  29767. };
  29768. var stop = function (state, editor) {
  29769. return function () {
  29770. state.on(function (state) {
  29771. if (state.dragging) {
  29772. editor.fire('dragend');
  29773. }
  29774. });
  29775. removeDragState(state);
  29776. };
  29777. };
  29778. var removeDragState = function (state) {
  29779. state.on(function (state) {
  29780. removeElement(state.ghost);
  29781. });
  29782. state.clear();
  29783. };
  29784. var bindFakeDragEvents = function (editor) {
  29785. var state = value();
  29786. var pageDom = DOMUtils.DOM;
  29787. var rootDocument = document;
  29788. var dragStartHandler = start(state, editor);
  29789. var dragHandler = move(state, editor);
  29790. var dropHandler = drop(state, editor);
  29791. var dragEndHandler = stop(state, editor);
  29792. editor.on('mousedown', dragStartHandler);
  29793. editor.on('mousemove', dragHandler);
  29794. editor.on('mouseup', dropHandler);
  29795. pageDom.bind(rootDocument, 'mousemove', dragHandler);
  29796. pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
  29797. editor.on('remove', function () {
  29798. pageDom.unbind(rootDocument, 'mousemove', dragHandler);
  29799. pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
  29800. });
  29801. editor.on('keydown', function (e) {
  29802. if (e.keyCode === VK.ESC) {
  29803. dragEndHandler();
  29804. }
  29805. });
  29806. };
  29807. var blockIeDrop = function (editor) {
  29808. editor.on('drop', function (e) {
  29809. var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
  29810. if (isContentEditableFalse$1(realTarget) || editor.dom.getContentEditableParent(realTarget) === 'false') {
  29811. e.preventDefault();
  29812. }
  29813. });
  29814. };
  29815. var blockUnsupportedFileDrop = function (editor) {
  29816. var preventFileDrop = function (e) {
  29817. if (!e.isDefaultPrevented()) {
  29818. var dataTransfer = e.dataTransfer;
  29819. if (dataTransfer && (contains$3(dataTransfer.types, 'Files') || dataTransfer.files.length > 0)) {
  29820. e.preventDefault();
  29821. if (e.type === 'drop') {
  29822. displayError(editor, 'Dropped file type is not supported');
  29823. }
  29824. }
  29825. }
  29826. };
  29827. var preventFileDropIfUIElement = function (e) {
  29828. if (isUIElement(editor, e.target)) {
  29829. preventFileDrop(e);
  29830. }
  29831. };
  29832. var setup = function () {
  29833. var pageDom = DOMUtils.DOM;
  29834. var dom = editor.dom;
  29835. var doc = document;
  29836. var editorRoot = editor.inline ? editor.getBody() : editor.getDoc();
  29837. var eventNames = [
  29838. 'drop',
  29839. 'dragover'
  29840. ];
  29841. each$k(eventNames, function (name) {
  29842. pageDom.bind(doc, name, preventFileDropIfUIElement);
  29843. dom.bind(editorRoot, name, preventFileDrop);
  29844. });
  29845. editor.on('remove', function () {
  29846. each$k(eventNames, function (name) {
  29847. pageDom.unbind(doc, name, preventFileDropIfUIElement);
  29848. dom.unbind(editorRoot, name, preventFileDrop);
  29849. });
  29850. });
  29851. };
  29852. editor.on('init', function () {
  29853. Delay.setEditorTimeout(editor, setup, 0);
  29854. });
  29855. };
  29856. var init$2 = function (editor) {
  29857. bindFakeDragEvents(editor);
  29858. blockIeDrop(editor);
  29859. if (shouldBlockUnsupportedDrop(editor)) {
  29860. blockUnsupportedFileDrop(editor);
  29861. }
  29862. };
  29863. var setup$1 = function (editor) {
  29864. var renderFocusCaret = first(function () {
  29865. if (!editor.removed && editor.getBody().contains(document.activeElement)) {
  29866. var rng = editor.selection.getRng();
  29867. if (rng.collapsed) {
  29868. var caretRange = renderRangeCaret(editor, rng, false);
  29869. editor.selection.setRng(caretRange);
  29870. }
  29871. }
  29872. }, 0);
  29873. editor.on('focus', function () {
  29874. renderFocusCaret.throttle();
  29875. });
  29876. editor.on('blur', function () {
  29877. renderFocusCaret.cancel();
  29878. });
  29879. };
  29880. var setup = function (editor) {
  29881. editor.on('init', function () {
  29882. editor.on('focusin', function (e) {
  29883. var target = e.target;
  29884. if (isMedia$2(target)) {
  29885. var ceRoot = getContentEditableRoot$1(editor.getBody(), target);
  29886. var node = isContentEditableFalse$b(ceRoot) ? ceRoot : target;
  29887. if (editor.selection.getNode() !== node) {
  29888. selectNode(editor, node).each(function (rng) {
  29889. return editor.selection.setRng(rng);
  29890. });
  29891. }
  29892. }
  29893. });
  29894. });
  29895. };
  29896. var isContentEditableTrue = isContentEditableTrue$4;
  29897. var isContentEditableFalse = isContentEditableFalse$b;
  29898. var getContentEditableRoot = function (editor, node) {
  29899. return getContentEditableRoot$1(editor.getBody(), node);
  29900. };
  29901. var SelectionOverrides = function (editor) {
  29902. var selection = editor.selection, dom = editor.dom;
  29903. var isBlock = dom.isBlock;
  29904. var rootNode = editor.getBody();
  29905. var fakeCaret = FakeCaret(editor, rootNode, isBlock, function () {
  29906. return hasFocus(editor);
  29907. });
  29908. var realSelectionId = 'sel-' + dom.uniqueId();
  29909. var elementSelectionAttr = 'data-mce-selected';
  29910. var selectedElement;
  29911. var isFakeSelectionElement = function (node) {
  29912. return dom.hasClass(node, 'mce-offscreen-selection');
  29913. };
  29914. var isFakeSelectionTargetElement = function (node) {
  29915. return node !== rootNode && (isContentEditableFalse(node) || isMedia$2(node)) && dom.isChildOf(node, rootNode);
  29916. };
  29917. var isNearFakeSelectionElement = function (pos) {
  29918. return isBeforeContentEditableFalse(pos) || isAfterContentEditableFalse(pos) || isBeforeMedia(pos) || isAfterMedia(pos);
  29919. };
  29920. var getRealSelectionElement = function () {
  29921. var container = dom.get(realSelectionId);
  29922. return container ? container.getElementsByTagName('*')[0] : container;
  29923. };
  29924. var setRange = function (range) {
  29925. if (range) {
  29926. selection.setRng(range);
  29927. }
  29928. };
  29929. var getRange = selection.getRng;
  29930. var showCaret = function (direction, node, before, scrollIntoView) {
  29931. if (scrollIntoView === void 0) {
  29932. scrollIntoView = true;
  29933. }
  29934. var e = editor.fire('ShowCaret', {
  29935. target: node,
  29936. direction: direction,
  29937. before: before
  29938. });
  29939. if (e.isDefaultPrevented()) {
  29940. return null;
  29941. }
  29942. if (scrollIntoView) {
  29943. selection.scrollIntoView(node, direction === -1);
  29944. }
  29945. return fakeCaret.show(before, node);
  29946. };
  29947. var showBlockCaretContainer = function (blockCaretContainer) {
  29948. if (blockCaretContainer.hasAttribute('data-mce-caret')) {
  29949. showCaretContainerBlock(blockCaretContainer);
  29950. setRange(getRange());
  29951. selection.scrollIntoView(blockCaretContainer);
  29952. }
  29953. };
  29954. var registerEvents = function () {
  29955. editor.on('mouseup', function (e) {
  29956. var range = getRange();
  29957. if (range.collapsed && isXYInContentArea(editor, e.clientX, e.clientY)) {
  29958. renderCaretAtRange(editor, range, false).each(setRange);
  29959. }
  29960. });
  29961. editor.on('click', function (e) {
  29962. var contentEditableRoot = getContentEditableRoot(editor, e.target);
  29963. if (contentEditableRoot) {
  29964. if (isContentEditableFalse(contentEditableRoot)) {
  29965. e.preventDefault();
  29966. editor.focus();
  29967. }
  29968. if (isContentEditableTrue(contentEditableRoot)) {
  29969. if (dom.isChildOf(contentEditableRoot, selection.getNode())) {
  29970. removeElementSelection();
  29971. }
  29972. }
  29973. }
  29974. });
  29975. editor.on('blur NewBlock', removeElementSelection);
  29976. editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition);
  29977. var hasNormalCaretPosition = function (elm) {
  29978. var start = elm.firstChild;
  29979. if (isNullable(start)) {
  29980. return false;
  29981. }
  29982. var startPos = CaretPosition.before(start);
  29983. if (isBr$5(startPos.getNode()) && elm.childNodes.length === 1) {
  29984. return !isNearFakeSelectionElement(startPos);
  29985. } else {
  29986. var caretWalker = CaretWalker(elm);
  29987. var newPos = caretWalker.next(startPos);
  29988. return newPos && !isNearFakeSelectionElement(newPos);
  29989. }
  29990. };
  29991. var isInSameBlock = function (node1, node2) {
  29992. var block1 = dom.getParent(node1, isBlock);
  29993. var block2 = dom.getParent(node2, isBlock);
  29994. return block1 === block2;
  29995. };
  29996. var hasBetterMouseTarget = function (targetNode, caretNode) {
  29997. var targetBlock = dom.getParent(targetNode, isBlock);
  29998. var caretBlock = dom.getParent(caretNode, isBlock);
  29999. if (isNullable(targetBlock)) {
  30000. return false;
  30001. }
  30002. if (targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse(getContentEditableRoot(editor, targetBlock)) === false) {
  30003. return true;
  30004. }
  30005. return !dom.isChildOf(caretBlock, targetBlock) && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
  30006. };
  30007. editor.on('tap', function (e) {
  30008. var targetElm = e.target;
  30009. var contentEditableRoot = getContentEditableRoot(editor, targetElm);
  30010. if (isContentEditableFalse(contentEditableRoot)) {
  30011. e.preventDefault();
  30012. selectNode(editor, contentEditableRoot).each(setElementSelection);
  30013. } else if (isFakeSelectionTargetElement(targetElm)) {
  30014. selectNode(editor, targetElm).each(setElementSelection);
  30015. }
  30016. }, true);
  30017. editor.on('mousedown', function (e) {
  30018. var targetElm = e.target;
  30019. if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !dom.isChildOf(targetElm, rootNode)) {
  30020. return;
  30021. }
  30022. if (isXYInContentArea(editor, e.clientX, e.clientY) === false) {
  30023. return;
  30024. }
  30025. var contentEditableRoot = getContentEditableRoot(editor, targetElm);
  30026. if (contentEditableRoot) {
  30027. if (isContentEditableFalse(contentEditableRoot)) {
  30028. e.preventDefault();
  30029. selectNode(editor, contentEditableRoot).each(setElementSelection);
  30030. } else {
  30031. removeElementSelection();
  30032. if (!(isContentEditableTrue(contentEditableRoot) && e.shiftKey) && !isXYWithinRange(e.clientX, e.clientY, selection.getRng())) {
  30033. hideFakeCaret();
  30034. selection.placeCaretAt(e.clientX, e.clientY);
  30035. }
  30036. }
  30037. } else if (isFakeSelectionTargetElement(targetElm)) {
  30038. selectNode(editor, targetElm).each(setElementSelection);
  30039. } else if (isFakeCaretTarget(targetElm) === false) {
  30040. removeElementSelection();
  30041. hideFakeCaret();
  30042. var fakeCaretInfo = closestFakeCaret(rootNode, e.clientX, e.clientY);
  30043. if (fakeCaretInfo) {
  30044. if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) {
  30045. e.preventDefault();
  30046. var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false);
  30047. setRange(range);
  30048. editor.getBody().focus();
  30049. }
  30050. }
  30051. }
  30052. });
  30053. editor.on('keypress', function (e) {
  30054. if (VK.modifierPressed(e)) {
  30055. return;
  30056. }
  30057. if (isContentEditableFalse(selection.getNode())) {
  30058. e.preventDefault();
  30059. }
  30060. });
  30061. editor.on('GetSelectionRange', function (e) {
  30062. var rng = e.range;
  30063. if (selectedElement) {
  30064. if (!selectedElement.parentNode) {
  30065. selectedElement = null;
  30066. return;
  30067. }
  30068. rng = rng.cloneRange();
  30069. rng.selectNode(selectedElement);
  30070. e.range = rng;
  30071. }
  30072. });
  30073. editor.on('SetSelectionRange', function (e) {
  30074. e.range = normalizeShortEndedElementSelection(e.range);
  30075. var rng = setElementSelection(e.range, e.forward);
  30076. if (rng) {
  30077. e.range = rng;
  30078. }
  30079. });
  30080. var isPasteBin = function (node) {
  30081. return node.id === 'mcepastebin';
  30082. };
  30083. editor.on('AfterSetSelectionRange', function (e) {
  30084. var rng = e.range;
  30085. var parentNode = rng.startContainer.parentNode;
  30086. if (!isRangeInCaretContainer(rng) && !isPasteBin(parentNode)) {
  30087. hideFakeCaret();
  30088. }
  30089. if (!isFakeSelectionElement(parentNode)) {
  30090. removeElementSelection();
  30091. }
  30092. });
  30093. editor.on('copy', function (e) {
  30094. var clipboardData = e.clipboardData;
  30095. if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) {
  30096. var realSelectionElement = getRealSelectionElement();
  30097. if (realSelectionElement) {
  30098. e.preventDefault();
  30099. clipboardData.clearData();
  30100. clipboardData.setData('text/html', realSelectionElement.outerHTML);
  30101. clipboardData.setData('text/plain', realSelectionElement.outerText || realSelectionElement.innerText);
  30102. }
  30103. }
  30104. });
  30105. init$2(editor);
  30106. setup$1(editor);
  30107. setup(editor);
  30108. };
  30109. var isWithinCaretContainer = function (node) {
  30110. return isCaretContainer$2(node) || startsWithCaretContainer$1(node) || endsWithCaretContainer$1(node);
  30111. };
  30112. var isRangeInCaretContainer = function (rng) {
  30113. return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer);
  30114. };
  30115. var normalizeShortEndedElementSelection = function (rng) {
  30116. var shortEndedElements = editor.schema.getShortEndedElements();
  30117. var newRng = dom.createRng();
  30118. var startContainer = rng.startContainer;
  30119. var startOffset = rng.startOffset;
  30120. var endContainer = rng.endContainer;
  30121. var endOffset = rng.endOffset;
  30122. if (has$2(shortEndedElements, startContainer.nodeName.toLowerCase())) {
  30123. if (startOffset === 0) {
  30124. newRng.setStartBefore(startContainer);
  30125. } else {
  30126. newRng.setStartAfter(startContainer);
  30127. }
  30128. } else {
  30129. newRng.setStart(startContainer, startOffset);
  30130. }
  30131. if (has$2(shortEndedElements, endContainer.nodeName.toLowerCase())) {
  30132. if (endOffset === 0) {
  30133. newRng.setEndBefore(endContainer);
  30134. } else {
  30135. newRng.setEndAfter(endContainer);
  30136. }
  30137. } else {
  30138. newRng.setEnd(endContainer, endOffset);
  30139. }
  30140. return newRng;
  30141. };
  30142. var setupOffscreenSelection = function (node, targetClone, origTargetClone) {
  30143. var $ = editor.$;
  30144. var $realSelectionContainer = descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () {
  30145. return $([]);
  30146. }, function (elm) {
  30147. return $([elm.dom]);
  30148. });
  30149. if ($realSelectionContainer.length === 0) {
  30150. $realSelectionContainer = $('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr('id', realSelectionId);
  30151. $realSelectionContainer.appendTo(editor.getBody());
  30152. }
  30153. var newRange = dom.createRng();
  30154. if (targetClone === origTargetClone && Env.ie) {
  30155. $realSelectionContainer.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xA0</p>').append(targetClone);
  30156. newRange.setStartAfter($realSelectionContainer[0].firstChild.firstChild);
  30157. newRange.setEndAfter(targetClone);
  30158. } else {
  30159. $realSelectionContainer.empty().append(nbsp).append(targetClone).append(nbsp);
  30160. newRange.setStart($realSelectionContainer[0].firstChild, 1);
  30161. newRange.setEnd($realSelectionContainer[0].lastChild, 0);
  30162. }
  30163. $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y });
  30164. $realSelectionContainer[0].focus();
  30165. var sel = selection.getSel();
  30166. sel.removeAllRanges();
  30167. sel.addRange(newRange);
  30168. return newRange;
  30169. };
  30170. var selectElement = function (elm) {
  30171. var targetClone = elm.cloneNode(true);
  30172. var e = editor.fire('ObjectSelected', {
  30173. target: elm,
  30174. targetClone: targetClone
  30175. });
  30176. if (e.isDefaultPrevented()) {
  30177. return null;
  30178. }
  30179. var range = setupOffscreenSelection(elm, e.targetClone, targetClone);
  30180. var nodeElm = SugarElement.fromDom(elm);
  30181. each$k(descendants(SugarElement.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) {
  30182. if (!eq(nodeElm, elm)) {
  30183. remove$6(elm, elementSelectionAttr);
  30184. }
  30185. });
  30186. if (!dom.getAttrib(elm, elementSelectionAttr)) {
  30187. elm.setAttribute(elementSelectionAttr, '1');
  30188. }
  30189. selectedElement = elm;
  30190. hideFakeCaret();
  30191. return range;
  30192. };
  30193. var setElementSelection = function (range, forward) {
  30194. if (!range) {
  30195. return null;
  30196. }
  30197. if (range.collapsed) {
  30198. if (!isRangeInCaretContainer(range)) {
  30199. var dir = forward ? 1 : -1;
  30200. var caretPosition = getNormalizedRangeEndPoint(dir, rootNode, range);
  30201. var beforeNode = caretPosition.getNode(!forward);
  30202. if (isFakeCaretTarget(beforeNode)) {
  30203. return showCaret(dir, beforeNode, forward ? !caretPosition.isAtEnd() : false, false);
  30204. }
  30205. var afterNode = caretPosition.getNode(forward);
  30206. if (isFakeCaretTarget(afterNode)) {
  30207. return showCaret(dir, afterNode, forward ? false : !caretPosition.isAtEnd(), false);
  30208. }
  30209. }
  30210. return null;
  30211. }
  30212. var startContainer = range.startContainer;
  30213. var startOffset = range.startOffset;
  30214. var endOffset = range.endOffset;
  30215. if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse(startContainer.parentNode)) {
  30216. startContainer = startContainer.parentNode;
  30217. startOffset = dom.nodeIndex(startContainer);
  30218. startContainer = startContainer.parentNode;
  30219. }
  30220. if (startContainer.nodeType !== 1) {
  30221. return null;
  30222. }
  30223. if (endOffset === startOffset + 1 && startContainer === range.endContainer) {
  30224. var node = startContainer.childNodes[startOffset];
  30225. if (isFakeSelectionTargetElement(node)) {
  30226. return selectElement(node);
  30227. }
  30228. }
  30229. return null;
  30230. };
  30231. var removeElementSelection = function () {
  30232. if (selectedElement) {
  30233. selectedElement.removeAttribute(elementSelectionAttr);
  30234. }
  30235. descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(remove$7);
  30236. selectedElement = null;
  30237. };
  30238. var destroy = function () {
  30239. fakeCaret.destroy();
  30240. selectedElement = null;
  30241. };
  30242. var hideFakeCaret = function () {
  30243. fakeCaret.hide();
  30244. };
  30245. if (Env.ceFalse && !isRtc(editor)) {
  30246. registerEvents();
  30247. }
  30248. return {
  30249. showCaret: showCaret,
  30250. showBlockCaretContainer: showBlockCaretContainer,
  30251. hideFakeCaret: hideFakeCaret,
  30252. destroy: destroy
  30253. };
  30254. };
  30255. var Quirks = function (editor) {
  30256. var each = Tools.each;
  30257. var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, parser = editor.parser;
  30258. var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
  30259. var mceInternalUrlPrefix = 'data:text/mce-internal,';
  30260. var mceInternalDataType = isIE ? 'Text' : 'URL';
  30261. var setEditorCommandState = function (cmd, state) {
  30262. try {
  30263. editor.getDoc().execCommand(cmd, false, state);
  30264. } catch (ex) {
  30265. }
  30266. };
  30267. var isDefaultPrevented = function (e) {
  30268. return e.isDefaultPrevented();
  30269. };
  30270. var setMceInternalContent = function (e) {
  30271. var selectionHtml, internalContent;
  30272. if (e.dataTransfer) {
  30273. if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') {
  30274. selection.select(e.target);
  30275. }
  30276. selectionHtml = editor.selection.getContent();
  30277. if (selectionHtml.length > 0) {
  30278. internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml);
  30279. e.dataTransfer.setData(mceInternalDataType, internalContent);
  30280. }
  30281. }
  30282. };
  30283. var getMceInternalContent = function (e) {
  30284. var internalContent;
  30285. if (e.dataTransfer) {
  30286. internalContent = e.dataTransfer.getData(mceInternalDataType);
  30287. if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
  30288. internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(',');
  30289. return {
  30290. id: unescape(internalContent[0]),
  30291. html: unescape(internalContent[1])
  30292. };
  30293. }
  30294. }
  30295. return null;
  30296. };
  30297. var insertClipboardContents = function (content, internal) {
  30298. if (editor.queryCommandSupported('mceInsertClipboardContent')) {
  30299. editor.execCommand('mceInsertClipboardContent', false, {
  30300. content: content,
  30301. internal: internal
  30302. });
  30303. } else {
  30304. editor.execCommand('mceInsertContent', false, content);
  30305. }
  30306. };
  30307. var emptyEditorWhenDeleting = function () {
  30308. var serializeRng = function (rng) {
  30309. var body = dom.create('body');
  30310. var contents = rng.cloneContents();
  30311. body.appendChild(contents);
  30312. return selection.serializer.serialize(body, { format: 'html' });
  30313. };
  30314. var allContentsSelected = function (rng) {
  30315. var selection = serializeRng(rng);
  30316. var allRng = dom.createRng();
  30317. allRng.selectNode(editor.getBody());
  30318. var allSelection = serializeRng(allRng);
  30319. return selection === allSelection;
  30320. };
  30321. editor.on('keydown', function (e) {
  30322. var keyCode = e.keyCode;
  30323. var isCollapsed, body;
  30324. if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) {
  30325. isCollapsed = editor.selection.isCollapsed();
  30326. body = editor.getBody();
  30327. if (isCollapsed && !dom.isEmpty(body)) {
  30328. return;
  30329. }
  30330. if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
  30331. return;
  30332. }
  30333. e.preventDefault();
  30334. editor.setContent('');
  30335. if (body.firstChild && dom.isBlock(body.firstChild)) {
  30336. editor.selection.setCursorLocation(body.firstChild, 0);
  30337. } else {
  30338. editor.selection.setCursorLocation(body, 0);
  30339. }
  30340. editor.nodeChanged();
  30341. }
  30342. });
  30343. };
  30344. var selectAll = function () {
  30345. editor.shortcuts.add('meta+a', null, 'SelectAll');
  30346. };
  30347. var documentElementEditingFocus = function () {
  30348. if (!editor.inline) {
  30349. dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) {
  30350. var rng;
  30351. if (e.target === editor.getDoc().documentElement) {
  30352. rng = selection.getRng();
  30353. editor.getBody().focus();
  30354. if (e.type === 'mousedown') {
  30355. if (isCaretContainer$2(rng.startContainer)) {
  30356. return;
  30357. }
  30358. selection.placeCaretAt(e.clientX, e.clientY);
  30359. } else {
  30360. selection.setRng(rng);
  30361. }
  30362. }
  30363. });
  30364. }
  30365. };
  30366. var removeHrOnBackspace = function () {
  30367. editor.on('keydown', function (e) {
  30368. if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
  30369. if (!editor.getBody().getElementsByTagName('hr').length) {
  30370. return;
  30371. }
  30372. if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
  30373. var node = selection.getNode();
  30374. var previousSibling = node.previousSibling;
  30375. if (node.nodeName === 'HR') {
  30376. dom.remove(node);
  30377. e.preventDefault();
  30378. return;
  30379. }
  30380. if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') {
  30381. dom.remove(previousSibling);
  30382. e.preventDefault();
  30383. }
  30384. }
  30385. }
  30386. });
  30387. };
  30388. var focusBody = function () {
  30389. if (!Range.prototype.getClientRects) {
  30390. editor.on('mousedown', function (e) {
  30391. if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') {
  30392. var body_1 = editor.getBody();
  30393. body_1.blur();
  30394. Delay.setEditorTimeout(editor, function () {
  30395. body_1.focus();
  30396. });
  30397. }
  30398. });
  30399. }
  30400. };
  30401. var selectControlElements = function () {
  30402. editor.on('click', function (e) {
  30403. var target = e.target;
  30404. if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') {
  30405. e.preventDefault();
  30406. editor.selection.select(target);
  30407. editor.nodeChanged();
  30408. }
  30409. if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) {
  30410. e.preventDefault();
  30411. selection.select(target);
  30412. }
  30413. });
  30414. };
  30415. var removeStylesWhenDeletingAcrossBlockElements = function () {
  30416. var getAttributeApplyFunction = function () {
  30417. var template = dom.getAttribs(selection.getStart().cloneNode(false));
  30418. return function () {
  30419. var target = selection.getStart();
  30420. if (target !== editor.getBody()) {
  30421. dom.setAttrib(target, 'style', null);
  30422. each(template, function (attr) {
  30423. target.setAttributeNode(attr.cloneNode(true));
  30424. });
  30425. }
  30426. };
  30427. };
  30428. var isSelectionAcrossElements = function () {
  30429. return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock);
  30430. };
  30431. editor.on('keypress', function (e) {
  30432. var applyAttributes;
  30433. if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) {
  30434. applyAttributes = getAttributeApplyFunction();
  30435. editor.getDoc().execCommand('delete', false, null);
  30436. applyAttributes();
  30437. e.preventDefault();
  30438. return false;
  30439. }
  30440. });
  30441. dom.bind(editor.getDoc(), 'cut', function (e) {
  30442. var applyAttributes;
  30443. if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
  30444. applyAttributes = getAttributeApplyFunction();
  30445. Delay.setEditorTimeout(editor, function () {
  30446. applyAttributes();
  30447. });
  30448. }
  30449. });
  30450. };
  30451. var disableBackspaceIntoATable = function () {
  30452. editor.on('keydown', function (e) {
  30453. if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
  30454. if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
  30455. var previousSibling = selection.getNode().previousSibling;
  30456. if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') {
  30457. e.preventDefault();
  30458. return false;
  30459. }
  30460. }
  30461. }
  30462. });
  30463. };
  30464. var removeBlockQuoteOnBackSpace = function () {
  30465. editor.on('keydown', function (e) {
  30466. var rng, parent;
  30467. if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) {
  30468. return;
  30469. }
  30470. rng = selection.getRng();
  30471. var container = rng.startContainer;
  30472. var offset = rng.startOffset;
  30473. var root = dom.getRoot();
  30474. parent = container;
  30475. if (!rng.collapsed || offset !== 0) {
  30476. return;
  30477. }
  30478. while (parent && parent.parentNode && parent.parentNode.firstChild === parent && parent.parentNode !== root) {
  30479. parent = parent.parentNode;
  30480. }
  30481. if (parent.tagName === 'BLOCKQUOTE') {
  30482. editor.formatter.toggle('blockquote', null, parent);
  30483. rng = dom.createRng();
  30484. rng.setStart(container, 0);
  30485. rng.setEnd(container, 0);
  30486. selection.setRng(rng);
  30487. }
  30488. });
  30489. };
  30490. var setGeckoEditingOptions = function () {
  30491. var setOpts = function () {
  30492. setEditorCommandState('StyleWithCSS', false);
  30493. setEditorCommandState('enableInlineTableEditing', false);
  30494. if (!getObjectResizing(editor)) {
  30495. setEditorCommandState('enableObjectResizing', false);
  30496. }
  30497. };
  30498. if (!isReadOnly$1(editor)) {
  30499. editor.on('BeforeExecCommand mousedown', setOpts);
  30500. }
  30501. };
  30502. var addBrAfterLastLinks = function () {
  30503. var fixLinks = function () {
  30504. each(dom.select('a'), function (node) {
  30505. var parentNode = node.parentNode;
  30506. var root = dom.getRoot();
  30507. if (parentNode.lastChild === node) {
  30508. while (parentNode && !dom.isBlock(parentNode)) {
  30509. if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
  30510. return;
  30511. }
  30512. parentNode = parentNode.parentNode;
  30513. }
  30514. dom.add(parentNode, 'br', { 'data-mce-bogus': 1 });
  30515. }
  30516. });
  30517. };
  30518. editor.on('SetContent ExecCommand', function (e) {
  30519. if (e.type === 'setcontent' || e.command === 'mceInsertLink') {
  30520. fixLinks();
  30521. }
  30522. });
  30523. };
  30524. var setDefaultBlockType = function () {
  30525. if (getForcedRootBlock(editor)) {
  30526. editor.on('init', function () {
  30527. setEditorCommandState('DefaultParagraphSeparator', getForcedRootBlock(editor));
  30528. });
  30529. }
  30530. };
  30531. var normalizeSelection = function () {
  30532. editor.on('keyup focusin mouseup', function (e) {
  30533. if (!VK.modifierPressed(e)) {
  30534. selection.normalize();
  30535. }
  30536. }, true);
  30537. };
  30538. var showBrokenImageIcon = function () {
  30539. editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}');
  30540. };
  30541. var restoreFocusOnKeyDown = function () {
  30542. if (!editor.inline) {
  30543. editor.on('keydown', function () {
  30544. if (document.activeElement === document.body) {
  30545. editor.getWin().focus();
  30546. }
  30547. });
  30548. }
  30549. };
  30550. var bodyHeight = function () {
  30551. if (!editor.inline) {
  30552. editor.contentStyles.push('body {min-height: 150px}');
  30553. editor.on('click', function (e) {
  30554. var rng;
  30555. if (e.target.nodeName === 'HTML') {
  30556. if (Env.ie > 11) {
  30557. editor.getBody().focus();
  30558. return;
  30559. }
  30560. rng = editor.selection.getRng();
  30561. editor.getBody().focus();
  30562. editor.selection.setRng(rng);
  30563. editor.selection.normalize();
  30564. editor.nodeChanged();
  30565. }
  30566. });
  30567. }
  30568. };
  30569. var blockCmdArrowNavigation = function () {
  30570. if (Env.mac) {
  30571. editor.on('keydown', function (e) {
  30572. if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) {
  30573. e.preventDefault();
  30574. var selection_1 = editor.selection.getSel();
  30575. selection_1.modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary');
  30576. }
  30577. });
  30578. }
  30579. };
  30580. var disableAutoUrlDetect = function () {
  30581. setEditorCommandState('AutoUrlDetect', false);
  30582. };
  30583. var tapLinksAndImages = function () {
  30584. editor.on('click', function (e) {
  30585. var elm = e.target;
  30586. do {
  30587. if (elm.tagName === 'A') {
  30588. e.preventDefault();
  30589. return;
  30590. }
  30591. } while (elm = elm.parentNode);
  30592. });
  30593. editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
  30594. };
  30595. var blockFormSubmitInsideEditor = function () {
  30596. editor.on('init', function () {
  30597. editor.dom.bind(editor.getBody(), 'submit', function (e) {
  30598. e.preventDefault();
  30599. });
  30600. });
  30601. };
  30602. var removeAppleInterchangeBrs = function () {
  30603. parser.addNodeFilter('br', function (nodes) {
  30604. var i = nodes.length;
  30605. while (i--) {
  30606. if (nodes[i].attr('class') === 'Apple-interchange-newline') {
  30607. nodes[i].remove();
  30608. }
  30609. }
  30610. });
  30611. };
  30612. var ieInternalDragAndDrop = function () {
  30613. editor.on('dragstart', function (e) {
  30614. setMceInternalContent(e);
  30615. });
  30616. editor.on('drop', function (e) {
  30617. if (!isDefaultPrevented(e)) {
  30618. var internalContent = getMceInternalContent(e);
  30619. if (internalContent && internalContent.id !== editor.id) {
  30620. e.preventDefault();
  30621. var rng = fromPoint(e.x, e.y, editor.getDoc());
  30622. selection.setRng(rng);
  30623. insertClipboardContents(internalContent.html, true);
  30624. }
  30625. }
  30626. });
  30627. };
  30628. var refreshContentEditable = noop;
  30629. var isHidden = function () {
  30630. if (!isGecko || editor.removed) {
  30631. return false;
  30632. }
  30633. var sel = editor.selection.getSel();
  30634. return !sel || !sel.rangeCount || sel.rangeCount === 0;
  30635. };
  30636. var setupRtc = function () {
  30637. if (isWebKit) {
  30638. documentElementEditingFocus();
  30639. selectControlElements();
  30640. blockFormSubmitInsideEditor();
  30641. selectAll();
  30642. if (Env.iOS) {
  30643. restoreFocusOnKeyDown();
  30644. bodyHeight();
  30645. tapLinksAndImages();
  30646. }
  30647. }
  30648. if (isGecko) {
  30649. focusBody();
  30650. setGeckoEditingOptions();
  30651. showBrokenImageIcon();
  30652. blockCmdArrowNavigation();
  30653. }
  30654. };
  30655. var setup = function () {
  30656. removeBlockQuoteOnBackSpace();
  30657. emptyEditorWhenDeleting();
  30658. if (!Env.windowsPhone) {
  30659. normalizeSelection();
  30660. }
  30661. if (isWebKit) {
  30662. documentElementEditingFocus();
  30663. selectControlElements();
  30664. setDefaultBlockType();
  30665. blockFormSubmitInsideEditor();
  30666. disableBackspaceIntoATable();
  30667. removeAppleInterchangeBrs();
  30668. if (Env.iOS) {
  30669. restoreFocusOnKeyDown();
  30670. bodyHeight();
  30671. tapLinksAndImages();
  30672. } else {
  30673. selectAll();
  30674. }
  30675. }
  30676. if (Env.ie >= 11) {
  30677. bodyHeight();
  30678. disableBackspaceIntoATable();
  30679. }
  30680. if (Env.ie) {
  30681. selectAll();
  30682. disableAutoUrlDetect();
  30683. ieInternalDragAndDrop();
  30684. }
  30685. if (isGecko) {
  30686. removeHrOnBackspace();
  30687. focusBody();
  30688. removeStylesWhenDeletingAcrossBlockElements();
  30689. setGeckoEditingOptions();
  30690. addBrAfterLastLinks();
  30691. showBrokenImageIcon();
  30692. blockCmdArrowNavigation();
  30693. disableBackspaceIntoATable();
  30694. }
  30695. };
  30696. if (isRtc(editor)) {
  30697. setupRtc();
  30698. } else {
  30699. setup();
  30700. }
  30701. return {
  30702. refreshContentEditable: refreshContentEditable,
  30703. isHidden: isHidden
  30704. };
  30705. };
  30706. var DOM$6 = DOMUtils.DOM;
  30707. var appendStyle = function (editor, text) {
  30708. var body = SugarElement.fromDom(editor.getBody());
  30709. var container = getStyleContainer(getRootNode(body));
  30710. var style = SugarElement.fromTag('style');
  30711. set$1(style, 'type', 'text/css');
  30712. append$1(style, SugarElement.fromText(text));
  30713. append$1(container, style);
  30714. editor.on('remove', function () {
  30715. remove$7(style);
  30716. });
  30717. };
  30718. var getRootName = function (editor) {
  30719. return editor.inline ? editor.getElement().nodeName.toLowerCase() : undefined;
  30720. };
  30721. var removeUndefined = function (obj) {
  30722. return filter$3(obj, function (v) {
  30723. return isUndefined(v) === false;
  30724. });
  30725. };
  30726. var mkParserSettings = function (editor) {
  30727. var settings = editor.settings;
  30728. var blobCache = editor.editorUpload.blobCache;
  30729. return removeUndefined({
  30730. allow_conditional_comments: settings.allow_conditional_comments,
  30731. allow_html_data_urls: settings.allow_html_data_urls,
  30732. allow_svg_data_urls: settings.allow_svg_data_urls,
  30733. allow_html_in_named_anchor: settings.allow_html_in_named_anchor,
  30734. allow_script_urls: settings.allow_script_urls,
  30735. allow_unsafe_link_target: settings.allow_unsafe_link_target,
  30736. convert_fonts_to_spans: settings.convert_fonts_to_spans,
  30737. fix_list_elements: settings.fix_list_elements,
  30738. font_size_legacy_values: settings.font_size_legacy_values,
  30739. forced_root_block: settings.forced_root_block,
  30740. forced_root_block_attrs: settings.forced_root_block_attrs,
  30741. padd_empty_with_br: settings.padd_empty_with_br,
  30742. preserve_cdata: settings.preserve_cdata,
  30743. remove_trailing_brs: settings.remove_trailing_brs,
  30744. inline_styles: settings.inline_styles,
  30745. root_name: getRootName(editor),
  30746. validate: true,
  30747. blob_cache: blobCache,
  30748. document: editor.getDoc(),
  30749. images_dataimg_filter: settings.images_dataimg_filter
  30750. });
  30751. };
  30752. var mkSerializerSettings = function (editor) {
  30753. var settings = editor.settings;
  30754. return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({
  30755. url_converter: settings.url_converter,
  30756. url_converter_scope: settings.url_converter_scope,
  30757. element_format: settings.element_format,
  30758. entities: settings.entities,
  30759. entity_encoding: settings.entity_encoding,
  30760. indent: settings.indent,
  30761. indent_after: settings.indent_after,
  30762. indent_before: settings.indent_before,
  30763. block_elements: settings.block_elements,
  30764. boolean_attributes: settings.boolean_attributes,
  30765. custom_elements: settings.custom_elements,
  30766. extended_valid_elements: settings.extended_valid_elements,
  30767. invalid_elements: settings.invalid_elements,
  30768. invalid_styles: settings.invalid_styles,
  30769. move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements,
  30770. non_empty_elements: settings.non_empty_elements,
  30771. schema: settings.schema,
  30772. self_closing_elements: settings.self_closing_elements,
  30773. short_ended_elements: settings.short_ended_elements,
  30774. special: settings.special,
  30775. text_block_elements: settings.text_block_elements,
  30776. text_inline_elements: settings.text_inline_elements,
  30777. valid_children: settings.valid_children,
  30778. valid_classes: settings.valid_classes,
  30779. valid_elements: settings.valid_elements,
  30780. valid_styles: settings.valid_styles,
  30781. verify_html: settings.verify_html,
  30782. whitespace_elements: settings.whitespace_elements
  30783. }));
  30784. };
  30785. var createParser = function (editor) {
  30786. var parser = DomParser(mkParserSettings(editor), editor.schema);
  30787. parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name) {
  30788. var i = nodes.length, node, value;
  30789. var dom = editor.dom;
  30790. var internalName = 'data-mce-' + name;
  30791. while (i--) {
  30792. node = nodes[i];
  30793. value = node.attr(name);
  30794. if (value && !node.attr(internalName)) {
  30795. if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) {
  30796. continue;
  30797. }
  30798. if (name === 'style') {
  30799. value = dom.serializeStyle(dom.parseStyle(value), node.name);
  30800. if (!value.length) {
  30801. value = null;
  30802. }
  30803. node.attr(internalName, value);
  30804. node.attr(name, value);
  30805. } else if (name === 'tabindex') {
  30806. node.attr(internalName, value);
  30807. node.attr(name, null);
  30808. } else {
  30809. node.attr(internalName, editor.convertURL(value, name, node.name));
  30810. }
  30811. }
  30812. }
  30813. });
  30814. parser.addNodeFilter('script', function (nodes) {
  30815. var i = nodes.length;
  30816. while (i--) {
  30817. var node = nodes[i];
  30818. var type = node.attr('type') || 'no/type';
  30819. if (type.indexOf('mce-') !== 0) {
  30820. node.attr('type', 'mce-' + type);
  30821. }
  30822. }
  30823. });
  30824. if (editor.settings.preserve_cdata) {
  30825. parser.addNodeFilter('#cdata', function (nodes) {
  30826. var i = nodes.length;
  30827. while (i--) {
  30828. var node = nodes[i];
  30829. node.type = 8;
  30830. node.name = '#comment';
  30831. node.value = '[CDATA[' + editor.dom.encode(node.value) + ']]';
  30832. }
  30833. });
  30834. }
  30835. parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) {
  30836. var i = nodes.length;
  30837. var nonEmptyElements = editor.schema.getNonEmptyElements();
  30838. while (i--) {
  30839. var node = nodes[i];
  30840. if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) {
  30841. node.append(new AstNode('br', 1)).shortEnded = true;
  30842. }
  30843. }
  30844. });
  30845. return parser;
  30846. };
  30847. var autoFocus = function (editor) {
  30848. if (editor.settings.auto_focus) {
  30849. Delay.setEditorTimeout(editor, function () {
  30850. var focusEditor;
  30851. if (editor.settings.auto_focus === true) {
  30852. focusEditor = editor;
  30853. } else {
  30854. focusEditor = editor.editorManager.get(editor.settings.auto_focus);
  30855. }
  30856. if (!focusEditor.destroyed) {
  30857. focusEditor.focus();
  30858. }
  30859. }, 100);
  30860. }
  30861. };
  30862. var moveSelectionToFirstCaretPosition = function (editor) {
  30863. var root = editor.dom.getRoot();
  30864. if (!editor.inline && (!hasAnyRanges(editor) || editor.selection.getStart(true) === root)) {
  30865. firstPositionIn(root).each(function (pos) {
  30866. var node = pos.getNode();
  30867. var caretPos = isTable$3(node) ? firstPositionIn(node).getOr(pos) : pos;
  30868. if (Env.browser.isIE()) {
  30869. storeNative(editor, caretPos.toRange());
  30870. } else {
  30871. editor.selection.setRng(caretPos.toRange());
  30872. }
  30873. });
  30874. }
  30875. };
  30876. var initEditor = function (editor) {
  30877. editor.bindPendingEventDelegates();
  30878. editor.initialized = true;
  30879. fireInit(editor);
  30880. editor.focus(true);
  30881. moveSelectionToFirstCaretPosition(editor);
  30882. editor.nodeChanged({ initial: true });
  30883. editor.execCallback('init_instance_callback', editor);
  30884. autoFocus(editor);
  30885. };
  30886. var getStyleSheetLoader$1 = function (editor) {
  30887. return editor.inline ? editor.ui.styleSheetLoader : editor.dom.styleSheetLoader;
  30888. };
  30889. var makeStylesheetLoadingPromises = function (editor, css, framedFonts) {
  30890. var promises = [new promiseObj(function (resolve, reject) {
  30891. return getStyleSheetLoader$1(editor).loadAll(css, resolve, reject);
  30892. })];
  30893. if (editor.inline) {
  30894. return promises;
  30895. } else {
  30896. return promises.concat([new promiseObj(function (resolve, reject) {
  30897. return editor.ui.styleSheetLoader.loadAll(framedFonts, resolve, reject);
  30898. })]);
  30899. }
  30900. };
  30901. var loadContentCss = function (editor) {
  30902. var styleSheetLoader = getStyleSheetLoader$1(editor);
  30903. var fontCss = getFontCss(editor);
  30904. var css = editor.contentCSS;
  30905. var removeCss = function () {
  30906. styleSheetLoader.unloadAll(css);
  30907. if (!editor.inline) {
  30908. editor.ui.styleSheetLoader.unloadAll(fontCss);
  30909. }
  30910. };
  30911. var loaded = function () {
  30912. if (editor.removed) {
  30913. removeCss();
  30914. } else {
  30915. editor.on('remove', removeCss);
  30916. }
  30917. };
  30918. if (editor.contentStyles.length > 0) {
  30919. var contentCssText_1 = '';
  30920. Tools.each(editor.contentStyles, function (style) {
  30921. contentCssText_1 += style + '\r\n';
  30922. });
  30923. editor.dom.addStyle(contentCssText_1);
  30924. }
  30925. var allStylesheets = promiseObj.all(makeStylesheetLoadingPromises(editor, css, fontCss)).then(loaded).catch(loaded);
  30926. if (editor.settings.content_style) {
  30927. appendStyle(editor, editor.settings.content_style);
  30928. }
  30929. return allStylesheets;
  30930. };
  30931. var preInit = function (editor) {
  30932. var settings = editor.settings, doc = editor.getDoc(), body = editor.getBody();
  30933. firePreInit(editor);
  30934. if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
  30935. doc.body.spellcheck = false;
  30936. DOM$6.setAttrib(body, 'spellcheck', 'false');
  30937. }
  30938. editor.quirks = Quirks(editor);
  30939. firePostRender(editor);
  30940. var directionality = getDirectionality(editor);
  30941. if (directionality !== undefined) {
  30942. body.dir = directionality;
  30943. }
  30944. if (settings.protect) {
  30945. editor.on('BeforeSetContent', function (e) {
  30946. Tools.each(settings.protect, function (pattern) {
  30947. e.content = e.content.replace(pattern, function (str) {
  30948. return '<!--mce:protected ' + escape(str) + '-->';
  30949. });
  30950. });
  30951. });
  30952. }
  30953. editor.on('SetContent', function () {
  30954. editor.addVisual(editor.getBody());
  30955. });
  30956. editor.on('compositionstart compositionend', function (e) {
  30957. editor.composing = e.type === 'compositionstart';
  30958. });
  30959. };
  30960. var loadInitialContent = function (editor) {
  30961. if (!isRtc(editor)) {
  30962. editor.load({
  30963. initial: true,
  30964. format: 'html'
  30965. });
  30966. }
  30967. editor.startContent = editor.getContent({ format: 'raw' });
  30968. };
  30969. var initEditorWithInitialContent = function (editor) {
  30970. if (editor.removed !== true) {
  30971. loadInitialContent(editor);
  30972. initEditor(editor);
  30973. }
  30974. };
  30975. var initContentBody = function (editor, skipWrite) {
  30976. var settings = editor.settings;
  30977. var targetElm = editor.getElement();
  30978. var doc = editor.getDoc();
  30979. if (!settings.inline) {
  30980. editor.getElement().style.visibility = editor.orgVisibility;
  30981. }
  30982. if (!skipWrite && !editor.inline) {
  30983. doc.open();
  30984. doc.write(editor.iframeHTML);
  30985. doc.close();
  30986. }
  30987. if (editor.inline) {
  30988. DOM$6.addClass(targetElm, 'mce-content-body');
  30989. editor.contentDocument = doc = document;
  30990. editor.contentWindow = window;
  30991. editor.bodyElement = targetElm;
  30992. editor.contentAreaContainer = targetElm;
  30993. }
  30994. var body = editor.getBody();
  30995. body.disabled = true;
  30996. editor.readonly = !!settings.readonly;
  30997. if (!editor.readonly) {
  30998. if (editor.inline && DOM$6.getStyle(body, 'position', true) === 'static') {
  30999. body.style.position = 'relative';
  31000. }
  31001. body.contentEditable = editor.getParam('content_editable_state', true);
  31002. }
  31003. body.disabled = false;
  31004. editor.editorUpload = EditorUpload(editor);
  31005. editor.schema = Schema(settings);
  31006. editor.dom = DOMUtils(doc, {
  31007. keep_values: true,
  31008. url_converter: editor.convertURL,
  31009. url_converter_scope: editor,
  31010. hex_colors: settings.force_hex_style_colors,
  31011. update_styles: true,
  31012. root_element: editor.inline ? editor.getBody() : null,
  31013. collect: function () {
  31014. return editor.inline;
  31015. },
  31016. schema: editor.schema,
  31017. contentCssCors: shouldUseContentCssCors(editor),
  31018. referrerPolicy: getReferrerPolicy(editor),
  31019. onSetAttrib: function (e) {
  31020. editor.fire('SetAttrib', e);
  31021. }
  31022. });
  31023. editor.parser = createParser(editor);
  31024. editor.serializer = DomSerializer(mkSerializerSettings(editor), editor);
  31025. editor.selection = EditorSelection(editor.dom, editor.getWin(), editor.serializer, editor);
  31026. editor.annotator = Annotator(editor);
  31027. editor.formatter = Formatter(editor);
  31028. editor.undoManager = UndoManager(editor);
  31029. editor._nodeChangeDispatcher = new NodeChange(editor);
  31030. editor._selectionOverrides = SelectionOverrides(editor);
  31031. setup$e(editor);
  31032. setup$3(editor);
  31033. if (!isRtc(editor)) {
  31034. setup$2(editor);
  31035. }
  31036. var caret = setup$4(editor);
  31037. setup$f(editor, caret);
  31038. setup$d(editor);
  31039. setup$g(editor);
  31040. var setupRtcThunk = setup$i(editor);
  31041. preInit(editor);
  31042. setupRtcThunk.fold(function () {
  31043. loadContentCss(editor).then(function () {
  31044. return initEditorWithInitialContent(editor);
  31045. });
  31046. }, function (setupRtc) {
  31047. editor.setProgressState(true);
  31048. loadContentCss(editor).then(function () {
  31049. setupRtc().then(function (_rtcMode) {
  31050. editor.setProgressState(false);
  31051. initEditorWithInitialContent(editor);
  31052. }, function (err) {
  31053. editor.notificationManager.open({
  31054. type: 'error',
  31055. text: String(err)
  31056. });
  31057. initEditorWithInitialContent(editor);
  31058. });
  31059. });
  31060. });
  31061. };
  31062. var DOM$5 = DOMUtils.DOM;
  31063. var relaxDomain = function (editor, ifr) {
  31064. if (document.domain !== window.location.hostname && Env.browser.isIE()) {
  31065. var bodyUuid = uuid('mce');
  31066. editor[bodyUuid] = function () {
  31067. initContentBody(editor);
  31068. };
  31069. var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()';
  31070. DOM$5.setAttrib(ifr, 'src', domainRelaxUrl);
  31071. return true;
  31072. }
  31073. return false;
  31074. };
  31075. var createIframeElement = function (id, title, height, customAttrs) {
  31076. var iframe = SugarElement.fromTag('iframe');
  31077. setAll$1(iframe, customAttrs);
  31078. setAll$1(iframe, {
  31079. id: id + '_ifr',
  31080. frameBorder: '0',
  31081. allowTransparency: 'true',
  31082. title: title
  31083. });
  31084. add$1(iframe, 'tox-edit-area__iframe');
  31085. return iframe;
  31086. };
  31087. var getIframeHtml = function (editor) {
  31088. var iframeHTML = getDocType(editor) + '<html><head>';
  31089. if (getDocumentBaseUrl(editor) !== editor.documentBaseUrl) {
  31090. iframeHTML += '<base href="' + editor.documentBaseURI.getURI() + '" />';
  31091. }
  31092. iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
  31093. var bodyId = getBodyId(editor);
  31094. var bodyClass = getBodyClass(editor);
  31095. var translatedAriaText = editor.translate(getIframeAriaText(editor));
  31096. if (getContentSecurityPolicy(editor)) {
  31097. iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + getContentSecurityPolicy(editor) + '" />';
  31098. }
  31099. iframeHTML += '</head>' + ('<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" data-id="' + editor.id + '" aria-label="' + translatedAriaText + '">') + '<br>' + '</body></html>';
  31100. return iframeHTML;
  31101. };
  31102. var createIframe = function (editor, o) {
  31103. var iframeTitle = editor.translate('Rich Text Area');
  31104. var ifr = createIframeElement(editor.id, iframeTitle, o.height, getIframeAttrs(editor)).dom;
  31105. ifr.onload = function () {
  31106. ifr.onload = null;
  31107. editor.fire('load');
  31108. };
  31109. var isDomainRelaxed = relaxDomain(editor, ifr);
  31110. editor.contentAreaContainer = o.iframeContainer;
  31111. editor.iframeElement = ifr;
  31112. editor.iframeHTML = getIframeHtml(editor);
  31113. DOM$5.add(o.iframeContainer, ifr);
  31114. return isDomainRelaxed;
  31115. };
  31116. var init$1 = function (editor, boxInfo) {
  31117. var isDomainRelaxed = createIframe(editor, boxInfo);
  31118. if (boxInfo.editorContainer) {
  31119. DOM$5.get(boxInfo.editorContainer).style.display = editor.orgDisplay;
  31120. editor.hidden = DOM$5.isHidden(boxInfo.editorContainer);
  31121. }
  31122. editor.getElement().style.display = 'none';
  31123. DOM$5.setAttrib(editor.id, 'aria-hidden', 'true');
  31124. if (!isDomainRelaxed) {
  31125. initContentBody(editor);
  31126. }
  31127. };
  31128. var DOM$4 = DOMUtils.DOM;
  31129. var initPlugin = function (editor, initializedPlugins, plugin) {
  31130. var Plugin = PluginManager.get(plugin);
  31131. var pluginUrl = PluginManager.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, '');
  31132. plugin = Tools.trim(plugin);
  31133. if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) {
  31134. Tools.each(PluginManager.dependencies(plugin), function (dep) {
  31135. initPlugin(editor, initializedPlugins, dep);
  31136. });
  31137. if (editor.plugins[plugin]) {
  31138. return;
  31139. }
  31140. try {
  31141. var pluginInstance = new Plugin(editor, pluginUrl, editor.$);
  31142. editor.plugins[plugin] = pluginInstance;
  31143. if (pluginInstance.init) {
  31144. pluginInstance.init(editor, pluginUrl);
  31145. initializedPlugins.push(plugin);
  31146. }
  31147. } catch (e) {
  31148. pluginInitError(editor, plugin, e);
  31149. }
  31150. }
  31151. };
  31152. var trimLegacyPrefix = function (name) {
  31153. return name.replace(/^\-/, '');
  31154. };
  31155. var initPlugins = function (editor) {
  31156. var initializedPlugins = [];
  31157. Tools.each(getPlugins(editor).split(/[ ,]/), function (name) {
  31158. initPlugin(editor, initializedPlugins, trimLegacyPrefix(name));
  31159. });
  31160. };
  31161. var initIcons = function (editor) {
  31162. var iconPackName = Tools.trim(getIconPackName(editor));
  31163. var currentIcons = editor.ui.registry.getAll().icons;
  31164. var loadIcons = __assign(__assign({}, IconManager.get('default').icons), IconManager.get(iconPackName).icons);
  31165. each$j(loadIcons, function (svgData, icon) {
  31166. if (!has$2(currentIcons, icon)) {
  31167. editor.ui.registry.addIcon(icon, svgData);
  31168. }
  31169. });
  31170. };
  31171. var initTheme = function (editor) {
  31172. var theme = getTheme(editor);
  31173. if (isString$1(theme)) {
  31174. editor.settings.theme = trimLegacyPrefix(theme);
  31175. var Theme = ThemeManager.get(theme);
  31176. editor.theme = new Theme(editor, ThemeManager.urls[theme]);
  31177. if (editor.theme.init) {
  31178. editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$);
  31179. }
  31180. } else {
  31181. editor.theme = {};
  31182. }
  31183. };
  31184. var renderFromLoadedTheme = function (editor) {
  31185. return editor.theme.renderUI();
  31186. };
  31187. var renderFromThemeFunc = function (editor) {
  31188. var elm = editor.getElement();
  31189. var theme = getTheme(editor);
  31190. var info = theme(editor, elm);
  31191. if (info.editorContainer.nodeType) {
  31192. info.editorContainer.id = info.editorContainer.id || editor.id + '_parent';
  31193. }
  31194. if (info.iframeContainer && info.iframeContainer.nodeType) {
  31195. info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer';
  31196. }
  31197. info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight;
  31198. return info;
  31199. };
  31200. var createThemeFalseResult = function (element) {
  31201. return {
  31202. editorContainer: element,
  31203. iframeContainer: element,
  31204. api: {}
  31205. };
  31206. };
  31207. var renderThemeFalseIframe = function (targetElement) {
  31208. var iframeContainer = DOM$4.create('div');
  31209. DOM$4.insertAfter(iframeContainer, targetElement);
  31210. return createThemeFalseResult(iframeContainer);
  31211. };
  31212. var renderThemeFalse = function (editor) {
  31213. var targetElement = editor.getElement();
  31214. return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement);
  31215. };
  31216. var renderThemeUi = function (editor) {
  31217. var elm = editor.getElement();
  31218. editor.orgDisplay = elm.style.display;
  31219. if (isString$1(getTheme(editor))) {
  31220. return renderFromLoadedTheme(editor);
  31221. } else if (isFunction(getTheme(editor))) {
  31222. return renderFromThemeFunc(editor);
  31223. } else {
  31224. return renderThemeFalse(editor);
  31225. }
  31226. };
  31227. var augmentEditorUiApi = function (editor, api) {
  31228. var uiApiFacade = {
  31229. show: Optional.from(api.show).getOr(noop),
  31230. hide: Optional.from(api.hide).getOr(noop),
  31231. disable: Optional.from(api.disable).getOr(noop),
  31232. isDisabled: Optional.from(api.isDisabled).getOr(never),
  31233. enable: function () {
  31234. if (!editor.mode.isReadOnly()) {
  31235. Optional.from(api.enable).map(call);
  31236. }
  31237. }
  31238. };
  31239. editor.ui = __assign(__assign({}, editor.ui), uiApiFacade);
  31240. };
  31241. var init = function (editor) {
  31242. editor.fire('ScriptsLoaded');
  31243. initIcons(editor);
  31244. initTheme(editor);
  31245. initPlugins(editor);
  31246. var renderInfo = renderThemeUi(editor);
  31247. augmentEditorUiApi(editor, Optional.from(renderInfo.api).getOr({}));
  31248. var boxInfo = {
  31249. editorContainer: renderInfo.editorContainer,
  31250. iframeContainer: renderInfo.iframeContainer
  31251. };
  31252. editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null;
  31253. appendContentCssFromSettings(editor);
  31254. if (editor.inline) {
  31255. return initContentBody(editor);
  31256. } else {
  31257. return init$1(editor, boxInfo);
  31258. }
  31259. };
  31260. var DOM$3 = DOMUtils.DOM;
  31261. var hasSkipLoadPrefix = function (name) {
  31262. return name.charAt(0) === '-';
  31263. };
  31264. var loadLanguage = function (scriptLoader, editor) {
  31265. var languageCode = getLanguageCode(editor);
  31266. var languageUrl = getLanguageUrl(editor);
  31267. if (I18n.hasCode(languageCode) === false && languageCode !== 'en') {
  31268. var url_1 = languageUrl !== '' ? languageUrl : editor.editorManager.baseURL + '/langs/' + languageCode + '.js';
  31269. scriptLoader.add(url_1, noop, undefined, function () {
  31270. languageLoadError(editor, url_1, languageCode);
  31271. });
  31272. }
  31273. };
  31274. var loadTheme = function (scriptLoader, editor, suffix, callback) {
  31275. var theme = getTheme(editor);
  31276. if (isString$1(theme)) {
  31277. if (!hasSkipLoadPrefix(theme) && !has$2(ThemeManager.urls, theme)) {
  31278. var themeUrl = getThemeUrl(editor);
  31279. if (themeUrl) {
  31280. ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl));
  31281. } else {
  31282. ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js');
  31283. }
  31284. }
  31285. scriptLoader.loadQueue(function () {
  31286. ThemeManager.waitFor(theme, callback);
  31287. });
  31288. } else {
  31289. callback();
  31290. }
  31291. };
  31292. var getIconsUrlMetaFromUrl = function (editor) {
  31293. return Optional.from(getIconsUrl(editor)).filter(function (url) {
  31294. return url.length > 0;
  31295. }).map(function (url) {
  31296. return {
  31297. url: url,
  31298. name: Optional.none()
  31299. };
  31300. });
  31301. };
  31302. var getIconsUrlMetaFromName = function (editor, name, suffix) {
  31303. return Optional.from(name).filter(function (name) {
  31304. return name.length > 0 && !IconManager.has(name);
  31305. }).map(function (name) {
  31306. return {
  31307. url: editor.editorManager.baseURL + '/icons/' + name + '/icons' + suffix + '.js',
  31308. name: Optional.some(name)
  31309. };
  31310. });
  31311. };
  31312. var loadIcons = function (scriptLoader, editor, suffix) {
  31313. var defaultIconsUrl = getIconsUrlMetaFromName(editor, 'default', suffix);
  31314. var customIconsUrl = getIconsUrlMetaFromUrl(editor).orThunk(function () {
  31315. return getIconsUrlMetaFromName(editor, getIconPackName(editor), '');
  31316. });
  31317. each$k(cat([
  31318. defaultIconsUrl,
  31319. customIconsUrl
  31320. ]), function (urlMeta) {
  31321. scriptLoader.add(urlMeta.url, noop, undefined, function () {
  31322. iconsLoadError(editor, urlMeta.url, urlMeta.name.getOrUndefined());
  31323. });
  31324. });
  31325. };
  31326. var loadPlugins = function (editor, suffix) {
  31327. Tools.each(getExternalPlugins$1(editor), function (url, name) {
  31328. PluginManager.load(name, url, noop, undefined, function () {
  31329. pluginLoadError(editor, url, name);
  31330. });
  31331. editor.settings.plugins += ' ' + name;
  31332. });
  31333. Tools.each(getPlugins(editor).split(/[ ,]/), function (plugin) {
  31334. plugin = Tools.trim(plugin);
  31335. if (plugin && !PluginManager.urls[plugin]) {
  31336. if (hasSkipLoadPrefix(plugin)) {
  31337. plugin = plugin.substr(1, plugin.length);
  31338. var dependencies = PluginManager.dependencies(plugin);
  31339. Tools.each(dependencies, function (depPlugin) {
  31340. var defaultSettings = {
  31341. prefix: 'plugins/',
  31342. resource: depPlugin,
  31343. suffix: '/plugin' + suffix + '.js'
  31344. };
  31345. var dep = PluginManager.createUrl(defaultSettings, depPlugin);
  31346. PluginManager.load(dep.resource, dep, noop, undefined, function () {
  31347. pluginLoadError(editor, dep.prefix + dep.resource + dep.suffix, dep.resource);
  31348. });
  31349. });
  31350. } else {
  31351. var url_2 = {
  31352. prefix: 'plugins/',
  31353. resource: plugin,
  31354. suffix: '/plugin' + suffix + '.js'
  31355. };
  31356. PluginManager.load(plugin, url_2, noop, undefined, function () {
  31357. pluginLoadError(editor, url_2.prefix + url_2.resource + url_2.suffix, plugin);
  31358. });
  31359. }
  31360. }
  31361. });
  31362. };
  31363. var loadScripts = function (editor, suffix) {
  31364. var scriptLoader = ScriptLoader.ScriptLoader;
  31365. loadTheme(scriptLoader, editor, suffix, function () {
  31366. loadLanguage(scriptLoader, editor);
  31367. loadIcons(scriptLoader, editor, suffix);
  31368. loadPlugins(editor, suffix);
  31369. scriptLoader.loadQueue(function () {
  31370. if (!editor.removed) {
  31371. init(editor);
  31372. }
  31373. }, editor, function () {
  31374. if (!editor.removed) {
  31375. init(editor);
  31376. }
  31377. });
  31378. });
  31379. };
  31380. var getStyleSheetLoader = function (element, editor) {
  31381. return instance.forElement(element, {
  31382. contentCssCors: hasContentCssCors(editor),
  31383. referrerPolicy: getReferrerPolicy(editor)
  31384. });
  31385. };
  31386. var render = function (editor) {
  31387. var id = editor.id;
  31388. I18n.setCode(getLanguageCode(editor));
  31389. var readyHandler = function () {
  31390. DOM$3.unbind(window, 'ready', readyHandler);
  31391. editor.render();
  31392. };
  31393. if (!EventUtils.Event.domLoaded) {
  31394. DOM$3.bind(window, 'ready', readyHandler);
  31395. return;
  31396. }
  31397. if (!editor.getElement()) {
  31398. return;
  31399. }
  31400. if (!Env.contentEditable) {
  31401. return;
  31402. }
  31403. var element = SugarElement.fromDom(editor.getElement());
  31404. var snapshot = clone$3(element);
  31405. editor.on('remove', function () {
  31406. eachr(element.dom.attributes, function (attr) {
  31407. return remove$6(element, attr.name);
  31408. });
  31409. setAll$1(element, snapshot);
  31410. });
  31411. editor.ui.styleSheetLoader = getStyleSheetLoader(element, editor);
  31412. if (!isInline(editor)) {
  31413. editor.orgVisibility = editor.getElement().style.visibility;
  31414. editor.getElement().style.visibility = 'hidden';
  31415. } else {
  31416. editor.inline = true;
  31417. }
  31418. var form = editor.getElement().form || DOM$3.getParent(id, 'form');
  31419. if (form) {
  31420. editor.formElement = form;
  31421. if (hasHiddenInput(editor) && !isTextareaOrInput(editor.getElement())) {
  31422. DOM$3.insertAfter(DOM$3.create('input', {
  31423. type: 'hidden',
  31424. name: id
  31425. }), id);
  31426. editor.hasHiddenInput = true;
  31427. }
  31428. editor.formEventDelegate = function (e) {
  31429. editor.fire(e.type, e);
  31430. };
  31431. DOM$3.bind(form, 'submit reset', editor.formEventDelegate);
  31432. editor.on('reset', function () {
  31433. editor.resetContent();
  31434. });
  31435. if (shouldPatchSubmit(editor) && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
  31436. form._mceOldSubmit = form.submit;
  31437. form.submit = function () {
  31438. editor.editorManager.triggerSave();
  31439. editor.setDirty(false);
  31440. return form._mceOldSubmit(form);
  31441. };
  31442. }
  31443. }
  31444. editor.windowManager = WindowManager(editor);
  31445. editor.notificationManager = NotificationManager(editor);
  31446. if (isEncodingXml(editor)) {
  31447. editor.on('GetContent', function (e) {
  31448. if (e.save) {
  31449. e.content = DOM$3.encode(e.content);
  31450. }
  31451. });
  31452. }
  31453. if (shouldAddFormSubmitTrigger(editor)) {
  31454. editor.on('submit', function () {
  31455. if (editor.initialized) {
  31456. editor.save();
  31457. }
  31458. });
  31459. }
  31460. if (shouldAddUnloadTrigger(editor)) {
  31461. editor._beforeUnload = function () {
  31462. if (editor.initialized && !editor.destroyed && !editor.isHidden()) {
  31463. editor.save({
  31464. format: 'raw',
  31465. no_events: true,
  31466. set_dirty: false
  31467. });
  31468. }
  31469. };
  31470. editor.editorManager.on('BeforeUnload', editor._beforeUnload);
  31471. }
  31472. editor.editorManager.add(editor);
  31473. loadScripts(editor, editor.suffix);
  31474. };
  31475. var addVisual = function (editor, elm) {
  31476. return addVisual$1(editor, elm);
  31477. };
  31478. var legacyPropNames = {
  31479. 'font-size': 'size',
  31480. 'font-family': 'face'
  31481. };
  31482. var getSpecifiedFontProp = function (propName, rootElm, elm) {
  31483. var getProperty = function (elm) {
  31484. return getRaw(elm, propName).orThunk(function () {
  31485. if (name(elm) === 'font') {
  31486. return get$9(legacyPropNames, propName).bind(function (legacyPropName) {
  31487. return getOpt(elm, legacyPropName);
  31488. });
  31489. } else {
  31490. return Optional.none();
  31491. }
  31492. });
  31493. };
  31494. var isRoot = function (elm) {
  31495. return eq(SugarElement.fromDom(rootElm), elm);
  31496. };
  31497. return closest$1(SugarElement.fromDom(elm), function (elm) {
  31498. return getProperty(elm);
  31499. }, isRoot);
  31500. };
  31501. var normalizeFontFamily = function (fontFamily) {
  31502. return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ',');
  31503. };
  31504. var getComputedFontProp = function (propName, elm) {
  31505. return Optional.from(DOMUtils.DOM.getStyle(elm, propName, true));
  31506. };
  31507. var getFontProp = function (propName) {
  31508. return function (rootElm, elm) {
  31509. return Optional.from(elm).map(SugarElement.fromDom).filter(isElement$6).bind(function (element) {
  31510. return getSpecifiedFontProp(propName, rootElm, element.dom).or(getComputedFontProp(propName, element.dom));
  31511. }).getOr('');
  31512. };
  31513. };
  31514. var getFontSize = getFontProp('font-size');
  31515. var getFontFamily = compose(normalizeFontFamily, getFontProp('font-family'));
  31516. var findFirstCaretElement = function (editor) {
  31517. return firstPositionIn(editor.getBody()).map(function (caret) {
  31518. var container = caret.container();
  31519. return isText$7(container) ? container.parentNode : container;
  31520. });
  31521. };
  31522. var getCaretElement = function (editor) {
  31523. return Optional.from(editor.selection.getRng()).bind(function (rng) {
  31524. var root = editor.getBody();
  31525. var atStartOfNode = rng.startContainer === root && rng.startOffset === 0;
  31526. return atStartOfNode ? Optional.none() : Optional.from(editor.selection.getStart(true));
  31527. });
  31528. };
  31529. var bindRange = function (editor, binder) {
  31530. return getCaretElement(editor).orThunk(curry(findFirstCaretElement, editor)).map(SugarElement.fromDom).filter(isElement$6).bind(binder);
  31531. };
  31532. var mapRange = function (editor, mapper) {
  31533. return bindRange(editor, compose1(Optional.some, mapper));
  31534. };
  31535. var fromFontSizeNumber = function (editor, value) {
  31536. if (/^[0-9.]+$/.test(value)) {
  31537. var fontSizeNumber = parseInt(value, 10);
  31538. if (fontSizeNumber >= 1 && fontSizeNumber <= 7) {
  31539. var fontSizes = getFontStyleValues(editor);
  31540. var fontClasses = getFontSizeClasses(editor);
  31541. if (fontClasses) {
  31542. return fontClasses[fontSizeNumber - 1] || value;
  31543. } else {
  31544. return fontSizes[fontSizeNumber - 1] || value;
  31545. }
  31546. } else {
  31547. return value;
  31548. }
  31549. } else {
  31550. return value;
  31551. }
  31552. };
  31553. var normalizeFontNames = function (font) {
  31554. var fonts = font.split(/\s*,\s*/);
  31555. return map$3(fonts, function (font) {
  31556. if (font.indexOf(' ') !== -1 && !(startsWith(font, '"') || startsWith(font, '\''))) {
  31557. return '\'' + font + '\'';
  31558. } else {
  31559. return font;
  31560. }
  31561. }).join(',');
  31562. };
  31563. var fontNameAction = function (editor, value) {
  31564. var font = fromFontSizeNumber(editor, value);
  31565. editor.formatter.toggle('fontname', { value: normalizeFontNames(font) });
  31566. editor.nodeChanged();
  31567. };
  31568. var fontNameQuery = function (editor) {
  31569. return mapRange(editor, function (elm) {
  31570. return getFontFamily(editor.getBody(), elm.dom);
  31571. }).getOr('');
  31572. };
  31573. var fontSizeAction = function (editor, value) {
  31574. editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) });
  31575. editor.nodeChanged();
  31576. };
  31577. var fontSizeQuery = function (editor) {
  31578. return mapRange(editor, function (elm) {
  31579. return getFontSize(editor.getBody(), elm.dom);
  31580. }).getOr('');
  31581. };
  31582. var lineHeightQuery = function (editor) {
  31583. return mapRange(editor, function (elm) {
  31584. var root = SugarElement.fromDom(editor.getBody());
  31585. var specifiedStyle = closest$1(elm, function (elm) {
  31586. return getRaw(elm, 'line-height');
  31587. }, curry(eq, root));
  31588. var computedStyle = function () {
  31589. var lineHeight = parseFloat(get$5(elm, 'line-height'));
  31590. var fontSize = parseFloat(get$5(elm, 'font-size'));
  31591. return String(lineHeight / fontSize);
  31592. };
  31593. return specifiedStyle.getOrThunk(computedStyle);
  31594. }).getOr('');
  31595. };
  31596. var lineHeightAction = function (editor, lineHeight) {
  31597. editor.formatter.toggle('lineheight', { value: String(lineHeight) });
  31598. editor.nodeChanged();
  31599. };
  31600. var processValue = function (value) {
  31601. if (typeof value !== 'string') {
  31602. var details = Tools.extend({
  31603. paste: value.paste,
  31604. data: { paste: value.paste }
  31605. }, value);
  31606. return {
  31607. content: value.content,
  31608. details: details
  31609. };
  31610. }
  31611. return {
  31612. content: value,
  31613. details: {}
  31614. };
  31615. };
  31616. var insertAtCaret = function (editor, value) {
  31617. var result = processValue(value);
  31618. insertContent(editor, result.content, result.details);
  31619. };
  31620. var each$4 = Tools.each;
  31621. var map = Tools.map, inArray = Tools.inArray;
  31622. var EditorCommands = function () {
  31623. function EditorCommands(editor) {
  31624. this.commands = {
  31625. state: {},
  31626. exec: {},
  31627. value: {}
  31628. };
  31629. this.editor = editor;
  31630. this.setupCommands(editor);
  31631. }
  31632. EditorCommands.prototype.execCommand = function (command, ui, value, args) {
  31633. var func, state = false;
  31634. var self = this;
  31635. if (self.editor.removed) {
  31636. return;
  31637. }
  31638. if (command.toLowerCase() !== 'mcefocus') {
  31639. if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
  31640. self.editor.focus();
  31641. } else {
  31642. restore(self.editor);
  31643. }
  31644. }
  31645. args = self.editor.fire('BeforeExecCommand', {
  31646. command: command,
  31647. ui: ui,
  31648. value: value
  31649. });
  31650. if (args.isDefaultPrevented()) {
  31651. return false;
  31652. }
  31653. var customCommand = command.toLowerCase();
  31654. if (func = self.commands.exec[customCommand]) {
  31655. func(customCommand, ui, value);
  31656. self.editor.fire('ExecCommand', {
  31657. command: command,
  31658. ui: ui,
  31659. value: value
  31660. });
  31661. return true;
  31662. }
  31663. each$4(this.editor.plugins, function (p) {
  31664. if (p.execCommand && p.execCommand(command, ui, value)) {
  31665. self.editor.fire('ExecCommand', {
  31666. command: command,
  31667. ui: ui,
  31668. value: value
  31669. });
  31670. state = true;
  31671. return false;
  31672. }
  31673. });
  31674. if (state) {
  31675. return state;
  31676. }
  31677. if (self.editor.theme && self.editor.theme.execCommand && self.editor.theme.execCommand(command, ui, value)) {
  31678. self.editor.fire('ExecCommand', {
  31679. command: command,
  31680. ui: ui,
  31681. value: value
  31682. });
  31683. return true;
  31684. }
  31685. try {
  31686. state = self.editor.getDoc().execCommand(command, ui, value);
  31687. } catch (ex) {
  31688. }
  31689. if (state) {
  31690. self.editor.fire('ExecCommand', {
  31691. command: command,
  31692. ui: ui,
  31693. value: value
  31694. });
  31695. return true;
  31696. }
  31697. return false;
  31698. };
  31699. EditorCommands.prototype.queryCommandState = function (command) {
  31700. var func;
  31701. if (this.editor.quirks.isHidden() || this.editor.removed) {
  31702. return;
  31703. }
  31704. command = command.toLowerCase();
  31705. if (func = this.commands.state[command]) {
  31706. return func(command);
  31707. }
  31708. try {
  31709. return this.editor.getDoc().queryCommandState(command);
  31710. } catch (ex) {
  31711. }
  31712. return false;
  31713. };
  31714. EditorCommands.prototype.queryCommandValue = function (command) {
  31715. var func;
  31716. if (this.editor.quirks.isHidden() || this.editor.removed) {
  31717. return;
  31718. }
  31719. command = command.toLowerCase();
  31720. if (func = this.commands.value[command]) {
  31721. return func(command);
  31722. }
  31723. try {
  31724. return this.editor.getDoc().queryCommandValue(command);
  31725. } catch (ex) {
  31726. }
  31727. };
  31728. EditorCommands.prototype.addCommands = function (commandList, type) {
  31729. if (type === void 0) {
  31730. type = 'exec';
  31731. }
  31732. var self = this;
  31733. each$4(commandList, function (callback, command) {
  31734. each$4(command.toLowerCase().split(','), function (command) {
  31735. self.commands[type][command] = callback;
  31736. });
  31737. });
  31738. };
  31739. EditorCommands.prototype.addCommand = function (command, callback, scope) {
  31740. var _this = this;
  31741. command = command.toLowerCase();
  31742. this.commands.exec[command] = function (command, ui, value, args) {
  31743. return callback.call(scope || _this.editor, ui, value, args);
  31744. };
  31745. };
  31746. EditorCommands.prototype.queryCommandSupported = function (command) {
  31747. command = command.toLowerCase();
  31748. if (this.commands.exec[command]) {
  31749. return true;
  31750. }
  31751. try {
  31752. return this.editor.getDoc().queryCommandSupported(command);
  31753. } catch (ex) {
  31754. }
  31755. return false;
  31756. };
  31757. EditorCommands.prototype.addQueryStateHandler = function (command, callback, scope) {
  31758. var _this = this;
  31759. command = command.toLowerCase();
  31760. this.commands.state[command] = function () {
  31761. return callback.call(scope || _this.editor);
  31762. };
  31763. };
  31764. EditorCommands.prototype.addQueryValueHandler = function (command, callback, scope) {
  31765. var _this = this;
  31766. command = command.toLowerCase();
  31767. this.commands.value[command] = function () {
  31768. return callback.call(scope || _this.editor);
  31769. };
  31770. };
  31771. EditorCommands.prototype.hasCustomCommand = function (command) {
  31772. command = command.toLowerCase();
  31773. return !!this.commands.exec[command];
  31774. };
  31775. EditorCommands.prototype.execNativeCommand = function (command, ui, value) {
  31776. if (ui === undefined) {
  31777. ui = false;
  31778. }
  31779. if (value === undefined) {
  31780. value = null;
  31781. }
  31782. return this.editor.getDoc().execCommand(command, ui, value);
  31783. };
  31784. EditorCommands.prototype.isFormatMatch = function (name) {
  31785. return this.editor.formatter.match(name);
  31786. };
  31787. EditorCommands.prototype.toggleFormat = function (name, value) {
  31788. this.editor.formatter.toggle(name, value);
  31789. this.editor.nodeChanged();
  31790. };
  31791. EditorCommands.prototype.storeSelection = function (type) {
  31792. this.selectionBookmark = this.editor.selection.getBookmark(type);
  31793. };
  31794. EditorCommands.prototype.restoreSelection = function () {
  31795. this.editor.selection.moveToBookmark(this.selectionBookmark);
  31796. };
  31797. EditorCommands.prototype.setupCommands = function (editor) {
  31798. var self = this;
  31799. this.addCommands({
  31800. 'mceResetDesignMode,mceBeginUndoLevel': noop,
  31801. 'mceEndUndoLevel,mceAddUndoLevel': function () {
  31802. editor.undoManager.add();
  31803. },
  31804. 'mceFocus': function (_command, _ui, value) {
  31805. focus(editor, value);
  31806. },
  31807. 'Cut,Copy,Paste': function (command) {
  31808. var doc = editor.getDoc();
  31809. var failed;
  31810. try {
  31811. self.execNativeCommand(command);
  31812. } catch (ex) {
  31813. failed = true;
  31814. }
  31815. if (command === 'paste' && !doc.queryCommandEnabled(command)) {
  31816. failed = true;
  31817. }
  31818. if (failed || !doc.queryCommandSupported(command)) {
  31819. var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.');
  31820. if (Env.mac) {
  31821. msg = msg.replace(/Ctrl\+/g, '\u2318+');
  31822. }
  31823. editor.notificationManager.open({
  31824. text: msg,
  31825. type: 'error'
  31826. });
  31827. }
  31828. },
  31829. 'unlink': function () {
  31830. if (editor.selection.isCollapsed()) {
  31831. var elm = editor.dom.getParent(editor.selection.getStart(), 'a');
  31832. if (elm) {
  31833. editor.dom.remove(elm, true);
  31834. }
  31835. return;
  31836. }
  31837. editor.formatter.remove('link');
  31838. },
  31839. 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) {
  31840. var align = command.substring(7);
  31841. if (align === 'full') {
  31842. align = 'justify';
  31843. }
  31844. each$4('left,center,right,justify'.split(','), function (name) {
  31845. if (align !== name) {
  31846. editor.formatter.remove('align' + name);
  31847. }
  31848. });
  31849. if (align !== 'none') {
  31850. self.toggleFormat('align' + align);
  31851. }
  31852. },
  31853. 'InsertUnorderedList,InsertOrderedList': function (command) {
  31854. var listParent;
  31855. self.execNativeCommand(command);
  31856. var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul');
  31857. if (listElm) {
  31858. listParent = listElm.parentNode;
  31859. if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
  31860. self.storeSelection();
  31861. editor.dom.split(listParent, listElm);
  31862. self.restoreSelection();
  31863. }
  31864. }
  31865. },
  31866. 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
  31867. self.toggleFormat(command);
  31868. },
  31869. 'ForeColor,HiliteColor': function (command, ui, value) {
  31870. self.toggleFormat(command, { value: value });
  31871. },
  31872. 'FontName': function (command, ui, value) {
  31873. fontNameAction(editor, value);
  31874. },
  31875. 'FontSize': function (command, ui, value) {
  31876. fontSizeAction(editor, value);
  31877. },
  31878. 'LineHeight': function (command, ui, value) {
  31879. lineHeightAction(editor, value);
  31880. },
  31881. 'Lang': function (command, ui, lang) {
  31882. self.toggleFormat(command, {
  31883. value: lang.code,
  31884. customValue: lang.customCode
  31885. });
  31886. },
  31887. 'RemoveFormat': function (command) {
  31888. editor.formatter.remove(command);
  31889. },
  31890. 'mceBlockQuote': function () {
  31891. self.toggleFormat('blockquote');
  31892. },
  31893. 'FormatBlock': function (command, ui, value) {
  31894. return self.toggleFormat(value || 'p');
  31895. },
  31896. 'mceCleanup': function () {
  31897. var bookmark = editor.selection.getBookmark();
  31898. editor.setContent(editor.getContent());
  31899. editor.selection.moveToBookmark(bookmark);
  31900. },
  31901. 'mceRemoveNode': function (command, ui, value) {
  31902. var node = value || editor.selection.getNode();
  31903. if (node !== editor.getBody()) {
  31904. self.storeSelection();
  31905. editor.dom.remove(node, true);
  31906. self.restoreSelection();
  31907. }
  31908. },
  31909. 'mceSelectNodeDepth': function (command, ui, value) {
  31910. var counter = 0;
  31911. editor.dom.getParent(editor.selection.getNode(), function (node) {
  31912. if (node.nodeType === 1 && counter++ === value) {
  31913. editor.selection.select(node);
  31914. return false;
  31915. }
  31916. }, editor.getBody());
  31917. },
  31918. 'mceSelectNode': function (command, ui, value) {
  31919. editor.selection.select(value);
  31920. },
  31921. 'mceInsertContent': function (command, ui, value) {
  31922. insertAtCaret(editor, value);
  31923. },
  31924. 'mceInsertRawHTML': function (command, ui, value) {
  31925. editor.selection.setContent('tiny_mce_marker');
  31926. var content = editor.getContent();
  31927. editor.setContent(content.replace(/tiny_mce_marker/g, function () {
  31928. return value;
  31929. }));
  31930. },
  31931. 'mceInsertNewLine': function (command, ui, value) {
  31932. insert(editor, value);
  31933. },
  31934. 'mceToggleFormat': function (command, ui, value) {
  31935. self.toggleFormat(value);
  31936. },
  31937. 'mceSetContent': function (command, ui, value) {
  31938. editor.setContent(value);
  31939. },
  31940. 'Indent,Outdent': function (command) {
  31941. handle(editor, command);
  31942. },
  31943. 'mceRepaint': noop,
  31944. 'InsertHorizontalRule': function () {
  31945. editor.execCommand('mceInsertContent', false, '<hr />');
  31946. },
  31947. 'mceToggleVisualAid': function () {
  31948. editor.hasVisual = !editor.hasVisual;
  31949. editor.addVisual();
  31950. },
  31951. 'mceReplaceContent': function (command, ui, value) {
  31952. editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, editor.selection.getContent({ format: 'text' })));
  31953. },
  31954. 'mceInsertLink': function (command, ui, value) {
  31955. if (typeof value === 'string') {
  31956. value = { href: value };
  31957. }
  31958. var anchor = editor.dom.getParent(editor.selection.getNode(), 'a');
  31959. value.href = value.href.replace(/ /g, '%20');
  31960. if (!anchor || !value.href) {
  31961. editor.formatter.remove('link');
  31962. }
  31963. if (value.href) {
  31964. editor.formatter.apply('link', value, anchor);
  31965. }
  31966. },
  31967. 'selectAll': function () {
  31968. var editingHost = editor.dom.getParent(editor.selection.getStart(), isContentEditableTrue$4);
  31969. if (editingHost) {
  31970. var rng = editor.dom.createRng();
  31971. rng.selectNodeContents(editingHost);
  31972. editor.selection.setRng(rng);
  31973. }
  31974. },
  31975. 'mceNewDocument': function () {
  31976. editor.setContent('');
  31977. },
  31978. 'InsertLineBreak': function (command, ui, value) {
  31979. insert$1(editor, value);
  31980. return true;
  31981. }
  31982. });
  31983. var alignStates = function (name) {
  31984. return function () {
  31985. var selection = editor.selection;
  31986. var nodes = selection.isCollapsed() ? [editor.dom.getParent(selection.getNode(), editor.dom.isBlock)] : selection.getSelectedBlocks();
  31987. var matches = map(nodes, function (node) {
  31988. return !!editor.formatter.matchNode(node, name);
  31989. });
  31990. return inArray(matches, true) !== -1;
  31991. };
  31992. };
  31993. self.addCommands({
  31994. 'JustifyLeft': alignStates('alignleft'),
  31995. 'JustifyCenter': alignStates('aligncenter'),
  31996. 'JustifyRight': alignStates('alignright'),
  31997. 'JustifyFull': alignStates('alignjustify'),
  31998. 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
  31999. return self.isFormatMatch(command);
  32000. },
  32001. 'mceBlockQuote': function () {
  32002. return self.isFormatMatch('blockquote');
  32003. },
  32004. 'Outdent': function () {
  32005. return canOutdent(editor);
  32006. },
  32007. 'InsertUnorderedList,InsertOrderedList': function (command) {
  32008. var list = editor.dom.getParent(editor.selection.getNode(), 'ul,ol');
  32009. return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL');
  32010. }
  32011. }, 'state');
  32012. self.addCommands({
  32013. Undo: function () {
  32014. editor.undoManager.undo();
  32015. },
  32016. Redo: function () {
  32017. editor.undoManager.redo();
  32018. }
  32019. });
  32020. self.addQueryValueHandler('FontName', function () {
  32021. return fontNameQuery(editor);
  32022. }, this);
  32023. self.addQueryValueHandler('FontSize', function () {
  32024. return fontSizeQuery(editor);
  32025. }, this);
  32026. self.addQueryValueHandler('LineHeight', function () {
  32027. return lineHeightQuery(editor);
  32028. }, this);
  32029. };
  32030. return EditorCommands;
  32031. }();
  32032. var internalContentEditableAttr = 'data-mce-contenteditable';
  32033. var toggleClass = function (elm, cls, state) {
  32034. if (has(elm, cls) && state === false) {
  32035. remove$3(elm, cls);
  32036. } else if (state) {
  32037. add$1(elm, cls);
  32038. }
  32039. };
  32040. var setEditorCommandState = function (editor, cmd, state) {
  32041. try {
  32042. editor.getDoc().execCommand(cmd, false, String(state));
  32043. } catch (ex) {
  32044. }
  32045. };
  32046. var setContentEditable = function (elm, state) {
  32047. elm.dom.contentEditable = state ? 'true' : 'false';
  32048. };
  32049. var switchOffContentEditableTrue = function (elm) {
  32050. each$k(descendants(elm, '*[contenteditable="true"]'), function (elm) {
  32051. set$1(elm, internalContentEditableAttr, 'true');
  32052. setContentEditable(elm, false);
  32053. });
  32054. };
  32055. var switchOnContentEditableTrue = function (elm) {
  32056. each$k(descendants(elm, '*[' + internalContentEditableAttr + '="true"]'), function (elm) {
  32057. remove$6(elm, internalContentEditableAttr);
  32058. setContentEditable(elm, true);
  32059. });
  32060. };
  32061. var removeFakeSelection = function (editor) {
  32062. Optional.from(editor.selection.getNode()).each(function (elm) {
  32063. elm.removeAttribute('data-mce-selected');
  32064. });
  32065. };
  32066. var restoreFakeSelection = function (editor) {
  32067. editor.selection.setRng(editor.selection.getRng());
  32068. };
  32069. var toggleReadOnly = function (editor, state) {
  32070. var body = SugarElement.fromDom(editor.getBody());
  32071. toggleClass(body, 'mce-content-readonly', state);
  32072. if (state) {
  32073. editor.selection.controlSelection.hideResizeRect();
  32074. editor._selectionOverrides.hideFakeCaret();
  32075. removeFakeSelection(editor);
  32076. editor.readonly = true;
  32077. setContentEditable(body, false);
  32078. switchOffContentEditableTrue(body);
  32079. } else {
  32080. editor.readonly = false;
  32081. setContentEditable(body, true);
  32082. switchOnContentEditableTrue(body);
  32083. setEditorCommandState(editor, 'StyleWithCSS', false);
  32084. setEditorCommandState(editor, 'enableInlineTableEditing', false);
  32085. setEditorCommandState(editor, 'enableObjectResizing', false);
  32086. if (hasEditorOrUiFocus(editor)) {
  32087. editor.focus();
  32088. }
  32089. restoreFakeSelection(editor);
  32090. editor.nodeChanged();
  32091. }
  32092. };
  32093. var isReadOnly = function (editor) {
  32094. return editor.readonly;
  32095. };
  32096. var registerFilters = function (editor) {
  32097. editor.parser.addAttributeFilter('contenteditable', function (nodes) {
  32098. if (isReadOnly(editor)) {
  32099. each$k(nodes, function (node) {
  32100. node.attr(internalContentEditableAttr, node.attr('contenteditable'));
  32101. node.attr('contenteditable', 'false');
  32102. });
  32103. }
  32104. });
  32105. editor.serializer.addAttributeFilter(internalContentEditableAttr, function (nodes) {
  32106. if (isReadOnly(editor)) {
  32107. each$k(nodes, function (node) {
  32108. node.attr('contenteditable', node.attr(internalContentEditableAttr));
  32109. });
  32110. }
  32111. });
  32112. editor.serializer.addTempAttr(internalContentEditableAttr);
  32113. };
  32114. var registerReadOnlyContentFilters = function (editor) {
  32115. if (editor.serializer) {
  32116. registerFilters(editor);
  32117. } else {
  32118. editor.on('PreInit', function () {
  32119. registerFilters(editor);
  32120. });
  32121. }
  32122. };
  32123. var isClickEvent = function (e) {
  32124. return e.type === 'click';
  32125. };
  32126. var getAnchorHrefOpt = function (editor, elm) {
  32127. var isRoot = function (elm) {
  32128. return eq(elm, SugarElement.fromDom(editor.getBody()));
  32129. };
  32130. return closest$2(elm, 'a', isRoot).bind(function (a) {
  32131. return getOpt(a, 'href');
  32132. });
  32133. };
  32134. var processReadonlyEvents = function (editor, e) {
  32135. if (isClickEvent(e) && !VK.metaKeyPressed(e)) {
  32136. var elm = SugarElement.fromDom(e.target);
  32137. getAnchorHrefOpt(editor, elm).each(function (href) {
  32138. e.preventDefault();
  32139. if (/^#/.test(href)) {
  32140. var targetEl = editor.dom.select(href + ',[name="' + removeLeading(href, '#') + '"]');
  32141. if (targetEl.length) {
  32142. editor.selection.scrollIntoView(targetEl[0], true);
  32143. }
  32144. } else {
  32145. window.open(href, '_blank', 'rel=noopener noreferrer,menubar=yes,toolbar=yes,location=yes,status=yes,resizable=yes,scrollbars=yes');
  32146. }
  32147. });
  32148. }
  32149. };
  32150. var registerReadOnlySelectionBlockers = function (editor) {
  32151. editor.on('ShowCaret', function (e) {
  32152. if (isReadOnly(editor)) {
  32153. e.preventDefault();
  32154. }
  32155. });
  32156. editor.on('ObjectSelected', function (e) {
  32157. if (isReadOnly(editor)) {
  32158. e.preventDefault();
  32159. }
  32160. });
  32161. };
  32162. var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel', ' ');
  32163. var EventDispatcher = function () {
  32164. function EventDispatcher(settings) {
  32165. this.bindings = {};
  32166. this.settings = settings || {};
  32167. this.scope = this.settings.scope || this;
  32168. this.toggleEvent = this.settings.toggleEvent || never;
  32169. }
  32170. EventDispatcher.isNative = function (name) {
  32171. return !!nativeEvents[name.toLowerCase()];
  32172. };
  32173. EventDispatcher.prototype.fire = function (name, args) {
  32174. var lcName = name.toLowerCase();
  32175. var event = normalize$3(lcName, args || {}, this.scope);
  32176. if (this.settings.beforeFire) {
  32177. this.settings.beforeFire(event);
  32178. }
  32179. var handlers = this.bindings[lcName];
  32180. if (handlers) {
  32181. for (var i = 0, l = handlers.length; i < l; i++) {
  32182. var callback = handlers[i];
  32183. if (callback.removed) {
  32184. continue;
  32185. }
  32186. if (callback.once) {
  32187. this.off(lcName, callback.func);
  32188. }
  32189. if (event.isImmediatePropagationStopped()) {
  32190. return event;
  32191. }
  32192. if (callback.func.call(this.scope, event) === false) {
  32193. event.preventDefault();
  32194. return event;
  32195. }
  32196. }
  32197. }
  32198. return event;
  32199. };
  32200. EventDispatcher.prototype.on = function (name, callback, prepend, extra) {
  32201. if (callback === false) {
  32202. callback = never;
  32203. }
  32204. if (callback) {
  32205. var wrappedCallback = {
  32206. func: callback,
  32207. removed: false
  32208. };
  32209. if (extra) {
  32210. Tools.extend(wrappedCallback, extra);
  32211. }
  32212. var names = name.toLowerCase().split(' ');
  32213. var i = names.length;
  32214. while (i--) {
  32215. var currentName = names[i];
  32216. var handlers = this.bindings[currentName];
  32217. if (!handlers) {
  32218. handlers = [];
  32219. this.toggleEvent(currentName, true);
  32220. }
  32221. if (prepend) {
  32222. handlers = __spreadArray([wrappedCallback], handlers, true);
  32223. } else {
  32224. handlers = __spreadArray(__spreadArray([], handlers, true), [wrappedCallback], false);
  32225. }
  32226. this.bindings[currentName] = handlers;
  32227. }
  32228. }
  32229. return this;
  32230. };
  32231. EventDispatcher.prototype.off = function (name, callback) {
  32232. var _this = this;
  32233. if (name) {
  32234. var names = name.toLowerCase().split(' ');
  32235. var i = names.length;
  32236. while (i--) {
  32237. var currentName = names[i];
  32238. var handlers = this.bindings[currentName];
  32239. if (!currentName) {
  32240. each$j(this.bindings, function (_value, bindingName) {
  32241. _this.toggleEvent(bindingName, false);
  32242. delete _this.bindings[bindingName];
  32243. });
  32244. return this;
  32245. }
  32246. if (handlers) {
  32247. if (!callback) {
  32248. handlers.length = 0;
  32249. } else {
  32250. var filteredHandlers = partition(handlers, function (handler) {
  32251. return handler.func === callback;
  32252. });
  32253. handlers = filteredHandlers.fail;
  32254. this.bindings[currentName] = handlers;
  32255. each$k(filteredHandlers.pass, function (handler) {
  32256. handler.removed = true;
  32257. });
  32258. }
  32259. if (!handlers.length) {
  32260. this.toggleEvent(name, false);
  32261. delete this.bindings[currentName];
  32262. }
  32263. }
  32264. }
  32265. } else {
  32266. each$j(this.bindings, function (_value, name) {
  32267. _this.toggleEvent(name, false);
  32268. });
  32269. this.bindings = {};
  32270. }
  32271. return this;
  32272. };
  32273. EventDispatcher.prototype.once = function (name, callback, prepend) {
  32274. return this.on(name, callback, prepend, { once: true });
  32275. };
  32276. EventDispatcher.prototype.has = function (name) {
  32277. name = name.toLowerCase();
  32278. return !(!this.bindings[name] || this.bindings[name].length === 0);
  32279. };
  32280. return EventDispatcher;
  32281. }();
  32282. var getEventDispatcher = function (obj) {
  32283. if (!obj._eventDispatcher) {
  32284. obj._eventDispatcher = new EventDispatcher({
  32285. scope: obj,
  32286. toggleEvent: function (name, state) {
  32287. if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) {
  32288. obj.toggleNativeEvent(name, state);
  32289. }
  32290. }
  32291. });
  32292. }
  32293. return obj._eventDispatcher;
  32294. };
  32295. var Observable = {
  32296. fire: function (name, args, bubble) {
  32297. var self = this;
  32298. if (self.removed && name !== 'remove' && name !== 'detach') {
  32299. return args;
  32300. }
  32301. var dispatcherArgs = getEventDispatcher(self).fire(name, args);
  32302. if (bubble !== false && self.parent) {
  32303. var parent_1 = self.parent();
  32304. while (parent_1 && !dispatcherArgs.isPropagationStopped()) {
  32305. parent_1.fire(name, dispatcherArgs, false);
  32306. parent_1 = parent_1.parent();
  32307. }
  32308. }
  32309. return dispatcherArgs;
  32310. },
  32311. on: function (name, callback, prepend) {
  32312. return getEventDispatcher(this).on(name, callback, prepend);
  32313. },
  32314. off: function (name, callback) {
  32315. return getEventDispatcher(this).off(name, callback);
  32316. },
  32317. once: function (name, callback) {
  32318. return getEventDispatcher(this).once(name, callback);
  32319. },
  32320. hasEventListeners: function (name) {
  32321. return getEventDispatcher(this).has(name);
  32322. }
  32323. };
  32324. var DOM$2 = DOMUtils.DOM;
  32325. var customEventRootDelegates;
  32326. var getEventTarget = function (editor, eventName) {
  32327. if (eventName === 'selectionchange') {
  32328. return editor.getDoc();
  32329. }
  32330. if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
  32331. return editor.getDoc().documentElement;
  32332. }
  32333. var eventRoot = getEventRoot(editor);
  32334. if (eventRoot) {
  32335. if (!editor.eventRoot) {
  32336. editor.eventRoot = DOM$2.select(eventRoot)[0];
  32337. }
  32338. return editor.eventRoot;
  32339. }
  32340. return editor.getBody();
  32341. };
  32342. var isListening = function (editor) {
  32343. return !editor.hidden && !isReadOnly(editor);
  32344. };
  32345. var fireEvent = function (editor, eventName, e) {
  32346. if (isListening(editor)) {
  32347. editor.fire(eventName, e);
  32348. } else if (isReadOnly(editor)) {
  32349. processReadonlyEvents(editor, e);
  32350. }
  32351. };
  32352. var bindEventDelegate = function (editor, eventName) {
  32353. var delegate;
  32354. if (!editor.delegates) {
  32355. editor.delegates = {};
  32356. }
  32357. if (editor.delegates[eventName] || editor.removed) {
  32358. return;
  32359. }
  32360. var eventRootElm = getEventTarget(editor, eventName);
  32361. if (getEventRoot(editor)) {
  32362. if (!customEventRootDelegates) {
  32363. customEventRootDelegates = {};
  32364. editor.editorManager.on('removeEditor', function () {
  32365. if (!editor.editorManager.activeEditor) {
  32366. if (customEventRootDelegates) {
  32367. each$j(customEventRootDelegates, function (_value, name) {
  32368. editor.dom.unbind(getEventTarget(editor, name));
  32369. });
  32370. customEventRootDelegates = null;
  32371. }
  32372. }
  32373. });
  32374. }
  32375. if (customEventRootDelegates[eventName]) {
  32376. return;
  32377. }
  32378. delegate = function (e) {
  32379. var target = e.target;
  32380. var editors = editor.editorManager.get();
  32381. var i = editors.length;
  32382. while (i--) {
  32383. var body = editors[i].getBody();
  32384. if (body === target || DOM$2.isChildOf(target, body)) {
  32385. fireEvent(editors[i], eventName, e);
  32386. }
  32387. }
  32388. };
  32389. customEventRootDelegates[eventName] = delegate;
  32390. DOM$2.bind(eventRootElm, eventName, delegate);
  32391. } else {
  32392. delegate = function (e) {
  32393. fireEvent(editor, eventName, e);
  32394. };
  32395. DOM$2.bind(eventRootElm, eventName, delegate);
  32396. editor.delegates[eventName] = delegate;
  32397. }
  32398. };
  32399. var EditorObservable = __assign(__assign({}, Observable), {
  32400. bindPendingEventDelegates: function () {
  32401. var self = this;
  32402. Tools.each(self._pendingNativeEvents, function (name) {
  32403. bindEventDelegate(self, name);
  32404. });
  32405. },
  32406. toggleNativeEvent: function (name, state) {
  32407. var self = this;
  32408. if (name === 'focus' || name === 'blur') {
  32409. return;
  32410. }
  32411. if (self.removed) {
  32412. return;
  32413. }
  32414. if (state) {
  32415. if (self.initialized) {
  32416. bindEventDelegate(self, name);
  32417. } else {
  32418. if (!self._pendingNativeEvents) {
  32419. self._pendingNativeEvents = [name];
  32420. } else {
  32421. self._pendingNativeEvents.push(name);
  32422. }
  32423. }
  32424. } else if (self.initialized) {
  32425. self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
  32426. delete self.delegates[name];
  32427. }
  32428. },
  32429. unbindAllNativeEvents: function () {
  32430. var self = this;
  32431. var body = self.getBody();
  32432. var dom = self.dom;
  32433. if (self.delegates) {
  32434. each$j(self.delegates, function (value, name) {
  32435. self.dom.unbind(getEventTarget(self, name), name, value);
  32436. });
  32437. delete self.delegates;
  32438. }
  32439. if (!self.inline && body && dom) {
  32440. body.onload = null;
  32441. dom.unbind(self.getWin());
  32442. dom.unbind(self.getDoc());
  32443. }
  32444. if (dom) {
  32445. dom.unbind(body);
  32446. dom.unbind(self.getContainer());
  32447. }
  32448. }
  32449. });
  32450. var defaultModes = [
  32451. 'design',
  32452. 'readonly'
  32453. ];
  32454. var switchToMode = function (editor, activeMode, availableModes, mode) {
  32455. var oldMode = availableModes[activeMode.get()];
  32456. var newMode = availableModes[mode];
  32457. try {
  32458. newMode.activate();
  32459. } catch (e) {
  32460. console.error('problem while activating editor mode ' + mode + ':', e);
  32461. return;
  32462. }
  32463. oldMode.deactivate();
  32464. if (oldMode.editorReadOnly !== newMode.editorReadOnly) {
  32465. toggleReadOnly(editor, newMode.editorReadOnly);
  32466. }
  32467. activeMode.set(mode);
  32468. fireSwitchMode(editor, mode);
  32469. };
  32470. var setMode = function (editor, availableModes, activeMode, mode) {
  32471. if (mode === activeMode.get()) {
  32472. return;
  32473. } else if (!has$2(availableModes, mode)) {
  32474. throw new Error('Editor mode \'' + mode + '\' is invalid');
  32475. }
  32476. if (editor.initialized) {
  32477. switchToMode(editor, activeMode, availableModes, mode);
  32478. } else {
  32479. editor.on('init', function () {
  32480. return switchToMode(editor, activeMode, availableModes, mode);
  32481. });
  32482. }
  32483. };
  32484. var registerMode = function (availableModes, mode, api) {
  32485. var _a;
  32486. if (contains$3(defaultModes, mode)) {
  32487. throw new Error('Cannot override default mode ' + mode);
  32488. }
  32489. return __assign(__assign({}, availableModes), (_a = {}, _a[mode] = __assign(__assign({}, api), {
  32490. deactivate: function () {
  32491. try {
  32492. api.deactivate();
  32493. } catch (e) {
  32494. console.error('problem while deactivating editor mode ' + mode + ':', e);
  32495. }
  32496. }
  32497. }), _a));
  32498. };
  32499. var create$4 = function (editor) {
  32500. var activeMode = Cell('design');
  32501. var availableModes = Cell({
  32502. design: {
  32503. activate: noop,
  32504. deactivate: noop,
  32505. editorReadOnly: false
  32506. },
  32507. readonly: {
  32508. activate: noop,
  32509. deactivate: noop,
  32510. editorReadOnly: true
  32511. }
  32512. });
  32513. registerReadOnlyContentFilters(editor);
  32514. registerReadOnlySelectionBlockers(editor);
  32515. return {
  32516. isReadOnly: function () {
  32517. return isReadOnly(editor);
  32518. },
  32519. set: function (mode) {
  32520. return setMode(editor, availableModes.get(), activeMode, mode);
  32521. },
  32522. get: function () {
  32523. return activeMode.get();
  32524. },
  32525. register: function (mode, api) {
  32526. availableModes.set(registerMode(availableModes.get(), mode, api));
  32527. }
  32528. };
  32529. };
  32530. var each$3 = Tools.each, explode$1 = Tools.explode;
  32531. var keyCodeLookup = {
  32532. f1: 112,
  32533. f2: 113,
  32534. f3: 114,
  32535. f4: 115,
  32536. f5: 116,
  32537. f6: 117,
  32538. f7: 118,
  32539. f8: 119,
  32540. f9: 120,
  32541. f10: 121,
  32542. f11: 122,
  32543. f12: 123
  32544. };
  32545. var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
  32546. var parseShortcut = function (pattern) {
  32547. var key;
  32548. var shortcut = {};
  32549. each$3(explode$1(pattern.toLowerCase(), '+'), function (value) {
  32550. if (value in modifierNames) {
  32551. shortcut[value] = true;
  32552. } else {
  32553. if (/^[0-9]{2,}$/.test(value)) {
  32554. shortcut.keyCode = parseInt(value, 10);
  32555. } else {
  32556. shortcut.charCode = value.charCodeAt(0);
  32557. shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
  32558. }
  32559. }
  32560. });
  32561. var id = [shortcut.keyCode];
  32562. for (key in modifierNames) {
  32563. if (shortcut[key]) {
  32564. id.push(key);
  32565. } else {
  32566. shortcut[key] = false;
  32567. }
  32568. }
  32569. shortcut.id = id.join(',');
  32570. if (shortcut.access) {
  32571. shortcut.alt = true;
  32572. if (Env.mac) {
  32573. shortcut.ctrl = true;
  32574. } else {
  32575. shortcut.shift = true;
  32576. }
  32577. }
  32578. if (shortcut.meta) {
  32579. if (Env.mac) {
  32580. shortcut.meta = true;
  32581. } else {
  32582. shortcut.ctrl = true;
  32583. shortcut.meta = false;
  32584. }
  32585. }
  32586. return shortcut;
  32587. };
  32588. var Shortcuts = function () {
  32589. function Shortcuts(editor) {
  32590. this.shortcuts = {};
  32591. this.pendingPatterns = [];
  32592. this.editor = editor;
  32593. var self = this;
  32594. editor.on('keyup keypress keydown', function (e) {
  32595. if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) {
  32596. each$3(self.shortcuts, function (shortcut) {
  32597. if (self.matchShortcut(e, shortcut)) {
  32598. self.pendingPatterns = shortcut.subpatterns.slice(0);
  32599. if (e.type === 'keydown') {
  32600. self.executeShortcutAction(shortcut);
  32601. }
  32602. return true;
  32603. }
  32604. });
  32605. if (self.matchShortcut(e, self.pendingPatterns[0])) {
  32606. if (self.pendingPatterns.length === 1) {
  32607. if (e.type === 'keydown') {
  32608. self.executeShortcutAction(self.pendingPatterns[0]);
  32609. }
  32610. }
  32611. self.pendingPatterns.shift();
  32612. }
  32613. }
  32614. });
  32615. }
  32616. Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) {
  32617. var self = this;
  32618. var func = self.normalizeCommandFunc(cmdFunc);
  32619. each$3(explode$1(Tools.trim(pattern)), function (pattern) {
  32620. var shortcut = self.createShortcut(pattern, desc, func, scope);
  32621. self.shortcuts[shortcut.id] = shortcut;
  32622. });
  32623. return true;
  32624. };
  32625. Shortcuts.prototype.remove = function (pattern) {
  32626. var shortcut = this.createShortcut(pattern);
  32627. if (this.shortcuts[shortcut.id]) {
  32628. delete this.shortcuts[shortcut.id];
  32629. return true;
  32630. }
  32631. return false;
  32632. };
  32633. Shortcuts.prototype.normalizeCommandFunc = function (cmdFunc) {
  32634. var self = this;
  32635. var cmd = cmdFunc;
  32636. if (typeof cmd === 'string') {
  32637. return function () {
  32638. self.editor.execCommand(cmd, false, null);
  32639. };
  32640. } else if (Tools.isArray(cmd)) {
  32641. return function () {
  32642. self.editor.execCommand(cmd[0], cmd[1], cmd[2]);
  32643. };
  32644. } else {
  32645. return cmd;
  32646. }
  32647. };
  32648. Shortcuts.prototype.createShortcut = function (pattern, desc, cmdFunc, scope) {
  32649. var shortcuts = Tools.map(explode$1(pattern, '>'), parseShortcut);
  32650. shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], {
  32651. func: cmdFunc,
  32652. scope: scope || this.editor
  32653. });
  32654. return Tools.extend(shortcuts[0], {
  32655. desc: this.editor.translate(desc),
  32656. subpatterns: shortcuts.slice(1)
  32657. });
  32658. };
  32659. Shortcuts.prototype.hasModifier = function (e) {
  32660. return e.altKey || e.ctrlKey || e.metaKey;
  32661. };
  32662. Shortcuts.prototype.isFunctionKey = function (e) {
  32663. return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123;
  32664. };
  32665. Shortcuts.prototype.matchShortcut = function (e, shortcut) {
  32666. if (!shortcut) {
  32667. return false;
  32668. }
  32669. if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) {
  32670. return false;
  32671. }
  32672. if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) {
  32673. return false;
  32674. }
  32675. if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) {
  32676. e.preventDefault();
  32677. return true;
  32678. }
  32679. return false;
  32680. };
  32681. Shortcuts.prototype.executeShortcutAction = function (shortcut) {
  32682. return shortcut.func ? shortcut.func.call(shortcut.scope) : null;
  32683. };
  32684. return Shortcuts;
  32685. }();
  32686. var create$3 = function () {
  32687. var buttons = {};
  32688. var menuItems = {};
  32689. var popups = {};
  32690. var icons = {};
  32691. var contextMenus = {};
  32692. var contextToolbars = {};
  32693. var sidebars = {};
  32694. var add = function (collection, type) {
  32695. return function (name, spec) {
  32696. return collection[name.toLowerCase()] = __assign(__assign({}, spec), { type: type });
  32697. };
  32698. };
  32699. var addIcon = function (name, svgData) {
  32700. return icons[name.toLowerCase()] = svgData;
  32701. };
  32702. return {
  32703. addButton: add(buttons, 'button'),
  32704. addGroupToolbarButton: add(buttons, 'grouptoolbarbutton'),
  32705. addToggleButton: add(buttons, 'togglebutton'),
  32706. addMenuButton: add(buttons, 'menubutton'),
  32707. addSplitButton: add(buttons, 'splitbutton'),
  32708. addMenuItem: add(menuItems, 'menuitem'),
  32709. addNestedMenuItem: add(menuItems, 'nestedmenuitem'),
  32710. addToggleMenuItem: add(menuItems, 'togglemenuitem'),
  32711. addAutocompleter: add(popups, 'autocompleter'),
  32712. addContextMenu: add(contextMenus, 'contextmenu'),
  32713. addContextToolbar: add(contextToolbars, 'contexttoolbar'),
  32714. addContextForm: add(contextToolbars, 'contextform'),
  32715. addSidebar: add(sidebars, 'sidebar'),
  32716. addIcon: addIcon,
  32717. getAll: function () {
  32718. return {
  32719. buttons: buttons,
  32720. menuItems: menuItems,
  32721. icons: icons,
  32722. popups: popups,
  32723. contextMenus: contextMenus,
  32724. contextToolbars: contextToolbars,
  32725. sidebars: sidebars
  32726. };
  32727. }
  32728. };
  32729. };
  32730. var registry = function () {
  32731. var bridge = create$3();
  32732. return {
  32733. addAutocompleter: bridge.addAutocompleter,
  32734. addButton: bridge.addButton,
  32735. addContextForm: bridge.addContextForm,
  32736. addContextMenu: bridge.addContextMenu,
  32737. addContextToolbar: bridge.addContextToolbar,
  32738. addIcon: bridge.addIcon,
  32739. addMenuButton: bridge.addMenuButton,
  32740. addMenuItem: bridge.addMenuItem,
  32741. addNestedMenuItem: bridge.addNestedMenuItem,
  32742. addSidebar: bridge.addSidebar,
  32743. addSplitButton: bridge.addSplitButton,
  32744. addToggleButton: bridge.addToggleButton,
  32745. addGroupToolbarButton: bridge.addGroupToolbarButton,
  32746. addToggleMenuItem: bridge.addToggleMenuItem,
  32747. getAll: bridge.getAll
  32748. };
  32749. };
  32750. var DOM$1 = DOMUtils.DOM;
  32751. var extend$3 = Tools.extend, each$2 = Tools.each;
  32752. var resolve = Tools.resolve;
  32753. var ie = Env.ie;
  32754. var Editor = function () {
  32755. function Editor(id, settings, editorManager) {
  32756. var _this = this;
  32757. this.plugins = {};
  32758. this.contentCSS = [];
  32759. this.contentStyles = [];
  32760. this.loadedCSS = {};
  32761. this.isNotDirty = false;
  32762. this.editorManager = editorManager;
  32763. this.documentBaseUrl = editorManager.documentBaseURL;
  32764. extend$3(this, EditorObservable);
  32765. this.settings = getEditorSettings(this, id, this.documentBaseUrl, editorManager.defaultSettings, settings);
  32766. if (this.settings.suffix) {
  32767. editorManager.suffix = this.settings.suffix;
  32768. }
  32769. this.suffix = editorManager.suffix;
  32770. if (this.settings.base_url) {
  32771. editorManager._setBaseUrl(this.settings.base_url);
  32772. }
  32773. this.baseUri = editorManager.baseURI;
  32774. if (this.settings.referrer_policy) {
  32775. ScriptLoader.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy);
  32776. DOMUtils.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy);
  32777. }
  32778. AddOnManager.languageLoad = this.settings.language_load;
  32779. AddOnManager.baseURL = editorManager.baseURL;
  32780. this.id = id;
  32781. this.setDirty(false);
  32782. this.documentBaseURI = new URI(this.settings.document_base_url, { base_uri: this.baseUri });
  32783. this.baseURI = this.baseUri;
  32784. this.inline = !!this.settings.inline;
  32785. this.shortcuts = new Shortcuts(this);
  32786. this.editorCommands = new EditorCommands(this);
  32787. if (this.settings.cache_suffix) {
  32788. Env.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, '');
  32789. }
  32790. this.ui = {
  32791. registry: registry(),
  32792. styleSheetLoader: undefined,
  32793. show: noop,
  32794. hide: noop,
  32795. enable: noop,
  32796. disable: noop,
  32797. isDisabled: never
  32798. };
  32799. var self = this;
  32800. var modeInstance = create$4(self);
  32801. this.mode = modeInstance;
  32802. this.setMode = modeInstance.set;
  32803. editorManager.fire('SetupEditor', { editor: this });
  32804. this.execCallback('setup', this);
  32805. this.$ = DomQuery.overrideDefaults(function () {
  32806. return {
  32807. context: _this.inline ? _this.getBody() : _this.getDoc(),
  32808. element: _this.getBody()
  32809. };
  32810. });
  32811. }
  32812. Editor.prototype.render = function () {
  32813. render(this);
  32814. };
  32815. Editor.prototype.focus = function (skipFocus) {
  32816. this.execCommand('mceFocus', false, skipFocus);
  32817. };
  32818. Editor.prototype.hasFocus = function () {
  32819. return hasFocus(this);
  32820. };
  32821. Editor.prototype.execCallback = function (name) {
  32822. var x = [];
  32823. for (var _i = 1; _i < arguments.length; _i++) {
  32824. x[_i - 1] = arguments[_i];
  32825. }
  32826. var self = this;
  32827. var callback = self.settings[name], scope;
  32828. if (!callback) {
  32829. return;
  32830. }
  32831. if (self.callbackLookup && (scope = self.callbackLookup[name])) {
  32832. callback = scope.func;
  32833. scope = scope.scope;
  32834. }
  32835. if (typeof callback === 'string') {
  32836. scope = callback.replace(/\.\w+$/, '');
  32837. scope = scope ? resolve(scope) : 0;
  32838. callback = resolve(callback);
  32839. self.callbackLookup = self.callbackLookup || {};
  32840. self.callbackLookup[name] = {
  32841. func: callback,
  32842. scope: scope
  32843. };
  32844. }
  32845. return callback.apply(scope || self, x);
  32846. };
  32847. Editor.prototype.translate = function (text) {
  32848. return I18n.translate(text);
  32849. };
  32850. Editor.prototype.getParam = function (name, defaultVal, type) {
  32851. return getParam(this, name, defaultVal, type);
  32852. };
  32853. Editor.prototype.hasPlugin = function (name, loaded) {
  32854. var hasPlugin = contains$3(getPlugins(this).split(/[ ,]/), name);
  32855. if (hasPlugin) {
  32856. return loaded ? PluginManager.get(name) !== undefined : true;
  32857. } else {
  32858. return false;
  32859. }
  32860. };
  32861. Editor.prototype.nodeChanged = function (args) {
  32862. this._nodeChangeDispatcher.nodeChanged(args);
  32863. };
  32864. Editor.prototype.addCommand = function (name, callback, scope) {
  32865. this.editorCommands.addCommand(name, callback, scope);
  32866. };
  32867. Editor.prototype.addQueryStateHandler = function (name, callback, scope) {
  32868. this.editorCommands.addQueryStateHandler(name, callback, scope);
  32869. };
  32870. Editor.prototype.addQueryValueHandler = function (name, callback, scope) {
  32871. this.editorCommands.addQueryValueHandler(name, callback, scope);
  32872. };
  32873. Editor.prototype.addShortcut = function (pattern, desc, cmdFunc, scope) {
  32874. this.shortcuts.add(pattern, desc, cmdFunc, scope);
  32875. };
  32876. Editor.prototype.execCommand = function (cmd, ui, value, args) {
  32877. return this.editorCommands.execCommand(cmd, ui, value, args);
  32878. };
  32879. Editor.prototype.queryCommandState = function (cmd) {
  32880. return this.editorCommands.queryCommandState(cmd);
  32881. };
  32882. Editor.prototype.queryCommandValue = function (cmd) {
  32883. return this.editorCommands.queryCommandValue(cmd);
  32884. };
  32885. Editor.prototype.queryCommandSupported = function (cmd) {
  32886. return this.editorCommands.queryCommandSupported(cmd);
  32887. };
  32888. Editor.prototype.show = function () {
  32889. var self = this;
  32890. if (self.hidden) {
  32891. self.hidden = false;
  32892. if (self.inline) {
  32893. self.getBody().contentEditable = 'true';
  32894. } else {
  32895. DOM$1.show(self.getContainer());
  32896. DOM$1.hide(self.id);
  32897. }
  32898. self.load();
  32899. self.fire('show');
  32900. }
  32901. };
  32902. Editor.prototype.hide = function () {
  32903. var self = this, doc = self.getDoc();
  32904. if (!self.hidden) {
  32905. if (ie && doc && !self.inline) {
  32906. doc.execCommand('SelectAll');
  32907. }
  32908. self.save();
  32909. if (self.inline) {
  32910. self.getBody().contentEditable = 'false';
  32911. if (self === self.editorManager.focusedEditor) {
  32912. self.editorManager.focusedEditor = null;
  32913. }
  32914. } else {
  32915. DOM$1.hide(self.getContainer());
  32916. DOM$1.setStyle(self.id, 'display', self.orgDisplay);
  32917. }
  32918. self.hidden = true;
  32919. self.fire('hide');
  32920. }
  32921. };
  32922. Editor.prototype.isHidden = function () {
  32923. return !!this.hidden;
  32924. };
  32925. Editor.prototype.setProgressState = function (state, time) {
  32926. this.fire('ProgressState', {
  32927. state: state,
  32928. time: time
  32929. });
  32930. };
  32931. Editor.prototype.load = function (args) {
  32932. var self = this;
  32933. var elm = self.getElement(), html;
  32934. if (self.removed) {
  32935. return '';
  32936. }
  32937. if (elm) {
  32938. args = args || {};
  32939. args.load = true;
  32940. var value = isTextareaOrInput(elm) ? elm.value : elm.innerHTML;
  32941. html = self.setContent(value, args);
  32942. args.element = elm;
  32943. if (!args.no_events) {
  32944. self.fire('LoadContent', args);
  32945. }
  32946. args.element = elm = null;
  32947. return html;
  32948. }
  32949. };
  32950. Editor.prototype.save = function (args) {
  32951. var self = this;
  32952. var elm = self.getElement(), html, form;
  32953. if (!elm || !self.initialized || self.removed) {
  32954. return;
  32955. }
  32956. args = args || {};
  32957. args.save = true;
  32958. args.element = elm;
  32959. html = args.content = self.getContent(args);
  32960. if (!args.no_events) {
  32961. self.fire('SaveContent', args);
  32962. }
  32963. if (args.format === 'raw') {
  32964. self.fire('RawSaveContent', args);
  32965. }
  32966. html = args.content;
  32967. if (!isTextareaOrInput(elm)) {
  32968. if (args.is_removing || !self.inline) {
  32969. elm.innerHTML = html;
  32970. }
  32971. if (form = DOM$1.getParent(self.id, 'form')) {
  32972. each$2(form.elements, function (elm) {
  32973. if (elm.name === self.id) {
  32974. elm.value = html;
  32975. return false;
  32976. }
  32977. });
  32978. }
  32979. } else {
  32980. elm.value = html;
  32981. }
  32982. args.element = elm = null;
  32983. if (args.set_dirty !== false) {
  32984. self.setDirty(false);
  32985. }
  32986. return html;
  32987. };
  32988. Editor.prototype.setContent = function (content, args) {
  32989. return setContent(this, content, args);
  32990. };
  32991. Editor.prototype.getContent = function (args) {
  32992. return getContent(this, args);
  32993. };
  32994. Editor.prototype.insertContent = function (content, args) {
  32995. if (args) {
  32996. content = extend$3({ content: content }, args);
  32997. }
  32998. this.execCommand('mceInsertContent', false, content);
  32999. };
  33000. Editor.prototype.resetContent = function (initialContent) {
  33001. if (initialContent === undefined) {
  33002. setContent(this, this.startContent, { format: 'raw' });
  33003. } else {
  33004. setContent(this, initialContent);
  33005. }
  33006. this.undoManager.reset();
  33007. this.setDirty(false);
  33008. this.nodeChanged();
  33009. };
  33010. Editor.prototype.isDirty = function () {
  33011. return !this.isNotDirty;
  33012. };
  33013. Editor.prototype.setDirty = function (state) {
  33014. var oldState = !this.isNotDirty;
  33015. this.isNotDirty = !state;
  33016. if (state && state !== oldState) {
  33017. this.fire('dirty');
  33018. }
  33019. };
  33020. Editor.prototype.getContainer = function () {
  33021. var self = this;
  33022. if (!self.container) {
  33023. self.container = DOM$1.get(self.editorContainer || self.id + '_parent');
  33024. }
  33025. return self.container;
  33026. };
  33027. Editor.prototype.getContentAreaContainer = function () {
  33028. return this.contentAreaContainer;
  33029. };
  33030. Editor.prototype.getElement = function () {
  33031. if (!this.targetElm) {
  33032. this.targetElm = DOM$1.get(this.id);
  33033. }
  33034. return this.targetElm;
  33035. };
  33036. Editor.prototype.getWin = function () {
  33037. var self = this;
  33038. var elm;
  33039. if (!self.contentWindow) {
  33040. elm = self.iframeElement;
  33041. if (elm) {
  33042. self.contentWindow = elm.contentWindow;
  33043. }
  33044. }
  33045. return self.contentWindow;
  33046. };
  33047. Editor.prototype.getDoc = function () {
  33048. var self = this;
  33049. var win;
  33050. if (!self.contentDocument) {
  33051. win = self.getWin();
  33052. if (win) {
  33053. self.contentDocument = win.document;
  33054. }
  33055. }
  33056. return self.contentDocument;
  33057. };
  33058. Editor.prototype.getBody = function () {
  33059. var doc = this.getDoc();
  33060. return this.bodyElement || (doc ? doc.body : null);
  33061. };
  33062. Editor.prototype.convertURL = function (url, name, elm) {
  33063. var self = this, settings = self.settings;
  33064. if (settings.urlconverter_callback) {
  33065. return self.execCallback('urlconverter_callback', url, elm, true, name);
  33066. }
  33067. if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) {
  33068. return url;
  33069. }
  33070. if (settings.relative_urls) {
  33071. return self.documentBaseURI.toRelative(url);
  33072. }
  33073. url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
  33074. return url;
  33075. };
  33076. Editor.prototype.addVisual = function (elm) {
  33077. addVisual(this, elm);
  33078. };
  33079. Editor.prototype.remove = function () {
  33080. remove(this);
  33081. };
  33082. Editor.prototype.destroy = function (automatic) {
  33083. destroy(this, automatic);
  33084. };
  33085. Editor.prototype.uploadImages = function (callback) {
  33086. return this.editorUpload.uploadImages(callback);
  33087. };
  33088. Editor.prototype._scanForImages = function () {
  33089. return this.editorUpload.scanForImages();
  33090. };
  33091. Editor.prototype.addButton = function () {
  33092. throw new Error('editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead');
  33093. };
  33094. Editor.prototype.addSidebar = function () {
  33095. throw new Error('editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead');
  33096. };
  33097. Editor.prototype.addMenuItem = function () {
  33098. throw new Error('editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead');
  33099. };
  33100. Editor.prototype.addContextToolbar = function () {
  33101. throw new Error('editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead');
  33102. };
  33103. return Editor;
  33104. }();
  33105. var DOM = DOMUtils.DOM;
  33106. var explode = Tools.explode, each$1 = Tools.each, extend$2 = Tools.extend;
  33107. var instanceCounter = 0, boundGlobalEvents = false;
  33108. var beforeUnloadDelegate;
  33109. var legacyEditors = [];
  33110. var editors = [];
  33111. var isValidLegacyKey = function (id) {
  33112. return id !== 'length';
  33113. };
  33114. var globalEventDelegate = function (e) {
  33115. var type = e.type;
  33116. each$1(EditorManager.get(), function (editor) {
  33117. switch (type) {
  33118. case 'scroll':
  33119. editor.fire('ScrollWindow', e);
  33120. break;
  33121. case 'resize':
  33122. editor.fire('ResizeWindow', e);
  33123. break;
  33124. }
  33125. });
  33126. };
  33127. var toggleGlobalEvents = function (state) {
  33128. if (state !== boundGlobalEvents) {
  33129. if (state) {
  33130. DomQuery(window).on('resize scroll', globalEventDelegate);
  33131. } else {
  33132. DomQuery(window).off('resize scroll', globalEventDelegate);
  33133. }
  33134. boundGlobalEvents = state;
  33135. }
  33136. };
  33137. var removeEditorFromList = function (targetEditor) {
  33138. var oldEditors = editors;
  33139. delete legacyEditors[targetEditor.id];
  33140. for (var i = 0; i < legacyEditors.length; i++) {
  33141. if (legacyEditors[i] === targetEditor) {
  33142. legacyEditors.splice(i, 1);
  33143. break;
  33144. }
  33145. }
  33146. editors = filter$4(editors, function (editor) {
  33147. return targetEditor !== editor;
  33148. });
  33149. if (EditorManager.activeEditor === targetEditor) {
  33150. EditorManager.activeEditor = editors.length > 0 ? editors[0] : null;
  33151. }
  33152. if (EditorManager.focusedEditor === targetEditor) {
  33153. EditorManager.focusedEditor = null;
  33154. }
  33155. return oldEditors.length !== editors.length;
  33156. };
  33157. var purgeDestroyedEditor = function (editor) {
  33158. if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) {
  33159. removeEditorFromList(editor);
  33160. editor.unbindAllNativeEvents();
  33161. editor.destroy(true);
  33162. editor.removed = true;
  33163. editor = null;
  33164. }
  33165. return editor;
  33166. };
  33167. var isQuirksMode = document.compatMode !== 'CSS1Compat';
  33168. var EditorManager = __assign(__assign({}, Observable), {
  33169. baseURI: null,
  33170. baseURL: null,
  33171. defaultSettings: {},
  33172. documentBaseURL: null,
  33173. suffix: null,
  33174. $: DomQuery,
  33175. majorVersion: '5',
  33176. minorVersion: '10.3',
  33177. releaseDate: '2022-02-09',
  33178. editors: legacyEditors,
  33179. i18n: I18n,
  33180. activeEditor: null,
  33181. focusedEditor: null,
  33182. settings: {},
  33183. setup: function () {
  33184. var self = this;
  33185. var baseURL, documentBaseURL, suffix = '';
  33186. documentBaseURL = URI.getDocumentBaseUrl(document.location);
  33187. if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
  33188. documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
  33189. if (!/[\/\\]$/.test(documentBaseURL)) {
  33190. documentBaseURL += '/';
  33191. }
  33192. }
  33193. var preInit = window.tinymce || window.tinyMCEPreInit;
  33194. if (preInit) {
  33195. baseURL = preInit.base || preInit.baseURL;
  33196. suffix = preInit.suffix;
  33197. } else {
  33198. var scripts = document.getElementsByTagName('script');
  33199. for (var i = 0; i < scripts.length; i++) {
  33200. var src = scripts[i].src || '';
  33201. if (src === '') {
  33202. continue;
  33203. }
  33204. var srcScript = src.substring(src.lastIndexOf('/'));
  33205. if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
  33206. if (srcScript.indexOf('.min') !== -1) {
  33207. suffix = '.min';
  33208. }
  33209. baseURL = src.substring(0, src.lastIndexOf('/'));
  33210. break;
  33211. }
  33212. }
  33213. if (!baseURL && document.currentScript) {
  33214. var src = document.currentScript.src;
  33215. if (src.indexOf('.min') !== -1) {
  33216. suffix = '.min';
  33217. }
  33218. baseURL = src.substring(0, src.lastIndexOf('/'));
  33219. }
  33220. }
  33221. self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
  33222. self.documentBaseURL = documentBaseURL;
  33223. self.baseURI = new URI(self.baseURL);
  33224. self.suffix = suffix;
  33225. setup$l(self);
  33226. },
  33227. overrideDefaults: function (defaultSettings) {
  33228. var baseUrl = defaultSettings.base_url;
  33229. if (baseUrl) {
  33230. this._setBaseUrl(baseUrl);
  33231. }
  33232. var suffix = defaultSettings.suffix;
  33233. if (defaultSettings.suffix) {
  33234. this.suffix = suffix;
  33235. }
  33236. this.defaultSettings = defaultSettings;
  33237. var pluginBaseUrls = defaultSettings.plugin_base_urls;
  33238. if (pluginBaseUrls !== undefined) {
  33239. each$j(pluginBaseUrls, function (pluginBaseUrl, pluginName) {
  33240. AddOnManager.PluginManager.urls[pluginName] = pluginBaseUrl;
  33241. });
  33242. }
  33243. },
  33244. init: function (settings) {
  33245. var self = this;
  33246. var result;
  33247. var invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu', ' ');
  33248. var isInvalidInlineTarget = function (settings, elm) {
  33249. return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets;
  33250. };
  33251. var createId = function (elm) {
  33252. var id = elm.id;
  33253. if (!id) {
  33254. id = get$9(elm, 'name').filter(function (name) {
  33255. return !DOM.get(name);
  33256. }).getOrThunk(DOM.uniqueId);
  33257. elm.setAttribute('id', id);
  33258. }
  33259. return id;
  33260. };
  33261. var execCallback = function (name) {
  33262. var callback = settings[name];
  33263. if (!callback) {
  33264. return;
  33265. }
  33266. return callback.apply(self, []);
  33267. };
  33268. var hasClass = function (elm, className) {
  33269. return className.constructor === RegExp ? className.test(elm.className) : DOM.hasClass(elm, className);
  33270. };
  33271. var findTargets = function (settings) {
  33272. var targets = [];
  33273. if (Env.browser.isIE() && Env.browser.version.major < 11) {
  33274. initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/');
  33275. return [];
  33276. } else if (isQuirksMode) {
  33277. initError('Failed to initialize the editor as the document is not in standards mode. ' + 'TinyMCE requires standards mode.');
  33278. return [];
  33279. }
  33280. if (settings.types) {
  33281. each$1(settings.types, function (type) {
  33282. targets = targets.concat(DOM.select(type.selector));
  33283. });
  33284. return targets;
  33285. } else if (settings.selector) {
  33286. return DOM.select(settings.selector);
  33287. } else if (settings.target) {
  33288. return [settings.target];
  33289. }
  33290. switch (settings.mode) {
  33291. case 'exact':
  33292. var l = settings.elements || '';
  33293. if (l.length > 0) {
  33294. each$1(explode(l), function (id) {
  33295. var elm = DOM.get(id);
  33296. if (elm) {
  33297. targets.push(elm);
  33298. } else {
  33299. each$1(document.forms, function (f) {
  33300. each$1(f.elements, function (e) {
  33301. if (e.name === id) {
  33302. id = 'mce_editor_' + instanceCounter++;
  33303. DOM.setAttrib(e, 'id', id);
  33304. targets.push(e);
  33305. }
  33306. });
  33307. });
  33308. }
  33309. });
  33310. }
  33311. break;
  33312. case 'textareas':
  33313. case 'specific_textareas':
  33314. each$1(DOM.select('textarea'), function (elm) {
  33315. if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
  33316. return;
  33317. }
  33318. if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
  33319. targets.push(elm);
  33320. }
  33321. });
  33322. break;
  33323. }
  33324. return targets;
  33325. };
  33326. var provideResults = function (editors) {
  33327. result = editors;
  33328. };
  33329. var initEditors = function () {
  33330. var initCount = 0;
  33331. var editors = [];
  33332. var targets;
  33333. var createEditor = function (id, settings, targetElm) {
  33334. var editor = new Editor(id, settings, self);
  33335. editors.push(editor);
  33336. editor.on('init', function () {
  33337. if (++initCount === targets.length) {
  33338. provideResults(editors);
  33339. }
  33340. });
  33341. editor.targetElm = editor.targetElm || targetElm;
  33342. editor.render();
  33343. };
  33344. DOM.unbind(window, 'ready', initEditors);
  33345. execCallback('onpageload');
  33346. targets = DomQuery.unique(findTargets(settings));
  33347. if (settings.types) {
  33348. each$1(settings.types, function (type) {
  33349. Tools.each(targets, function (elm) {
  33350. if (DOM.is(elm, type.selector)) {
  33351. createEditor(createId(elm), extend$2({}, settings, type), elm);
  33352. return false;
  33353. }
  33354. return true;
  33355. });
  33356. });
  33357. return;
  33358. }
  33359. Tools.each(targets, function (elm) {
  33360. purgeDestroyedEditor(self.get(elm.id));
  33361. });
  33362. targets = Tools.grep(targets, function (elm) {
  33363. return !self.get(elm.id);
  33364. });
  33365. if (targets.length === 0) {
  33366. provideResults([]);
  33367. } else {
  33368. each$1(targets, function (elm) {
  33369. if (isInvalidInlineTarget(settings, elm)) {
  33370. initError('Could not initialize inline editor on invalid inline target element', elm);
  33371. } else {
  33372. createEditor(createId(elm), settings, elm);
  33373. }
  33374. });
  33375. }
  33376. };
  33377. self.settings = settings;
  33378. DOM.bind(window, 'ready', initEditors);
  33379. return new promiseObj(function (resolve) {
  33380. if (result) {
  33381. resolve(result);
  33382. } else {
  33383. provideResults = function (editors) {
  33384. resolve(editors);
  33385. };
  33386. }
  33387. });
  33388. },
  33389. get: function (id) {
  33390. if (arguments.length === 0) {
  33391. return editors.slice(0);
  33392. } else if (isString$1(id)) {
  33393. return find$3(editors, function (editor) {
  33394. return editor.id === id;
  33395. }).getOr(null);
  33396. } else if (isNumber(id)) {
  33397. return editors[id] ? editors[id] : null;
  33398. } else {
  33399. return null;
  33400. }
  33401. },
  33402. add: function (editor) {
  33403. var self = this;
  33404. var existingEditor = legacyEditors[editor.id];
  33405. if (existingEditor === editor) {
  33406. return editor;
  33407. }
  33408. if (self.get(editor.id) === null) {
  33409. if (isValidLegacyKey(editor.id)) {
  33410. legacyEditors[editor.id] = editor;
  33411. }
  33412. legacyEditors.push(editor);
  33413. editors.push(editor);
  33414. }
  33415. toggleGlobalEvents(true);
  33416. self.activeEditor = editor;
  33417. self.fire('AddEditor', { editor: editor });
  33418. if (!beforeUnloadDelegate) {
  33419. beforeUnloadDelegate = function (e) {
  33420. var event = self.fire('BeforeUnload');
  33421. if (event.returnValue) {
  33422. e.preventDefault();
  33423. e.returnValue = event.returnValue;
  33424. return event.returnValue;
  33425. }
  33426. };
  33427. window.addEventListener('beforeunload', beforeUnloadDelegate);
  33428. }
  33429. return editor;
  33430. },
  33431. createEditor: function (id, settings) {
  33432. return this.add(new Editor(id, settings, this));
  33433. },
  33434. remove: function (selector) {
  33435. var self = this;
  33436. var i, editor;
  33437. if (!selector) {
  33438. for (i = editors.length - 1; i >= 0; i--) {
  33439. self.remove(editors[i]);
  33440. }
  33441. return;
  33442. }
  33443. if (isString$1(selector)) {
  33444. each$1(DOM.select(selector), function (elm) {
  33445. editor = self.get(elm.id);
  33446. if (editor) {
  33447. self.remove(editor);
  33448. }
  33449. });
  33450. return;
  33451. }
  33452. editor = selector;
  33453. if (isNull(self.get(editor.id))) {
  33454. return null;
  33455. }
  33456. if (removeEditorFromList(editor)) {
  33457. self.fire('RemoveEditor', { editor: editor });
  33458. }
  33459. if (editors.length === 0) {
  33460. window.removeEventListener('beforeunload', beforeUnloadDelegate);
  33461. }
  33462. editor.remove();
  33463. toggleGlobalEvents(editors.length > 0);
  33464. return editor;
  33465. },
  33466. execCommand: function (cmd, ui, value) {
  33467. var self = this, editor = self.get(value);
  33468. switch (cmd) {
  33469. case 'mceAddEditor':
  33470. if (!self.get(value)) {
  33471. new Editor(value, self.settings, self).render();
  33472. }
  33473. return true;
  33474. case 'mceRemoveEditor':
  33475. if (editor) {
  33476. editor.remove();
  33477. }
  33478. return true;
  33479. case 'mceToggleEditor':
  33480. if (!editor) {
  33481. self.execCommand('mceAddEditor', false, value);
  33482. return true;
  33483. }
  33484. if (editor.isHidden()) {
  33485. editor.show();
  33486. } else {
  33487. editor.hide();
  33488. }
  33489. return true;
  33490. }
  33491. if (self.activeEditor) {
  33492. return self.activeEditor.execCommand(cmd, ui, value);
  33493. }
  33494. return false;
  33495. },
  33496. triggerSave: function () {
  33497. each$1(editors, function (editor) {
  33498. editor.save();
  33499. });
  33500. },
  33501. addI18n: function (code, items) {
  33502. I18n.add(code, items);
  33503. },
  33504. translate: function (text) {
  33505. return I18n.translate(text);
  33506. },
  33507. setActive: function (editor) {
  33508. var activeEditor = this.activeEditor;
  33509. if (this.activeEditor !== editor) {
  33510. if (activeEditor) {
  33511. activeEditor.fire('deactivate', { relatedTarget: editor });
  33512. }
  33513. editor.fire('activate', { relatedTarget: activeEditor });
  33514. }
  33515. this.activeEditor = editor;
  33516. },
  33517. _setBaseUrl: function (baseUrl) {
  33518. this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
  33519. this.baseURI = new URI(this.baseURL);
  33520. }
  33521. });
  33522. EditorManager.setup();
  33523. var min$1 = Math.min, max$1 = Math.max, round$1 = Math.round;
  33524. var relativePosition = function (rect, targetRect, rel) {
  33525. var x = targetRect.x;
  33526. var y = targetRect.y;
  33527. var w = rect.w;
  33528. var h = rect.h;
  33529. var targetW = targetRect.w;
  33530. var targetH = targetRect.h;
  33531. var relChars = (rel || '').split('');
  33532. if (relChars[0] === 'b') {
  33533. y += targetH;
  33534. }
  33535. if (relChars[1] === 'r') {
  33536. x += targetW;
  33537. }
  33538. if (relChars[0] === 'c') {
  33539. y += round$1(targetH / 2);
  33540. }
  33541. if (relChars[1] === 'c') {
  33542. x += round$1(targetW / 2);
  33543. }
  33544. if (relChars[3] === 'b') {
  33545. y -= h;
  33546. }
  33547. if (relChars[4] === 'r') {
  33548. x -= w;
  33549. }
  33550. if (relChars[3] === 'c') {
  33551. y -= round$1(h / 2);
  33552. }
  33553. if (relChars[4] === 'c') {
  33554. x -= round$1(w / 2);
  33555. }
  33556. return create$2(x, y, w, h);
  33557. };
  33558. var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
  33559. var pos, i;
  33560. for (i = 0; i < rels.length; i++) {
  33561. pos = relativePosition(rect, targetRect, rels[i]);
  33562. if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) {
  33563. return rels[i];
  33564. }
  33565. }
  33566. return null;
  33567. };
  33568. var inflate = function (rect, w, h) {
  33569. return create$2(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
  33570. };
  33571. var intersect = function (rect, cropRect) {
  33572. var x1 = max$1(rect.x, cropRect.x);
  33573. var y1 = max$1(rect.y, cropRect.y);
  33574. var x2 = min$1(rect.x + rect.w, cropRect.x + cropRect.w);
  33575. var y2 = min$1(rect.y + rect.h, cropRect.y + cropRect.h);
  33576. if (x2 - x1 < 0 || y2 - y1 < 0) {
  33577. return null;
  33578. }
  33579. return create$2(x1, y1, x2 - x1, y2 - y1);
  33580. };
  33581. var clamp = function (rect, clampRect, fixedSize) {
  33582. var x1 = rect.x;
  33583. var y1 = rect.y;
  33584. var x2 = rect.x + rect.w;
  33585. var y2 = rect.y + rect.h;
  33586. var cx2 = clampRect.x + clampRect.w;
  33587. var cy2 = clampRect.y + clampRect.h;
  33588. var underflowX1 = max$1(0, clampRect.x - x1);
  33589. var underflowY1 = max$1(0, clampRect.y - y1);
  33590. var overflowX2 = max$1(0, x2 - cx2);
  33591. var overflowY2 = max$1(0, y2 - cy2);
  33592. x1 += underflowX1;
  33593. y1 += underflowY1;
  33594. if (fixedSize) {
  33595. x2 += underflowX1;
  33596. y2 += underflowY1;
  33597. x1 -= overflowX2;
  33598. y1 -= overflowY2;
  33599. }
  33600. x2 -= overflowX2;
  33601. y2 -= overflowY2;
  33602. return create$2(x1, y1, x2 - x1, y2 - y1);
  33603. };
  33604. var create$2 = function (x, y, w, h) {
  33605. return {
  33606. x: x,
  33607. y: y,
  33608. w: w,
  33609. h: h
  33610. };
  33611. };
  33612. var fromClientRect = function (clientRect) {
  33613. return create$2(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
  33614. };
  33615. var Rect = {
  33616. inflate: inflate,
  33617. relativePosition: relativePosition,
  33618. findBestRelativePosition: findBestRelativePosition,
  33619. intersect: intersect,
  33620. clamp: clamp,
  33621. create: create$2,
  33622. fromClientRect: fromClientRect
  33623. };
  33624. var awaiter = function (resolveCb, rejectCb, timeout) {
  33625. if (timeout === void 0) {
  33626. timeout = 1000;
  33627. }
  33628. var done = false;
  33629. var timer = null;
  33630. var complete = function (completer) {
  33631. return function () {
  33632. var args = [];
  33633. for (var _i = 0; _i < arguments.length; _i++) {
  33634. args[_i] = arguments[_i];
  33635. }
  33636. if (!done) {
  33637. done = true;
  33638. if (timer !== null) {
  33639. clearTimeout(timer);
  33640. timer = null;
  33641. }
  33642. completer.apply(null, args);
  33643. }
  33644. };
  33645. };
  33646. var resolve = complete(resolveCb);
  33647. var reject = complete(rejectCb);
  33648. var start = function () {
  33649. var args = [];
  33650. for (var _i = 0; _i < arguments.length; _i++) {
  33651. args[_i] = arguments[_i];
  33652. }
  33653. if (!done && timer === null) {
  33654. timer = setTimeout(function () {
  33655. return reject.apply(null, args);
  33656. }, timeout);
  33657. }
  33658. };
  33659. return {
  33660. start: start,
  33661. resolve: resolve,
  33662. reject: reject
  33663. };
  33664. };
  33665. var create$1 = function () {
  33666. var tasks = {};
  33667. var resultFns = {};
  33668. var load = function (id, url) {
  33669. var loadErrMsg = 'Script at URL "' + url + '" failed to load';
  33670. var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second';
  33671. if (tasks[id] !== undefined) {
  33672. return tasks[id];
  33673. } else {
  33674. var task = new promiseObj(function (resolve, reject) {
  33675. var waiter = awaiter(resolve, reject);
  33676. resultFns[id] = waiter.resolve;
  33677. ScriptLoader.ScriptLoader.loadScript(url, function () {
  33678. return waiter.start(runErrMsg);
  33679. }, function () {
  33680. return waiter.reject(loadErrMsg);
  33681. });
  33682. });
  33683. tasks[id] = task;
  33684. return task;
  33685. }
  33686. };
  33687. var add = function (id, data) {
  33688. if (resultFns[id] !== undefined) {
  33689. resultFns[id](data);
  33690. delete resultFns[id];
  33691. }
  33692. tasks[id] = promiseObj.resolve(data);
  33693. };
  33694. return {
  33695. load: load,
  33696. add: add
  33697. };
  33698. };
  33699. var Resource = create$1();
  33700. var each = Tools.each, extend$1 = Tools.extend;
  33701. var extendClass, initializing;
  33702. var Class = function () {
  33703. };
  33704. Class.extend = extendClass = function (props) {
  33705. var self = this;
  33706. var _super = self.prototype;
  33707. var Class = function () {
  33708. var i, mixins, mixin;
  33709. var self = this;
  33710. if (!initializing) {
  33711. if (self.init) {
  33712. self.init.apply(self, arguments);
  33713. }
  33714. mixins = self.Mixins;
  33715. if (mixins) {
  33716. i = mixins.length;
  33717. while (i--) {
  33718. mixin = mixins[i];
  33719. if (mixin.init) {
  33720. mixin.init.apply(self, arguments);
  33721. }
  33722. }
  33723. }
  33724. }
  33725. };
  33726. var dummy = function () {
  33727. return this;
  33728. };
  33729. var createMethod = function (name, fn) {
  33730. return function () {
  33731. var self = this;
  33732. var tmp = self._super;
  33733. self._super = _super[name];
  33734. var ret = fn.apply(self, arguments);
  33735. self._super = tmp;
  33736. return ret;
  33737. };
  33738. };
  33739. initializing = true;
  33740. var prototype = new self();
  33741. initializing = false;
  33742. if (props.Mixins) {
  33743. each(props.Mixins, function (mixin) {
  33744. for (var name_1 in mixin) {
  33745. if (name_1 !== 'init') {
  33746. props[name_1] = mixin[name_1];
  33747. }
  33748. }
  33749. });
  33750. if (_super.Mixins) {
  33751. props.Mixins = _super.Mixins.concat(props.Mixins);
  33752. }
  33753. }
  33754. if (props.Methods) {
  33755. each(props.Methods.split(','), function (name) {
  33756. props[name] = dummy;
  33757. });
  33758. }
  33759. if (props.Properties) {
  33760. each(props.Properties.split(','), function (name) {
  33761. var fieldName = '_' + name;
  33762. props[name] = function (value) {
  33763. var self = this;
  33764. if (value !== undefined) {
  33765. self[fieldName] = value;
  33766. return self;
  33767. }
  33768. return self[fieldName];
  33769. };
  33770. });
  33771. }
  33772. if (props.Statics) {
  33773. each(props.Statics, function (func, name) {
  33774. Class[name] = func;
  33775. });
  33776. }
  33777. if (props.Defaults && _super.Defaults) {
  33778. props.Defaults = extend$1({}, _super.Defaults, props.Defaults);
  33779. }
  33780. each$j(props, function (member, name) {
  33781. if (typeof member === 'function' && _super[name]) {
  33782. prototype[name] = createMethod(name, member);
  33783. } else {
  33784. prototype[name] = member;
  33785. }
  33786. });
  33787. Class.prototype = prototype;
  33788. Class.constructor = Class;
  33789. Class.extend = extendClass;
  33790. return Class;
  33791. };
  33792. var min = Math.min, max = Math.max, round = Math.round;
  33793. var Color = function (value) {
  33794. var self = {};
  33795. var r = 0, g = 0, b = 0;
  33796. var rgb2hsv = function (r, g, b) {
  33797. var h, s, v;
  33798. h = 0;
  33799. s = 0;
  33800. v = 0;
  33801. r = r / 255;
  33802. g = g / 255;
  33803. b = b / 255;
  33804. var minRGB = min(r, min(g, b));
  33805. var maxRGB = max(r, max(g, b));
  33806. if (minRGB === maxRGB) {
  33807. v = minRGB;
  33808. return {
  33809. h: 0,
  33810. s: 0,
  33811. v: v * 100
  33812. };
  33813. }
  33814. var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r;
  33815. h = r === minRGB ? 3 : b === minRGB ? 1 : 5;
  33816. h = 60 * (h - d / (maxRGB - minRGB));
  33817. s = (maxRGB - minRGB) / maxRGB;
  33818. v = maxRGB;
  33819. return {
  33820. h: round(h),
  33821. s: round(s * 100),
  33822. v: round(v * 100)
  33823. };
  33824. };
  33825. var hsvToRgb = function (hue, saturation, brightness) {
  33826. hue = (parseInt(hue, 10) || 0) % 360;
  33827. saturation = parseInt(saturation, 10) / 100;
  33828. brightness = parseInt(brightness, 10) / 100;
  33829. saturation = max(0, min(saturation, 1));
  33830. brightness = max(0, min(brightness, 1));
  33831. if (saturation === 0) {
  33832. r = g = b = round(255 * brightness);
  33833. return;
  33834. }
  33835. var side = hue / 60;
  33836. var chroma = brightness * saturation;
  33837. var x = chroma * (1 - Math.abs(side % 2 - 1));
  33838. var match = brightness - chroma;
  33839. switch (Math.floor(side)) {
  33840. case 0:
  33841. r = chroma;
  33842. g = x;
  33843. b = 0;
  33844. break;
  33845. case 1:
  33846. r = x;
  33847. g = chroma;
  33848. b = 0;
  33849. break;
  33850. case 2:
  33851. r = 0;
  33852. g = chroma;
  33853. b = x;
  33854. break;
  33855. case 3:
  33856. r = 0;
  33857. g = x;
  33858. b = chroma;
  33859. break;
  33860. case 4:
  33861. r = x;
  33862. g = 0;
  33863. b = chroma;
  33864. break;
  33865. case 5:
  33866. r = chroma;
  33867. g = 0;
  33868. b = x;
  33869. break;
  33870. default:
  33871. r = g = b = 0;
  33872. }
  33873. r = round(255 * (r + match));
  33874. g = round(255 * (g + match));
  33875. b = round(255 * (b + match));
  33876. };
  33877. var toHex = function () {
  33878. var hex = function (val) {
  33879. val = parseInt(val, 10).toString(16);
  33880. return val.length > 1 ? val : '0' + val;
  33881. };
  33882. return '#' + hex(r) + hex(g) + hex(b);
  33883. };
  33884. var toRgb = function () {
  33885. return {
  33886. r: r,
  33887. g: g,
  33888. b: b
  33889. };
  33890. };
  33891. var toHsv = function () {
  33892. return rgb2hsv(r, g, b);
  33893. };
  33894. var parse = function (value) {
  33895. var matches;
  33896. if (typeof value === 'object') {
  33897. if ('r' in value) {
  33898. r = value.r;
  33899. g = value.g;
  33900. b = value.b;
  33901. } else if ('v' in value) {
  33902. hsvToRgb(value.h, value.s, value.v);
  33903. }
  33904. } else {
  33905. if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) {
  33906. r = parseInt(matches[1], 10);
  33907. g = parseInt(matches[2], 10);
  33908. b = parseInt(matches[3], 10);
  33909. } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) {
  33910. r = parseInt(matches[1], 16);
  33911. g = parseInt(matches[2], 16);
  33912. b = parseInt(matches[3], 16);
  33913. } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) {
  33914. r = parseInt(matches[1] + matches[1], 16);
  33915. g = parseInt(matches[2] + matches[2], 16);
  33916. b = parseInt(matches[3] + matches[3], 16);
  33917. }
  33918. }
  33919. r = r < 0 ? 0 : r > 255 ? 255 : r;
  33920. g = g < 0 ? 0 : g > 255 ? 255 : g;
  33921. b = b < 0 ? 0 : b > 255 ? 255 : b;
  33922. return self;
  33923. };
  33924. if (value) {
  33925. parse(value);
  33926. }
  33927. self.toRgb = toRgb;
  33928. self.toHsv = toHsv;
  33929. self.toHex = toHex;
  33930. self.parse = parse;
  33931. return self;
  33932. };
  33933. var serialize = function (obj) {
  33934. var data = JSON.stringify(obj);
  33935. if (!isString$1(data)) {
  33936. return data;
  33937. }
  33938. return data.replace(/[\u0080-\uFFFF]/g, function (match) {
  33939. var hexCode = match.charCodeAt(0).toString(16);
  33940. return '\\u' + '0000'.substring(hexCode.length) + hexCode;
  33941. });
  33942. };
  33943. var JSONUtils = {
  33944. serialize: serialize,
  33945. parse: function (text) {
  33946. try {
  33947. return JSON.parse(text);
  33948. } catch (ex) {
  33949. }
  33950. }
  33951. };
  33952. var JSONP = {
  33953. callbacks: {},
  33954. count: 0,
  33955. send: function (settings) {
  33956. var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count;
  33957. var id = 'tinymce_jsonp_' + count;
  33958. self.callbacks[count] = function (json) {
  33959. dom.remove(id);
  33960. delete self.callbacks[count];
  33961. settings.callback(json);
  33962. };
  33963. dom.add(dom.doc.body, 'script', {
  33964. id: id,
  33965. src: settings.url,
  33966. type: 'text/javascript'
  33967. });
  33968. self.count++;
  33969. }
  33970. };
  33971. var XHR = __assign(__assign({}, Observable), {
  33972. send: function (settings) {
  33973. var xhr, count = 0;
  33974. var ready = function () {
  33975. if (!settings.async || xhr.readyState === 4 || count++ > 10000) {
  33976. if (settings.success && count < 10000 && xhr.status === 200) {
  33977. settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
  33978. } else if (settings.error) {
  33979. settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
  33980. }
  33981. xhr = null;
  33982. } else {
  33983. Delay.setTimeout(ready, 10);
  33984. }
  33985. };
  33986. settings.scope = settings.scope || this;
  33987. settings.success_scope = settings.success_scope || settings.scope;
  33988. settings.error_scope = settings.error_scope || settings.scope;
  33989. settings.async = settings.async !== false;
  33990. settings.data = settings.data || '';
  33991. XHR.fire('beforeInitialize', { settings: settings });
  33992. xhr = new XMLHttpRequest();
  33993. if (xhr.overrideMimeType) {
  33994. xhr.overrideMimeType(settings.content_type);
  33995. }
  33996. xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
  33997. if (settings.crossDomain) {
  33998. xhr.withCredentials = true;
  33999. }
  34000. if (settings.content_type) {
  34001. xhr.setRequestHeader('Content-Type', settings.content_type);
  34002. }
  34003. if (settings.requestheaders) {
  34004. Tools.each(settings.requestheaders, function (header) {
  34005. xhr.setRequestHeader(header.key, header.value);
  34006. });
  34007. }
  34008. xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  34009. xhr = XHR.fire('beforeSend', {
  34010. xhr: xhr,
  34011. settings: settings
  34012. }).xhr;
  34013. xhr.send(settings.data);
  34014. if (!settings.async) {
  34015. return ready();
  34016. }
  34017. Delay.setTimeout(ready, 10);
  34018. }
  34019. });
  34020. var extend = Tools.extend;
  34021. var JSONRequest = function () {
  34022. function JSONRequest(settings) {
  34023. this.settings = extend({}, settings);
  34024. this.count = 0;
  34025. }
  34026. JSONRequest.sendRPC = function (o) {
  34027. return new JSONRequest().send(o);
  34028. };
  34029. JSONRequest.prototype.send = function (args) {
  34030. var ecb = args.error, scb = args.success;
  34031. var xhrArgs = extend(this.settings, args);
  34032. xhrArgs.success = function (c, x) {
  34033. c = JSONUtils.parse(c);
  34034. if (typeof c === 'undefined') {
  34035. c = { error: 'JSON Parse error.' };
  34036. }
  34037. if (c.error) {
  34038. ecb.call(xhrArgs.error_scope || xhrArgs.scope, c.error, x);
  34039. } else {
  34040. scb.call(xhrArgs.success_scope || xhrArgs.scope, c.result);
  34041. }
  34042. };
  34043. xhrArgs.error = function (ty, x) {
  34044. if (ecb) {
  34045. ecb.call(xhrArgs.error_scope || xhrArgs.scope, ty, x);
  34046. }
  34047. };
  34048. xhrArgs.data = JSONUtils.serialize({
  34049. id: args.id || 'c' + this.count++,
  34050. method: args.method,
  34051. params: args.params
  34052. });
  34053. xhrArgs.content_type = 'application/json';
  34054. XHR.send(xhrArgs);
  34055. };
  34056. return JSONRequest;
  34057. }();
  34058. var create = function () {
  34059. return function () {
  34060. var data = {};
  34061. var keys = [];
  34062. var storage = {
  34063. getItem: function (key) {
  34064. var item = data[key];
  34065. return item ? item : null;
  34066. },
  34067. setItem: function (key, value) {
  34068. keys.push(key);
  34069. data[key] = String(value);
  34070. },
  34071. key: function (index) {
  34072. return keys[index];
  34073. },
  34074. removeItem: function (key) {
  34075. keys = keys.filter(function (k) {
  34076. return k === key;
  34077. });
  34078. delete data[key];
  34079. },
  34080. clear: function () {
  34081. keys = [];
  34082. data = {};
  34083. },
  34084. length: 0
  34085. };
  34086. Object.defineProperty(storage, 'length', {
  34087. get: function () {
  34088. return keys.length;
  34089. },
  34090. configurable: false,
  34091. enumerable: false
  34092. });
  34093. return storage;
  34094. }();
  34095. };
  34096. var localStorage;
  34097. try {
  34098. var test = '__storage_test__';
  34099. localStorage = window.localStorage;
  34100. localStorage.setItem(test, test);
  34101. localStorage.removeItem(test);
  34102. } catch (e) {
  34103. localStorage = create();
  34104. }
  34105. var LocalStorage = localStorage;
  34106. var publicApi = {
  34107. geom: { Rect: Rect },
  34108. util: {
  34109. Promise: promiseObj,
  34110. Delay: Delay,
  34111. Tools: Tools,
  34112. VK: VK,
  34113. URI: URI,
  34114. Class: Class,
  34115. EventDispatcher: EventDispatcher,
  34116. Observable: Observable,
  34117. I18n: I18n,
  34118. XHR: XHR,
  34119. JSON: JSONUtils,
  34120. JSONRequest: JSONRequest,
  34121. JSONP: JSONP,
  34122. LocalStorage: LocalStorage,
  34123. Color: Color,
  34124. ImageUploader: ImageUploader
  34125. },
  34126. dom: {
  34127. EventUtils: EventUtils,
  34128. Sizzle: Sizzle,
  34129. DomQuery: DomQuery,
  34130. TreeWalker: DomTreeWalker,
  34131. TextSeeker: TextSeeker,
  34132. DOMUtils: DOMUtils,
  34133. ScriptLoader: ScriptLoader,
  34134. RangeUtils: RangeUtils,
  34135. Serializer: DomSerializer,
  34136. StyleSheetLoader: StyleSheetLoader,
  34137. ControlSelection: ControlSelection,
  34138. BookmarkManager: BookmarkManager,
  34139. Selection: EditorSelection,
  34140. Event: EventUtils.Event
  34141. },
  34142. html: {
  34143. Styles: Styles,
  34144. Entities: Entities,
  34145. Node: AstNode,
  34146. Schema: Schema,
  34147. SaxParser: SaxParser,
  34148. DomParser: DomParser,
  34149. Writer: Writer,
  34150. Serializer: HtmlSerializer
  34151. },
  34152. Env: Env,
  34153. AddOnManager: AddOnManager,
  34154. Annotator: Annotator,
  34155. Formatter: Formatter,
  34156. UndoManager: UndoManager,
  34157. EditorCommands: EditorCommands,
  34158. WindowManager: WindowManager,
  34159. NotificationManager: NotificationManager,
  34160. EditorObservable: EditorObservable,
  34161. Shortcuts: Shortcuts,
  34162. Editor: Editor,
  34163. FocusManager: FocusManager,
  34164. EditorManager: EditorManager,
  34165. DOM: DOMUtils.DOM,
  34166. ScriptLoader: ScriptLoader.ScriptLoader,
  34167. PluginManager: PluginManager,
  34168. ThemeManager: ThemeManager,
  34169. IconManager: IconManager,
  34170. Resource: Resource,
  34171. trim: Tools.trim,
  34172. isArray: Tools.isArray,
  34173. is: Tools.is,
  34174. toArray: Tools.toArray,
  34175. makeMap: Tools.makeMap,
  34176. each: Tools.each,
  34177. map: Tools.map,
  34178. grep: Tools.grep,
  34179. inArray: Tools.inArray,
  34180. extend: Tools.extend,
  34181. create: Tools.create,
  34182. walk: Tools.walk,
  34183. createNS: Tools.createNS,
  34184. resolve: Tools.resolve,
  34185. explode: Tools.explode,
  34186. _addCacheSuffix: Tools._addCacheSuffix,
  34187. isOpera: Env.opera,
  34188. isWebKit: Env.webkit,
  34189. isIE: Env.ie,
  34190. isGecko: Env.gecko,
  34191. isMac: Env.mac
  34192. };
  34193. var tinymce = Tools.extend(EditorManager, publicApi);
  34194. var exportToModuleLoaders = function (tinymce) {
  34195. if (true) {
  34196. try {
  34197. module.exports = tinymce;
  34198. } catch (_) {
  34199. }
  34200. }
  34201. };
  34202. var exportToWindowGlobal = function (tinymce) {
  34203. window.tinymce = tinymce;
  34204. window.tinyMCE = tinymce;
  34205. };
  34206. exportToWindowGlobal(tinymce);
  34207. exportToModuleLoaders(tinymce);
  34208. }());
  34209. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(31).setImmediate))
  34210. /***/ }),
  34211. /* 54 */
  34212. /***/ (function(module, exports, __webpack_require__) {
  34213. var mapCacheClear = __webpack_require__(151),
  34214. mapCacheDelete = __webpack_require__(167),
  34215. mapCacheGet = __webpack_require__(169),
  34216. mapCacheHas = __webpack_require__(170),
  34217. mapCacheSet = __webpack_require__(171);
  34218. /**
  34219. * Creates a map cache object to store key-value pairs.
  34220. *
  34221. * @private
  34222. * @constructor
  34223. * @param {Array} [entries] The key-value pairs to cache.
  34224. */
  34225. function MapCache(entries) {
  34226. var index = -1,
  34227. length = entries == null ? 0 : entries.length;
  34228. this.clear();
  34229. while (++index < length) {
  34230. var entry = entries[index];
  34231. this.set(entry[0], entry[1]);
  34232. }
  34233. }
  34234. // Add methods to `MapCache`.
  34235. MapCache.prototype.clear = mapCacheClear;
  34236. MapCache.prototype['delete'] = mapCacheDelete;
  34237. MapCache.prototype.get = mapCacheGet;
  34238. MapCache.prototype.has = mapCacheHas;
  34239. MapCache.prototype.set = mapCacheSet;
  34240. module.exports = MapCache;
  34241. /***/ }),
  34242. /* 55 */
  34243. /***/ (function(module, exports, __webpack_require__) {
  34244. var ListCache = __webpack_require__(12),
  34245. stackClear = __webpack_require__(172),
  34246. stackDelete = __webpack_require__(173),
  34247. stackGet = __webpack_require__(174),
  34248. stackHas = __webpack_require__(175),
  34249. stackSet = __webpack_require__(176);
  34250. /**
  34251. * Creates a stack cache object to store key-value pairs.
  34252. *
  34253. * @private
  34254. * @constructor
  34255. * @param {Array} [entries] The key-value pairs to cache.
  34256. */
  34257. function Stack(entries) {
  34258. var data = this.__data__ = new ListCache(entries);
  34259. this.size = data.size;
  34260. }
  34261. // Add methods to `Stack`.
  34262. Stack.prototype.clear = stackClear;
  34263. Stack.prototype['delete'] = stackDelete;
  34264. Stack.prototype.get = stackGet;
  34265. Stack.prototype.has = stackHas;
  34266. Stack.prototype.set = stackSet;
  34267. module.exports = Stack;
  34268. /***/ }),
  34269. /* 56 */
  34270. /***/ (function(module, exports, __webpack_require__) {
  34271. var disposed = false
  34272. function injectStyle (ssrContext) {
  34273. if (disposed) return
  34274. __webpack_require__(113)
  34275. }
  34276. var normalizeComponent = __webpack_require__(2)
  34277. /* script */
  34278. var __vue_script__ = __webpack_require__(115)
  34279. /* template */
  34280. var __vue_template__ = __webpack_require__(116)
  34281. /* template functional */
  34282. var __vue_template_functional__ = false
  34283. /* styles */
  34284. var __vue_styles__ = injectStyle
  34285. /* scopeId */
  34286. var __vue_scopeId__ = "data-v-5eba4923"
  34287. /* moduleIdentifier (server only) */
  34288. var __vue_module_identifier__ = null
  34289. var Component = normalizeComponent(
  34290. __vue_script__,
  34291. __vue_template__,
  34292. __vue_template_functional__,
  34293. __vue_styles__,
  34294. __vue_scopeId__,
  34295. __vue_module_identifier__
  34296. )
  34297. Component.options.__file = "resources/assets/js/_components/ScrollerY.vue"
  34298. /* hot reload */
  34299. if (false) {(function () {
  34300. var hotAPI = require("vue-hot-reload-api")
  34301. hotAPI.install(require("vue"), false)
  34302. if (!hotAPI.compatible) return
  34303. module.hot.accept()
  34304. if (!module.hot.data) {
  34305. hotAPI.createRecord("data-v-5eba4923", Component.options)
  34306. } else {
  34307. hotAPI.reload("data-v-5eba4923", Component.options)
  34308. }
  34309. module.hot.dispose(function (data) {
  34310. disposed = true
  34311. })
  34312. })()}
  34313. module.exports = Component.exports
  34314. /***/ }),
  34315. /* 57 */,
  34316. /* 58 */
  34317. /***/ (function(module, exports, __webpack_require__) {
  34318. var disposed = false
  34319. function injectStyle (ssrContext) {
  34320. if (disposed) return
  34321. __webpack_require__(139)
  34322. }
  34323. var normalizeComponent = __webpack_require__(2)
  34324. /* script */
  34325. var __vue_script__ = __webpack_require__(141)
  34326. /* template */
  34327. var __vue_template__ = __webpack_require__(144)
  34328. /* template functional */
  34329. var __vue_template_functional__ = false
  34330. /* styles */
  34331. var __vue_styles__ = injectStyle
  34332. /* scopeId */
  34333. var __vue_scopeId__ = "data-v-0c50b298"
  34334. /* moduleIdentifier (server only) */
  34335. var __vue_module_identifier__ = null
  34336. var Component = normalizeComponent(
  34337. __vue_script__,
  34338. __vue_template__,
  34339. __vue_template_functional__,
  34340. __vue_styles__,
  34341. __vue_scopeId__,
  34342. __vue_module_identifier__
  34343. )
  34344. Component.options.__file = "resources/assets/js/main/components/project/task/files.vue"
  34345. /* hot reload */
  34346. if (false) {(function () {
  34347. var hotAPI = require("vue-hot-reload-api")
  34348. hotAPI.install(require("vue"), false)
  34349. if (!hotAPI.compatible) return
  34350. module.hot.accept()
  34351. if (!module.hot.data) {
  34352. hotAPI.createRecord("data-v-0c50b298", Component.options)
  34353. } else {
  34354. hotAPI.reload("data-v-0c50b298", Component.options)
  34355. }
  34356. module.hot.dispose(function (data) {
  34357. disposed = true
  34358. })
  34359. })()}
  34360. module.exports = Component.exports
  34361. /***/ }),
  34362. /* 59 */
  34363. /***/ (function(module, exports, __webpack_require__) {
  34364. var disposed = false
  34365. function injectStyle (ssrContext) {
  34366. if (disposed) return
  34367. __webpack_require__(145)
  34368. }
  34369. var normalizeComponent = __webpack_require__(2)
  34370. /* script */
  34371. var __vue_script__ = __webpack_require__(147)
  34372. /* template */
  34373. var __vue_template__ = __webpack_require__(148)
  34374. /* template functional */
  34375. var __vue_template_functional__ = false
  34376. /* styles */
  34377. var __vue_styles__ = injectStyle
  34378. /* scopeId */
  34379. var __vue_scopeId__ = "data-v-2951ea9e"
  34380. /* moduleIdentifier (server only) */
  34381. var __vue_module_identifier__ = null
  34382. var Component = normalizeComponent(
  34383. __vue_script__,
  34384. __vue_template__,
  34385. __vue_template_functional__,
  34386. __vue_styles__,
  34387. __vue_scopeId__,
  34388. __vue_module_identifier__
  34389. )
  34390. Component.options.__file = "resources/assets/js/main/components/project/task/logs.vue"
  34391. /* hot reload */
  34392. if (false) {(function () {
  34393. var hotAPI = require("vue-hot-reload-api")
  34394. hotAPI.install(require("vue"), false)
  34395. if (!hotAPI.compatible) return
  34396. module.hot.accept()
  34397. if (!module.hot.data) {
  34398. hotAPI.createRecord("data-v-2951ea9e", Component.options)
  34399. } else {
  34400. hotAPI.reload("data-v-2951ea9e", Component.options)
  34401. }
  34402. module.hot.dispose(function (data) {
  34403. disposed = true
  34404. })
  34405. })()}
  34406. module.exports = Component.exports
  34407. /***/ }),
  34408. /* 60 */
  34409. /***/ (function(module, exports, __webpack_require__) {
  34410. var root = __webpack_require__(3);
  34411. /** Built-in value references. */
  34412. var Uint8Array = root.Uint8Array;
  34413. module.exports = Uint8Array;
  34414. /***/ }),
  34415. /* 61 */
  34416. /***/ (function(module, exports, __webpack_require__) {
  34417. var baseGetAllKeys = __webpack_require__(40),
  34418. getSymbols = __webpack_require__(24),
  34419. keys = __webpack_require__(19);
  34420. /**
  34421. * Creates an array of own enumerable property names and symbols of `object`.
  34422. *
  34423. * @private
  34424. * @param {Object} object The object to query.
  34425. * @returns {Array} Returns the array of property names and symbols.
  34426. */
  34427. function getAllKeys(object) {
  34428. return baseGetAllKeys(object, keys, getSymbols);
  34429. }
  34430. module.exports = getAllKeys;
  34431. /***/ }),
  34432. /* 62 */
  34433. /***/ (function(module, exports, __webpack_require__) {
  34434. var baseIsArguments = __webpack_require__(179),
  34435. isObjectLike = __webpack_require__(8);
  34436. /** Used for built-in method references. */
  34437. var objectProto = Object.prototype;
  34438. /** Used to check objects for own properties. */
  34439. var hasOwnProperty = objectProto.hasOwnProperty;
  34440. /** Built-in value references. */
  34441. var propertyIsEnumerable = objectProto.propertyIsEnumerable;
  34442. /**
  34443. * Checks if `value` is likely an `arguments` object.
  34444. *
  34445. * @static
  34446. * @memberOf _
  34447. * @since 0.1.0
  34448. * @category Lang
  34449. * @param {*} value The value to check.
  34450. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  34451. * else `false`.
  34452. * @example
  34453. *
  34454. * _.isArguments(function() { return arguments; }());
  34455. * // => true
  34456. *
  34457. * _.isArguments([1, 2, 3]);
  34458. * // => false
  34459. */
  34460. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  34461. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  34462. !propertyIsEnumerable.call(value, 'callee');
  34463. };
  34464. module.exports = isArguments;
  34465. /***/ }),
  34466. /* 63 */
  34467. /***/ (function(module, exports) {
  34468. /** Used as references for various `Number` constants. */
  34469. var MAX_SAFE_INTEGER = 9007199254740991;
  34470. /** Used to detect unsigned integer values. */
  34471. var reIsUint = /^(?:0|[1-9]\d*)$/;
  34472. /**
  34473. * Checks if `value` is a valid array-like index.
  34474. *
  34475. * @private
  34476. * @param {*} value The value to check.
  34477. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  34478. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  34479. */
  34480. function isIndex(value, length) {
  34481. var type = typeof value;
  34482. length = length == null ? MAX_SAFE_INTEGER : length;
  34483. return !!length &&
  34484. (type == 'number' ||
  34485. (type != 'symbol' && reIsUint.test(value))) &&
  34486. (value > -1 && value % 1 == 0 && value < length);
  34487. }
  34488. module.exports = isIndex;
  34489. /***/ }),
  34490. /* 64 */
  34491. /***/ (function(module, exports, __webpack_require__) {
  34492. var baseIsTypedArray = __webpack_require__(181),
  34493. baseUnary = __webpack_require__(20),
  34494. nodeUtil = __webpack_require__(26);
  34495. /* Node.js helper references. */
  34496. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  34497. /**
  34498. * Checks if `value` is classified as a typed array.
  34499. *
  34500. * @static
  34501. * @memberOf _
  34502. * @since 3.0.0
  34503. * @category Lang
  34504. * @param {*} value The value to check.
  34505. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  34506. * @example
  34507. *
  34508. * _.isTypedArray(new Uint8Array);
  34509. * // => true
  34510. *
  34511. * _.isTypedArray([]);
  34512. * // => false
  34513. */
  34514. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  34515. module.exports = isTypedArray;
  34516. /***/ }),
  34517. /* 65 */
  34518. /***/ (function(module, exports, __webpack_require__) {
  34519. var disposed = false
  34520. function injectStyle (ssrContext) {
  34521. if (disposed) return
  34522. __webpack_require__(189)
  34523. }
  34524. var normalizeComponent = __webpack_require__(2)
  34525. /* script */
  34526. var __vue_script__ = __webpack_require__(191)
  34527. /* template */
  34528. var __vue_template__ = __webpack_require__(192)
  34529. /* template functional */
  34530. var __vue_template_functional__ = false
  34531. /* styles */
  34532. var __vue_styles__ = injectStyle
  34533. /* scopeId */
  34534. var __vue_scopeId__ = "data-v-1fd3fc13"
  34535. /* moduleIdentifier (server only) */
  34536. var __vue_module_identifier__ = null
  34537. var Component = normalizeComponent(
  34538. __vue_script__,
  34539. __vue_template__,
  34540. __vue_template_functional__,
  34541. __vue_styles__,
  34542. __vue_scopeId__,
  34543. __vue_module_identifier__
  34544. )
  34545. Component.options.__file = "resources/assets/js/main/components/report/content.vue"
  34546. /* hot reload */
  34547. if (false) {(function () {
  34548. var hotAPI = require("vue-hot-reload-api")
  34549. hotAPI.install(require("vue"), false)
  34550. if (!hotAPI.compatible) return
  34551. module.hot.accept()
  34552. if (!module.hot.data) {
  34553. hotAPI.createRecord("data-v-1fd3fc13", Component.options)
  34554. } else {
  34555. hotAPI.reload("data-v-1fd3fc13", Component.options)
  34556. }
  34557. module.hot.dispose(function (data) {
  34558. disposed = true
  34559. })
  34560. })()}
  34561. module.exports = Component.exports
  34562. /***/ }),
  34563. /* 66 */
  34564. /***/ (function(module, exports, __webpack_require__) {
  34565. __webpack_require__(67);
  34566. module.exports = __webpack_require__(286);
  34567. /***/ }),
  34568. /* 67 */
  34569. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  34570. "use strict";
  34571. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  34572. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  34573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  34574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App_vue__ = __webpack_require__(70);
  34575. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__App_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__App_vue__);
  34576. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__routes__ = __webpack_require__(137);
  34577. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vue_router__ = __webpack_require__(193);
  34578. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design__ = __webpack_require__(194);
  34579. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_view_design__);
  34580. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__modules_language__ = __webpack_require__(195);
  34581. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__modules_mixins__ = __webpack_require__(198);
  34582. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common__ = __webpack_require__(199);
  34583. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__common___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__common__);
  34584. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__main__ = __webpack_require__(200);
  34585. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_Title_vue__ = __webpack_require__(203);
  34586. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_Title_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9__components_Title_vue__);
  34587. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue__ = __webpack_require__(206);
  34588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue__);
  34589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_UserInput__ = __webpack_require__(209);
  34590. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_UserInput___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11__components_UserInput__);
  34591. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_UserView__ = __webpack_require__(220);
  34592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_UserView___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12__components_UserView__);
  34593. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_UserImg__ = __webpack_require__(227);
  34594. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__components_UserImg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_13__components_UserImg__);
  34595. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_WLoading__ = __webpack_require__(232);
  34596. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__components_WLoading___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_14__components_WLoading__);
  34597. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__components_project_task_detail__ = __webpack_require__(237);
  34598. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__components_report_detail__ = __webpack_require__(282);
  34599. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  34600. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */]);
  34601. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_4_view_design___default.a);
  34602. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_5__modules_language__["a" /* default */]);
  34603. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_6__modules_mixins__["a" /* default */]);
  34604. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('VTitle', __WEBPACK_IMPORTED_MODULE_9__components_Title_vue___default.a);
  34605. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('sreachTitle', __WEBPACK_IMPORTED_MODULE_10__components_sreachTitle_vue___default.a);
  34606. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserInput', __WEBPACK_IMPORTED_MODULE_11__components_UserInput___default.a);
  34607. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserView', __WEBPACK_IMPORTED_MODULE_12__components_UserView___default.a);
  34608. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('UserImg', __WEBPACK_IMPORTED_MODULE_13__components_UserImg___default.a);
  34609. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.component('WLoading', __WEBPACK_IMPORTED_MODULE_14__components_WLoading___default.a);
  34610. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.taskDetail = __WEBPACK_IMPORTED_MODULE_15__components_project_task_detail__["a" /* default */];
  34611. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.reportDetail = __WEBPACK_IMPORTED_MODULE_16__components_report_detail__["a" /* default */];
  34612. var originalPush = __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */].prototype.push;
  34613. __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */].prototype.push = function push(location) {
  34614. return originalPush.call(this, location).catch(function (err) {
  34615. return err;
  34616. });
  34617. };
  34618. var router = new __WEBPACK_IMPORTED_MODULE_3_vue_router__["a" /* default */]({
  34619. mode: 'history',
  34620. routes: __WEBPACK_IMPORTED_MODULE_2__routes__["a" /* default */]
  34621. });
  34622. //进度条配置
  34623. __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.config({
  34624. color: '#3fcc25',
  34625. failedColor: '#ff0000'
  34626. });
  34627. router.beforeEach(function (to, from, next) {
  34628. __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.start();
  34629. next();
  34630. });
  34631. router.afterEach(function (to, from, next) {
  34632. __WEBPACK_IMPORTED_MODULE_4_view_design___default.a.LoadingBar.finish();
  34633. });
  34634. //加载函数
  34635. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.goForward = function (location, isReplace) {
  34636. if (typeof location === 'string') location = { name: location };
  34637. if (isReplace === true) {
  34638. this.$router.replace(location);
  34639. } else {
  34640. this.$router.push(location);
  34641. }
  34642. };
  34643. //返回函数
  34644. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.goBack = function (number) {
  34645. var history = $A.jsonParse(window.sessionStorage['__history__'] || '{}');
  34646. if ($A.runNum(history['::count']) > 2) {
  34647. this.$router.go(typeof number === 'number' ? number : -1);
  34648. } else {
  34649. this.$router.replace((typeof number === 'undefined' ? 'undefined' : _typeof(number)) === "object" ? number : { path: '/' });
  34650. }
  34651. };
  34652. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$A = $A;
  34653. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.config.productionTip = false;
  34654. var app = new __WEBPACK_IMPORTED_MODULE_0_vue___default.a({
  34655. el: '#app',
  34656. router: router,
  34657. template: '<App/>',
  34658. components: { App: __WEBPACK_IMPORTED_MODULE_1__App_vue___default.a }
  34659. });
  34660. $A.app = app;
  34661. window.localStorage.setItem("__::WookTeam:check", "success");
  34662. /***/ }),
  34663. /* 68 */
  34664. /***/ (function(module, exports, __webpack_require__) {
  34665. "use strict";
  34666. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  34667. * Vue.js v2.6.14
  34668. * (c) 2014-2021 Evan You
  34669. * Released under the MIT License.
  34670. */
  34671. /* */
  34672. var emptyObject = Object.freeze({});
  34673. // These helpers produce better VM code in JS engines due to their
  34674. // explicitness and function inlining.
  34675. function isUndef (v) {
  34676. return v === undefined || v === null
  34677. }
  34678. function isDef (v) {
  34679. return v !== undefined && v !== null
  34680. }
  34681. function isTrue (v) {
  34682. return v === true
  34683. }
  34684. function isFalse (v) {
  34685. return v === false
  34686. }
  34687. /**
  34688. * Check if value is primitive.
  34689. */
  34690. function isPrimitive (value) {
  34691. return (
  34692. typeof value === 'string' ||
  34693. typeof value === 'number' ||
  34694. // $flow-disable-line
  34695. typeof value === 'symbol' ||
  34696. typeof value === 'boolean'
  34697. )
  34698. }
  34699. /**
  34700. * Quick object check - this is primarily used to tell
  34701. * Objects from primitive values when we know the value
  34702. * is a JSON-compliant type.
  34703. */
  34704. function isObject (obj) {
  34705. return obj !== null && typeof obj === 'object'
  34706. }
  34707. /**
  34708. * Get the raw type string of a value, e.g., [object Object].
  34709. */
  34710. var _toString = Object.prototype.toString;
  34711. function toRawType (value) {
  34712. return _toString.call(value).slice(8, -1)
  34713. }
  34714. /**
  34715. * Strict object type check. Only returns true
  34716. * for plain JavaScript objects.
  34717. */
  34718. function isPlainObject (obj) {
  34719. return _toString.call(obj) === '[object Object]'
  34720. }
  34721. function isRegExp (v) {
  34722. return _toString.call(v) === '[object RegExp]'
  34723. }
  34724. /**
  34725. * Check if val is a valid array index.
  34726. */
  34727. function isValidArrayIndex (val) {
  34728. var n = parseFloat(String(val));
  34729. return n >= 0 && Math.floor(n) === n && isFinite(val)
  34730. }
  34731. function isPromise (val) {
  34732. return (
  34733. isDef(val) &&
  34734. typeof val.then === 'function' &&
  34735. typeof val.catch === 'function'
  34736. )
  34737. }
  34738. /**
  34739. * Convert a value to a string that is actually rendered.
  34740. */
  34741. function toString (val) {
  34742. return val == null
  34743. ? ''
  34744. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  34745. ? JSON.stringify(val, null, 2)
  34746. : String(val)
  34747. }
  34748. /**
  34749. * Convert an input value to a number for persistence.
  34750. * If the conversion fails, return original string.
  34751. */
  34752. function toNumber (val) {
  34753. var n = parseFloat(val);
  34754. return isNaN(n) ? val : n
  34755. }
  34756. /**
  34757. * Make a map and return a function for checking if a key
  34758. * is in that map.
  34759. */
  34760. function makeMap (
  34761. str,
  34762. expectsLowerCase
  34763. ) {
  34764. var map = Object.create(null);
  34765. var list = str.split(',');
  34766. for (var i = 0; i < list.length; i++) {
  34767. map[list[i]] = true;
  34768. }
  34769. return expectsLowerCase
  34770. ? function (val) { return map[val.toLowerCase()]; }
  34771. : function (val) { return map[val]; }
  34772. }
  34773. /**
  34774. * Check if a tag is a built-in tag.
  34775. */
  34776. var isBuiltInTag = makeMap('slot,component', true);
  34777. /**
  34778. * Check if an attribute is a reserved attribute.
  34779. */
  34780. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  34781. /**
  34782. * Remove an item from an array.
  34783. */
  34784. function remove (arr, item) {
  34785. if (arr.length) {
  34786. var index = arr.indexOf(item);
  34787. if (index > -1) {
  34788. return arr.splice(index, 1)
  34789. }
  34790. }
  34791. }
  34792. /**
  34793. * Check whether an object has the property.
  34794. */
  34795. var hasOwnProperty = Object.prototype.hasOwnProperty;
  34796. function hasOwn (obj, key) {
  34797. return hasOwnProperty.call(obj, key)
  34798. }
  34799. /**
  34800. * Create a cached version of a pure function.
  34801. */
  34802. function cached (fn) {
  34803. var cache = Object.create(null);
  34804. return (function cachedFn (str) {
  34805. var hit = cache[str];
  34806. return hit || (cache[str] = fn(str))
  34807. })
  34808. }
  34809. /**
  34810. * Camelize a hyphen-delimited string.
  34811. */
  34812. var camelizeRE = /-(\w)/g;
  34813. var camelize = cached(function (str) {
  34814. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  34815. });
  34816. /**
  34817. * Capitalize a string.
  34818. */
  34819. var capitalize = cached(function (str) {
  34820. return str.charAt(0).toUpperCase() + str.slice(1)
  34821. });
  34822. /**
  34823. * Hyphenate a camelCase string.
  34824. */
  34825. var hyphenateRE = /\B([A-Z])/g;
  34826. var hyphenate = cached(function (str) {
  34827. return str.replace(hyphenateRE, '-$1').toLowerCase()
  34828. });
  34829. /**
  34830. * Simple bind polyfill for environments that do not support it,
  34831. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  34832. * since native bind is now performant enough in most browsers.
  34833. * But removing it would mean breaking code that was able to run in
  34834. * PhantomJS 1.x, so this must be kept for backward compatibility.
  34835. */
  34836. /* istanbul ignore next */
  34837. function polyfillBind (fn, ctx) {
  34838. function boundFn (a) {
  34839. var l = arguments.length;
  34840. return l
  34841. ? l > 1
  34842. ? fn.apply(ctx, arguments)
  34843. : fn.call(ctx, a)
  34844. : fn.call(ctx)
  34845. }
  34846. boundFn._length = fn.length;
  34847. return boundFn
  34848. }
  34849. function nativeBind (fn, ctx) {
  34850. return fn.bind(ctx)
  34851. }
  34852. var bind = Function.prototype.bind
  34853. ? nativeBind
  34854. : polyfillBind;
  34855. /**
  34856. * Convert an Array-like object to a real Array.
  34857. */
  34858. function toArray (list, start) {
  34859. start = start || 0;
  34860. var i = list.length - start;
  34861. var ret = new Array(i);
  34862. while (i--) {
  34863. ret[i] = list[i + start];
  34864. }
  34865. return ret
  34866. }
  34867. /**
  34868. * Mix properties into target object.
  34869. */
  34870. function extend (to, _from) {
  34871. for (var key in _from) {
  34872. to[key] = _from[key];
  34873. }
  34874. return to
  34875. }
  34876. /**
  34877. * Merge an Array of Objects into a single Object.
  34878. */
  34879. function toObject (arr) {
  34880. var res = {};
  34881. for (var i = 0; i < arr.length; i++) {
  34882. if (arr[i]) {
  34883. extend(res, arr[i]);
  34884. }
  34885. }
  34886. return res
  34887. }
  34888. /* eslint-disable no-unused-vars */
  34889. /**
  34890. * Perform no operation.
  34891. * Stubbing args to make Flow happy without leaving useless transpiled code
  34892. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  34893. */
  34894. function noop (a, b, c) {}
  34895. /**
  34896. * Always return false.
  34897. */
  34898. var no = function (a, b, c) { return false; };
  34899. /* eslint-enable no-unused-vars */
  34900. /**
  34901. * Return the same value.
  34902. */
  34903. var identity = function (_) { return _; };
  34904. /**
  34905. * Generate a string containing static keys from compiler modules.
  34906. */
  34907. function genStaticKeys (modules) {
  34908. return modules.reduce(function (keys, m) {
  34909. return keys.concat(m.staticKeys || [])
  34910. }, []).join(',')
  34911. }
  34912. /**
  34913. * Check if two values are loosely equal - that is,
  34914. * if they are plain objects, do they have the same shape?
  34915. */
  34916. function looseEqual (a, b) {
  34917. if (a === b) { return true }
  34918. var isObjectA = isObject(a);
  34919. var isObjectB = isObject(b);
  34920. if (isObjectA && isObjectB) {
  34921. try {
  34922. var isArrayA = Array.isArray(a);
  34923. var isArrayB = Array.isArray(b);
  34924. if (isArrayA && isArrayB) {
  34925. return a.length === b.length && a.every(function (e, i) {
  34926. return looseEqual(e, b[i])
  34927. })
  34928. } else if (a instanceof Date && b instanceof Date) {
  34929. return a.getTime() === b.getTime()
  34930. } else if (!isArrayA && !isArrayB) {
  34931. var keysA = Object.keys(a);
  34932. var keysB = Object.keys(b);
  34933. return keysA.length === keysB.length && keysA.every(function (key) {
  34934. return looseEqual(a[key], b[key])
  34935. })
  34936. } else {
  34937. /* istanbul ignore next */
  34938. return false
  34939. }
  34940. } catch (e) {
  34941. /* istanbul ignore next */
  34942. return false
  34943. }
  34944. } else if (!isObjectA && !isObjectB) {
  34945. return String(a) === String(b)
  34946. } else {
  34947. return false
  34948. }
  34949. }
  34950. /**
  34951. * Return the first index at which a loosely equal value can be
  34952. * found in the array (if value is a plain object, the array must
  34953. * contain an object of the same shape), or -1 if it is not present.
  34954. */
  34955. function looseIndexOf (arr, val) {
  34956. for (var i = 0; i < arr.length; i++) {
  34957. if (looseEqual(arr[i], val)) { return i }
  34958. }
  34959. return -1
  34960. }
  34961. /**
  34962. * Ensure a function is called only once.
  34963. */
  34964. function once (fn) {
  34965. var called = false;
  34966. return function () {
  34967. if (!called) {
  34968. called = true;
  34969. fn.apply(this, arguments);
  34970. }
  34971. }
  34972. }
  34973. var SSR_ATTR = 'data-server-rendered';
  34974. var ASSET_TYPES = [
  34975. 'component',
  34976. 'directive',
  34977. 'filter'
  34978. ];
  34979. var LIFECYCLE_HOOKS = [
  34980. 'beforeCreate',
  34981. 'created',
  34982. 'beforeMount',
  34983. 'mounted',
  34984. 'beforeUpdate',
  34985. 'updated',
  34986. 'beforeDestroy',
  34987. 'destroyed',
  34988. 'activated',
  34989. 'deactivated',
  34990. 'errorCaptured',
  34991. 'serverPrefetch'
  34992. ];
  34993. /* */
  34994. var config = ({
  34995. /**
  34996. * Option merge strategies (used in core/util/options)
  34997. */
  34998. // $flow-disable-line
  34999. optionMergeStrategies: Object.create(null),
  35000. /**
  35001. * Whether to suppress warnings.
  35002. */
  35003. silent: false,
  35004. /**
  35005. * Show production mode tip message on boot?
  35006. */
  35007. productionTip: "development" !== 'production',
  35008. /**
  35009. * Whether to enable devtools
  35010. */
  35011. devtools: "development" !== 'production',
  35012. /**
  35013. * Whether to record perf
  35014. */
  35015. performance: false,
  35016. /**
  35017. * Error handler for watcher errors
  35018. */
  35019. errorHandler: null,
  35020. /**
  35021. * Warn handler for watcher warns
  35022. */
  35023. warnHandler: null,
  35024. /**
  35025. * Ignore certain custom elements
  35026. */
  35027. ignoredElements: [],
  35028. /**
  35029. * Custom user key aliases for v-on
  35030. */
  35031. // $flow-disable-line
  35032. keyCodes: Object.create(null),
  35033. /**
  35034. * Check if a tag is reserved so that it cannot be registered as a
  35035. * component. This is platform-dependent and may be overwritten.
  35036. */
  35037. isReservedTag: no,
  35038. /**
  35039. * Check if an attribute is reserved so that it cannot be used as a component
  35040. * prop. This is platform-dependent and may be overwritten.
  35041. */
  35042. isReservedAttr: no,
  35043. /**
  35044. * Check if a tag is an unknown element.
  35045. * Platform-dependent.
  35046. */
  35047. isUnknownElement: no,
  35048. /**
  35049. * Get the namespace of an element
  35050. */
  35051. getTagNamespace: noop,
  35052. /**
  35053. * Parse the real tag name for the specific platform.
  35054. */
  35055. parsePlatformTagName: identity,
  35056. /**
  35057. * Check if an attribute must be bound using property, e.g. value
  35058. * Platform-dependent.
  35059. */
  35060. mustUseProp: no,
  35061. /**
  35062. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  35063. * This will significantly reduce performance if set to false.
  35064. */
  35065. async: true,
  35066. /**
  35067. * Exposed for legacy reasons
  35068. */
  35069. _lifecycleHooks: LIFECYCLE_HOOKS
  35070. });
  35071. /* */
  35072. /**
  35073. * unicode letters used for parsing html tags, component names and property paths.
  35074. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  35075. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  35076. */
  35077. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  35078. /**
  35079. * Check if a string starts with $ or _
  35080. */
  35081. function isReserved (str) {
  35082. var c = (str + '').charCodeAt(0);
  35083. return c === 0x24 || c === 0x5F
  35084. }
  35085. /**
  35086. * Define a property.
  35087. */
  35088. function def (obj, key, val, enumerable) {
  35089. Object.defineProperty(obj, key, {
  35090. value: val,
  35091. enumerable: !!enumerable,
  35092. writable: true,
  35093. configurable: true
  35094. });
  35095. }
  35096. /**
  35097. * Parse simple path.
  35098. */
  35099. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  35100. function parsePath (path) {
  35101. if (bailRE.test(path)) {
  35102. return
  35103. }
  35104. var segments = path.split('.');
  35105. return function (obj) {
  35106. for (var i = 0; i < segments.length; i++) {
  35107. if (!obj) { return }
  35108. obj = obj[segments[i]];
  35109. }
  35110. return obj
  35111. }
  35112. }
  35113. /* */
  35114. // can we use __proto__?
  35115. var hasProto = '__proto__' in {};
  35116. // Browser environment sniffing
  35117. var inBrowser = typeof window !== 'undefined';
  35118. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  35119. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  35120. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  35121. var isIE = UA && /msie|trident/.test(UA);
  35122. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  35123. var isEdge = UA && UA.indexOf('edge/') > 0;
  35124. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  35125. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  35126. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  35127. var isPhantomJS = UA && /phantomjs/.test(UA);
  35128. var isFF = UA && UA.match(/firefox\/(\d+)/);
  35129. // Firefox has a "watch" function on Object.prototype...
  35130. var nativeWatch = ({}).watch;
  35131. var supportsPassive = false;
  35132. if (inBrowser) {
  35133. try {
  35134. var opts = {};
  35135. Object.defineProperty(opts, 'passive', ({
  35136. get: function get () {
  35137. /* istanbul ignore next */
  35138. supportsPassive = true;
  35139. }
  35140. })); // https://github.com/facebook/flow/issues/285
  35141. window.addEventListener('test-passive', null, opts);
  35142. } catch (e) {}
  35143. }
  35144. // this needs to be lazy-evaled because vue may be required before
  35145. // vue-server-renderer can set VUE_ENV
  35146. var _isServer;
  35147. var isServerRendering = function () {
  35148. if (_isServer === undefined) {
  35149. /* istanbul ignore if */
  35150. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  35151. // detect presence of vue-server-renderer and avoid
  35152. // Webpack shimming the process
  35153. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  35154. } else {
  35155. _isServer = false;
  35156. }
  35157. }
  35158. return _isServer
  35159. };
  35160. // detect devtools
  35161. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  35162. /* istanbul ignore next */
  35163. function isNative (Ctor) {
  35164. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  35165. }
  35166. var hasSymbol =
  35167. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  35168. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  35169. var _Set;
  35170. /* istanbul ignore if */ // $flow-disable-line
  35171. if (typeof Set !== 'undefined' && isNative(Set)) {
  35172. // use native Set when available.
  35173. _Set = Set;
  35174. } else {
  35175. // a non-standard Set polyfill that only works with primitive keys.
  35176. _Set = /*@__PURE__*/(function () {
  35177. function Set () {
  35178. this.set = Object.create(null);
  35179. }
  35180. Set.prototype.has = function has (key) {
  35181. return this.set[key] === true
  35182. };
  35183. Set.prototype.add = function add (key) {
  35184. this.set[key] = true;
  35185. };
  35186. Set.prototype.clear = function clear () {
  35187. this.set = Object.create(null);
  35188. };
  35189. return Set;
  35190. }());
  35191. }
  35192. /* */
  35193. var warn = noop;
  35194. var tip = noop;
  35195. var generateComponentTrace = (noop); // work around flow check
  35196. var formatComponentName = (noop);
  35197. {
  35198. var hasConsole = typeof console !== 'undefined';
  35199. var classifyRE = /(?:^|[-_])(\w)/g;
  35200. var classify = function (str) { return str
  35201. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  35202. .replace(/[-_]/g, ''); };
  35203. warn = function (msg, vm) {
  35204. var trace = vm ? generateComponentTrace(vm) : '';
  35205. if (config.warnHandler) {
  35206. config.warnHandler.call(null, msg, vm, trace);
  35207. } else if (hasConsole && (!config.silent)) {
  35208. console.error(("[Vue warn]: " + msg + trace));
  35209. }
  35210. };
  35211. tip = function (msg, vm) {
  35212. if (hasConsole && (!config.silent)) {
  35213. console.warn("[Vue tip]: " + msg + (
  35214. vm ? generateComponentTrace(vm) : ''
  35215. ));
  35216. }
  35217. };
  35218. formatComponentName = function (vm, includeFile) {
  35219. if (vm.$root === vm) {
  35220. return '<Root>'
  35221. }
  35222. var options = typeof vm === 'function' && vm.cid != null
  35223. ? vm.options
  35224. : vm._isVue
  35225. ? vm.$options || vm.constructor.options
  35226. : vm;
  35227. var name = options.name || options._componentTag;
  35228. var file = options.__file;
  35229. if (!name && file) {
  35230. var match = file.match(/([^/\\]+)\.vue$/);
  35231. name = match && match[1];
  35232. }
  35233. return (
  35234. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  35235. (file && includeFile !== false ? (" at " + file) : '')
  35236. )
  35237. };
  35238. var repeat = function (str, n) {
  35239. var res = '';
  35240. while (n) {
  35241. if (n % 2 === 1) { res += str; }
  35242. if (n > 1) { str += str; }
  35243. n >>= 1;
  35244. }
  35245. return res
  35246. };
  35247. generateComponentTrace = function (vm) {
  35248. if (vm._isVue && vm.$parent) {
  35249. var tree = [];
  35250. var currentRecursiveSequence = 0;
  35251. while (vm) {
  35252. if (tree.length > 0) {
  35253. var last = tree[tree.length - 1];
  35254. if (last.constructor === vm.constructor) {
  35255. currentRecursiveSequence++;
  35256. vm = vm.$parent;
  35257. continue
  35258. } else if (currentRecursiveSequence > 0) {
  35259. tree[tree.length - 1] = [last, currentRecursiveSequence];
  35260. currentRecursiveSequence = 0;
  35261. }
  35262. }
  35263. tree.push(vm);
  35264. vm = vm.$parent;
  35265. }
  35266. return '\n\nfound in\n\n' + tree
  35267. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  35268. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  35269. : formatComponentName(vm))); })
  35270. .join('\n')
  35271. } else {
  35272. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  35273. }
  35274. };
  35275. }
  35276. /* */
  35277. var uid = 0;
  35278. /**
  35279. * A dep is an observable that can have multiple
  35280. * directives subscribing to it.
  35281. */
  35282. var Dep = function Dep () {
  35283. this.id = uid++;
  35284. this.subs = [];
  35285. };
  35286. Dep.prototype.addSub = function addSub (sub) {
  35287. this.subs.push(sub);
  35288. };
  35289. Dep.prototype.removeSub = function removeSub (sub) {
  35290. remove(this.subs, sub);
  35291. };
  35292. Dep.prototype.depend = function depend () {
  35293. if (Dep.target) {
  35294. Dep.target.addDep(this);
  35295. }
  35296. };
  35297. Dep.prototype.notify = function notify () {
  35298. // stabilize the subscriber list first
  35299. var subs = this.subs.slice();
  35300. if (!config.async) {
  35301. // subs aren't sorted in scheduler if not running async
  35302. // we need to sort them now to make sure they fire in correct
  35303. // order
  35304. subs.sort(function (a, b) { return a.id - b.id; });
  35305. }
  35306. for (var i = 0, l = subs.length; i < l; i++) {
  35307. subs[i].update();
  35308. }
  35309. };
  35310. // The current target watcher being evaluated.
  35311. // This is globally unique because only one watcher
  35312. // can be evaluated at a time.
  35313. Dep.target = null;
  35314. var targetStack = [];
  35315. function pushTarget (target) {
  35316. targetStack.push(target);
  35317. Dep.target = target;
  35318. }
  35319. function popTarget () {
  35320. targetStack.pop();
  35321. Dep.target = targetStack[targetStack.length - 1];
  35322. }
  35323. /* */
  35324. var VNode = function VNode (
  35325. tag,
  35326. data,
  35327. children,
  35328. text,
  35329. elm,
  35330. context,
  35331. componentOptions,
  35332. asyncFactory
  35333. ) {
  35334. this.tag = tag;
  35335. this.data = data;
  35336. this.children = children;
  35337. this.text = text;
  35338. this.elm = elm;
  35339. this.ns = undefined;
  35340. this.context = context;
  35341. this.fnContext = undefined;
  35342. this.fnOptions = undefined;
  35343. this.fnScopeId = undefined;
  35344. this.key = data && data.key;
  35345. this.componentOptions = componentOptions;
  35346. this.componentInstance = undefined;
  35347. this.parent = undefined;
  35348. this.raw = false;
  35349. this.isStatic = false;
  35350. this.isRootInsert = true;
  35351. this.isComment = false;
  35352. this.isCloned = false;
  35353. this.isOnce = false;
  35354. this.asyncFactory = asyncFactory;
  35355. this.asyncMeta = undefined;
  35356. this.isAsyncPlaceholder = false;
  35357. };
  35358. var prototypeAccessors = { child: { configurable: true } };
  35359. // DEPRECATED: alias for componentInstance for backwards compat.
  35360. /* istanbul ignore next */
  35361. prototypeAccessors.child.get = function () {
  35362. return this.componentInstance
  35363. };
  35364. Object.defineProperties( VNode.prototype, prototypeAccessors );
  35365. var createEmptyVNode = function (text) {
  35366. if ( text === void 0 ) text = '';
  35367. var node = new VNode();
  35368. node.text = text;
  35369. node.isComment = true;
  35370. return node
  35371. };
  35372. function createTextVNode (val) {
  35373. return new VNode(undefined, undefined, undefined, String(val))
  35374. }
  35375. // optimized shallow clone
  35376. // used for static nodes and slot nodes because they may be reused across
  35377. // multiple renders, cloning them avoids errors when DOM manipulations rely
  35378. // on their elm reference.
  35379. function cloneVNode (vnode) {
  35380. var cloned = new VNode(
  35381. vnode.tag,
  35382. vnode.data,
  35383. // #7975
  35384. // clone children array to avoid mutating original in case of cloning
  35385. // a child.
  35386. vnode.children && vnode.children.slice(),
  35387. vnode.text,
  35388. vnode.elm,
  35389. vnode.context,
  35390. vnode.componentOptions,
  35391. vnode.asyncFactory
  35392. );
  35393. cloned.ns = vnode.ns;
  35394. cloned.isStatic = vnode.isStatic;
  35395. cloned.key = vnode.key;
  35396. cloned.isComment = vnode.isComment;
  35397. cloned.fnContext = vnode.fnContext;
  35398. cloned.fnOptions = vnode.fnOptions;
  35399. cloned.fnScopeId = vnode.fnScopeId;
  35400. cloned.asyncMeta = vnode.asyncMeta;
  35401. cloned.isCloned = true;
  35402. return cloned
  35403. }
  35404. /*
  35405. * not type checking this file because flow doesn't play well with
  35406. * dynamically accessing methods on Array prototype
  35407. */
  35408. var arrayProto = Array.prototype;
  35409. var arrayMethods = Object.create(arrayProto);
  35410. var methodsToPatch = [
  35411. 'push',
  35412. 'pop',
  35413. 'shift',
  35414. 'unshift',
  35415. 'splice',
  35416. 'sort',
  35417. 'reverse'
  35418. ];
  35419. /**
  35420. * Intercept mutating methods and emit events
  35421. */
  35422. methodsToPatch.forEach(function (method) {
  35423. // cache original method
  35424. var original = arrayProto[method];
  35425. def(arrayMethods, method, function mutator () {
  35426. var args = [], len = arguments.length;
  35427. while ( len-- ) args[ len ] = arguments[ len ];
  35428. var result = original.apply(this, args);
  35429. var ob = this.__ob__;
  35430. var inserted;
  35431. switch (method) {
  35432. case 'push':
  35433. case 'unshift':
  35434. inserted = args;
  35435. break
  35436. case 'splice':
  35437. inserted = args.slice(2);
  35438. break
  35439. }
  35440. if (inserted) { ob.observeArray(inserted); }
  35441. // notify change
  35442. ob.dep.notify();
  35443. return result
  35444. });
  35445. });
  35446. /* */
  35447. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  35448. /**
  35449. * In some cases we may want to disable observation inside a component's
  35450. * update computation.
  35451. */
  35452. var shouldObserve = true;
  35453. function toggleObserving (value) {
  35454. shouldObserve = value;
  35455. }
  35456. /**
  35457. * Observer class that is attached to each observed
  35458. * object. Once attached, the observer converts the target
  35459. * object's property keys into getter/setters that
  35460. * collect dependencies and dispatch updates.
  35461. */
  35462. var Observer = function Observer (value) {
  35463. this.value = value;
  35464. this.dep = new Dep();
  35465. this.vmCount = 0;
  35466. def(value, '__ob__', this);
  35467. if (Array.isArray(value)) {
  35468. if (hasProto) {
  35469. protoAugment(value, arrayMethods);
  35470. } else {
  35471. copyAugment(value, arrayMethods, arrayKeys);
  35472. }
  35473. this.observeArray(value);
  35474. } else {
  35475. this.walk(value);
  35476. }
  35477. };
  35478. /**
  35479. * Walk through all properties and convert them into
  35480. * getter/setters. This method should only be called when
  35481. * value type is Object.
  35482. */
  35483. Observer.prototype.walk = function walk (obj) {
  35484. var keys = Object.keys(obj);
  35485. for (var i = 0; i < keys.length; i++) {
  35486. defineReactive$$1(obj, keys[i]);
  35487. }
  35488. };
  35489. /**
  35490. * Observe a list of Array items.
  35491. */
  35492. Observer.prototype.observeArray = function observeArray (items) {
  35493. for (var i = 0, l = items.length; i < l; i++) {
  35494. observe(items[i]);
  35495. }
  35496. };
  35497. // helpers
  35498. /**
  35499. * Augment a target Object or Array by intercepting
  35500. * the prototype chain using __proto__
  35501. */
  35502. function protoAugment (target, src) {
  35503. /* eslint-disable no-proto */
  35504. target.__proto__ = src;
  35505. /* eslint-enable no-proto */
  35506. }
  35507. /**
  35508. * Augment a target Object or Array by defining
  35509. * hidden properties.
  35510. */
  35511. /* istanbul ignore next */
  35512. function copyAugment (target, src, keys) {
  35513. for (var i = 0, l = keys.length; i < l; i++) {
  35514. var key = keys[i];
  35515. def(target, key, src[key]);
  35516. }
  35517. }
  35518. /**
  35519. * Attempt to create an observer instance for a value,
  35520. * returns the new observer if successfully observed,
  35521. * or the existing observer if the value already has one.
  35522. */
  35523. function observe (value, asRootData) {
  35524. if (!isObject(value) || value instanceof VNode) {
  35525. return
  35526. }
  35527. var ob;
  35528. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  35529. ob = value.__ob__;
  35530. } else if (
  35531. shouldObserve &&
  35532. !isServerRendering() &&
  35533. (Array.isArray(value) || isPlainObject(value)) &&
  35534. Object.isExtensible(value) &&
  35535. !value._isVue
  35536. ) {
  35537. ob = new Observer(value);
  35538. }
  35539. if (asRootData && ob) {
  35540. ob.vmCount++;
  35541. }
  35542. return ob
  35543. }
  35544. /**
  35545. * Define a reactive property on an Object.
  35546. */
  35547. function defineReactive$$1 (
  35548. obj,
  35549. key,
  35550. val,
  35551. customSetter,
  35552. shallow
  35553. ) {
  35554. var dep = new Dep();
  35555. var property = Object.getOwnPropertyDescriptor(obj, key);
  35556. if (property && property.configurable === false) {
  35557. return
  35558. }
  35559. // cater for pre-defined getter/setters
  35560. var getter = property && property.get;
  35561. var setter = property && property.set;
  35562. if ((!getter || setter) && arguments.length === 2) {
  35563. val = obj[key];
  35564. }
  35565. var childOb = !shallow && observe(val);
  35566. Object.defineProperty(obj, key, {
  35567. enumerable: true,
  35568. configurable: true,
  35569. get: function reactiveGetter () {
  35570. var value = getter ? getter.call(obj) : val;
  35571. if (Dep.target) {
  35572. dep.depend();
  35573. if (childOb) {
  35574. childOb.dep.depend();
  35575. if (Array.isArray(value)) {
  35576. dependArray(value);
  35577. }
  35578. }
  35579. }
  35580. return value
  35581. },
  35582. set: function reactiveSetter (newVal) {
  35583. var value = getter ? getter.call(obj) : val;
  35584. /* eslint-disable no-self-compare */
  35585. if (newVal === value || (newVal !== newVal && value !== value)) {
  35586. return
  35587. }
  35588. /* eslint-enable no-self-compare */
  35589. if (customSetter) {
  35590. customSetter();
  35591. }
  35592. // #7981: for accessor properties without setter
  35593. if (getter && !setter) { return }
  35594. if (setter) {
  35595. setter.call(obj, newVal);
  35596. } else {
  35597. val = newVal;
  35598. }
  35599. childOb = !shallow && observe(newVal);
  35600. dep.notify();
  35601. }
  35602. });
  35603. }
  35604. /**
  35605. * Set a property on an object. Adds the new property and
  35606. * triggers change notification if the property doesn't
  35607. * already exist.
  35608. */
  35609. function set (target, key, val) {
  35610. if (isUndef(target) || isPrimitive(target)
  35611. ) {
  35612. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  35613. }
  35614. if (Array.isArray(target) && isValidArrayIndex(key)) {
  35615. target.length = Math.max(target.length, key);
  35616. target.splice(key, 1, val);
  35617. return val
  35618. }
  35619. if (key in target && !(key in Object.prototype)) {
  35620. target[key] = val;
  35621. return val
  35622. }
  35623. var ob = (target).__ob__;
  35624. if (target._isVue || (ob && ob.vmCount)) {
  35625. warn(
  35626. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  35627. 'at runtime - declare it upfront in the data option.'
  35628. );
  35629. return val
  35630. }
  35631. if (!ob) {
  35632. target[key] = val;
  35633. return val
  35634. }
  35635. defineReactive$$1(ob.value, key, val);
  35636. ob.dep.notify();
  35637. return val
  35638. }
  35639. /**
  35640. * Delete a property and trigger change if necessary.
  35641. */
  35642. function del (target, key) {
  35643. if (isUndef(target) || isPrimitive(target)
  35644. ) {
  35645. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  35646. }
  35647. if (Array.isArray(target) && isValidArrayIndex(key)) {
  35648. target.splice(key, 1);
  35649. return
  35650. }
  35651. var ob = (target).__ob__;
  35652. if (target._isVue || (ob && ob.vmCount)) {
  35653. warn(
  35654. 'Avoid deleting properties on a Vue instance or its root $data ' +
  35655. '- just set it to null.'
  35656. );
  35657. return
  35658. }
  35659. if (!hasOwn(target, key)) {
  35660. return
  35661. }
  35662. delete target[key];
  35663. if (!ob) {
  35664. return
  35665. }
  35666. ob.dep.notify();
  35667. }
  35668. /**
  35669. * Collect dependencies on array elements when the array is touched, since
  35670. * we cannot intercept array element access like property getters.
  35671. */
  35672. function dependArray (value) {
  35673. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  35674. e = value[i];
  35675. e && e.__ob__ && e.__ob__.dep.depend();
  35676. if (Array.isArray(e)) {
  35677. dependArray(e);
  35678. }
  35679. }
  35680. }
  35681. /* */
  35682. /**
  35683. * Option overwriting strategies are functions that handle
  35684. * how to merge a parent option value and a child option
  35685. * value into the final value.
  35686. */
  35687. var strats = config.optionMergeStrategies;
  35688. /**
  35689. * Options with restrictions
  35690. */
  35691. {
  35692. strats.el = strats.propsData = function (parent, child, vm, key) {
  35693. if (!vm) {
  35694. warn(
  35695. "option \"" + key + "\" can only be used during instance " +
  35696. 'creation with the `new` keyword.'
  35697. );
  35698. }
  35699. return defaultStrat(parent, child)
  35700. };
  35701. }
  35702. /**
  35703. * Helper that recursively merges two data objects together.
  35704. */
  35705. function mergeData (to, from) {
  35706. if (!from) { return to }
  35707. var key, toVal, fromVal;
  35708. var keys = hasSymbol
  35709. ? Reflect.ownKeys(from)
  35710. : Object.keys(from);
  35711. for (var i = 0; i < keys.length; i++) {
  35712. key = keys[i];
  35713. // in case the object is already observed...
  35714. if (key === '__ob__') { continue }
  35715. toVal = to[key];
  35716. fromVal = from[key];
  35717. if (!hasOwn(to, key)) {
  35718. set(to, key, fromVal);
  35719. } else if (
  35720. toVal !== fromVal &&
  35721. isPlainObject(toVal) &&
  35722. isPlainObject(fromVal)
  35723. ) {
  35724. mergeData(toVal, fromVal);
  35725. }
  35726. }
  35727. return to
  35728. }
  35729. /**
  35730. * Data
  35731. */
  35732. function mergeDataOrFn (
  35733. parentVal,
  35734. childVal,
  35735. vm
  35736. ) {
  35737. if (!vm) {
  35738. // in a Vue.extend merge, both should be functions
  35739. if (!childVal) {
  35740. return parentVal
  35741. }
  35742. if (!parentVal) {
  35743. return childVal
  35744. }
  35745. // when parentVal & childVal are both present,
  35746. // we need to return a function that returns the
  35747. // merged result of both functions... no need to
  35748. // check if parentVal is a function here because
  35749. // it has to be a function to pass previous merges.
  35750. return function mergedDataFn () {
  35751. return mergeData(
  35752. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  35753. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  35754. )
  35755. }
  35756. } else {
  35757. return function mergedInstanceDataFn () {
  35758. // instance merge
  35759. var instanceData = typeof childVal === 'function'
  35760. ? childVal.call(vm, vm)
  35761. : childVal;
  35762. var defaultData = typeof parentVal === 'function'
  35763. ? parentVal.call(vm, vm)
  35764. : parentVal;
  35765. if (instanceData) {
  35766. return mergeData(instanceData, defaultData)
  35767. } else {
  35768. return defaultData
  35769. }
  35770. }
  35771. }
  35772. }
  35773. strats.data = function (
  35774. parentVal,
  35775. childVal,
  35776. vm
  35777. ) {
  35778. if (!vm) {
  35779. if (childVal && typeof childVal !== 'function') {
  35780. warn(
  35781. 'The "data" option should be a function ' +
  35782. 'that returns a per-instance value in component ' +
  35783. 'definitions.',
  35784. vm
  35785. );
  35786. return parentVal
  35787. }
  35788. return mergeDataOrFn(parentVal, childVal)
  35789. }
  35790. return mergeDataOrFn(parentVal, childVal, vm)
  35791. };
  35792. /**
  35793. * Hooks and props are merged as arrays.
  35794. */
  35795. function mergeHook (
  35796. parentVal,
  35797. childVal
  35798. ) {
  35799. var res = childVal
  35800. ? parentVal
  35801. ? parentVal.concat(childVal)
  35802. : Array.isArray(childVal)
  35803. ? childVal
  35804. : [childVal]
  35805. : parentVal;
  35806. return res
  35807. ? dedupeHooks(res)
  35808. : res
  35809. }
  35810. function dedupeHooks (hooks) {
  35811. var res = [];
  35812. for (var i = 0; i < hooks.length; i++) {
  35813. if (res.indexOf(hooks[i]) === -1) {
  35814. res.push(hooks[i]);
  35815. }
  35816. }
  35817. return res
  35818. }
  35819. LIFECYCLE_HOOKS.forEach(function (hook) {
  35820. strats[hook] = mergeHook;
  35821. });
  35822. /**
  35823. * Assets
  35824. *
  35825. * When a vm is present (instance creation), we need to do
  35826. * a three-way merge between constructor options, instance
  35827. * options and parent options.
  35828. */
  35829. function mergeAssets (
  35830. parentVal,
  35831. childVal,
  35832. vm,
  35833. key
  35834. ) {
  35835. var res = Object.create(parentVal || null);
  35836. if (childVal) {
  35837. assertObjectType(key, childVal, vm);
  35838. return extend(res, childVal)
  35839. } else {
  35840. return res
  35841. }
  35842. }
  35843. ASSET_TYPES.forEach(function (type) {
  35844. strats[type + 's'] = mergeAssets;
  35845. });
  35846. /**
  35847. * Watchers.
  35848. *
  35849. * Watchers hashes should not overwrite one
  35850. * another, so we merge them as arrays.
  35851. */
  35852. strats.watch = function (
  35853. parentVal,
  35854. childVal,
  35855. vm,
  35856. key
  35857. ) {
  35858. // work around Firefox's Object.prototype.watch...
  35859. if (parentVal === nativeWatch) { parentVal = undefined; }
  35860. if (childVal === nativeWatch) { childVal = undefined; }
  35861. /* istanbul ignore if */
  35862. if (!childVal) { return Object.create(parentVal || null) }
  35863. {
  35864. assertObjectType(key, childVal, vm);
  35865. }
  35866. if (!parentVal) { return childVal }
  35867. var ret = {};
  35868. extend(ret, parentVal);
  35869. for (var key$1 in childVal) {
  35870. var parent = ret[key$1];
  35871. var child = childVal[key$1];
  35872. if (parent && !Array.isArray(parent)) {
  35873. parent = [parent];
  35874. }
  35875. ret[key$1] = parent
  35876. ? parent.concat(child)
  35877. : Array.isArray(child) ? child : [child];
  35878. }
  35879. return ret
  35880. };
  35881. /**
  35882. * Other object hashes.
  35883. */
  35884. strats.props =
  35885. strats.methods =
  35886. strats.inject =
  35887. strats.computed = function (
  35888. parentVal,
  35889. childVal,
  35890. vm,
  35891. key
  35892. ) {
  35893. if (childVal && "development" !== 'production') {
  35894. assertObjectType(key, childVal, vm);
  35895. }
  35896. if (!parentVal) { return childVal }
  35897. var ret = Object.create(null);
  35898. extend(ret, parentVal);
  35899. if (childVal) { extend(ret, childVal); }
  35900. return ret
  35901. };
  35902. strats.provide = mergeDataOrFn;
  35903. /**
  35904. * Default strategy.
  35905. */
  35906. var defaultStrat = function (parentVal, childVal) {
  35907. return childVal === undefined
  35908. ? parentVal
  35909. : childVal
  35910. };
  35911. /**
  35912. * Validate component names
  35913. */
  35914. function checkComponents (options) {
  35915. for (var key in options.components) {
  35916. validateComponentName(key);
  35917. }
  35918. }
  35919. function validateComponentName (name) {
  35920. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  35921. warn(
  35922. 'Invalid component name: "' + name + '". Component names ' +
  35923. 'should conform to valid custom element name in html5 specification.'
  35924. );
  35925. }
  35926. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  35927. warn(
  35928. 'Do not use built-in or reserved HTML elements as component ' +
  35929. 'id: ' + name
  35930. );
  35931. }
  35932. }
  35933. /**
  35934. * Ensure all props option syntax are normalized into the
  35935. * Object-based format.
  35936. */
  35937. function normalizeProps (options, vm) {
  35938. var props = options.props;
  35939. if (!props) { return }
  35940. var res = {};
  35941. var i, val, name;
  35942. if (Array.isArray(props)) {
  35943. i = props.length;
  35944. while (i--) {
  35945. val = props[i];
  35946. if (typeof val === 'string') {
  35947. name = camelize(val);
  35948. res[name] = { type: null };
  35949. } else {
  35950. warn('props must be strings when using array syntax.');
  35951. }
  35952. }
  35953. } else if (isPlainObject(props)) {
  35954. for (var key in props) {
  35955. val = props[key];
  35956. name = camelize(key);
  35957. res[name] = isPlainObject(val)
  35958. ? val
  35959. : { type: val };
  35960. }
  35961. } else {
  35962. warn(
  35963. "Invalid value for option \"props\": expected an Array or an Object, " +
  35964. "but got " + (toRawType(props)) + ".",
  35965. vm
  35966. );
  35967. }
  35968. options.props = res;
  35969. }
  35970. /**
  35971. * Normalize all injections into Object-based format
  35972. */
  35973. function normalizeInject (options, vm) {
  35974. var inject = options.inject;
  35975. if (!inject) { return }
  35976. var normalized = options.inject = {};
  35977. if (Array.isArray(inject)) {
  35978. for (var i = 0; i < inject.length; i++) {
  35979. normalized[inject[i]] = { from: inject[i] };
  35980. }
  35981. } else if (isPlainObject(inject)) {
  35982. for (var key in inject) {
  35983. var val = inject[key];
  35984. normalized[key] = isPlainObject(val)
  35985. ? extend({ from: key }, val)
  35986. : { from: val };
  35987. }
  35988. } else {
  35989. warn(
  35990. "Invalid value for option \"inject\": expected an Array or an Object, " +
  35991. "but got " + (toRawType(inject)) + ".",
  35992. vm
  35993. );
  35994. }
  35995. }
  35996. /**
  35997. * Normalize raw function directives into object format.
  35998. */
  35999. function normalizeDirectives (options) {
  36000. var dirs = options.directives;
  36001. if (dirs) {
  36002. for (var key in dirs) {
  36003. var def$$1 = dirs[key];
  36004. if (typeof def$$1 === 'function') {
  36005. dirs[key] = { bind: def$$1, update: def$$1 };
  36006. }
  36007. }
  36008. }
  36009. }
  36010. function assertObjectType (name, value, vm) {
  36011. if (!isPlainObject(value)) {
  36012. warn(
  36013. "Invalid value for option \"" + name + "\": expected an Object, " +
  36014. "but got " + (toRawType(value)) + ".",
  36015. vm
  36016. );
  36017. }
  36018. }
  36019. /**
  36020. * Merge two option objects into a new one.
  36021. * Core utility used in both instantiation and inheritance.
  36022. */
  36023. function mergeOptions (
  36024. parent,
  36025. child,
  36026. vm
  36027. ) {
  36028. {
  36029. checkComponents(child);
  36030. }
  36031. if (typeof child === 'function') {
  36032. child = child.options;
  36033. }
  36034. normalizeProps(child, vm);
  36035. normalizeInject(child, vm);
  36036. normalizeDirectives(child);
  36037. // Apply extends and mixins on the child options,
  36038. // but only if it is a raw options object that isn't
  36039. // the result of another mergeOptions call.
  36040. // Only merged options has the _base property.
  36041. if (!child._base) {
  36042. if (child.extends) {
  36043. parent = mergeOptions(parent, child.extends, vm);
  36044. }
  36045. if (child.mixins) {
  36046. for (var i = 0, l = child.mixins.length; i < l; i++) {
  36047. parent = mergeOptions(parent, child.mixins[i], vm);
  36048. }
  36049. }
  36050. }
  36051. var options = {};
  36052. var key;
  36053. for (key in parent) {
  36054. mergeField(key);
  36055. }
  36056. for (key in child) {
  36057. if (!hasOwn(parent, key)) {
  36058. mergeField(key);
  36059. }
  36060. }
  36061. function mergeField (key) {
  36062. var strat = strats[key] || defaultStrat;
  36063. options[key] = strat(parent[key], child[key], vm, key);
  36064. }
  36065. return options
  36066. }
  36067. /**
  36068. * Resolve an asset.
  36069. * This function is used because child instances need access
  36070. * to assets defined in its ancestor chain.
  36071. */
  36072. function resolveAsset (
  36073. options,
  36074. type,
  36075. id,
  36076. warnMissing
  36077. ) {
  36078. /* istanbul ignore if */
  36079. if (typeof id !== 'string') {
  36080. return
  36081. }
  36082. var assets = options[type];
  36083. // check local registration variations first
  36084. if (hasOwn(assets, id)) { return assets[id] }
  36085. var camelizedId = camelize(id);
  36086. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  36087. var PascalCaseId = capitalize(camelizedId);
  36088. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  36089. // fallback to prototype chain
  36090. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  36091. if (warnMissing && !res) {
  36092. warn(
  36093. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  36094. options
  36095. );
  36096. }
  36097. return res
  36098. }
  36099. /* */
  36100. function validateProp (
  36101. key,
  36102. propOptions,
  36103. propsData,
  36104. vm
  36105. ) {
  36106. var prop = propOptions[key];
  36107. var absent = !hasOwn(propsData, key);
  36108. var value = propsData[key];
  36109. // boolean casting
  36110. var booleanIndex = getTypeIndex(Boolean, prop.type);
  36111. if (booleanIndex > -1) {
  36112. if (absent && !hasOwn(prop, 'default')) {
  36113. value = false;
  36114. } else if (value === '' || value === hyphenate(key)) {
  36115. // only cast empty string / same name to boolean if
  36116. // boolean has higher priority
  36117. var stringIndex = getTypeIndex(String, prop.type);
  36118. if (stringIndex < 0 || booleanIndex < stringIndex) {
  36119. value = true;
  36120. }
  36121. }
  36122. }
  36123. // check default value
  36124. if (value === undefined) {
  36125. value = getPropDefaultValue(vm, prop, key);
  36126. // since the default value is a fresh copy,
  36127. // make sure to observe it.
  36128. var prevShouldObserve = shouldObserve;
  36129. toggleObserving(true);
  36130. observe(value);
  36131. toggleObserving(prevShouldObserve);
  36132. }
  36133. {
  36134. assertProp(prop, key, value, vm, absent);
  36135. }
  36136. return value
  36137. }
  36138. /**
  36139. * Get the default value of a prop.
  36140. */
  36141. function getPropDefaultValue (vm, prop, key) {
  36142. // no default, return undefined
  36143. if (!hasOwn(prop, 'default')) {
  36144. return undefined
  36145. }
  36146. var def = prop.default;
  36147. // warn against non-factory defaults for Object & Array
  36148. if (isObject(def)) {
  36149. warn(
  36150. 'Invalid default value for prop "' + key + '": ' +
  36151. 'Props with type Object/Array must use a factory function ' +
  36152. 'to return the default value.',
  36153. vm
  36154. );
  36155. }
  36156. // the raw prop value was also undefined from previous render,
  36157. // return previous default value to avoid unnecessary watcher trigger
  36158. if (vm && vm.$options.propsData &&
  36159. vm.$options.propsData[key] === undefined &&
  36160. vm._props[key] !== undefined
  36161. ) {
  36162. return vm._props[key]
  36163. }
  36164. // call factory function for non-Function types
  36165. // a value is Function if its prototype is function even across different execution context
  36166. return typeof def === 'function' && getType(prop.type) !== 'Function'
  36167. ? def.call(vm)
  36168. : def
  36169. }
  36170. /**
  36171. * Assert whether a prop is valid.
  36172. */
  36173. function assertProp (
  36174. prop,
  36175. name,
  36176. value,
  36177. vm,
  36178. absent
  36179. ) {
  36180. if (prop.required && absent) {
  36181. warn(
  36182. 'Missing required prop: "' + name + '"',
  36183. vm
  36184. );
  36185. return
  36186. }
  36187. if (value == null && !prop.required) {
  36188. return
  36189. }
  36190. var type = prop.type;
  36191. var valid = !type || type === true;
  36192. var expectedTypes = [];
  36193. if (type) {
  36194. if (!Array.isArray(type)) {
  36195. type = [type];
  36196. }
  36197. for (var i = 0; i < type.length && !valid; i++) {
  36198. var assertedType = assertType(value, type[i], vm);
  36199. expectedTypes.push(assertedType.expectedType || '');
  36200. valid = assertedType.valid;
  36201. }
  36202. }
  36203. var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
  36204. if (!valid && haveExpectedTypes) {
  36205. warn(
  36206. getInvalidTypeMessage(name, value, expectedTypes),
  36207. vm
  36208. );
  36209. return
  36210. }
  36211. var validator = prop.validator;
  36212. if (validator) {
  36213. if (!validator(value)) {
  36214. warn(
  36215. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  36216. vm
  36217. );
  36218. }
  36219. }
  36220. }
  36221. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
  36222. function assertType (value, type, vm) {
  36223. var valid;
  36224. var expectedType = getType(type);
  36225. if (simpleCheckRE.test(expectedType)) {
  36226. var t = typeof value;
  36227. valid = t === expectedType.toLowerCase();
  36228. // for primitive wrapper objects
  36229. if (!valid && t === 'object') {
  36230. valid = value instanceof type;
  36231. }
  36232. } else if (expectedType === 'Object') {
  36233. valid = isPlainObject(value);
  36234. } else if (expectedType === 'Array') {
  36235. valid = Array.isArray(value);
  36236. } else {
  36237. try {
  36238. valid = value instanceof type;
  36239. } catch (e) {
  36240. warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
  36241. valid = false;
  36242. }
  36243. }
  36244. return {
  36245. valid: valid,
  36246. expectedType: expectedType
  36247. }
  36248. }
  36249. var functionTypeCheckRE = /^\s*function (\w+)/;
  36250. /**
  36251. * Use function string name to check built-in types,
  36252. * because a simple equality check will fail when running
  36253. * across different vms / iframes.
  36254. */
  36255. function getType (fn) {
  36256. var match = fn && fn.toString().match(functionTypeCheckRE);
  36257. return match ? match[1] : ''
  36258. }
  36259. function isSameType (a, b) {
  36260. return getType(a) === getType(b)
  36261. }
  36262. function getTypeIndex (type, expectedTypes) {
  36263. if (!Array.isArray(expectedTypes)) {
  36264. return isSameType(expectedTypes, type) ? 0 : -1
  36265. }
  36266. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  36267. if (isSameType(expectedTypes[i], type)) {
  36268. return i
  36269. }
  36270. }
  36271. return -1
  36272. }
  36273. function getInvalidTypeMessage (name, value, expectedTypes) {
  36274. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  36275. " Expected " + (expectedTypes.map(capitalize).join(', '));
  36276. var expectedType = expectedTypes[0];
  36277. var receivedType = toRawType(value);
  36278. // check if we need to specify expected value
  36279. if (
  36280. expectedTypes.length === 1 &&
  36281. isExplicable(expectedType) &&
  36282. isExplicable(typeof value) &&
  36283. !isBoolean(expectedType, receivedType)
  36284. ) {
  36285. message += " with value " + (styleValue(value, expectedType));
  36286. }
  36287. message += ", got " + receivedType + " ";
  36288. // check if we need to specify received value
  36289. if (isExplicable(receivedType)) {
  36290. message += "with value " + (styleValue(value, receivedType)) + ".";
  36291. }
  36292. return message
  36293. }
  36294. function styleValue (value, type) {
  36295. if (type === 'String') {
  36296. return ("\"" + value + "\"")
  36297. } else if (type === 'Number') {
  36298. return ("" + (Number(value)))
  36299. } else {
  36300. return ("" + value)
  36301. }
  36302. }
  36303. var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
  36304. function isExplicable (value) {
  36305. return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
  36306. }
  36307. function isBoolean () {
  36308. var args = [], len = arguments.length;
  36309. while ( len-- ) args[ len ] = arguments[ len ];
  36310. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  36311. }
  36312. /* */
  36313. function handleError (err, vm, info) {
  36314. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  36315. // See: https://github.com/vuejs/vuex/issues/1505
  36316. pushTarget();
  36317. try {
  36318. if (vm) {
  36319. var cur = vm;
  36320. while ((cur = cur.$parent)) {
  36321. var hooks = cur.$options.errorCaptured;
  36322. if (hooks) {
  36323. for (var i = 0; i < hooks.length; i++) {
  36324. try {
  36325. var capture = hooks[i].call(cur, err, vm, info) === false;
  36326. if (capture) { return }
  36327. } catch (e) {
  36328. globalHandleError(e, cur, 'errorCaptured hook');
  36329. }
  36330. }
  36331. }
  36332. }
  36333. }
  36334. globalHandleError(err, vm, info);
  36335. } finally {
  36336. popTarget();
  36337. }
  36338. }
  36339. function invokeWithErrorHandling (
  36340. handler,
  36341. context,
  36342. args,
  36343. vm,
  36344. info
  36345. ) {
  36346. var res;
  36347. try {
  36348. res = args ? handler.apply(context, args) : handler.call(context);
  36349. if (res && !res._isVue && isPromise(res) && !res._handled) {
  36350. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  36351. // issue #9511
  36352. // avoid catch triggering multiple times when nested calls
  36353. res._handled = true;
  36354. }
  36355. } catch (e) {
  36356. handleError(e, vm, info);
  36357. }
  36358. return res
  36359. }
  36360. function globalHandleError (err, vm, info) {
  36361. if (config.errorHandler) {
  36362. try {
  36363. return config.errorHandler.call(null, err, vm, info)
  36364. } catch (e) {
  36365. // if the user intentionally throws the original error in the handler,
  36366. // do not log it twice
  36367. if (e !== err) {
  36368. logError(e, null, 'config.errorHandler');
  36369. }
  36370. }
  36371. }
  36372. logError(err, vm, info);
  36373. }
  36374. function logError (err, vm, info) {
  36375. {
  36376. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  36377. }
  36378. /* istanbul ignore else */
  36379. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  36380. console.error(err);
  36381. } else {
  36382. throw err
  36383. }
  36384. }
  36385. /* */
  36386. var isUsingMicroTask = false;
  36387. var callbacks = [];
  36388. var pending = false;
  36389. function flushCallbacks () {
  36390. pending = false;
  36391. var copies = callbacks.slice(0);
  36392. callbacks.length = 0;
  36393. for (var i = 0; i < copies.length; i++) {
  36394. copies[i]();
  36395. }
  36396. }
  36397. // Here we have async deferring wrappers using microtasks.
  36398. // In 2.5 we used (macro) tasks (in combination with microtasks).
  36399. // However, it has subtle problems when state is changed right before repaint
  36400. // (e.g. #6813, out-in transitions).
  36401. // Also, using (macro) tasks in event handler would cause some weird behaviors
  36402. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  36403. // So we now use microtasks everywhere, again.
  36404. // A major drawback of this tradeoff is that there are some scenarios
  36405. // where microtasks have too high a priority and fire in between supposedly
  36406. // sequential events (e.g. #4521, #6690, which have workarounds)
  36407. // or even between bubbling of the same event (#6566).
  36408. var timerFunc;
  36409. // The nextTick behavior leverages the microtask queue, which can be accessed
  36410. // via either native Promise.then or MutationObserver.
  36411. // MutationObserver has wider support, however it is seriously bugged in
  36412. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  36413. // completely stops working after triggering a few times... so, if native
  36414. // Promise is available, we will use it:
  36415. /* istanbul ignore next, $flow-disable-line */
  36416. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  36417. var p = Promise.resolve();
  36418. timerFunc = function () {
  36419. p.then(flushCallbacks);
  36420. // In problematic UIWebViews, Promise.then doesn't completely break, but
  36421. // it can get stuck in a weird state where callbacks are pushed into the
  36422. // microtask queue but the queue isn't being flushed, until the browser
  36423. // needs to do some other work, e.g. handle a timer. Therefore we can
  36424. // "force" the microtask queue to be flushed by adding an empty timer.
  36425. if (isIOS) { setTimeout(noop); }
  36426. };
  36427. isUsingMicroTask = true;
  36428. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  36429. isNative(MutationObserver) ||
  36430. // PhantomJS and iOS 7.x
  36431. MutationObserver.toString() === '[object MutationObserverConstructor]'
  36432. )) {
  36433. // Use MutationObserver where native Promise is not available,
  36434. // e.g. PhantomJS, iOS7, Android 4.4
  36435. // (#6466 MutationObserver is unreliable in IE11)
  36436. var counter = 1;
  36437. var observer = new MutationObserver(flushCallbacks);
  36438. var textNode = document.createTextNode(String(counter));
  36439. observer.observe(textNode, {
  36440. characterData: true
  36441. });
  36442. timerFunc = function () {
  36443. counter = (counter + 1) % 2;
  36444. textNode.data = String(counter);
  36445. };
  36446. isUsingMicroTask = true;
  36447. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  36448. // Fallback to setImmediate.
  36449. // Technically it leverages the (macro) task queue,
  36450. // but it is still a better choice than setTimeout.
  36451. timerFunc = function () {
  36452. setImmediate(flushCallbacks);
  36453. };
  36454. } else {
  36455. // Fallback to setTimeout.
  36456. timerFunc = function () {
  36457. setTimeout(flushCallbacks, 0);
  36458. };
  36459. }
  36460. function nextTick (cb, ctx) {
  36461. var _resolve;
  36462. callbacks.push(function () {
  36463. if (cb) {
  36464. try {
  36465. cb.call(ctx);
  36466. } catch (e) {
  36467. handleError(e, ctx, 'nextTick');
  36468. }
  36469. } else if (_resolve) {
  36470. _resolve(ctx);
  36471. }
  36472. });
  36473. if (!pending) {
  36474. pending = true;
  36475. timerFunc();
  36476. }
  36477. // $flow-disable-line
  36478. if (!cb && typeof Promise !== 'undefined') {
  36479. return new Promise(function (resolve) {
  36480. _resolve = resolve;
  36481. })
  36482. }
  36483. }
  36484. /* */
  36485. var mark;
  36486. var measure;
  36487. {
  36488. var perf = inBrowser && window.performance;
  36489. /* istanbul ignore if */
  36490. if (
  36491. perf &&
  36492. perf.mark &&
  36493. perf.measure &&
  36494. perf.clearMarks &&
  36495. perf.clearMeasures
  36496. ) {
  36497. mark = function (tag) { return perf.mark(tag); };
  36498. measure = function (name, startTag, endTag) {
  36499. perf.measure(name, startTag, endTag);
  36500. perf.clearMarks(startTag);
  36501. perf.clearMarks(endTag);
  36502. // perf.clearMeasures(name)
  36503. };
  36504. }
  36505. }
  36506. /* not type checking this file because flow doesn't play well with Proxy */
  36507. var initProxy;
  36508. {
  36509. var allowedGlobals = makeMap(
  36510. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  36511. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  36512. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
  36513. 'require' // for Webpack/Browserify
  36514. );
  36515. var warnNonPresent = function (target, key) {
  36516. warn(
  36517. "Property or method \"" + key + "\" is not defined on the instance but " +
  36518. 'referenced during render. Make sure that this property is reactive, ' +
  36519. 'either in the data option, or for class-based components, by ' +
  36520. 'initializing the property. ' +
  36521. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  36522. target
  36523. );
  36524. };
  36525. var warnReservedPrefix = function (target, key) {
  36526. warn(
  36527. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  36528. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  36529. 'prevent conflicts with Vue internals. ' +
  36530. 'See: https://vuejs.org/v2/api/#data',
  36531. target
  36532. );
  36533. };
  36534. var hasProxy =
  36535. typeof Proxy !== 'undefined' && isNative(Proxy);
  36536. if (hasProxy) {
  36537. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  36538. config.keyCodes = new Proxy(config.keyCodes, {
  36539. set: function set (target, key, value) {
  36540. if (isBuiltInModifier(key)) {
  36541. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  36542. return false
  36543. } else {
  36544. target[key] = value;
  36545. return true
  36546. }
  36547. }
  36548. });
  36549. }
  36550. var hasHandler = {
  36551. has: function has (target, key) {
  36552. var has = key in target;
  36553. var isAllowed = allowedGlobals(key) ||
  36554. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  36555. if (!has && !isAllowed) {
  36556. if (key in target.$data) { warnReservedPrefix(target, key); }
  36557. else { warnNonPresent(target, key); }
  36558. }
  36559. return has || !isAllowed
  36560. }
  36561. };
  36562. var getHandler = {
  36563. get: function get (target, key) {
  36564. if (typeof key === 'string' && !(key in target)) {
  36565. if (key in target.$data) { warnReservedPrefix(target, key); }
  36566. else { warnNonPresent(target, key); }
  36567. }
  36568. return target[key]
  36569. }
  36570. };
  36571. initProxy = function initProxy (vm) {
  36572. if (hasProxy) {
  36573. // determine which proxy handler to use
  36574. var options = vm.$options;
  36575. var handlers = options.render && options.render._withStripped
  36576. ? getHandler
  36577. : hasHandler;
  36578. vm._renderProxy = new Proxy(vm, handlers);
  36579. } else {
  36580. vm._renderProxy = vm;
  36581. }
  36582. };
  36583. }
  36584. /* */
  36585. var seenObjects = new _Set();
  36586. /**
  36587. * Recursively traverse an object to evoke all converted
  36588. * getters, so that every nested property inside the object
  36589. * is collected as a "deep" dependency.
  36590. */
  36591. function traverse (val) {
  36592. _traverse(val, seenObjects);
  36593. seenObjects.clear();
  36594. }
  36595. function _traverse (val, seen) {
  36596. var i, keys;
  36597. var isA = Array.isArray(val);
  36598. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  36599. return
  36600. }
  36601. if (val.__ob__) {
  36602. var depId = val.__ob__.dep.id;
  36603. if (seen.has(depId)) {
  36604. return
  36605. }
  36606. seen.add(depId);
  36607. }
  36608. if (isA) {
  36609. i = val.length;
  36610. while (i--) { _traverse(val[i], seen); }
  36611. } else {
  36612. keys = Object.keys(val);
  36613. i = keys.length;
  36614. while (i--) { _traverse(val[keys[i]], seen); }
  36615. }
  36616. }
  36617. /* */
  36618. var normalizeEvent = cached(function (name) {
  36619. var passive = name.charAt(0) === '&';
  36620. name = passive ? name.slice(1) : name;
  36621. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  36622. name = once$$1 ? name.slice(1) : name;
  36623. var capture = name.charAt(0) === '!';
  36624. name = capture ? name.slice(1) : name;
  36625. return {
  36626. name: name,
  36627. once: once$$1,
  36628. capture: capture,
  36629. passive: passive
  36630. }
  36631. });
  36632. function createFnInvoker (fns, vm) {
  36633. function invoker () {
  36634. var arguments$1 = arguments;
  36635. var fns = invoker.fns;
  36636. if (Array.isArray(fns)) {
  36637. var cloned = fns.slice();
  36638. for (var i = 0; i < cloned.length; i++) {
  36639. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  36640. }
  36641. } else {
  36642. // return handler return value for single handlers
  36643. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  36644. }
  36645. }
  36646. invoker.fns = fns;
  36647. return invoker
  36648. }
  36649. function updateListeners (
  36650. on,
  36651. oldOn,
  36652. add,
  36653. remove$$1,
  36654. createOnceHandler,
  36655. vm
  36656. ) {
  36657. var name, def$$1, cur, old, event;
  36658. for (name in on) {
  36659. def$$1 = cur = on[name];
  36660. old = oldOn[name];
  36661. event = normalizeEvent(name);
  36662. if (isUndef(cur)) {
  36663. warn(
  36664. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  36665. vm
  36666. );
  36667. } else if (isUndef(old)) {
  36668. if (isUndef(cur.fns)) {
  36669. cur = on[name] = createFnInvoker(cur, vm);
  36670. }
  36671. if (isTrue(event.once)) {
  36672. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  36673. }
  36674. add(event.name, cur, event.capture, event.passive, event.params);
  36675. } else if (cur !== old) {
  36676. old.fns = cur;
  36677. on[name] = old;
  36678. }
  36679. }
  36680. for (name in oldOn) {
  36681. if (isUndef(on[name])) {
  36682. event = normalizeEvent(name);
  36683. remove$$1(event.name, oldOn[name], event.capture);
  36684. }
  36685. }
  36686. }
  36687. /* */
  36688. function mergeVNodeHook (def, hookKey, hook) {
  36689. if (def instanceof VNode) {
  36690. def = def.data.hook || (def.data.hook = {});
  36691. }
  36692. var invoker;
  36693. var oldHook = def[hookKey];
  36694. function wrappedHook () {
  36695. hook.apply(this, arguments);
  36696. // important: remove merged hook to ensure it's called only once
  36697. // and prevent memory leak
  36698. remove(invoker.fns, wrappedHook);
  36699. }
  36700. if (isUndef(oldHook)) {
  36701. // no existing hook
  36702. invoker = createFnInvoker([wrappedHook]);
  36703. } else {
  36704. /* istanbul ignore if */
  36705. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  36706. // already a merged invoker
  36707. invoker = oldHook;
  36708. invoker.fns.push(wrappedHook);
  36709. } else {
  36710. // existing plain hook
  36711. invoker = createFnInvoker([oldHook, wrappedHook]);
  36712. }
  36713. }
  36714. invoker.merged = true;
  36715. def[hookKey] = invoker;
  36716. }
  36717. /* */
  36718. function extractPropsFromVNodeData (
  36719. data,
  36720. Ctor,
  36721. tag
  36722. ) {
  36723. // we are only extracting raw values here.
  36724. // validation and default values are handled in the child
  36725. // component itself.
  36726. var propOptions = Ctor.options.props;
  36727. if (isUndef(propOptions)) {
  36728. return
  36729. }
  36730. var res = {};
  36731. var attrs = data.attrs;
  36732. var props = data.props;
  36733. if (isDef(attrs) || isDef(props)) {
  36734. for (var key in propOptions) {
  36735. var altKey = hyphenate(key);
  36736. {
  36737. var keyInLowerCase = key.toLowerCase();
  36738. if (
  36739. key !== keyInLowerCase &&
  36740. attrs && hasOwn(attrs, keyInLowerCase)
  36741. ) {
  36742. tip(
  36743. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  36744. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  36745. " \"" + key + "\". " +
  36746. "Note that HTML attributes are case-insensitive and camelCased " +
  36747. "props need to use their kebab-case equivalents when using in-DOM " +
  36748. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  36749. );
  36750. }
  36751. }
  36752. checkProp(res, props, key, altKey, true) ||
  36753. checkProp(res, attrs, key, altKey, false);
  36754. }
  36755. }
  36756. return res
  36757. }
  36758. function checkProp (
  36759. res,
  36760. hash,
  36761. key,
  36762. altKey,
  36763. preserve
  36764. ) {
  36765. if (isDef(hash)) {
  36766. if (hasOwn(hash, key)) {
  36767. res[key] = hash[key];
  36768. if (!preserve) {
  36769. delete hash[key];
  36770. }
  36771. return true
  36772. } else if (hasOwn(hash, altKey)) {
  36773. res[key] = hash[altKey];
  36774. if (!preserve) {
  36775. delete hash[altKey];
  36776. }
  36777. return true
  36778. }
  36779. }
  36780. return false
  36781. }
  36782. /* */
  36783. // The template compiler attempts to minimize the need for normalization by
  36784. // statically analyzing the template at compile time.
  36785. //
  36786. // For plain HTML markup, normalization can be completely skipped because the
  36787. // generated render function is guaranteed to return Array<VNode>. There are
  36788. // two cases where extra normalization is needed:
  36789. // 1. When the children contains components - because a functional component
  36790. // may return an Array instead of a single root. In this case, just a simple
  36791. // normalization is needed - if any child is an Array, we flatten the whole
  36792. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  36793. // because functional components already normalize their own children.
  36794. function simpleNormalizeChildren (children) {
  36795. for (var i = 0; i < children.length; i++) {
  36796. if (Array.isArray(children[i])) {
  36797. return Array.prototype.concat.apply([], children)
  36798. }
  36799. }
  36800. return children
  36801. }
  36802. // 2. When the children contains constructs that always generated nested Arrays,
  36803. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  36804. // with hand-written render functions / JSX. In such cases a full normalization
  36805. // is needed to cater to all possible types of children values.
  36806. function normalizeChildren (children) {
  36807. return isPrimitive(children)
  36808. ? [createTextVNode(children)]
  36809. : Array.isArray(children)
  36810. ? normalizeArrayChildren(children)
  36811. : undefined
  36812. }
  36813. function isTextNode (node) {
  36814. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  36815. }
  36816. function normalizeArrayChildren (children, nestedIndex) {
  36817. var res = [];
  36818. var i, c, lastIndex, last;
  36819. for (i = 0; i < children.length; i++) {
  36820. c = children[i];
  36821. if (isUndef(c) || typeof c === 'boolean') { continue }
  36822. lastIndex = res.length - 1;
  36823. last = res[lastIndex];
  36824. // nested
  36825. if (Array.isArray(c)) {
  36826. if (c.length > 0) {
  36827. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  36828. // merge adjacent text nodes
  36829. if (isTextNode(c[0]) && isTextNode(last)) {
  36830. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  36831. c.shift();
  36832. }
  36833. res.push.apply(res, c);
  36834. }
  36835. } else if (isPrimitive(c)) {
  36836. if (isTextNode(last)) {
  36837. // merge adjacent text nodes
  36838. // this is necessary for SSR hydration because text nodes are
  36839. // essentially merged when rendered to HTML strings
  36840. res[lastIndex] = createTextVNode(last.text + c);
  36841. } else if (c !== '') {
  36842. // convert primitive to vnode
  36843. res.push(createTextVNode(c));
  36844. }
  36845. } else {
  36846. if (isTextNode(c) && isTextNode(last)) {
  36847. // merge adjacent text nodes
  36848. res[lastIndex] = createTextVNode(last.text + c.text);
  36849. } else {
  36850. // default key for nested array children (likely generated by v-for)
  36851. if (isTrue(children._isVList) &&
  36852. isDef(c.tag) &&
  36853. isUndef(c.key) &&
  36854. isDef(nestedIndex)) {
  36855. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  36856. }
  36857. res.push(c);
  36858. }
  36859. }
  36860. }
  36861. return res
  36862. }
  36863. /* */
  36864. function initProvide (vm) {
  36865. var provide = vm.$options.provide;
  36866. if (provide) {
  36867. vm._provided = typeof provide === 'function'
  36868. ? provide.call(vm)
  36869. : provide;
  36870. }
  36871. }
  36872. function initInjections (vm) {
  36873. var result = resolveInject(vm.$options.inject, vm);
  36874. if (result) {
  36875. toggleObserving(false);
  36876. Object.keys(result).forEach(function (key) {
  36877. /* istanbul ignore else */
  36878. {
  36879. defineReactive$$1(vm, key, result[key], function () {
  36880. warn(
  36881. "Avoid mutating an injected value directly since the changes will be " +
  36882. "overwritten whenever the provided component re-renders. " +
  36883. "injection being mutated: \"" + key + "\"",
  36884. vm
  36885. );
  36886. });
  36887. }
  36888. });
  36889. toggleObserving(true);
  36890. }
  36891. }
  36892. function resolveInject (inject, vm) {
  36893. if (inject) {
  36894. // inject is :any because flow is not smart enough to figure out cached
  36895. var result = Object.create(null);
  36896. var keys = hasSymbol
  36897. ? Reflect.ownKeys(inject)
  36898. : Object.keys(inject);
  36899. for (var i = 0; i < keys.length; i++) {
  36900. var key = keys[i];
  36901. // #6574 in case the inject object is observed...
  36902. if (key === '__ob__') { continue }
  36903. var provideKey = inject[key].from;
  36904. var source = vm;
  36905. while (source) {
  36906. if (source._provided && hasOwn(source._provided, provideKey)) {
  36907. result[key] = source._provided[provideKey];
  36908. break
  36909. }
  36910. source = source.$parent;
  36911. }
  36912. if (!source) {
  36913. if ('default' in inject[key]) {
  36914. var provideDefault = inject[key].default;
  36915. result[key] = typeof provideDefault === 'function'
  36916. ? provideDefault.call(vm)
  36917. : provideDefault;
  36918. } else {
  36919. warn(("Injection \"" + key + "\" not found"), vm);
  36920. }
  36921. }
  36922. }
  36923. return result
  36924. }
  36925. }
  36926. /* */
  36927. /**
  36928. * Runtime helper for resolving raw children VNodes into a slot object.
  36929. */
  36930. function resolveSlots (
  36931. children,
  36932. context
  36933. ) {
  36934. if (!children || !children.length) {
  36935. return {}
  36936. }
  36937. var slots = {};
  36938. for (var i = 0, l = children.length; i < l; i++) {
  36939. var child = children[i];
  36940. var data = child.data;
  36941. // remove slot attribute if the node is resolved as a Vue slot node
  36942. if (data && data.attrs && data.attrs.slot) {
  36943. delete data.attrs.slot;
  36944. }
  36945. // named slots should only be respected if the vnode was rendered in the
  36946. // same context.
  36947. if ((child.context === context || child.fnContext === context) &&
  36948. data && data.slot != null
  36949. ) {
  36950. var name = data.slot;
  36951. var slot = (slots[name] || (slots[name] = []));
  36952. if (child.tag === 'template') {
  36953. slot.push.apply(slot, child.children || []);
  36954. } else {
  36955. slot.push(child);
  36956. }
  36957. } else {
  36958. (slots.default || (slots.default = [])).push(child);
  36959. }
  36960. }
  36961. // ignore slots that contains only whitespace
  36962. for (var name$1 in slots) {
  36963. if (slots[name$1].every(isWhitespace)) {
  36964. delete slots[name$1];
  36965. }
  36966. }
  36967. return slots
  36968. }
  36969. function isWhitespace (node) {
  36970. return (node.isComment && !node.asyncFactory) || node.text === ' '
  36971. }
  36972. /* */
  36973. function isAsyncPlaceholder (node) {
  36974. return node.isComment && node.asyncFactory
  36975. }
  36976. /* */
  36977. function normalizeScopedSlots (
  36978. slots,
  36979. normalSlots,
  36980. prevSlots
  36981. ) {
  36982. var res;
  36983. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  36984. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  36985. var key = slots && slots.$key;
  36986. if (!slots) {
  36987. res = {};
  36988. } else if (slots._normalized) {
  36989. // fast path 1: child component re-render only, parent did not change
  36990. return slots._normalized
  36991. } else if (
  36992. isStable &&
  36993. prevSlots &&
  36994. prevSlots !== emptyObject &&
  36995. key === prevSlots.$key &&
  36996. !hasNormalSlots &&
  36997. !prevSlots.$hasNormal
  36998. ) {
  36999. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  37000. // only need to normalize once
  37001. return prevSlots
  37002. } else {
  37003. res = {};
  37004. for (var key$1 in slots) {
  37005. if (slots[key$1] && key$1[0] !== '$') {
  37006. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  37007. }
  37008. }
  37009. }
  37010. // expose normal slots on scopedSlots
  37011. for (var key$2 in normalSlots) {
  37012. if (!(key$2 in res)) {
  37013. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  37014. }
  37015. }
  37016. // avoriaz seems to mock a non-extensible $scopedSlots object
  37017. // and when that is passed down this would cause an error
  37018. if (slots && Object.isExtensible(slots)) {
  37019. (slots)._normalized = res;
  37020. }
  37021. def(res, '$stable', isStable);
  37022. def(res, '$key', key);
  37023. def(res, '$hasNormal', hasNormalSlots);
  37024. return res
  37025. }
  37026. function normalizeScopedSlot(normalSlots, key, fn) {
  37027. var normalized = function () {
  37028. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  37029. res = res && typeof res === 'object' && !Array.isArray(res)
  37030. ? [res] // single vnode
  37031. : normalizeChildren(res);
  37032. var vnode = res && res[0];
  37033. return res && (
  37034. !vnode ||
  37035. (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
  37036. ) ? undefined
  37037. : res
  37038. };
  37039. // this is a slot using the new v-slot syntax without scope. although it is
  37040. // compiled as a scoped slot, render fn users would expect it to be present
  37041. // on this.$slots because the usage is semantically a normal slot.
  37042. if (fn.proxy) {
  37043. Object.defineProperty(normalSlots, key, {
  37044. get: normalized,
  37045. enumerable: true,
  37046. configurable: true
  37047. });
  37048. }
  37049. return normalized
  37050. }
  37051. function proxyNormalSlot(slots, key) {
  37052. return function () { return slots[key]; }
  37053. }
  37054. /* */
  37055. /**
  37056. * Runtime helper for rendering v-for lists.
  37057. */
  37058. function renderList (
  37059. val,
  37060. render
  37061. ) {
  37062. var ret, i, l, keys, key;
  37063. if (Array.isArray(val) || typeof val === 'string') {
  37064. ret = new Array(val.length);
  37065. for (i = 0, l = val.length; i < l; i++) {
  37066. ret[i] = render(val[i], i);
  37067. }
  37068. } else if (typeof val === 'number') {
  37069. ret = new Array(val);
  37070. for (i = 0; i < val; i++) {
  37071. ret[i] = render(i + 1, i);
  37072. }
  37073. } else if (isObject(val)) {
  37074. if (hasSymbol && val[Symbol.iterator]) {
  37075. ret = [];
  37076. var iterator = val[Symbol.iterator]();
  37077. var result = iterator.next();
  37078. while (!result.done) {
  37079. ret.push(render(result.value, ret.length));
  37080. result = iterator.next();
  37081. }
  37082. } else {
  37083. keys = Object.keys(val);
  37084. ret = new Array(keys.length);
  37085. for (i = 0, l = keys.length; i < l; i++) {
  37086. key = keys[i];
  37087. ret[i] = render(val[key], key, i);
  37088. }
  37089. }
  37090. }
  37091. if (!isDef(ret)) {
  37092. ret = [];
  37093. }
  37094. (ret)._isVList = true;
  37095. return ret
  37096. }
  37097. /* */
  37098. /**
  37099. * Runtime helper for rendering <slot>
  37100. */
  37101. function renderSlot (
  37102. name,
  37103. fallbackRender,
  37104. props,
  37105. bindObject
  37106. ) {
  37107. var scopedSlotFn = this.$scopedSlots[name];
  37108. var nodes;
  37109. if (scopedSlotFn) {
  37110. // scoped slot
  37111. props = props || {};
  37112. if (bindObject) {
  37113. if (!isObject(bindObject)) {
  37114. warn('slot v-bind without argument expects an Object', this);
  37115. }
  37116. props = extend(extend({}, bindObject), props);
  37117. }
  37118. nodes =
  37119. scopedSlotFn(props) ||
  37120. (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
  37121. } else {
  37122. nodes =
  37123. this.$slots[name] ||
  37124. (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
  37125. }
  37126. var target = props && props.slot;
  37127. if (target) {
  37128. return this.$createElement('template', { slot: target }, nodes)
  37129. } else {
  37130. return nodes
  37131. }
  37132. }
  37133. /* */
  37134. /**
  37135. * Runtime helper for resolving filters
  37136. */
  37137. function resolveFilter (id) {
  37138. return resolveAsset(this.$options, 'filters', id, true) || identity
  37139. }
  37140. /* */
  37141. function isKeyNotMatch (expect, actual) {
  37142. if (Array.isArray(expect)) {
  37143. return expect.indexOf(actual) === -1
  37144. } else {
  37145. return expect !== actual
  37146. }
  37147. }
  37148. /**
  37149. * Runtime helper for checking keyCodes from config.
  37150. * exposed as Vue.prototype._k
  37151. * passing in eventKeyName as last argument separately for backwards compat
  37152. */
  37153. function checkKeyCodes (
  37154. eventKeyCode,
  37155. key,
  37156. builtInKeyCode,
  37157. eventKeyName,
  37158. builtInKeyName
  37159. ) {
  37160. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  37161. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  37162. return isKeyNotMatch(builtInKeyName, eventKeyName)
  37163. } else if (mappedKeyCode) {
  37164. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  37165. } else if (eventKeyName) {
  37166. return hyphenate(eventKeyName) !== key
  37167. }
  37168. return eventKeyCode === undefined
  37169. }
  37170. /* */
  37171. /**
  37172. * Runtime helper for merging v-bind="object" into a VNode's data.
  37173. */
  37174. function bindObjectProps (
  37175. data,
  37176. tag,
  37177. value,
  37178. asProp,
  37179. isSync
  37180. ) {
  37181. if (value) {
  37182. if (!isObject(value)) {
  37183. warn(
  37184. 'v-bind without argument expects an Object or Array value',
  37185. this
  37186. );
  37187. } else {
  37188. if (Array.isArray(value)) {
  37189. value = toObject(value);
  37190. }
  37191. var hash;
  37192. var loop = function ( key ) {
  37193. if (
  37194. key === 'class' ||
  37195. key === 'style' ||
  37196. isReservedAttribute(key)
  37197. ) {
  37198. hash = data;
  37199. } else {
  37200. var type = data.attrs && data.attrs.type;
  37201. hash = asProp || config.mustUseProp(tag, type, key)
  37202. ? data.domProps || (data.domProps = {})
  37203. : data.attrs || (data.attrs = {});
  37204. }
  37205. var camelizedKey = camelize(key);
  37206. var hyphenatedKey = hyphenate(key);
  37207. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  37208. hash[key] = value[key];
  37209. if (isSync) {
  37210. var on = data.on || (data.on = {});
  37211. on[("update:" + key)] = function ($event) {
  37212. value[key] = $event;
  37213. };
  37214. }
  37215. }
  37216. };
  37217. for (var key in value) loop( key );
  37218. }
  37219. }
  37220. return data
  37221. }
  37222. /* */
  37223. /**
  37224. * Runtime helper for rendering static trees.
  37225. */
  37226. function renderStatic (
  37227. index,
  37228. isInFor
  37229. ) {
  37230. var cached = this._staticTrees || (this._staticTrees = []);
  37231. var tree = cached[index];
  37232. // if has already-rendered static tree and not inside v-for,
  37233. // we can reuse the same tree.
  37234. if (tree && !isInFor) {
  37235. return tree
  37236. }
  37237. // otherwise, render a fresh tree.
  37238. tree = cached[index] = this.$options.staticRenderFns[index].call(
  37239. this._renderProxy,
  37240. null,
  37241. this // for render fns generated for functional component templates
  37242. );
  37243. markStatic(tree, ("__static__" + index), false);
  37244. return tree
  37245. }
  37246. /**
  37247. * Runtime helper for v-once.
  37248. * Effectively it means marking the node as static with a unique key.
  37249. */
  37250. function markOnce (
  37251. tree,
  37252. index,
  37253. key
  37254. ) {
  37255. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  37256. return tree
  37257. }
  37258. function markStatic (
  37259. tree,
  37260. key,
  37261. isOnce
  37262. ) {
  37263. if (Array.isArray(tree)) {
  37264. for (var i = 0; i < tree.length; i++) {
  37265. if (tree[i] && typeof tree[i] !== 'string') {
  37266. markStaticNode(tree[i], (key + "_" + i), isOnce);
  37267. }
  37268. }
  37269. } else {
  37270. markStaticNode(tree, key, isOnce);
  37271. }
  37272. }
  37273. function markStaticNode (node, key, isOnce) {
  37274. node.isStatic = true;
  37275. node.key = key;
  37276. node.isOnce = isOnce;
  37277. }
  37278. /* */
  37279. function bindObjectListeners (data, value) {
  37280. if (value) {
  37281. if (!isPlainObject(value)) {
  37282. warn(
  37283. 'v-on without argument expects an Object value',
  37284. this
  37285. );
  37286. } else {
  37287. var on = data.on = data.on ? extend({}, data.on) : {};
  37288. for (var key in value) {
  37289. var existing = on[key];
  37290. var ours = value[key];
  37291. on[key] = existing ? [].concat(existing, ours) : ours;
  37292. }
  37293. }
  37294. }
  37295. return data
  37296. }
  37297. /* */
  37298. function resolveScopedSlots (
  37299. fns, // see flow/vnode
  37300. res,
  37301. // the following are added in 2.6
  37302. hasDynamicKeys,
  37303. contentHashKey
  37304. ) {
  37305. res = res || { $stable: !hasDynamicKeys };
  37306. for (var i = 0; i < fns.length; i++) {
  37307. var slot = fns[i];
  37308. if (Array.isArray(slot)) {
  37309. resolveScopedSlots(slot, res, hasDynamicKeys);
  37310. } else if (slot) {
  37311. // marker for reverse proxying v-slot without scope on this.$slots
  37312. if (slot.proxy) {
  37313. slot.fn.proxy = true;
  37314. }
  37315. res[slot.key] = slot.fn;
  37316. }
  37317. }
  37318. if (contentHashKey) {
  37319. (res).$key = contentHashKey;
  37320. }
  37321. return res
  37322. }
  37323. /* */
  37324. function bindDynamicKeys (baseObj, values) {
  37325. for (var i = 0; i < values.length; i += 2) {
  37326. var key = values[i];
  37327. if (typeof key === 'string' && key) {
  37328. baseObj[values[i]] = values[i + 1];
  37329. } else if (key !== '' && key !== null) {
  37330. // null is a special value for explicitly removing a binding
  37331. warn(
  37332. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  37333. this
  37334. );
  37335. }
  37336. }
  37337. return baseObj
  37338. }
  37339. // helper to dynamically append modifier runtime markers to event names.
  37340. // ensure only append when value is already string, otherwise it will be cast
  37341. // to string and cause the type check to miss.
  37342. function prependModifier (value, symbol) {
  37343. return typeof value === 'string' ? symbol + value : value
  37344. }
  37345. /* */
  37346. function installRenderHelpers (target) {
  37347. target._o = markOnce;
  37348. target._n = toNumber;
  37349. target._s = toString;
  37350. target._l = renderList;
  37351. target._t = renderSlot;
  37352. target._q = looseEqual;
  37353. target._i = looseIndexOf;
  37354. target._m = renderStatic;
  37355. target._f = resolveFilter;
  37356. target._k = checkKeyCodes;
  37357. target._b = bindObjectProps;
  37358. target._v = createTextVNode;
  37359. target._e = createEmptyVNode;
  37360. target._u = resolveScopedSlots;
  37361. target._g = bindObjectListeners;
  37362. target._d = bindDynamicKeys;
  37363. target._p = prependModifier;
  37364. }
  37365. /* */
  37366. function FunctionalRenderContext (
  37367. data,
  37368. props,
  37369. children,
  37370. parent,
  37371. Ctor
  37372. ) {
  37373. var this$1 = this;
  37374. var options = Ctor.options;
  37375. // ensure the createElement function in functional components
  37376. // gets a unique context - this is necessary for correct named slot check
  37377. var contextVm;
  37378. if (hasOwn(parent, '_uid')) {
  37379. contextVm = Object.create(parent);
  37380. // $flow-disable-line
  37381. contextVm._original = parent;
  37382. } else {
  37383. // the context vm passed in is a functional context as well.
  37384. // in this case we want to make sure we are able to get a hold to the
  37385. // real context instance.
  37386. contextVm = parent;
  37387. // $flow-disable-line
  37388. parent = parent._original;
  37389. }
  37390. var isCompiled = isTrue(options._compiled);
  37391. var needNormalization = !isCompiled;
  37392. this.data = data;
  37393. this.props = props;
  37394. this.children = children;
  37395. this.parent = parent;
  37396. this.listeners = data.on || emptyObject;
  37397. this.injections = resolveInject(options.inject, parent);
  37398. this.slots = function () {
  37399. if (!this$1.$slots) {
  37400. normalizeScopedSlots(
  37401. data.scopedSlots,
  37402. this$1.$slots = resolveSlots(children, parent)
  37403. );
  37404. }
  37405. return this$1.$slots
  37406. };
  37407. Object.defineProperty(this, 'scopedSlots', ({
  37408. enumerable: true,
  37409. get: function get () {
  37410. return normalizeScopedSlots(data.scopedSlots, this.slots())
  37411. }
  37412. }));
  37413. // support for compiled functional template
  37414. if (isCompiled) {
  37415. // exposing $options for renderStatic()
  37416. this.$options = options;
  37417. // pre-resolve slots for renderSlot()
  37418. this.$slots = this.slots();
  37419. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  37420. }
  37421. if (options._scopeId) {
  37422. this._c = function (a, b, c, d) {
  37423. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  37424. if (vnode && !Array.isArray(vnode)) {
  37425. vnode.fnScopeId = options._scopeId;
  37426. vnode.fnContext = parent;
  37427. }
  37428. return vnode
  37429. };
  37430. } else {
  37431. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  37432. }
  37433. }
  37434. installRenderHelpers(FunctionalRenderContext.prototype);
  37435. function createFunctionalComponent (
  37436. Ctor,
  37437. propsData,
  37438. data,
  37439. contextVm,
  37440. children
  37441. ) {
  37442. var options = Ctor.options;
  37443. var props = {};
  37444. var propOptions = options.props;
  37445. if (isDef(propOptions)) {
  37446. for (var key in propOptions) {
  37447. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  37448. }
  37449. } else {
  37450. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  37451. if (isDef(data.props)) { mergeProps(props, data.props); }
  37452. }
  37453. var renderContext = new FunctionalRenderContext(
  37454. data,
  37455. props,
  37456. children,
  37457. contextVm,
  37458. Ctor
  37459. );
  37460. var vnode = options.render.call(null, renderContext._c, renderContext);
  37461. if (vnode instanceof VNode) {
  37462. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  37463. } else if (Array.isArray(vnode)) {
  37464. var vnodes = normalizeChildren(vnode) || [];
  37465. var res = new Array(vnodes.length);
  37466. for (var i = 0; i < vnodes.length; i++) {
  37467. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  37468. }
  37469. return res
  37470. }
  37471. }
  37472. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  37473. // #7817 clone node before setting fnContext, otherwise if the node is reused
  37474. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  37475. // that should not be matched to match.
  37476. var clone = cloneVNode(vnode);
  37477. clone.fnContext = contextVm;
  37478. clone.fnOptions = options;
  37479. {
  37480. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  37481. }
  37482. if (data.slot) {
  37483. (clone.data || (clone.data = {})).slot = data.slot;
  37484. }
  37485. return clone
  37486. }
  37487. function mergeProps (to, from) {
  37488. for (var key in from) {
  37489. to[camelize(key)] = from[key];
  37490. }
  37491. }
  37492. /* */
  37493. /* */
  37494. /* */
  37495. /* */
  37496. // inline hooks to be invoked on component VNodes during patch
  37497. var componentVNodeHooks = {
  37498. init: function init (vnode, hydrating) {
  37499. if (
  37500. vnode.componentInstance &&
  37501. !vnode.componentInstance._isDestroyed &&
  37502. vnode.data.keepAlive
  37503. ) {
  37504. // kept-alive components, treat as a patch
  37505. var mountedNode = vnode; // work around flow
  37506. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  37507. } else {
  37508. var child = vnode.componentInstance = createComponentInstanceForVnode(
  37509. vnode,
  37510. activeInstance
  37511. );
  37512. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  37513. }
  37514. },
  37515. prepatch: function prepatch (oldVnode, vnode) {
  37516. var options = vnode.componentOptions;
  37517. var child = vnode.componentInstance = oldVnode.componentInstance;
  37518. updateChildComponent(
  37519. child,
  37520. options.propsData, // updated props
  37521. options.listeners, // updated listeners
  37522. vnode, // new parent vnode
  37523. options.children // new children
  37524. );
  37525. },
  37526. insert: function insert (vnode) {
  37527. var context = vnode.context;
  37528. var componentInstance = vnode.componentInstance;
  37529. if (!componentInstance._isMounted) {
  37530. componentInstance._isMounted = true;
  37531. callHook(componentInstance, 'mounted');
  37532. }
  37533. if (vnode.data.keepAlive) {
  37534. if (context._isMounted) {
  37535. // vue-router#1212
  37536. // During updates, a kept-alive component's child components may
  37537. // change, so directly walking the tree here may call activated hooks
  37538. // on incorrect children. Instead we push them into a queue which will
  37539. // be processed after the whole patch process ended.
  37540. queueActivatedComponent(componentInstance);
  37541. } else {
  37542. activateChildComponent(componentInstance, true /* direct */);
  37543. }
  37544. }
  37545. },
  37546. destroy: function destroy (vnode) {
  37547. var componentInstance = vnode.componentInstance;
  37548. if (!componentInstance._isDestroyed) {
  37549. if (!vnode.data.keepAlive) {
  37550. componentInstance.$destroy();
  37551. } else {
  37552. deactivateChildComponent(componentInstance, true /* direct */);
  37553. }
  37554. }
  37555. }
  37556. };
  37557. var hooksToMerge = Object.keys(componentVNodeHooks);
  37558. function createComponent (
  37559. Ctor,
  37560. data,
  37561. context,
  37562. children,
  37563. tag
  37564. ) {
  37565. if (isUndef(Ctor)) {
  37566. return
  37567. }
  37568. var baseCtor = context.$options._base;
  37569. // plain options object: turn it into a constructor
  37570. if (isObject(Ctor)) {
  37571. Ctor = baseCtor.extend(Ctor);
  37572. }
  37573. // if at this stage it's not a constructor or an async component factory,
  37574. // reject.
  37575. if (typeof Ctor !== 'function') {
  37576. {
  37577. warn(("Invalid Component definition: " + (String(Ctor))), context);
  37578. }
  37579. return
  37580. }
  37581. // async component
  37582. var asyncFactory;
  37583. if (isUndef(Ctor.cid)) {
  37584. asyncFactory = Ctor;
  37585. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  37586. if (Ctor === undefined) {
  37587. // return a placeholder node for async component, which is rendered
  37588. // as a comment node but preserves all the raw information for the node.
  37589. // the information will be used for async server-rendering and hydration.
  37590. return createAsyncPlaceholder(
  37591. asyncFactory,
  37592. data,
  37593. context,
  37594. children,
  37595. tag
  37596. )
  37597. }
  37598. }
  37599. data = data || {};
  37600. // resolve constructor options in case global mixins are applied after
  37601. // component constructor creation
  37602. resolveConstructorOptions(Ctor);
  37603. // transform component v-model data into props & events
  37604. if (isDef(data.model)) {
  37605. transformModel(Ctor.options, data);
  37606. }
  37607. // extract props
  37608. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  37609. // functional component
  37610. if (isTrue(Ctor.options.functional)) {
  37611. return createFunctionalComponent(Ctor, propsData, data, context, children)
  37612. }
  37613. // extract listeners, since these needs to be treated as
  37614. // child component listeners instead of DOM listeners
  37615. var listeners = data.on;
  37616. // replace with listeners with .native modifier
  37617. // so it gets processed during parent component patch.
  37618. data.on = data.nativeOn;
  37619. if (isTrue(Ctor.options.abstract)) {
  37620. // abstract components do not keep anything
  37621. // other than props & listeners & slot
  37622. // work around flow
  37623. var slot = data.slot;
  37624. data = {};
  37625. if (slot) {
  37626. data.slot = slot;
  37627. }
  37628. }
  37629. // install component management hooks onto the placeholder node
  37630. installComponentHooks(data);
  37631. // return a placeholder vnode
  37632. var name = Ctor.options.name || tag;
  37633. var vnode = new VNode(
  37634. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  37635. data, undefined, undefined, undefined, context,
  37636. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  37637. asyncFactory
  37638. );
  37639. return vnode
  37640. }
  37641. function createComponentInstanceForVnode (
  37642. // we know it's MountedComponentVNode but flow doesn't
  37643. vnode,
  37644. // activeInstance in lifecycle state
  37645. parent
  37646. ) {
  37647. var options = {
  37648. _isComponent: true,
  37649. _parentVnode: vnode,
  37650. parent: parent
  37651. };
  37652. // check inline-template render functions
  37653. var inlineTemplate = vnode.data.inlineTemplate;
  37654. if (isDef(inlineTemplate)) {
  37655. options.render = inlineTemplate.render;
  37656. options.staticRenderFns = inlineTemplate.staticRenderFns;
  37657. }
  37658. return new vnode.componentOptions.Ctor(options)
  37659. }
  37660. function installComponentHooks (data) {
  37661. var hooks = data.hook || (data.hook = {});
  37662. for (var i = 0; i < hooksToMerge.length; i++) {
  37663. var key = hooksToMerge[i];
  37664. var existing = hooks[key];
  37665. var toMerge = componentVNodeHooks[key];
  37666. if (existing !== toMerge && !(existing && existing._merged)) {
  37667. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  37668. }
  37669. }
  37670. }
  37671. function mergeHook$1 (f1, f2) {
  37672. var merged = function (a, b) {
  37673. // flow complains about extra args which is why we use any
  37674. f1(a, b);
  37675. f2(a, b);
  37676. };
  37677. merged._merged = true;
  37678. return merged
  37679. }
  37680. // transform component v-model info (value and callback) into
  37681. // prop and event handler respectively.
  37682. function transformModel (options, data) {
  37683. var prop = (options.model && options.model.prop) || 'value';
  37684. var event = (options.model && options.model.event) || 'input'
  37685. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  37686. var on = data.on || (data.on = {});
  37687. var existing = on[event];
  37688. var callback = data.model.callback;
  37689. if (isDef(existing)) {
  37690. if (
  37691. Array.isArray(existing)
  37692. ? existing.indexOf(callback) === -1
  37693. : existing !== callback
  37694. ) {
  37695. on[event] = [callback].concat(existing);
  37696. }
  37697. } else {
  37698. on[event] = callback;
  37699. }
  37700. }
  37701. /* */
  37702. var SIMPLE_NORMALIZE = 1;
  37703. var ALWAYS_NORMALIZE = 2;
  37704. // wrapper function for providing a more flexible interface
  37705. // without getting yelled at by flow
  37706. function createElement (
  37707. context,
  37708. tag,
  37709. data,
  37710. children,
  37711. normalizationType,
  37712. alwaysNormalize
  37713. ) {
  37714. if (Array.isArray(data) || isPrimitive(data)) {
  37715. normalizationType = children;
  37716. children = data;
  37717. data = undefined;
  37718. }
  37719. if (isTrue(alwaysNormalize)) {
  37720. normalizationType = ALWAYS_NORMALIZE;
  37721. }
  37722. return _createElement(context, tag, data, children, normalizationType)
  37723. }
  37724. function _createElement (
  37725. context,
  37726. tag,
  37727. data,
  37728. children,
  37729. normalizationType
  37730. ) {
  37731. if (isDef(data) && isDef((data).__ob__)) {
  37732. warn(
  37733. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  37734. 'Always create fresh vnode data objects in each render!',
  37735. context
  37736. );
  37737. return createEmptyVNode()
  37738. }
  37739. // object syntax in v-bind
  37740. if (isDef(data) && isDef(data.is)) {
  37741. tag = data.is;
  37742. }
  37743. if (!tag) {
  37744. // in case of component :is set to falsy value
  37745. return createEmptyVNode()
  37746. }
  37747. // warn against non-primitive key
  37748. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  37749. ) {
  37750. {
  37751. warn(
  37752. 'Avoid using non-primitive value as key, ' +
  37753. 'use string/number value instead.',
  37754. context
  37755. );
  37756. }
  37757. }
  37758. // support single function children as default scoped slot
  37759. if (Array.isArray(children) &&
  37760. typeof children[0] === 'function'
  37761. ) {
  37762. data = data || {};
  37763. data.scopedSlots = { default: children[0] };
  37764. children.length = 0;
  37765. }
  37766. if (normalizationType === ALWAYS_NORMALIZE) {
  37767. children = normalizeChildren(children);
  37768. } else if (normalizationType === SIMPLE_NORMALIZE) {
  37769. children = simpleNormalizeChildren(children);
  37770. }
  37771. var vnode, ns;
  37772. if (typeof tag === 'string') {
  37773. var Ctor;
  37774. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  37775. if (config.isReservedTag(tag)) {
  37776. // platform built-in elements
  37777. if (isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') {
  37778. warn(
  37779. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  37780. context
  37781. );
  37782. }
  37783. vnode = new VNode(
  37784. config.parsePlatformTagName(tag), data, children,
  37785. undefined, undefined, context
  37786. );
  37787. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  37788. // component
  37789. vnode = createComponent(Ctor, data, context, children, tag);
  37790. } else {
  37791. // unknown or unlisted namespaced elements
  37792. // check at runtime because it may get assigned a namespace when its
  37793. // parent normalizes children
  37794. vnode = new VNode(
  37795. tag, data, children,
  37796. undefined, undefined, context
  37797. );
  37798. }
  37799. } else {
  37800. // direct component options / constructor
  37801. vnode = createComponent(tag, data, context, children);
  37802. }
  37803. if (Array.isArray(vnode)) {
  37804. return vnode
  37805. } else if (isDef(vnode)) {
  37806. if (isDef(ns)) { applyNS(vnode, ns); }
  37807. if (isDef(data)) { registerDeepBindings(data); }
  37808. return vnode
  37809. } else {
  37810. return createEmptyVNode()
  37811. }
  37812. }
  37813. function applyNS (vnode, ns, force) {
  37814. vnode.ns = ns;
  37815. if (vnode.tag === 'foreignObject') {
  37816. // use default namespace inside foreignObject
  37817. ns = undefined;
  37818. force = true;
  37819. }
  37820. if (isDef(vnode.children)) {
  37821. for (var i = 0, l = vnode.children.length; i < l; i++) {
  37822. var child = vnode.children[i];
  37823. if (isDef(child.tag) && (
  37824. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  37825. applyNS(child, ns, force);
  37826. }
  37827. }
  37828. }
  37829. }
  37830. // ref #5318
  37831. // necessary to ensure parent re-render when deep bindings like :style and
  37832. // :class are used on slot nodes
  37833. function registerDeepBindings (data) {
  37834. if (isObject(data.style)) {
  37835. traverse(data.style);
  37836. }
  37837. if (isObject(data.class)) {
  37838. traverse(data.class);
  37839. }
  37840. }
  37841. /* */
  37842. function initRender (vm) {
  37843. vm._vnode = null; // the root of the child tree
  37844. vm._staticTrees = null; // v-once cached trees
  37845. var options = vm.$options;
  37846. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  37847. var renderContext = parentVnode && parentVnode.context;
  37848. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  37849. vm.$scopedSlots = emptyObject;
  37850. // bind the createElement fn to this instance
  37851. // so that we get proper render context inside it.
  37852. // args order: tag, data, children, normalizationType, alwaysNormalize
  37853. // internal version is used by render functions compiled from templates
  37854. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  37855. // normalization is always applied for the public version, used in
  37856. // user-written render functions.
  37857. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  37858. // $attrs & $listeners are exposed for easier HOC creation.
  37859. // they need to be reactive so that HOCs using them are always updated
  37860. var parentData = parentVnode && parentVnode.data;
  37861. /* istanbul ignore else */
  37862. {
  37863. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  37864. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  37865. }, true);
  37866. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  37867. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  37868. }, true);
  37869. }
  37870. }
  37871. var currentRenderingInstance = null;
  37872. function renderMixin (Vue) {
  37873. // install runtime convenience helpers
  37874. installRenderHelpers(Vue.prototype);
  37875. Vue.prototype.$nextTick = function (fn) {
  37876. return nextTick(fn, this)
  37877. };
  37878. Vue.prototype._render = function () {
  37879. var vm = this;
  37880. var ref = vm.$options;
  37881. var render = ref.render;
  37882. var _parentVnode = ref._parentVnode;
  37883. if (_parentVnode) {
  37884. vm.$scopedSlots = normalizeScopedSlots(
  37885. _parentVnode.data.scopedSlots,
  37886. vm.$slots,
  37887. vm.$scopedSlots
  37888. );
  37889. }
  37890. // set parent vnode. this allows render functions to have access
  37891. // to the data on the placeholder node.
  37892. vm.$vnode = _parentVnode;
  37893. // render self
  37894. var vnode;
  37895. try {
  37896. // There's no need to maintain a stack because all render fns are called
  37897. // separately from one another. Nested component's render fns are called
  37898. // when parent component is patched.
  37899. currentRenderingInstance = vm;
  37900. vnode = render.call(vm._renderProxy, vm.$createElement);
  37901. } catch (e) {
  37902. handleError(e, vm, "render");
  37903. // return error render result,
  37904. // or previous vnode to prevent render error causing blank component
  37905. /* istanbul ignore else */
  37906. if (vm.$options.renderError) {
  37907. try {
  37908. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  37909. } catch (e) {
  37910. handleError(e, vm, "renderError");
  37911. vnode = vm._vnode;
  37912. }
  37913. } else {
  37914. vnode = vm._vnode;
  37915. }
  37916. } finally {
  37917. currentRenderingInstance = null;
  37918. }
  37919. // if the returned array contains only a single node, allow it
  37920. if (Array.isArray(vnode) && vnode.length === 1) {
  37921. vnode = vnode[0];
  37922. }
  37923. // return empty vnode in case the render function errored out
  37924. if (!(vnode instanceof VNode)) {
  37925. if (Array.isArray(vnode)) {
  37926. warn(
  37927. 'Multiple root nodes returned from render function. Render function ' +
  37928. 'should return a single root node.',
  37929. vm
  37930. );
  37931. }
  37932. vnode = createEmptyVNode();
  37933. }
  37934. // set parent
  37935. vnode.parent = _parentVnode;
  37936. return vnode
  37937. };
  37938. }
  37939. /* */
  37940. function ensureCtor (comp, base) {
  37941. if (
  37942. comp.__esModule ||
  37943. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  37944. ) {
  37945. comp = comp.default;
  37946. }
  37947. return isObject(comp)
  37948. ? base.extend(comp)
  37949. : comp
  37950. }
  37951. function createAsyncPlaceholder (
  37952. factory,
  37953. data,
  37954. context,
  37955. children,
  37956. tag
  37957. ) {
  37958. var node = createEmptyVNode();
  37959. node.asyncFactory = factory;
  37960. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  37961. return node
  37962. }
  37963. function resolveAsyncComponent (
  37964. factory,
  37965. baseCtor
  37966. ) {
  37967. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  37968. return factory.errorComp
  37969. }
  37970. if (isDef(factory.resolved)) {
  37971. return factory.resolved
  37972. }
  37973. var owner = currentRenderingInstance;
  37974. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  37975. // already pending
  37976. factory.owners.push(owner);
  37977. }
  37978. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  37979. return factory.loadingComp
  37980. }
  37981. if (owner && !isDef(factory.owners)) {
  37982. var owners = factory.owners = [owner];
  37983. var sync = true;
  37984. var timerLoading = null;
  37985. var timerTimeout = null
  37986. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  37987. var forceRender = function (renderCompleted) {
  37988. for (var i = 0, l = owners.length; i < l; i++) {
  37989. (owners[i]).$forceUpdate();
  37990. }
  37991. if (renderCompleted) {
  37992. owners.length = 0;
  37993. if (timerLoading !== null) {
  37994. clearTimeout(timerLoading);
  37995. timerLoading = null;
  37996. }
  37997. if (timerTimeout !== null) {
  37998. clearTimeout(timerTimeout);
  37999. timerTimeout = null;
  38000. }
  38001. }
  38002. };
  38003. var resolve = once(function (res) {
  38004. // cache resolved
  38005. factory.resolved = ensureCtor(res, baseCtor);
  38006. // invoke callbacks only if this is not a synchronous resolve
  38007. // (async resolves are shimmed as synchronous during SSR)
  38008. if (!sync) {
  38009. forceRender(true);
  38010. } else {
  38011. owners.length = 0;
  38012. }
  38013. });
  38014. var reject = once(function (reason) {
  38015. warn(
  38016. "Failed to resolve async component: " + (String(factory)) +
  38017. (reason ? ("\nReason: " + reason) : '')
  38018. );
  38019. if (isDef(factory.errorComp)) {
  38020. factory.error = true;
  38021. forceRender(true);
  38022. }
  38023. });
  38024. var res = factory(resolve, reject);
  38025. if (isObject(res)) {
  38026. if (isPromise(res)) {
  38027. // () => Promise
  38028. if (isUndef(factory.resolved)) {
  38029. res.then(resolve, reject);
  38030. }
  38031. } else if (isPromise(res.component)) {
  38032. res.component.then(resolve, reject);
  38033. if (isDef(res.error)) {
  38034. factory.errorComp = ensureCtor(res.error, baseCtor);
  38035. }
  38036. if (isDef(res.loading)) {
  38037. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  38038. if (res.delay === 0) {
  38039. factory.loading = true;
  38040. } else {
  38041. timerLoading = setTimeout(function () {
  38042. timerLoading = null;
  38043. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  38044. factory.loading = true;
  38045. forceRender(false);
  38046. }
  38047. }, res.delay || 200);
  38048. }
  38049. }
  38050. if (isDef(res.timeout)) {
  38051. timerTimeout = setTimeout(function () {
  38052. timerTimeout = null;
  38053. if (isUndef(factory.resolved)) {
  38054. reject(
  38055. "timeout (" + (res.timeout) + "ms)"
  38056. );
  38057. }
  38058. }, res.timeout);
  38059. }
  38060. }
  38061. }
  38062. sync = false;
  38063. // return in case resolved synchronously
  38064. return factory.loading
  38065. ? factory.loadingComp
  38066. : factory.resolved
  38067. }
  38068. }
  38069. /* */
  38070. function getFirstComponentChild (children) {
  38071. if (Array.isArray(children)) {
  38072. for (var i = 0; i < children.length; i++) {
  38073. var c = children[i];
  38074. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  38075. return c
  38076. }
  38077. }
  38078. }
  38079. }
  38080. /* */
  38081. /* */
  38082. function initEvents (vm) {
  38083. vm._events = Object.create(null);
  38084. vm._hasHookEvent = false;
  38085. // init parent attached events
  38086. var listeners = vm.$options._parentListeners;
  38087. if (listeners) {
  38088. updateComponentListeners(vm, listeners);
  38089. }
  38090. }
  38091. var target;
  38092. function add (event, fn) {
  38093. target.$on(event, fn);
  38094. }
  38095. function remove$1 (event, fn) {
  38096. target.$off(event, fn);
  38097. }
  38098. function createOnceHandler (event, fn) {
  38099. var _target = target;
  38100. return function onceHandler () {
  38101. var res = fn.apply(null, arguments);
  38102. if (res !== null) {
  38103. _target.$off(event, onceHandler);
  38104. }
  38105. }
  38106. }
  38107. function updateComponentListeners (
  38108. vm,
  38109. listeners,
  38110. oldListeners
  38111. ) {
  38112. target = vm;
  38113. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  38114. target = undefined;
  38115. }
  38116. function eventsMixin (Vue) {
  38117. var hookRE = /^hook:/;
  38118. Vue.prototype.$on = function (event, fn) {
  38119. var vm = this;
  38120. if (Array.isArray(event)) {
  38121. for (var i = 0, l = event.length; i < l; i++) {
  38122. vm.$on(event[i], fn);
  38123. }
  38124. } else {
  38125. (vm._events[event] || (vm._events[event] = [])).push(fn);
  38126. // optimize hook:event cost by using a boolean flag marked at registration
  38127. // instead of a hash lookup
  38128. if (hookRE.test(event)) {
  38129. vm._hasHookEvent = true;
  38130. }
  38131. }
  38132. return vm
  38133. };
  38134. Vue.prototype.$once = function (event, fn) {
  38135. var vm = this;
  38136. function on () {
  38137. vm.$off(event, on);
  38138. fn.apply(vm, arguments);
  38139. }
  38140. on.fn = fn;
  38141. vm.$on(event, on);
  38142. return vm
  38143. };
  38144. Vue.prototype.$off = function (event, fn) {
  38145. var vm = this;
  38146. // all
  38147. if (!arguments.length) {
  38148. vm._events = Object.create(null);
  38149. return vm
  38150. }
  38151. // array of events
  38152. if (Array.isArray(event)) {
  38153. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  38154. vm.$off(event[i$1], fn);
  38155. }
  38156. return vm
  38157. }
  38158. // specific event
  38159. var cbs = vm._events[event];
  38160. if (!cbs) {
  38161. return vm
  38162. }
  38163. if (!fn) {
  38164. vm._events[event] = null;
  38165. return vm
  38166. }
  38167. // specific handler
  38168. var cb;
  38169. var i = cbs.length;
  38170. while (i--) {
  38171. cb = cbs[i];
  38172. if (cb === fn || cb.fn === fn) {
  38173. cbs.splice(i, 1);
  38174. break
  38175. }
  38176. }
  38177. return vm
  38178. };
  38179. Vue.prototype.$emit = function (event) {
  38180. var vm = this;
  38181. {
  38182. var lowerCaseEvent = event.toLowerCase();
  38183. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  38184. tip(
  38185. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  38186. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  38187. "Note that HTML attributes are case-insensitive and you cannot use " +
  38188. "v-on to listen to camelCase events when using in-DOM templates. " +
  38189. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  38190. );
  38191. }
  38192. }
  38193. var cbs = vm._events[event];
  38194. if (cbs) {
  38195. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  38196. var args = toArray(arguments, 1);
  38197. var info = "event handler for \"" + event + "\"";
  38198. for (var i = 0, l = cbs.length; i < l; i++) {
  38199. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  38200. }
  38201. }
  38202. return vm
  38203. };
  38204. }
  38205. /* */
  38206. var activeInstance = null;
  38207. var isUpdatingChildComponent = false;
  38208. function setActiveInstance(vm) {
  38209. var prevActiveInstance = activeInstance;
  38210. activeInstance = vm;
  38211. return function () {
  38212. activeInstance = prevActiveInstance;
  38213. }
  38214. }
  38215. function initLifecycle (vm) {
  38216. var options = vm.$options;
  38217. // locate first non-abstract parent
  38218. var parent = options.parent;
  38219. if (parent && !options.abstract) {
  38220. while (parent.$options.abstract && parent.$parent) {
  38221. parent = parent.$parent;
  38222. }
  38223. parent.$children.push(vm);
  38224. }
  38225. vm.$parent = parent;
  38226. vm.$root = parent ? parent.$root : vm;
  38227. vm.$children = [];
  38228. vm.$refs = {};
  38229. vm._watcher = null;
  38230. vm._inactive = null;
  38231. vm._directInactive = false;
  38232. vm._isMounted = false;
  38233. vm._isDestroyed = false;
  38234. vm._isBeingDestroyed = false;
  38235. }
  38236. function lifecycleMixin (Vue) {
  38237. Vue.prototype._update = function (vnode, hydrating) {
  38238. var vm = this;
  38239. var prevEl = vm.$el;
  38240. var prevVnode = vm._vnode;
  38241. var restoreActiveInstance = setActiveInstance(vm);
  38242. vm._vnode = vnode;
  38243. // Vue.prototype.__patch__ is injected in entry points
  38244. // based on the rendering backend used.
  38245. if (!prevVnode) {
  38246. // initial render
  38247. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  38248. } else {
  38249. // updates
  38250. vm.$el = vm.__patch__(prevVnode, vnode);
  38251. }
  38252. restoreActiveInstance();
  38253. // update __vue__ reference
  38254. if (prevEl) {
  38255. prevEl.__vue__ = null;
  38256. }
  38257. if (vm.$el) {
  38258. vm.$el.__vue__ = vm;
  38259. }
  38260. // if parent is an HOC, update its $el as well
  38261. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  38262. vm.$parent.$el = vm.$el;
  38263. }
  38264. // updated hook is called by the scheduler to ensure that children are
  38265. // updated in a parent's updated hook.
  38266. };
  38267. Vue.prototype.$forceUpdate = function () {
  38268. var vm = this;
  38269. if (vm._watcher) {
  38270. vm._watcher.update();
  38271. }
  38272. };
  38273. Vue.prototype.$destroy = function () {
  38274. var vm = this;
  38275. if (vm._isBeingDestroyed) {
  38276. return
  38277. }
  38278. callHook(vm, 'beforeDestroy');
  38279. vm._isBeingDestroyed = true;
  38280. // remove self from parent
  38281. var parent = vm.$parent;
  38282. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  38283. remove(parent.$children, vm);
  38284. }
  38285. // teardown watchers
  38286. if (vm._watcher) {
  38287. vm._watcher.teardown();
  38288. }
  38289. var i = vm._watchers.length;
  38290. while (i--) {
  38291. vm._watchers[i].teardown();
  38292. }
  38293. // remove reference from data ob
  38294. // frozen object may not have observer.
  38295. if (vm._data.__ob__) {
  38296. vm._data.__ob__.vmCount--;
  38297. }
  38298. // call the last hook...
  38299. vm._isDestroyed = true;
  38300. // invoke destroy hooks on current rendered tree
  38301. vm.__patch__(vm._vnode, null);
  38302. // fire destroyed hook
  38303. callHook(vm, 'destroyed');
  38304. // turn off all instance listeners.
  38305. vm.$off();
  38306. // remove __vue__ reference
  38307. if (vm.$el) {
  38308. vm.$el.__vue__ = null;
  38309. }
  38310. // release circular reference (#6759)
  38311. if (vm.$vnode) {
  38312. vm.$vnode.parent = null;
  38313. }
  38314. };
  38315. }
  38316. function mountComponent (
  38317. vm,
  38318. el,
  38319. hydrating
  38320. ) {
  38321. vm.$el = el;
  38322. if (!vm.$options.render) {
  38323. vm.$options.render = createEmptyVNode;
  38324. {
  38325. /* istanbul ignore if */
  38326. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  38327. vm.$options.el || el) {
  38328. warn(
  38329. 'You are using the runtime-only build of Vue where the template ' +
  38330. 'compiler is not available. Either pre-compile the templates into ' +
  38331. 'render functions, or use the compiler-included build.',
  38332. vm
  38333. );
  38334. } else {
  38335. warn(
  38336. 'Failed to mount component: template or render function not defined.',
  38337. vm
  38338. );
  38339. }
  38340. }
  38341. }
  38342. callHook(vm, 'beforeMount');
  38343. var updateComponent;
  38344. /* istanbul ignore if */
  38345. if (config.performance && mark) {
  38346. updateComponent = function () {
  38347. var name = vm._name;
  38348. var id = vm._uid;
  38349. var startTag = "vue-perf-start:" + id;
  38350. var endTag = "vue-perf-end:" + id;
  38351. mark(startTag);
  38352. var vnode = vm._render();
  38353. mark(endTag);
  38354. measure(("vue " + name + " render"), startTag, endTag);
  38355. mark(startTag);
  38356. vm._update(vnode, hydrating);
  38357. mark(endTag);
  38358. measure(("vue " + name + " patch"), startTag, endTag);
  38359. };
  38360. } else {
  38361. updateComponent = function () {
  38362. vm._update(vm._render(), hydrating);
  38363. };
  38364. }
  38365. // we set this to vm._watcher inside the watcher's constructor
  38366. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  38367. // component's mounted hook), which relies on vm._watcher being already defined
  38368. new Watcher(vm, updateComponent, noop, {
  38369. before: function before () {
  38370. if (vm._isMounted && !vm._isDestroyed) {
  38371. callHook(vm, 'beforeUpdate');
  38372. }
  38373. }
  38374. }, true /* isRenderWatcher */);
  38375. hydrating = false;
  38376. // manually mounted instance, call mounted on self
  38377. // mounted is called for render-created child components in its inserted hook
  38378. if (vm.$vnode == null) {
  38379. vm._isMounted = true;
  38380. callHook(vm, 'mounted');
  38381. }
  38382. return vm
  38383. }
  38384. function updateChildComponent (
  38385. vm,
  38386. propsData,
  38387. listeners,
  38388. parentVnode,
  38389. renderChildren
  38390. ) {
  38391. {
  38392. isUpdatingChildComponent = true;
  38393. }
  38394. // determine whether component has slot children
  38395. // we need to do this before overwriting $options._renderChildren.
  38396. // check if there are dynamic scopedSlots (hand-written or compiled but with
  38397. // dynamic slot names). Static scoped slots compiled from template has the
  38398. // "$stable" marker.
  38399. var newScopedSlots = parentVnode.data.scopedSlots;
  38400. var oldScopedSlots = vm.$scopedSlots;
  38401. var hasDynamicScopedSlot = !!(
  38402. (newScopedSlots && !newScopedSlots.$stable) ||
  38403. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  38404. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
  38405. (!newScopedSlots && vm.$scopedSlots.$key)
  38406. );
  38407. // Any static slot children from the parent may have changed during parent's
  38408. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  38409. // update is necessary to ensure correctness.
  38410. var needsForceUpdate = !!(
  38411. renderChildren || // has new static slots
  38412. vm.$options._renderChildren || // has old static slots
  38413. hasDynamicScopedSlot
  38414. );
  38415. vm.$options._parentVnode = parentVnode;
  38416. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  38417. if (vm._vnode) { // update child tree's parent
  38418. vm._vnode.parent = parentVnode;
  38419. }
  38420. vm.$options._renderChildren = renderChildren;
  38421. // update $attrs and $listeners hash
  38422. // these are also reactive so they may trigger child update if the child
  38423. // used them during render
  38424. vm.$attrs = parentVnode.data.attrs || emptyObject;
  38425. vm.$listeners = listeners || emptyObject;
  38426. // update props
  38427. if (propsData && vm.$options.props) {
  38428. toggleObserving(false);
  38429. var props = vm._props;
  38430. var propKeys = vm.$options._propKeys || [];
  38431. for (var i = 0; i < propKeys.length; i++) {
  38432. var key = propKeys[i];
  38433. var propOptions = vm.$options.props; // wtf flow?
  38434. props[key] = validateProp(key, propOptions, propsData, vm);
  38435. }
  38436. toggleObserving(true);
  38437. // keep a copy of raw propsData
  38438. vm.$options.propsData = propsData;
  38439. }
  38440. // update listeners
  38441. listeners = listeners || emptyObject;
  38442. var oldListeners = vm.$options._parentListeners;
  38443. vm.$options._parentListeners = listeners;
  38444. updateComponentListeners(vm, listeners, oldListeners);
  38445. // resolve slots + force update if has children
  38446. if (needsForceUpdate) {
  38447. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  38448. vm.$forceUpdate();
  38449. }
  38450. {
  38451. isUpdatingChildComponent = false;
  38452. }
  38453. }
  38454. function isInInactiveTree (vm) {
  38455. while (vm && (vm = vm.$parent)) {
  38456. if (vm._inactive) { return true }
  38457. }
  38458. return false
  38459. }
  38460. function activateChildComponent (vm, direct) {
  38461. if (direct) {
  38462. vm._directInactive = false;
  38463. if (isInInactiveTree(vm)) {
  38464. return
  38465. }
  38466. } else if (vm._directInactive) {
  38467. return
  38468. }
  38469. if (vm._inactive || vm._inactive === null) {
  38470. vm._inactive = false;
  38471. for (var i = 0; i < vm.$children.length; i++) {
  38472. activateChildComponent(vm.$children[i]);
  38473. }
  38474. callHook(vm, 'activated');
  38475. }
  38476. }
  38477. function deactivateChildComponent (vm, direct) {
  38478. if (direct) {
  38479. vm._directInactive = true;
  38480. if (isInInactiveTree(vm)) {
  38481. return
  38482. }
  38483. }
  38484. if (!vm._inactive) {
  38485. vm._inactive = true;
  38486. for (var i = 0; i < vm.$children.length; i++) {
  38487. deactivateChildComponent(vm.$children[i]);
  38488. }
  38489. callHook(vm, 'deactivated');
  38490. }
  38491. }
  38492. function callHook (vm, hook) {
  38493. // #7573 disable dep collection when invoking lifecycle hooks
  38494. pushTarget();
  38495. var handlers = vm.$options[hook];
  38496. var info = hook + " hook";
  38497. if (handlers) {
  38498. for (var i = 0, j = handlers.length; i < j; i++) {
  38499. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  38500. }
  38501. }
  38502. if (vm._hasHookEvent) {
  38503. vm.$emit('hook:' + hook);
  38504. }
  38505. popTarget();
  38506. }
  38507. /* */
  38508. var MAX_UPDATE_COUNT = 100;
  38509. var queue = [];
  38510. var activatedChildren = [];
  38511. var has = {};
  38512. var circular = {};
  38513. var waiting = false;
  38514. var flushing = false;
  38515. var index = 0;
  38516. /**
  38517. * Reset the scheduler's state.
  38518. */
  38519. function resetSchedulerState () {
  38520. index = queue.length = activatedChildren.length = 0;
  38521. has = {};
  38522. {
  38523. circular = {};
  38524. }
  38525. waiting = flushing = false;
  38526. }
  38527. // Async edge case #6566 requires saving the timestamp when event listeners are
  38528. // attached. However, calling performance.now() has a perf overhead especially
  38529. // if the page has thousands of event listeners. Instead, we take a timestamp
  38530. // every time the scheduler flushes and use that for all event listeners
  38531. // attached during that flush.
  38532. var currentFlushTimestamp = 0;
  38533. // Async edge case fix requires storing an event listener's attach timestamp.
  38534. var getNow = Date.now;
  38535. // Determine what event timestamp the browser is using. Annoyingly, the
  38536. // timestamp can either be hi-res (relative to page load) or low-res
  38537. // (relative to UNIX epoch), so in order to compare time we have to use the
  38538. // same timestamp type when saving the flush timestamp.
  38539. // All IE versions use low-res event timestamps, and have problematic clock
  38540. // implementations (#9632)
  38541. if (inBrowser && !isIE) {
  38542. var performance = window.performance;
  38543. if (
  38544. performance &&
  38545. typeof performance.now === 'function' &&
  38546. getNow() > document.createEvent('Event').timeStamp
  38547. ) {
  38548. // if the event timestamp, although evaluated AFTER the Date.now(), is
  38549. // smaller than it, it means the event is using a hi-res timestamp,
  38550. // and we need to use the hi-res version for event listener timestamps as
  38551. // well.
  38552. getNow = function () { return performance.now(); };
  38553. }
  38554. }
  38555. /**
  38556. * Flush both queues and run the watchers.
  38557. */
  38558. function flushSchedulerQueue () {
  38559. currentFlushTimestamp = getNow();
  38560. flushing = true;
  38561. var watcher, id;
  38562. // Sort queue before flush.
  38563. // This ensures that:
  38564. // 1. Components are updated from parent to child. (because parent is always
  38565. // created before the child)
  38566. // 2. A component's user watchers are run before its render watcher (because
  38567. // user watchers are created before the render watcher)
  38568. // 3. If a component is destroyed during a parent component's watcher run,
  38569. // its watchers can be skipped.
  38570. queue.sort(function (a, b) { return a.id - b.id; });
  38571. // do not cache length because more watchers might be pushed
  38572. // as we run existing watchers
  38573. for (index = 0; index < queue.length; index++) {
  38574. watcher = queue[index];
  38575. if (watcher.before) {
  38576. watcher.before();
  38577. }
  38578. id = watcher.id;
  38579. has[id] = null;
  38580. watcher.run();
  38581. // in dev build, check and stop circular updates.
  38582. if (has[id] != null) {
  38583. circular[id] = (circular[id] || 0) + 1;
  38584. if (circular[id] > MAX_UPDATE_COUNT) {
  38585. warn(
  38586. 'You may have an infinite update loop ' + (
  38587. watcher.user
  38588. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  38589. : "in a component render function."
  38590. ),
  38591. watcher.vm
  38592. );
  38593. break
  38594. }
  38595. }
  38596. }
  38597. // keep copies of post queues before resetting state
  38598. var activatedQueue = activatedChildren.slice();
  38599. var updatedQueue = queue.slice();
  38600. resetSchedulerState();
  38601. // call component updated and activated hooks
  38602. callActivatedHooks(activatedQueue);
  38603. callUpdatedHooks(updatedQueue);
  38604. // devtool hook
  38605. /* istanbul ignore if */
  38606. if (devtools && config.devtools) {
  38607. devtools.emit('flush');
  38608. }
  38609. }
  38610. function callUpdatedHooks (queue) {
  38611. var i = queue.length;
  38612. while (i--) {
  38613. var watcher = queue[i];
  38614. var vm = watcher.vm;
  38615. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  38616. callHook(vm, 'updated');
  38617. }
  38618. }
  38619. }
  38620. /**
  38621. * Queue a kept-alive component that was activated during patch.
  38622. * The queue will be processed after the entire tree has been patched.
  38623. */
  38624. function queueActivatedComponent (vm) {
  38625. // setting _inactive to false here so that a render function can
  38626. // rely on checking whether it's in an inactive tree (e.g. router-view)
  38627. vm._inactive = false;
  38628. activatedChildren.push(vm);
  38629. }
  38630. function callActivatedHooks (queue) {
  38631. for (var i = 0; i < queue.length; i++) {
  38632. queue[i]._inactive = true;
  38633. activateChildComponent(queue[i], true /* true */);
  38634. }
  38635. }
  38636. /**
  38637. * Push a watcher into the watcher queue.
  38638. * Jobs with duplicate IDs will be skipped unless it's
  38639. * pushed when the queue is being flushed.
  38640. */
  38641. function queueWatcher (watcher) {
  38642. var id = watcher.id;
  38643. if (has[id] == null) {
  38644. has[id] = true;
  38645. if (!flushing) {
  38646. queue.push(watcher);
  38647. } else {
  38648. // if already flushing, splice the watcher based on its id
  38649. // if already past its id, it will be run next immediately.
  38650. var i = queue.length - 1;
  38651. while (i > index && queue[i].id > watcher.id) {
  38652. i--;
  38653. }
  38654. queue.splice(i + 1, 0, watcher);
  38655. }
  38656. // queue the flush
  38657. if (!waiting) {
  38658. waiting = true;
  38659. if (!config.async) {
  38660. flushSchedulerQueue();
  38661. return
  38662. }
  38663. nextTick(flushSchedulerQueue);
  38664. }
  38665. }
  38666. }
  38667. /* */
  38668. var uid$2 = 0;
  38669. /**
  38670. * A watcher parses an expression, collects dependencies,
  38671. * and fires callback when the expression value changes.
  38672. * This is used for both the $watch() api and directives.
  38673. */
  38674. var Watcher = function Watcher (
  38675. vm,
  38676. expOrFn,
  38677. cb,
  38678. options,
  38679. isRenderWatcher
  38680. ) {
  38681. this.vm = vm;
  38682. if (isRenderWatcher) {
  38683. vm._watcher = this;
  38684. }
  38685. vm._watchers.push(this);
  38686. // options
  38687. if (options) {
  38688. this.deep = !!options.deep;
  38689. this.user = !!options.user;
  38690. this.lazy = !!options.lazy;
  38691. this.sync = !!options.sync;
  38692. this.before = options.before;
  38693. } else {
  38694. this.deep = this.user = this.lazy = this.sync = false;
  38695. }
  38696. this.cb = cb;
  38697. this.id = ++uid$2; // uid for batching
  38698. this.active = true;
  38699. this.dirty = this.lazy; // for lazy watchers
  38700. this.deps = [];
  38701. this.newDeps = [];
  38702. this.depIds = new _Set();
  38703. this.newDepIds = new _Set();
  38704. this.expression = expOrFn.toString();
  38705. // parse expression for getter
  38706. if (typeof expOrFn === 'function') {
  38707. this.getter = expOrFn;
  38708. } else {
  38709. this.getter = parsePath(expOrFn);
  38710. if (!this.getter) {
  38711. this.getter = noop;
  38712. warn(
  38713. "Failed watching path: \"" + expOrFn + "\" " +
  38714. 'Watcher only accepts simple dot-delimited paths. ' +
  38715. 'For full control, use a function instead.',
  38716. vm
  38717. );
  38718. }
  38719. }
  38720. this.value = this.lazy
  38721. ? undefined
  38722. : this.get();
  38723. };
  38724. /**
  38725. * Evaluate the getter, and re-collect dependencies.
  38726. */
  38727. Watcher.prototype.get = function get () {
  38728. pushTarget(this);
  38729. var value;
  38730. var vm = this.vm;
  38731. try {
  38732. value = this.getter.call(vm, vm);
  38733. } catch (e) {
  38734. if (this.user) {
  38735. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  38736. } else {
  38737. throw e
  38738. }
  38739. } finally {
  38740. // "touch" every property so they are all tracked as
  38741. // dependencies for deep watching
  38742. if (this.deep) {
  38743. traverse(value);
  38744. }
  38745. popTarget();
  38746. this.cleanupDeps();
  38747. }
  38748. return value
  38749. };
  38750. /**
  38751. * Add a dependency to this directive.
  38752. */
  38753. Watcher.prototype.addDep = function addDep (dep) {
  38754. var id = dep.id;
  38755. if (!this.newDepIds.has(id)) {
  38756. this.newDepIds.add(id);
  38757. this.newDeps.push(dep);
  38758. if (!this.depIds.has(id)) {
  38759. dep.addSub(this);
  38760. }
  38761. }
  38762. };
  38763. /**
  38764. * Clean up for dependency collection.
  38765. */
  38766. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  38767. var i = this.deps.length;
  38768. while (i--) {
  38769. var dep = this.deps[i];
  38770. if (!this.newDepIds.has(dep.id)) {
  38771. dep.removeSub(this);
  38772. }
  38773. }
  38774. var tmp = this.depIds;
  38775. this.depIds = this.newDepIds;
  38776. this.newDepIds = tmp;
  38777. this.newDepIds.clear();
  38778. tmp = this.deps;
  38779. this.deps = this.newDeps;
  38780. this.newDeps = tmp;
  38781. this.newDeps.length = 0;
  38782. };
  38783. /**
  38784. * Subscriber interface.
  38785. * Will be called when a dependency changes.
  38786. */
  38787. Watcher.prototype.update = function update () {
  38788. /* istanbul ignore else */
  38789. if (this.lazy) {
  38790. this.dirty = true;
  38791. } else if (this.sync) {
  38792. this.run();
  38793. } else {
  38794. queueWatcher(this);
  38795. }
  38796. };
  38797. /**
  38798. * Scheduler job interface.
  38799. * Will be called by the scheduler.
  38800. */
  38801. Watcher.prototype.run = function run () {
  38802. if (this.active) {
  38803. var value = this.get();
  38804. if (
  38805. value !== this.value ||
  38806. // Deep watchers and watchers on Object/Arrays should fire even
  38807. // when the value is the same, because the value may
  38808. // have mutated.
  38809. isObject(value) ||
  38810. this.deep
  38811. ) {
  38812. // set new value
  38813. var oldValue = this.value;
  38814. this.value = value;
  38815. if (this.user) {
  38816. var info = "callback for watcher \"" + (this.expression) + "\"";
  38817. invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
  38818. } else {
  38819. this.cb.call(this.vm, value, oldValue);
  38820. }
  38821. }
  38822. }
  38823. };
  38824. /**
  38825. * Evaluate the value of the watcher.
  38826. * This only gets called for lazy watchers.
  38827. */
  38828. Watcher.prototype.evaluate = function evaluate () {
  38829. this.value = this.get();
  38830. this.dirty = false;
  38831. };
  38832. /**
  38833. * Depend on all deps collected by this watcher.
  38834. */
  38835. Watcher.prototype.depend = function depend () {
  38836. var i = this.deps.length;
  38837. while (i--) {
  38838. this.deps[i].depend();
  38839. }
  38840. };
  38841. /**
  38842. * Remove self from all dependencies' subscriber list.
  38843. */
  38844. Watcher.prototype.teardown = function teardown () {
  38845. if (this.active) {
  38846. // remove self from vm's watcher list
  38847. // this is a somewhat expensive operation so we skip it
  38848. // if the vm is being destroyed.
  38849. if (!this.vm._isBeingDestroyed) {
  38850. remove(this.vm._watchers, this);
  38851. }
  38852. var i = this.deps.length;
  38853. while (i--) {
  38854. this.deps[i].removeSub(this);
  38855. }
  38856. this.active = false;
  38857. }
  38858. };
  38859. /* */
  38860. var sharedPropertyDefinition = {
  38861. enumerable: true,
  38862. configurable: true,
  38863. get: noop,
  38864. set: noop
  38865. };
  38866. function proxy (target, sourceKey, key) {
  38867. sharedPropertyDefinition.get = function proxyGetter () {
  38868. return this[sourceKey][key]
  38869. };
  38870. sharedPropertyDefinition.set = function proxySetter (val) {
  38871. this[sourceKey][key] = val;
  38872. };
  38873. Object.defineProperty(target, key, sharedPropertyDefinition);
  38874. }
  38875. function initState (vm) {
  38876. vm._watchers = [];
  38877. var opts = vm.$options;
  38878. if (opts.props) { initProps(vm, opts.props); }
  38879. if (opts.methods) { initMethods(vm, opts.methods); }
  38880. if (opts.data) {
  38881. initData(vm);
  38882. } else {
  38883. observe(vm._data = {}, true /* asRootData */);
  38884. }
  38885. if (opts.computed) { initComputed(vm, opts.computed); }
  38886. if (opts.watch && opts.watch !== nativeWatch) {
  38887. initWatch(vm, opts.watch);
  38888. }
  38889. }
  38890. function initProps (vm, propsOptions) {
  38891. var propsData = vm.$options.propsData || {};
  38892. var props = vm._props = {};
  38893. // cache prop keys so that future props updates can iterate using Array
  38894. // instead of dynamic object key enumeration.
  38895. var keys = vm.$options._propKeys = [];
  38896. var isRoot = !vm.$parent;
  38897. // root instance props should be converted
  38898. if (!isRoot) {
  38899. toggleObserving(false);
  38900. }
  38901. var loop = function ( key ) {
  38902. keys.push(key);
  38903. var value = validateProp(key, propsOptions, propsData, vm);
  38904. /* istanbul ignore else */
  38905. {
  38906. var hyphenatedKey = hyphenate(key);
  38907. if (isReservedAttribute(hyphenatedKey) ||
  38908. config.isReservedAttr(hyphenatedKey)) {
  38909. warn(
  38910. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  38911. vm
  38912. );
  38913. }
  38914. defineReactive$$1(props, key, value, function () {
  38915. if (!isRoot && !isUpdatingChildComponent) {
  38916. warn(
  38917. "Avoid mutating a prop directly since the value will be " +
  38918. "overwritten whenever the parent component re-renders. " +
  38919. "Instead, use a data or computed property based on the prop's " +
  38920. "value. Prop being mutated: \"" + key + "\"",
  38921. vm
  38922. );
  38923. }
  38924. });
  38925. }
  38926. // static props are already proxied on the component's prototype
  38927. // during Vue.extend(). We only need to proxy props defined at
  38928. // instantiation here.
  38929. if (!(key in vm)) {
  38930. proxy(vm, "_props", key);
  38931. }
  38932. };
  38933. for (var key in propsOptions) loop( key );
  38934. toggleObserving(true);
  38935. }
  38936. function initData (vm) {
  38937. var data = vm.$options.data;
  38938. data = vm._data = typeof data === 'function'
  38939. ? getData(data, vm)
  38940. : data || {};
  38941. if (!isPlainObject(data)) {
  38942. data = {};
  38943. warn(
  38944. 'data functions should return an object:\n' +
  38945. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  38946. vm
  38947. );
  38948. }
  38949. // proxy data on instance
  38950. var keys = Object.keys(data);
  38951. var props = vm.$options.props;
  38952. var methods = vm.$options.methods;
  38953. var i = keys.length;
  38954. while (i--) {
  38955. var key = keys[i];
  38956. {
  38957. if (methods && hasOwn(methods, key)) {
  38958. warn(
  38959. ("Method \"" + key + "\" has already been defined as a data property."),
  38960. vm
  38961. );
  38962. }
  38963. }
  38964. if (props && hasOwn(props, key)) {
  38965. warn(
  38966. "The data property \"" + key + "\" is already declared as a prop. " +
  38967. "Use prop default value instead.",
  38968. vm
  38969. );
  38970. } else if (!isReserved(key)) {
  38971. proxy(vm, "_data", key);
  38972. }
  38973. }
  38974. // observe data
  38975. observe(data, true /* asRootData */);
  38976. }
  38977. function getData (data, vm) {
  38978. // #7573 disable dep collection when invoking data getters
  38979. pushTarget();
  38980. try {
  38981. return data.call(vm, vm)
  38982. } catch (e) {
  38983. handleError(e, vm, "data()");
  38984. return {}
  38985. } finally {
  38986. popTarget();
  38987. }
  38988. }
  38989. var computedWatcherOptions = { lazy: true };
  38990. function initComputed (vm, computed) {
  38991. // $flow-disable-line
  38992. var watchers = vm._computedWatchers = Object.create(null);
  38993. // computed properties are just getters during SSR
  38994. var isSSR = isServerRendering();
  38995. for (var key in computed) {
  38996. var userDef = computed[key];
  38997. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  38998. if (getter == null) {
  38999. warn(
  39000. ("Getter is missing for computed property \"" + key + "\"."),
  39001. vm
  39002. );
  39003. }
  39004. if (!isSSR) {
  39005. // create internal watcher for the computed property.
  39006. watchers[key] = new Watcher(
  39007. vm,
  39008. getter || noop,
  39009. noop,
  39010. computedWatcherOptions
  39011. );
  39012. }
  39013. // component-defined computed properties are already defined on the
  39014. // component prototype. We only need to define computed properties defined
  39015. // at instantiation here.
  39016. if (!(key in vm)) {
  39017. defineComputed(vm, key, userDef);
  39018. } else {
  39019. if (key in vm.$data) {
  39020. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  39021. } else if (vm.$options.props && key in vm.$options.props) {
  39022. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  39023. } else if (vm.$options.methods && key in vm.$options.methods) {
  39024. warn(("The computed property \"" + key + "\" is already defined as a method."), vm);
  39025. }
  39026. }
  39027. }
  39028. }
  39029. function defineComputed (
  39030. target,
  39031. key,
  39032. userDef
  39033. ) {
  39034. var shouldCache = !isServerRendering();
  39035. if (typeof userDef === 'function') {
  39036. sharedPropertyDefinition.get = shouldCache
  39037. ? createComputedGetter(key)
  39038. : createGetterInvoker(userDef);
  39039. sharedPropertyDefinition.set = noop;
  39040. } else {
  39041. sharedPropertyDefinition.get = userDef.get
  39042. ? shouldCache && userDef.cache !== false
  39043. ? createComputedGetter(key)
  39044. : createGetterInvoker(userDef.get)
  39045. : noop;
  39046. sharedPropertyDefinition.set = userDef.set || noop;
  39047. }
  39048. if (sharedPropertyDefinition.set === noop) {
  39049. sharedPropertyDefinition.set = function () {
  39050. warn(
  39051. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  39052. this
  39053. );
  39054. };
  39055. }
  39056. Object.defineProperty(target, key, sharedPropertyDefinition);
  39057. }
  39058. function createComputedGetter (key) {
  39059. return function computedGetter () {
  39060. var watcher = this._computedWatchers && this._computedWatchers[key];
  39061. if (watcher) {
  39062. if (watcher.dirty) {
  39063. watcher.evaluate();
  39064. }
  39065. if (Dep.target) {
  39066. watcher.depend();
  39067. }
  39068. return watcher.value
  39069. }
  39070. }
  39071. }
  39072. function createGetterInvoker(fn) {
  39073. return function computedGetter () {
  39074. return fn.call(this, this)
  39075. }
  39076. }
  39077. function initMethods (vm, methods) {
  39078. var props = vm.$options.props;
  39079. for (var key in methods) {
  39080. {
  39081. if (typeof methods[key] !== 'function') {
  39082. warn(
  39083. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  39084. "Did you reference the function correctly?",
  39085. vm
  39086. );
  39087. }
  39088. if (props && hasOwn(props, key)) {
  39089. warn(
  39090. ("Method \"" + key + "\" has already been defined as a prop."),
  39091. vm
  39092. );
  39093. }
  39094. if ((key in vm) && isReserved(key)) {
  39095. warn(
  39096. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  39097. "Avoid defining component methods that start with _ or $."
  39098. );
  39099. }
  39100. }
  39101. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  39102. }
  39103. }
  39104. function initWatch (vm, watch) {
  39105. for (var key in watch) {
  39106. var handler = watch[key];
  39107. if (Array.isArray(handler)) {
  39108. for (var i = 0; i < handler.length; i++) {
  39109. createWatcher(vm, key, handler[i]);
  39110. }
  39111. } else {
  39112. createWatcher(vm, key, handler);
  39113. }
  39114. }
  39115. }
  39116. function createWatcher (
  39117. vm,
  39118. expOrFn,
  39119. handler,
  39120. options
  39121. ) {
  39122. if (isPlainObject(handler)) {
  39123. options = handler;
  39124. handler = handler.handler;
  39125. }
  39126. if (typeof handler === 'string') {
  39127. handler = vm[handler];
  39128. }
  39129. return vm.$watch(expOrFn, handler, options)
  39130. }
  39131. function stateMixin (Vue) {
  39132. // flow somehow has problems with directly declared definition object
  39133. // when using Object.defineProperty, so we have to procedurally build up
  39134. // the object here.
  39135. var dataDef = {};
  39136. dataDef.get = function () { return this._data };
  39137. var propsDef = {};
  39138. propsDef.get = function () { return this._props };
  39139. {
  39140. dataDef.set = function () {
  39141. warn(
  39142. 'Avoid replacing instance root $data. ' +
  39143. 'Use nested data properties instead.',
  39144. this
  39145. );
  39146. };
  39147. propsDef.set = function () {
  39148. warn("$props is readonly.", this);
  39149. };
  39150. }
  39151. Object.defineProperty(Vue.prototype, '$data', dataDef);
  39152. Object.defineProperty(Vue.prototype, '$props', propsDef);
  39153. Vue.prototype.$set = set;
  39154. Vue.prototype.$delete = del;
  39155. Vue.prototype.$watch = function (
  39156. expOrFn,
  39157. cb,
  39158. options
  39159. ) {
  39160. var vm = this;
  39161. if (isPlainObject(cb)) {
  39162. return createWatcher(vm, expOrFn, cb, options)
  39163. }
  39164. options = options || {};
  39165. options.user = true;
  39166. var watcher = new Watcher(vm, expOrFn, cb, options);
  39167. if (options.immediate) {
  39168. var info = "callback for immediate watcher \"" + (watcher.expression) + "\"";
  39169. pushTarget();
  39170. invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
  39171. popTarget();
  39172. }
  39173. return function unwatchFn () {
  39174. watcher.teardown();
  39175. }
  39176. };
  39177. }
  39178. /* */
  39179. var uid$3 = 0;
  39180. function initMixin (Vue) {
  39181. Vue.prototype._init = function (options) {
  39182. var vm = this;
  39183. // a uid
  39184. vm._uid = uid$3++;
  39185. var startTag, endTag;
  39186. /* istanbul ignore if */
  39187. if (config.performance && mark) {
  39188. startTag = "vue-perf-start:" + (vm._uid);
  39189. endTag = "vue-perf-end:" + (vm._uid);
  39190. mark(startTag);
  39191. }
  39192. // a flag to avoid this being observed
  39193. vm._isVue = true;
  39194. // merge options
  39195. if (options && options._isComponent) {
  39196. // optimize internal component instantiation
  39197. // since dynamic options merging is pretty slow, and none of the
  39198. // internal component options needs special treatment.
  39199. initInternalComponent(vm, options);
  39200. } else {
  39201. vm.$options = mergeOptions(
  39202. resolveConstructorOptions(vm.constructor),
  39203. options || {},
  39204. vm
  39205. );
  39206. }
  39207. /* istanbul ignore else */
  39208. {
  39209. initProxy(vm);
  39210. }
  39211. // expose real self
  39212. vm._self = vm;
  39213. initLifecycle(vm);
  39214. initEvents(vm);
  39215. initRender(vm);
  39216. callHook(vm, 'beforeCreate');
  39217. initInjections(vm); // resolve injections before data/props
  39218. initState(vm);
  39219. initProvide(vm); // resolve provide after data/props
  39220. callHook(vm, 'created');
  39221. /* istanbul ignore if */
  39222. if (config.performance && mark) {
  39223. vm._name = formatComponentName(vm, false);
  39224. mark(endTag);
  39225. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  39226. }
  39227. if (vm.$options.el) {
  39228. vm.$mount(vm.$options.el);
  39229. }
  39230. };
  39231. }
  39232. function initInternalComponent (vm, options) {
  39233. var opts = vm.$options = Object.create(vm.constructor.options);
  39234. // doing this because it's faster than dynamic enumeration.
  39235. var parentVnode = options._parentVnode;
  39236. opts.parent = options.parent;
  39237. opts._parentVnode = parentVnode;
  39238. var vnodeComponentOptions = parentVnode.componentOptions;
  39239. opts.propsData = vnodeComponentOptions.propsData;
  39240. opts._parentListeners = vnodeComponentOptions.listeners;
  39241. opts._renderChildren = vnodeComponentOptions.children;
  39242. opts._componentTag = vnodeComponentOptions.tag;
  39243. if (options.render) {
  39244. opts.render = options.render;
  39245. opts.staticRenderFns = options.staticRenderFns;
  39246. }
  39247. }
  39248. function resolveConstructorOptions (Ctor) {
  39249. var options = Ctor.options;
  39250. if (Ctor.super) {
  39251. var superOptions = resolveConstructorOptions(Ctor.super);
  39252. var cachedSuperOptions = Ctor.superOptions;
  39253. if (superOptions !== cachedSuperOptions) {
  39254. // super option changed,
  39255. // need to resolve new options.
  39256. Ctor.superOptions = superOptions;
  39257. // check if there are any late-modified/attached options (#4976)
  39258. var modifiedOptions = resolveModifiedOptions(Ctor);
  39259. // update base extend options
  39260. if (modifiedOptions) {
  39261. extend(Ctor.extendOptions, modifiedOptions);
  39262. }
  39263. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  39264. if (options.name) {
  39265. options.components[options.name] = Ctor;
  39266. }
  39267. }
  39268. }
  39269. return options
  39270. }
  39271. function resolveModifiedOptions (Ctor) {
  39272. var modified;
  39273. var latest = Ctor.options;
  39274. var sealed = Ctor.sealedOptions;
  39275. for (var key in latest) {
  39276. if (latest[key] !== sealed[key]) {
  39277. if (!modified) { modified = {}; }
  39278. modified[key] = latest[key];
  39279. }
  39280. }
  39281. return modified
  39282. }
  39283. function Vue (options) {
  39284. if (!(this instanceof Vue)
  39285. ) {
  39286. warn('Vue is a constructor and should be called with the `new` keyword');
  39287. }
  39288. this._init(options);
  39289. }
  39290. initMixin(Vue);
  39291. stateMixin(Vue);
  39292. eventsMixin(Vue);
  39293. lifecycleMixin(Vue);
  39294. renderMixin(Vue);
  39295. /* */
  39296. function initUse (Vue) {
  39297. Vue.use = function (plugin) {
  39298. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  39299. if (installedPlugins.indexOf(plugin) > -1) {
  39300. return this
  39301. }
  39302. // additional parameters
  39303. var args = toArray(arguments, 1);
  39304. args.unshift(this);
  39305. if (typeof plugin.install === 'function') {
  39306. plugin.install.apply(plugin, args);
  39307. } else if (typeof plugin === 'function') {
  39308. plugin.apply(null, args);
  39309. }
  39310. installedPlugins.push(plugin);
  39311. return this
  39312. };
  39313. }
  39314. /* */
  39315. function initMixin$1 (Vue) {
  39316. Vue.mixin = function (mixin) {
  39317. this.options = mergeOptions(this.options, mixin);
  39318. return this
  39319. };
  39320. }
  39321. /* */
  39322. function initExtend (Vue) {
  39323. /**
  39324. * Each instance constructor, including Vue, has a unique
  39325. * cid. This enables us to create wrapped "child
  39326. * constructors" for prototypal inheritance and cache them.
  39327. */
  39328. Vue.cid = 0;
  39329. var cid = 1;
  39330. /**
  39331. * Class inheritance
  39332. */
  39333. Vue.extend = function (extendOptions) {
  39334. extendOptions = extendOptions || {};
  39335. var Super = this;
  39336. var SuperId = Super.cid;
  39337. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  39338. if (cachedCtors[SuperId]) {
  39339. return cachedCtors[SuperId]
  39340. }
  39341. var name = extendOptions.name || Super.options.name;
  39342. if (name) {
  39343. validateComponentName(name);
  39344. }
  39345. var Sub = function VueComponent (options) {
  39346. this._init(options);
  39347. };
  39348. Sub.prototype = Object.create(Super.prototype);
  39349. Sub.prototype.constructor = Sub;
  39350. Sub.cid = cid++;
  39351. Sub.options = mergeOptions(
  39352. Super.options,
  39353. extendOptions
  39354. );
  39355. Sub['super'] = Super;
  39356. // For props and computed properties, we define the proxy getters on
  39357. // the Vue instances at extension time, on the extended prototype. This
  39358. // avoids Object.defineProperty calls for each instance created.
  39359. if (Sub.options.props) {
  39360. initProps$1(Sub);
  39361. }
  39362. if (Sub.options.computed) {
  39363. initComputed$1(Sub);
  39364. }
  39365. // allow further extension/mixin/plugin usage
  39366. Sub.extend = Super.extend;
  39367. Sub.mixin = Super.mixin;
  39368. Sub.use = Super.use;
  39369. // create asset registers, so extended classes
  39370. // can have their private assets too.
  39371. ASSET_TYPES.forEach(function (type) {
  39372. Sub[type] = Super[type];
  39373. });
  39374. // enable recursive self-lookup
  39375. if (name) {
  39376. Sub.options.components[name] = Sub;
  39377. }
  39378. // keep a reference to the super options at extension time.
  39379. // later at instantiation we can check if Super's options have
  39380. // been updated.
  39381. Sub.superOptions = Super.options;
  39382. Sub.extendOptions = extendOptions;
  39383. Sub.sealedOptions = extend({}, Sub.options);
  39384. // cache constructor
  39385. cachedCtors[SuperId] = Sub;
  39386. return Sub
  39387. };
  39388. }
  39389. function initProps$1 (Comp) {
  39390. var props = Comp.options.props;
  39391. for (var key in props) {
  39392. proxy(Comp.prototype, "_props", key);
  39393. }
  39394. }
  39395. function initComputed$1 (Comp) {
  39396. var computed = Comp.options.computed;
  39397. for (var key in computed) {
  39398. defineComputed(Comp.prototype, key, computed[key]);
  39399. }
  39400. }
  39401. /* */
  39402. function initAssetRegisters (Vue) {
  39403. /**
  39404. * Create asset registration methods.
  39405. */
  39406. ASSET_TYPES.forEach(function (type) {
  39407. Vue[type] = function (
  39408. id,
  39409. definition
  39410. ) {
  39411. if (!definition) {
  39412. return this.options[type + 's'][id]
  39413. } else {
  39414. /* istanbul ignore if */
  39415. if (type === 'component') {
  39416. validateComponentName(id);
  39417. }
  39418. if (type === 'component' && isPlainObject(definition)) {
  39419. definition.name = definition.name || id;
  39420. definition = this.options._base.extend(definition);
  39421. }
  39422. if (type === 'directive' && typeof definition === 'function') {
  39423. definition = { bind: definition, update: definition };
  39424. }
  39425. this.options[type + 's'][id] = definition;
  39426. return definition
  39427. }
  39428. };
  39429. });
  39430. }
  39431. /* */
  39432. function getComponentName (opts) {
  39433. return opts && (opts.Ctor.options.name || opts.tag)
  39434. }
  39435. function matches (pattern, name) {
  39436. if (Array.isArray(pattern)) {
  39437. return pattern.indexOf(name) > -1
  39438. } else if (typeof pattern === 'string') {
  39439. return pattern.split(',').indexOf(name) > -1
  39440. } else if (isRegExp(pattern)) {
  39441. return pattern.test(name)
  39442. }
  39443. /* istanbul ignore next */
  39444. return false
  39445. }
  39446. function pruneCache (keepAliveInstance, filter) {
  39447. var cache = keepAliveInstance.cache;
  39448. var keys = keepAliveInstance.keys;
  39449. var _vnode = keepAliveInstance._vnode;
  39450. for (var key in cache) {
  39451. var entry = cache[key];
  39452. if (entry) {
  39453. var name = entry.name;
  39454. if (name && !filter(name)) {
  39455. pruneCacheEntry(cache, key, keys, _vnode);
  39456. }
  39457. }
  39458. }
  39459. }
  39460. function pruneCacheEntry (
  39461. cache,
  39462. key,
  39463. keys,
  39464. current
  39465. ) {
  39466. var entry = cache[key];
  39467. if (entry && (!current || entry.tag !== current.tag)) {
  39468. entry.componentInstance.$destroy();
  39469. }
  39470. cache[key] = null;
  39471. remove(keys, key);
  39472. }
  39473. var patternTypes = [String, RegExp, Array];
  39474. var KeepAlive = {
  39475. name: 'keep-alive',
  39476. abstract: true,
  39477. props: {
  39478. include: patternTypes,
  39479. exclude: patternTypes,
  39480. max: [String, Number]
  39481. },
  39482. methods: {
  39483. cacheVNode: function cacheVNode() {
  39484. var ref = this;
  39485. var cache = ref.cache;
  39486. var keys = ref.keys;
  39487. var vnodeToCache = ref.vnodeToCache;
  39488. var keyToCache = ref.keyToCache;
  39489. if (vnodeToCache) {
  39490. var tag = vnodeToCache.tag;
  39491. var componentInstance = vnodeToCache.componentInstance;
  39492. var componentOptions = vnodeToCache.componentOptions;
  39493. cache[keyToCache] = {
  39494. name: getComponentName(componentOptions),
  39495. tag: tag,
  39496. componentInstance: componentInstance,
  39497. };
  39498. keys.push(keyToCache);
  39499. // prune oldest entry
  39500. if (this.max && keys.length > parseInt(this.max)) {
  39501. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  39502. }
  39503. this.vnodeToCache = null;
  39504. }
  39505. }
  39506. },
  39507. created: function created () {
  39508. this.cache = Object.create(null);
  39509. this.keys = [];
  39510. },
  39511. destroyed: function destroyed () {
  39512. for (var key in this.cache) {
  39513. pruneCacheEntry(this.cache, key, this.keys);
  39514. }
  39515. },
  39516. mounted: function mounted () {
  39517. var this$1 = this;
  39518. this.cacheVNode();
  39519. this.$watch('include', function (val) {
  39520. pruneCache(this$1, function (name) { return matches(val, name); });
  39521. });
  39522. this.$watch('exclude', function (val) {
  39523. pruneCache(this$1, function (name) { return !matches(val, name); });
  39524. });
  39525. },
  39526. updated: function updated () {
  39527. this.cacheVNode();
  39528. },
  39529. render: function render () {
  39530. var slot = this.$slots.default;
  39531. var vnode = getFirstComponentChild(slot);
  39532. var componentOptions = vnode && vnode.componentOptions;
  39533. if (componentOptions) {
  39534. // check pattern
  39535. var name = getComponentName(componentOptions);
  39536. var ref = this;
  39537. var include = ref.include;
  39538. var exclude = ref.exclude;
  39539. if (
  39540. // not included
  39541. (include && (!name || !matches(include, name))) ||
  39542. // excluded
  39543. (exclude && name && matches(exclude, name))
  39544. ) {
  39545. return vnode
  39546. }
  39547. var ref$1 = this;
  39548. var cache = ref$1.cache;
  39549. var keys = ref$1.keys;
  39550. var key = vnode.key == null
  39551. // same constructor may get registered as different local components
  39552. // so cid alone is not enough (#3269)
  39553. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  39554. : vnode.key;
  39555. if (cache[key]) {
  39556. vnode.componentInstance = cache[key].componentInstance;
  39557. // make current key freshest
  39558. remove(keys, key);
  39559. keys.push(key);
  39560. } else {
  39561. // delay setting the cache until update
  39562. this.vnodeToCache = vnode;
  39563. this.keyToCache = key;
  39564. }
  39565. vnode.data.keepAlive = true;
  39566. }
  39567. return vnode || (slot && slot[0])
  39568. }
  39569. };
  39570. var builtInComponents = {
  39571. KeepAlive: KeepAlive
  39572. };
  39573. /* */
  39574. function initGlobalAPI (Vue) {
  39575. // config
  39576. var configDef = {};
  39577. configDef.get = function () { return config; };
  39578. {
  39579. configDef.set = function () {
  39580. warn(
  39581. 'Do not replace the Vue.config object, set individual fields instead.'
  39582. );
  39583. };
  39584. }
  39585. Object.defineProperty(Vue, 'config', configDef);
  39586. // exposed util methods.
  39587. // NOTE: these are not considered part of the public API - avoid relying on
  39588. // them unless you are aware of the risk.
  39589. Vue.util = {
  39590. warn: warn,
  39591. extend: extend,
  39592. mergeOptions: mergeOptions,
  39593. defineReactive: defineReactive$$1
  39594. };
  39595. Vue.set = set;
  39596. Vue.delete = del;
  39597. Vue.nextTick = nextTick;
  39598. // 2.6 explicit observable API
  39599. Vue.observable = function (obj) {
  39600. observe(obj);
  39601. return obj
  39602. };
  39603. Vue.options = Object.create(null);
  39604. ASSET_TYPES.forEach(function (type) {
  39605. Vue.options[type + 's'] = Object.create(null);
  39606. });
  39607. // this is used to identify the "base" constructor to extend all plain-object
  39608. // components with in Weex's multi-instance scenarios.
  39609. Vue.options._base = Vue;
  39610. extend(Vue.options.components, builtInComponents);
  39611. initUse(Vue);
  39612. initMixin$1(Vue);
  39613. initExtend(Vue);
  39614. initAssetRegisters(Vue);
  39615. }
  39616. initGlobalAPI(Vue);
  39617. Object.defineProperty(Vue.prototype, '$isServer', {
  39618. get: isServerRendering
  39619. });
  39620. Object.defineProperty(Vue.prototype, '$ssrContext', {
  39621. get: function get () {
  39622. /* istanbul ignore next */
  39623. return this.$vnode && this.$vnode.ssrContext
  39624. }
  39625. });
  39626. // expose FunctionalRenderContext for ssr runtime helper installation
  39627. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  39628. value: FunctionalRenderContext
  39629. });
  39630. Vue.version = '2.6.14';
  39631. /* */
  39632. // these are reserved for web because they are directly compiled away
  39633. // during template compilation
  39634. var isReservedAttr = makeMap('style,class');
  39635. // attributes that should be using props for binding
  39636. var acceptValue = makeMap('input,textarea,option,select,progress');
  39637. var mustUseProp = function (tag, type, attr) {
  39638. return (
  39639. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  39640. (attr === 'selected' && tag === 'option') ||
  39641. (attr === 'checked' && tag === 'input') ||
  39642. (attr === 'muted' && tag === 'video')
  39643. )
  39644. };
  39645. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  39646. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  39647. var convertEnumeratedValue = function (key, value) {
  39648. return isFalsyAttrValue(value) || value === 'false'
  39649. ? 'false'
  39650. // allow arbitrary string value for contenteditable
  39651. : key === 'contenteditable' && isValidContentEditableValue(value)
  39652. ? value
  39653. : 'true'
  39654. };
  39655. var isBooleanAttr = makeMap(
  39656. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  39657. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  39658. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  39659. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  39660. 'required,reversed,scoped,seamless,selected,sortable,' +
  39661. 'truespeed,typemustmatch,visible'
  39662. );
  39663. var xlinkNS = 'http://www.w3.org/1999/xlink';
  39664. var isXlink = function (name) {
  39665. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  39666. };
  39667. var getXlinkProp = function (name) {
  39668. return isXlink(name) ? name.slice(6, name.length) : ''
  39669. };
  39670. var isFalsyAttrValue = function (val) {
  39671. return val == null || val === false
  39672. };
  39673. /* */
  39674. function genClassForVnode (vnode) {
  39675. var data = vnode.data;
  39676. var parentNode = vnode;
  39677. var childNode = vnode;
  39678. while (isDef(childNode.componentInstance)) {
  39679. childNode = childNode.componentInstance._vnode;
  39680. if (childNode && childNode.data) {
  39681. data = mergeClassData(childNode.data, data);
  39682. }
  39683. }
  39684. while (isDef(parentNode = parentNode.parent)) {
  39685. if (parentNode && parentNode.data) {
  39686. data = mergeClassData(data, parentNode.data);
  39687. }
  39688. }
  39689. return renderClass(data.staticClass, data.class)
  39690. }
  39691. function mergeClassData (child, parent) {
  39692. return {
  39693. staticClass: concat(child.staticClass, parent.staticClass),
  39694. class: isDef(child.class)
  39695. ? [child.class, parent.class]
  39696. : parent.class
  39697. }
  39698. }
  39699. function renderClass (
  39700. staticClass,
  39701. dynamicClass
  39702. ) {
  39703. if (isDef(staticClass) || isDef(dynamicClass)) {
  39704. return concat(staticClass, stringifyClass(dynamicClass))
  39705. }
  39706. /* istanbul ignore next */
  39707. return ''
  39708. }
  39709. function concat (a, b) {
  39710. return a ? b ? (a + ' ' + b) : a : (b || '')
  39711. }
  39712. function stringifyClass (value) {
  39713. if (Array.isArray(value)) {
  39714. return stringifyArray(value)
  39715. }
  39716. if (isObject(value)) {
  39717. return stringifyObject(value)
  39718. }
  39719. if (typeof value === 'string') {
  39720. return value
  39721. }
  39722. /* istanbul ignore next */
  39723. return ''
  39724. }
  39725. function stringifyArray (value) {
  39726. var res = '';
  39727. var stringified;
  39728. for (var i = 0, l = value.length; i < l; i++) {
  39729. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  39730. if (res) { res += ' '; }
  39731. res += stringified;
  39732. }
  39733. }
  39734. return res
  39735. }
  39736. function stringifyObject (value) {
  39737. var res = '';
  39738. for (var key in value) {
  39739. if (value[key]) {
  39740. if (res) { res += ' '; }
  39741. res += key;
  39742. }
  39743. }
  39744. return res
  39745. }
  39746. /* */
  39747. var namespaceMap = {
  39748. svg: 'http://www.w3.org/2000/svg',
  39749. math: 'http://www.w3.org/1998/Math/MathML'
  39750. };
  39751. var isHTMLTag = makeMap(
  39752. 'html,body,base,head,link,meta,style,title,' +
  39753. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  39754. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  39755. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  39756. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  39757. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  39758. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  39759. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  39760. 'output,progress,select,textarea,' +
  39761. 'details,dialog,menu,menuitem,summary,' +
  39762. 'content,element,shadow,template,blockquote,iframe,tfoot'
  39763. );
  39764. // this map is intentionally selective, only covering SVG elements that may
  39765. // contain child elements.
  39766. var isSVG = makeMap(
  39767. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  39768. 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  39769. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  39770. true
  39771. );
  39772. var isPreTag = function (tag) { return tag === 'pre'; };
  39773. var isReservedTag = function (tag) {
  39774. return isHTMLTag(tag) || isSVG(tag)
  39775. };
  39776. function getTagNamespace (tag) {
  39777. if (isSVG(tag)) {
  39778. return 'svg'
  39779. }
  39780. // basic support for MathML
  39781. // note it doesn't support other MathML elements being component roots
  39782. if (tag === 'math') {
  39783. return 'math'
  39784. }
  39785. }
  39786. var unknownElementCache = Object.create(null);
  39787. function isUnknownElement (tag) {
  39788. /* istanbul ignore if */
  39789. if (!inBrowser) {
  39790. return true
  39791. }
  39792. if (isReservedTag(tag)) {
  39793. return false
  39794. }
  39795. tag = tag.toLowerCase();
  39796. /* istanbul ignore if */
  39797. if (unknownElementCache[tag] != null) {
  39798. return unknownElementCache[tag]
  39799. }
  39800. var el = document.createElement(tag);
  39801. if (tag.indexOf('-') > -1) {
  39802. // http://stackoverflow.com/a/28210364/1070244
  39803. return (unknownElementCache[tag] = (
  39804. el.constructor === window.HTMLUnknownElement ||
  39805. el.constructor === window.HTMLElement
  39806. ))
  39807. } else {
  39808. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  39809. }
  39810. }
  39811. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  39812. /* */
  39813. /**
  39814. * Query an element selector if it's not an element already.
  39815. */
  39816. function query (el) {
  39817. if (typeof el === 'string') {
  39818. var selected = document.querySelector(el);
  39819. if (!selected) {
  39820. warn(
  39821. 'Cannot find element: ' + el
  39822. );
  39823. return document.createElement('div')
  39824. }
  39825. return selected
  39826. } else {
  39827. return el
  39828. }
  39829. }
  39830. /* */
  39831. function createElement$1 (tagName, vnode) {
  39832. var elm = document.createElement(tagName);
  39833. if (tagName !== 'select') {
  39834. return elm
  39835. }
  39836. // false or null will remove the attribute but undefined will not
  39837. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  39838. elm.setAttribute('multiple', 'multiple');
  39839. }
  39840. return elm
  39841. }
  39842. function createElementNS (namespace, tagName) {
  39843. return document.createElementNS(namespaceMap[namespace], tagName)
  39844. }
  39845. function createTextNode (text) {
  39846. return document.createTextNode(text)
  39847. }
  39848. function createComment (text) {
  39849. return document.createComment(text)
  39850. }
  39851. function insertBefore (parentNode, newNode, referenceNode) {
  39852. parentNode.insertBefore(newNode, referenceNode);
  39853. }
  39854. function removeChild (node, child) {
  39855. node.removeChild(child);
  39856. }
  39857. function appendChild (node, child) {
  39858. node.appendChild(child);
  39859. }
  39860. function parentNode (node) {
  39861. return node.parentNode
  39862. }
  39863. function nextSibling (node) {
  39864. return node.nextSibling
  39865. }
  39866. function tagName (node) {
  39867. return node.tagName
  39868. }
  39869. function setTextContent (node, text) {
  39870. node.textContent = text;
  39871. }
  39872. function setStyleScope (node, scopeId) {
  39873. node.setAttribute(scopeId, '');
  39874. }
  39875. var nodeOps = /*#__PURE__*/Object.freeze({
  39876. createElement: createElement$1,
  39877. createElementNS: createElementNS,
  39878. createTextNode: createTextNode,
  39879. createComment: createComment,
  39880. insertBefore: insertBefore,
  39881. removeChild: removeChild,
  39882. appendChild: appendChild,
  39883. parentNode: parentNode,
  39884. nextSibling: nextSibling,
  39885. tagName: tagName,
  39886. setTextContent: setTextContent,
  39887. setStyleScope: setStyleScope
  39888. });
  39889. /* */
  39890. var ref = {
  39891. create: function create (_, vnode) {
  39892. registerRef(vnode);
  39893. },
  39894. update: function update (oldVnode, vnode) {
  39895. if (oldVnode.data.ref !== vnode.data.ref) {
  39896. registerRef(oldVnode, true);
  39897. registerRef(vnode);
  39898. }
  39899. },
  39900. destroy: function destroy (vnode) {
  39901. registerRef(vnode, true);
  39902. }
  39903. };
  39904. function registerRef (vnode, isRemoval) {
  39905. var key = vnode.data.ref;
  39906. if (!isDef(key)) { return }
  39907. var vm = vnode.context;
  39908. var ref = vnode.componentInstance || vnode.elm;
  39909. var refs = vm.$refs;
  39910. if (isRemoval) {
  39911. if (Array.isArray(refs[key])) {
  39912. remove(refs[key], ref);
  39913. } else if (refs[key] === ref) {
  39914. refs[key] = undefined;
  39915. }
  39916. } else {
  39917. if (vnode.data.refInFor) {
  39918. if (!Array.isArray(refs[key])) {
  39919. refs[key] = [ref];
  39920. } else if (refs[key].indexOf(ref) < 0) {
  39921. // $flow-disable-line
  39922. refs[key].push(ref);
  39923. }
  39924. } else {
  39925. refs[key] = ref;
  39926. }
  39927. }
  39928. }
  39929. /**
  39930. * Virtual DOM patching algorithm based on Snabbdom by
  39931. * Simon Friis Vindum (@paldepind)
  39932. * Licensed under the MIT License
  39933. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  39934. *
  39935. * modified by Evan You (@yyx990803)
  39936. *
  39937. * Not type-checking this because this file is perf-critical and the cost
  39938. * of making flow understand it is not worth it.
  39939. */
  39940. var emptyNode = new VNode('', {}, []);
  39941. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  39942. function sameVnode (a, b) {
  39943. return (
  39944. a.key === b.key &&
  39945. a.asyncFactory === b.asyncFactory && (
  39946. (
  39947. a.tag === b.tag &&
  39948. a.isComment === b.isComment &&
  39949. isDef(a.data) === isDef(b.data) &&
  39950. sameInputType(a, b)
  39951. ) || (
  39952. isTrue(a.isAsyncPlaceholder) &&
  39953. isUndef(b.asyncFactory.error)
  39954. )
  39955. )
  39956. )
  39957. }
  39958. function sameInputType (a, b) {
  39959. if (a.tag !== 'input') { return true }
  39960. var i;
  39961. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  39962. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  39963. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  39964. }
  39965. function createKeyToOldIdx (children, beginIdx, endIdx) {
  39966. var i, key;
  39967. var map = {};
  39968. for (i = beginIdx; i <= endIdx; ++i) {
  39969. key = children[i].key;
  39970. if (isDef(key)) { map[key] = i; }
  39971. }
  39972. return map
  39973. }
  39974. function createPatchFunction (backend) {
  39975. var i, j;
  39976. var cbs = {};
  39977. var modules = backend.modules;
  39978. var nodeOps = backend.nodeOps;
  39979. for (i = 0; i < hooks.length; ++i) {
  39980. cbs[hooks[i]] = [];
  39981. for (j = 0; j < modules.length; ++j) {
  39982. if (isDef(modules[j][hooks[i]])) {
  39983. cbs[hooks[i]].push(modules[j][hooks[i]]);
  39984. }
  39985. }
  39986. }
  39987. function emptyNodeAt (elm) {
  39988. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  39989. }
  39990. function createRmCb (childElm, listeners) {
  39991. function remove$$1 () {
  39992. if (--remove$$1.listeners === 0) {
  39993. removeNode(childElm);
  39994. }
  39995. }
  39996. remove$$1.listeners = listeners;
  39997. return remove$$1
  39998. }
  39999. function removeNode (el) {
  40000. var parent = nodeOps.parentNode(el);
  40001. // element may have already been removed due to v-html / v-text
  40002. if (isDef(parent)) {
  40003. nodeOps.removeChild(parent, el);
  40004. }
  40005. }
  40006. function isUnknownElement$$1 (vnode, inVPre) {
  40007. return (
  40008. !inVPre &&
  40009. !vnode.ns &&
  40010. !(
  40011. config.ignoredElements.length &&
  40012. config.ignoredElements.some(function (ignore) {
  40013. return isRegExp(ignore)
  40014. ? ignore.test(vnode.tag)
  40015. : ignore === vnode.tag
  40016. })
  40017. ) &&
  40018. config.isUnknownElement(vnode.tag)
  40019. )
  40020. }
  40021. var creatingElmInVPre = 0;
  40022. function createElm (
  40023. vnode,
  40024. insertedVnodeQueue,
  40025. parentElm,
  40026. refElm,
  40027. nested,
  40028. ownerArray,
  40029. index
  40030. ) {
  40031. if (isDef(vnode.elm) && isDef(ownerArray)) {
  40032. // This vnode was used in a previous render!
  40033. // now it's used as a new node, overwriting its elm would cause
  40034. // potential patch errors down the road when it's used as an insertion
  40035. // reference node. Instead, we clone the node on-demand before creating
  40036. // associated DOM element for it.
  40037. vnode = ownerArray[index] = cloneVNode(vnode);
  40038. }
  40039. vnode.isRootInsert = !nested; // for transition enter check
  40040. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  40041. return
  40042. }
  40043. var data = vnode.data;
  40044. var children = vnode.children;
  40045. var tag = vnode.tag;
  40046. if (isDef(tag)) {
  40047. {
  40048. if (data && data.pre) {
  40049. creatingElmInVPre++;
  40050. }
  40051. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  40052. warn(
  40053. 'Unknown custom element: <' + tag + '> - did you ' +
  40054. 'register the component correctly? For recursive components, ' +
  40055. 'make sure to provide the "name" option.',
  40056. vnode.context
  40057. );
  40058. }
  40059. }
  40060. vnode.elm = vnode.ns
  40061. ? nodeOps.createElementNS(vnode.ns, tag)
  40062. : nodeOps.createElement(tag, vnode);
  40063. setScope(vnode);
  40064. /* istanbul ignore if */
  40065. {
  40066. createChildren(vnode, children, insertedVnodeQueue);
  40067. if (isDef(data)) {
  40068. invokeCreateHooks(vnode, insertedVnodeQueue);
  40069. }
  40070. insert(parentElm, vnode.elm, refElm);
  40071. }
  40072. if (data && data.pre) {
  40073. creatingElmInVPre--;
  40074. }
  40075. } else if (isTrue(vnode.isComment)) {
  40076. vnode.elm = nodeOps.createComment(vnode.text);
  40077. insert(parentElm, vnode.elm, refElm);
  40078. } else {
  40079. vnode.elm = nodeOps.createTextNode(vnode.text);
  40080. insert(parentElm, vnode.elm, refElm);
  40081. }
  40082. }
  40083. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  40084. var i = vnode.data;
  40085. if (isDef(i)) {
  40086. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  40087. if (isDef(i = i.hook) && isDef(i = i.init)) {
  40088. i(vnode, false /* hydrating */);
  40089. }
  40090. // after calling the init hook, if the vnode is a child component
  40091. // it should've created a child instance and mounted it. the child
  40092. // component also has set the placeholder vnode's elm.
  40093. // in that case we can just return the element and be done.
  40094. if (isDef(vnode.componentInstance)) {
  40095. initComponent(vnode, insertedVnodeQueue);
  40096. insert(parentElm, vnode.elm, refElm);
  40097. if (isTrue(isReactivated)) {
  40098. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  40099. }
  40100. return true
  40101. }
  40102. }
  40103. }
  40104. function initComponent (vnode, insertedVnodeQueue) {
  40105. if (isDef(vnode.data.pendingInsert)) {
  40106. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  40107. vnode.data.pendingInsert = null;
  40108. }
  40109. vnode.elm = vnode.componentInstance.$el;
  40110. if (isPatchable(vnode)) {
  40111. invokeCreateHooks(vnode, insertedVnodeQueue);
  40112. setScope(vnode);
  40113. } else {
  40114. // empty component root.
  40115. // skip all element-related modules except for ref (#3455)
  40116. registerRef(vnode);
  40117. // make sure to invoke the insert hook
  40118. insertedVnodeQueue.push(vnode);
  40119. }
  40120. }
  40121. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  40122. var i;
  40123. // hack for #4339: a reactivated component with inner transition
  40124. // does not trigger because the inner node's created hooks are not called
  40125. // again. It's not ideal to involve module-specific logic in here but
  40126. // there doesn't seem to be a better way to do it.
  40127. var innerNode = vnode;
  40128. while (innerNode.componentInstance) {
  40129. innerNode = innerNode.componentInstance._vnode;
  40130. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  40131. for (i = 0; i < cbs.activate.length; ++i) {
  40132. cbs.activate[i](emptyNode, innerNode);
  40133. }
  40134. insertedVnodeQueue.push(innerNode);
  40135. break
  40136. }
  40137. }
  40138. // unlike a newly created component,
  40139. // a reactivated keep-alive component doesn't insert itself
  40140. insert(parentElm, vnode.elm, refElm);
  40141. }
  40142. function insert (parent, elm, ref$$1) {
  40143. if (isDef(parent)) {
  40144. if (isDef(ref$$1)) {
  40145. if (nodeOps.parentNode(ref$$1) === parent) {
  40146. nodeOps.insertBefore(parent, elm, ref$$1);
  40147. }
  40148. } else {
  40149. nodeOps.appendChild(parent, elm);
  40150. }
  40151. }
  40152. }
  40153. function createChildren (vnode, children, insertedVnodeQueue) {
  40154. if (Array.isArray(children)) {
  40155. {
  40156. checkDuplicateKeys(children);
  40157. }
  40158. for (var i = 0; i < children.length; ++i) {
  40159. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  40160. }
  40161. } else if (isPrimitive(vnode.text)) {
  40162. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  40163. }
  40164. }
  40165. function isPatchable (vnode) {
  40166. while (vnode.componentInstance) {
  40167. vnode = vnode.componentInstance._vnode;
  40168. }
  40169. return isDef(vnode.tag)
  40170. }
  40171. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  40172. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  40173. cbs.create[i$1](emptyNode, vnode);
  40174. }
  40175. i = vnode.data.hook; // Reuse variable
  40176. if (isDef(i)) {
  40177. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  40178. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  40179. }
  40180. }
  40181. // set scope id attribute for scoped CSS.
  40182. // this is implemented as a special case to avoid the overhead
  40183. // of going through the normal attribute patching process.
  40184. function setScope (vnode) {
  40185. var i;
  40186. if (isDef(i = vnode.fnScopeId)) {
  40187. nodeOps.setStyleScope(vnode.elm, i);
  40188. } else {
  40189. var ancestor = vnode;
  40190. while (ancestor) {
  40191. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  40192. nodeOps.setStyleScope(vnode.elm, i);
  40193. }
  40194. ancestor = ancestor.parent;
  40195. }
  40196. }
  40197. // for slot content they should also get the scopeId from the host instance.
  40198. if (isDef(i = activeInstance) &&
  40199. i !== vnode.context &&
  40200. i !== vnode.fnContext &&
  40201. isDef(i = i.$options._scopeId)
  40202. ) {
  40203. nodeOps.setStyleScope(vnode.elm, i);
  40204. }
  40205. }
  40206. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  40207. for (; startIdx <= endIdx; ++startIdx) {
  40208. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  40209. }
  40210. }
  40211. function invokeDestroyHook (vnode) {
  40212. var i, j;
  40213. var data = vnode.data;
  40214. if (isDef(data)) {
  40215. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  40216. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  40217. }
  40218. if (isDef(i = vnode.children)) {
  40219. for (j = 0; j < vnode.children.length; ++j) {
  40220. invokeDestroyHook(vnode.children[j]);
  40221. }
  40222. }
  40223. }
  40224. function removeVnodes (vnodes, startIdx, endIdx) {
  40225. for (; startIdx <= endIdx; ++startIdx) {
  40226. var ch = vnodes[startIdx];
  40227. if (isDef(ch)) {
  40228. if (isDef(ch.tag)) {
  40229. removeAndInvokeRemoveHook(ch);
  40230. invokeDestroyHook(ch);
  40231. } else { // Text node
  40232. removeNode(ch.elm);
  40233. }
  40234. }
  40235. }
  40236. }
  40237. function removeAndInvokeRemoveHook (vnode, rm) {
  40238. if (isDef(rm) || isDef(vnode.data)) {
  40239. var i;
  40240. var listeners = cbs.remove.length + 1;
  40241. if (isDef(rm)) {
  40242. // we have a recursively passed down rm callback
  40243. // increase the listeners count
  40244. rm.listeners += listeners;
  40245. } else {
  40246. // directly removing
  40247. rm = createRmCb(vnode.elm, listeners);
  40248. }
  40249. // recursively invoke hooks on child component root node
  40250. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  40251. removeAndInvokeRemoveHook(i, rm);
  40252. }
  40253. for (i = 0; i < cbs.remove.length; ++i) {
  40254. cbs.remove[i](vnode, rm);
  40255. }
  40256. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  40257. i(vnode, rm);
  40258. } else {
  40259. rm();
  40260. }
  40261. } else {
  40262. removeNode(vnode.elm);
  40263. }
  40264. }
  40265. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  40266. var oldStartIdx = 0;
  40267. var newStartIdx = 0;
  40268. var oldEndIdx = oldCh.length - 1;
  40269. var oldStartVnode = oldCh[0];
  40270. var oldEndVnode = oldCh[oldEndIdx];
  40271. var newEndIdx = newCh.length - 1;
  40272. var newStartVnode = newCh[0];
  40273. var newEndVnode = newCh[newEndIdx];
  40274. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  40275. // removeOnly is a special flag used only by <transition-group>
  40276. // to ensure removed elements stay in correct relative positions
  40277. // during leaving transitions
  40278. var canMove = !removeOnly;
  40279. {
  40280. checkDuplicateKeys(newCh);
  40281. }
  40282. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  40283. if (isUndef(oldStartVnode)) {
  40284. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  40285. } else if (isUndef(oldEndVnode)) {
  40286. oldEndVnode = oldCh[--oldEndIdx];
  40287. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  40288. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  40289. oldStartVnode = oldCh[++oldStartIdx];
  40290. newStartVnode = newCh[++newStartIdx];
  40291. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  40292. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  40293. oldEndVnode = oldCh[--oldEndIdx];
  40294. newEndVnode = newCh[--newEndIdx];
  40295. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  40296. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  40297. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  40298. oldStartVnode = oldCh[++oldStartIdx];
  40299. newEndVnode = newCh[--newEndIdx];
  40300. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  40301. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  40302. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  40303. oldEndVnode = oldCh[--oldEndIdx];
  40304. newStartVnode = newCh[++newStartIdx];
  40305. } else {
  40306. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  40307. idxInOld = isDef(newStartVnode.key)
  40308. ? oldKeyToIdx[newStartVnode.key]
  40309. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  40310. if (isUndef(idxInOld)) { // New element
  40311. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  40312. } else {
  40313. vnodeToMove = oldCh[idxInOld];
  40314. if (sameVnode(vnodeToMove, newStartVnode)) {
  40315. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  40316. oldCh[idxInOld] = undefined;
  40317. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  40318. } else {
  40319. // same key but different element. treat as new element
  40320. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  40321. }
  40322. }
  40323. newStartVnode = newCh[++newStartIdx];
  40324. }
  40325. }
  40326. if (oldStartIdx > oldEndIdx) {
  40327. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  40328. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  40329. } else if (newStartIdx > newEndIdx) {
  40330. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  40331. }
  40332. }
  40333. function checkDuplicateKeys (children) {
  40334. var seenKeys = {};
  40335. for (var i = 0; i < children.length; i++) {
  40336. var vnode = children[i];
  40337. var key = vnode.key;
  40338. if (isDef(key)) {
  40339. if (seenKeys[key]) {
  40340. warn(
  40341. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  40342. vnode.context
  40343. );
  40344. } else {
  40345. seenKeys[key] = true;
  40346. }
  40347. }
  40348. }
  40349. }
  40350. function findIdxInOld (node, oldCh, start, end) {
  40351. for (var i = start; i < end; i++) {
  40352. var c = oldCh[i];
  40353. if (isDef(c) && sameVnode(node, c)) { return i }
  40354. }
  40355. }
  40356. function patchVnode (
  40357. oldVnode,
  40358. vnode,
  40359. insertedVnodeQueue,
  40360. ownerArray,
  40361. index,
  40362. removeOnly
  40363. ) {
  40364. if (oldVnode === vnode) {
  40365. return
  40366. }
  40367. if (isDef(vnode.elm) && isDef(ownerArray)) {
  40368. // clone reused vnode
  40369. vnode = ownerArray[index] = cloneVNode(vnode);
  40370. }
  40371. var elm = vnode.elm = oldVnode.elm;
  40372. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  40373. if (isDef(vnode.asyncFactory.resolved)) {
  40374. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  40375. } else {
  40376. vnode.isAsyncPlaceholder = true;
  40377. }
  40378. return
  40379. }
  40380. // reuse element for static trees.
  40381. // note we only do this if the vnode is cloned -
  40382. // if the new node is not cloned it means the render functions have been
  40383. // reset by the hot-reload-api and we need to do a proper re-render.
  40384. if (isTrue(vnode.isStatic) &&
  40385. isTrue(oldVnode.isStatic) &&
  40386. vnode.key === oldVnode.key &&
  40387. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  40388. ) {
  40389. vnode.componentInstance = oldVnode.componentInstance;
  40390. return
  40391. }
  40392. var i;
  40393. var data = vnode.data;
  40394. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  40395. i(oldVnode, vnode);
  40396. }
  40397. var oldCh = oldVnode.children;
  40398. var ch = vnode.children;
  40399. if (isDef(data) && isPatchable(vnode)) {
  40400. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  40401. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  40402. }
  40403. if (isUndef(vnode.text)) {
  40404. if (isDef(oldCh) && isDef(ch)) {
  40405. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  40406. } else if (isDef(ch)) {
  40407. {
  40408. checkDuplicateKeys(ch);
  40409. }
  40410. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  40411. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  40412. } else if (isDef(oldCh)) {
  40413. removeVnodes(oldCh, 0, oldCh.length - 1);
  40414. } else if (isDef(oldVnode.text)) {
  40415. nodeOps.setTextContent(elm, '');
  40416. }
  40417. } else if (oldVnode.text !== vnode.text) {
  40418. nodeOps.setTextContent(elm, vnode.text);
  40419. }
  40420. if (isDef(data)) {
  40421. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  40422. }
  40423. }
  40424. function invokeInsertHook (vnode, queue, initial) {
  40425. // delay insert hooks for component root nodes, invoke them after the
  40426. // element is really inserted
  40427. if (isTrue(initial) && isDef(vnode.parent)) {
  40428. vnode.parent.data.pendingInsert = queue;
  40429. } else {
  40430. for (var i = 0; i < queue.length; ++i) {
  40431. queue[i].data.hook.insert(queue[i]);
  40432. }
  40433. }
  40434. }
  40435. var hydrationBailed = false;
  40436. // list of modules that can skip create hook during hydration because they
  40437. // are already rendered on the client or has no need for initialization
  40438. // Note: style is excluded because it relies on initial clone for future
  40439. // deep updates (#7063).
  40440. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  40441. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  40442. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  40443. var i;
  40444. var tag = vnode.tag;
  40445. var data = vnode.data;
  40446. var children = vnode.children;
  40447. inVPre = inVPre || (data && data.pre);
  40448. vnode.elm = elm;
  40449. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  40450. vnode.isAsyncPlaceholder = true;
  40451. return true
  40452. }
  40453. // assert node match
  40454. {
  40455. if (!assertNodeMatch(elm, vnode, inVPre)) {
  40456. return false
  40457. }
  40458. }
  40459. if (isDef(data)) {
  40460. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  40461. if (isDef(i = vnode.componentInstance)) {
  40462. // child component. it should have hydrated its own tree.
  40463. initComponent(vnode, insertedVnodeQueue);
  40464. return true
  40465. }
  40466. }
  40467. if (isDef(tag)) {
  40468. if (isDef(children)) {
  40469. // empty element, allow client to pick up and populate children
  40470. if (!elm.hasChildNodes()) {
  40471. createChildren(vnode, children, insertedVnodeQueue);
  40472. } else {
  40473. // v-html and domProps: innerHTML
  40474. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  40475. if (i !== elm.innerHTML) {
  40476. /* istanbul ignore if */
  40477. if (typeof console !== 'undefined' &&
  40478. !hydrationBailed
  40479. ) {
  40480. hydrationBailed = true;
  40481. console.warn('Parent: ', elm);
  40482. console.warn('server innerHTML: ', i);
  40483. console.warn('client innerHTML: ', elm.innerHTML);
  40484. }
  40485. return false
  40486. }
  40487. } else {
  40488. // iterate and compare children lists
  40489. var childrenMatch = true;
  40490. var childNode = elm.firstChild;
  40491. for (var i$1 = 0; i$1 < children.length; i$1++) {
  40492. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  40493. childrenMatch = false;
  40494. break
  40495. }
  40496. childNode = childNode.nextSibling;
  40497. }
  40498. // if childNode is not null, it means the actual childNodes list is
  40499. // longer than the virtual children list.
  40500. if (!childrenMatch || childNode) {
  40501. /* istanbul ignore if */
  40502. if (typeof console !== 'undefined' &&
  40503. !hydrationBailed
  40504. ) {
  40505. hydrationBailed = true;
  40506. console.warn('Parent: ', elm);
  40507. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  40508. }
  40509. return false
  40510. }
  40511. }
  40512. }
  40513. }
  40514. if (isDef(data)) {
  40515. var fullInvoke = false;
  40516. for (var key in data) {
  40517. if (!isRenderedModule(key)) {
  40518. fullInvoke = true;
  40519. invokeCreateHooks(vnode, insertedVnodeQueue);
  40520. break
  40521. }
  40522. }
  40523. if (!fullInvoke && data['class']) {
  40524. // ensure collecting deps for deep class bindings for future updates
  40525. traverse(data['class']);
  40526. }
  40527. }
  40528. } else if (elm.data !== vnode.text) {
  40529. elm.data = vnode.text;
  40530. }
  40531. return true
  40532. }
  40533. function assertNodeMatch (node, vnode, inVPre) {
  40534. if (isDef(vnode.tag)) {
  40535. return vnode.tag.indexOf('vue-component') === 0 || (
  40536. !isUnknownElement$$1(vnode, inVPre) &&
  40537. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  40538. )
  40539. } else {
  40540. return node.nodeType === (vnode.isComment ? 8 : 3)
  40541. }
  40542. }
  40543. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  40544. if (isUndef(vnode)) {
  40545. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  40546. return
  40547. }
  40548. var isInitialPatch = false;
  40549. var insertedVnodeQueue = [];
  40550. if (isUndef(oldVnode)) {
  40551. // empty mount (likely as component), create new root element
  40552. isInitialPatch = true;
  40553. createElm(vnode, insertedVnodeQueue);
  40554. } else {
  40555. var isRealElement = isDef(oldVnode.nodeType);
  40556. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  40557. // patch existing root node
  40558. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  40559. } else {
  40560. if (isRealElement) {
  40561. // mounting to a real element
  40562. // check if this is server-rendered content and if we can perform
  40563. // a successful hydration.
  40564. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  40565. oldVnode.removeAttribute(SSR_ATTR);
  40566. hydrating = true;
  40567. }
  40568. if (isTrue(hydrating)) {
  40569. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  40570. invokeInsertHook(vnode, insertedVnodeQueue, true);
  40571. return oldVnode
  40572. } else {
  40573. warn(
  40574. 'The client-side rendered virtual DOM tree is not matching ' +
  40575. 'server-rendered content. This is likely caused by incorrect ' +
  40576. 'HTML markup, for example nesting block-level elements inside ' +
  40577. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  40578. 'full client-side render.'
  40579. );
  40580. }
  40581. }
  40582. // either not server-rendered, or hydration failed.
  40583. // create an empty node and replace it
  40584. oldVnode = emptyNodeAt(oldVnode);
  40585. }
  40586. // replacing existing element
  40587. var oldElm = oldVnode.elm;
  40588. var parentElm = nodeOps.parentNode(oldElm);
  40589. // create new node
  40590. createElm(
  40591. vnode,
  40592. insertedVnodeQueue,
  40593. // extremely rare edge case: do not insert if old element is in a
  40594. // leaving transition. Only happens when combining transition +
  40595. // keep-alive + HOCs. (#4590)
  40596. oldElm._leaveCb ? null : parentElm,
  40597. nodeOps.nextSibling(oldElm)
  40598. );
  40599. // update parent placeholder node element, recursively
  40600. if (isDef(vnode.parent)) {
  40601. var ancestor = vnode.parent;
  40602. var patchable = isPatchable(vnode);
  40603. while (ancestor) {
  40604. for (var i = 0; i < cbs.destroy.length; ++i) {
  40605. cbs.destroy[i](ancestor);
  40606. }
  40607. ancestor.elm = vnode.elm;
  40608. if (patchable) {
  40609. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  40610. cbs.create[i$1](emptyNode, ancestor);
  40611. }
  40612. // #6513
  40613. // invoke insert hooks that may have been merged by create hooks.
  40614. // e.g. for directives that uses the "inserted" hook.
  40615. var insert = ancestor.data.hook.insert;
  40616. if (insert.merged) {
  40617. // start at index 1 to avoid re-invoking component mounted hook
  40618. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  40619. insert.fns[i$2]();
  40620. }
  40621. }
  40622. } else {
  40623. registerRef(ancestor);
  40624. }
  40625. ancestor = ancestor.parent;
  40626. }
  40627. }
  40628. // destroy old node
  40629. if (isDef(parentElm)) {
  40630. removeVnodes([oldVnode], 0, 0);
  40631. } else if (isDef(oldVnode.tag)) {
  40632. invokeDestroyHook(oldVnode);
  40633. }
  40634. }
  40635. }
  40636. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  40637. return vnode.elm
  40638. }
  40639. }
  40640. /* */
  40641. var directives = {
  40642. create: updateDirectives,
  40643. update: updateDirectives,
  40644. destroy: function unbindDirectives (vnode) {
  40645. updateDirectives(vnode, emptyNode);
  40646. }
  40647. };
  40648. function updateDirectives (oldVnode, vnode) {
  40649. if (oldVnode.data.directives || vnode.data.directives) {
  40650. _update(oldVnode, vnode);
  40651. }
  40652. }
  40653. function _update (oldVnode, vnode) {
  40654. var isCreate = oldVnode === emptyNode;
  40655. var isDestroy = vnode === emptyNode;
  40656. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  40657. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  40658. var dirsWithInsert = [];
  40659. var dirsWithPostpatch = [];
  40660. var key, oldDir, dir;
  40661. for (key in newDirs) {
  40662. oldDir = oldDirs[key];
  40663. dir = newDirs[key];
  40664. if (!oldDir) {
  40665. // new directive, bind
  40666. callHook$1(dir, 'bind', vnode, oldVnode);
  40667. if (dir.def && dir.def.inserted) {
  40668. dirsWithInsert.push(dir);
  40669. }
  40670. } else {
  40671. // existing directive, update
  40672. dir.oldValue = oldDir.value;
  40673. dir.oldArg = oldDir.arg;
  40674. callHook$1(dir, 'update', vnode, oldVnode);
  40675. if (dir.def && dir.def.componentUpdated) {
  40676. dirsWithPostpatch.push(dir);
  40677. }
  40678. }
  40679. }
  40680. if (dirsWithInsert.length) {
  40681. var callInsert = function () {
  40682. for (var i = 0; i < dirsWithInsert.length; i++) {
  40683. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  40684. }
  40685. };
  40686. if (isCreate) {
  40687. mergeVNodeHook(vnode, 'insert', callInsert);
  40688. } else {
  40689. callInsert();
  40690. }
  40691. }
  40692. if (dirsWithPostpatch.length) {
  40693. mergeVNodeHook(vnode, 'postpatch', function () {
  40694. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  40695. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  40696. }
  40697. });
  40698. }
  40699. if (!isCreate) {
  40700. for (key in oldDirs) {
  40701. if (!newDirs[key]) {
  40702. // no longer present, unbind
  40703. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  40704. }
  40705. }
  40706. }
  40707. }
  40708. var emptyModifiers = Object.create(null);
  40709. function normalizeDirectives$1 (
  40710. dirs,
  40711. vm
  40712. ) {
  40713. var res = Object.create(null);
  40714. if (!dirs) {
  40715. // $flow-disable-line
  40716. return res
  40717. }
  40718. var i, dir;
  40719. for (i = 0; i < dirs.length; i++) {
  40720. dir = dirs[i];
  40721. if (!dir.modifiers) {
  40722. // $flow-disable-line
  40723. dir.modifiers = emptyModifiers;
  40724. }
  40725. res[getRawDirName(dir)] = dir;
  40726. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  40727. }
  40728. // $flow-disable-line
  40729. return res
  40730. }
  40731. function getRawDirName (dir) {
  40732. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  40733. }
  40734. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  40735. var fn = dir.def && dir.def[hook];
  40736. if (fn) {
  40737. try {
  40738. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  40739. } catch (e) {
  40740. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  40741. }
  40742. }
  40743. }
  40744. var baseModules = [
  40745. ref,
  40746. directives
  40747. ];
  40748. /* */
  40749. function updateAttrs (oldVnode, vnode) {
  40750. var opts = vnode.componentOptions;
  40751. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  40752. return
  40753. }
  40754. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  40755. return
  40756. }
  40757. var key, cur, old;
  40758. var elm = vnode.elm;
  40759. var oldAttrs = oldVnode.data.attrs || {};
  40760. var attrs = vnode.data.attrs || {};
  40761. // clone observed objects, as the user probably wants to mutate it
  40762. if (isDef(attrs.__ob__)) {
  40763. attrs = vnode.data.attrs = extend({}, attrs);
  40764. }
  40765. for (key in attrs) {
  40766. cur = attrs[key];
  40767. old = oldAttrs[key];
  40768. if (old !== cur) {
  40769. setAttr(elm, key, cur, vnode.data.pre);
  40770. }
  40771. }
  40772. // #4391: in IE9, setting type can reset value for input[type=radio]
  40773. // #6666: IE/Edge forces progress value down to 1 before setting a max
  40774. /* istanbul ignore if */
  40775. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  40776. setAttr(elm, 'value', attrs.value);
  40777. }
  40778. for (key in oldAttrs) {
  40779. if (isUndef(attrs[key])) {
  40780. if (isXlink(key)) {
  40781. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  40782. } else if (!isEnumeratedAttr(key)) {
  40783. elm.removeAttribute(key);
  40784. }
  40785. }
  40786. }
  40787. }
  40788. function setAttr (el, key, value, isInPre) {
  40789. if (isInPre || el.tagName.indexOf('-') > -1) {
  40790. baseSetAttr(el, key, value);
  40791. } else if (isBooleanAttr(key)) {
  40792. // set attribute for blank value
  40793. // e.g. <option disabled>Select one</option>
  40794. if (isFalsyAttrValue(value)) {
  40795. el.removeAttribute(key);
  40796. } else {
  40797. // technically allowfullscreen is a boolean attribute for <iframe>,
  40798. // but Flash expects a value of "true" when used on <embed> tag
  40799. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  40800. ? 'true'
  40801. : key;
  40802. el.setAttribute(key, value);
  40803. }
  40804. } else if (isEnumeratedAttr(key)) {
  40805. el.setAttribute(key, convertEnumeratedValue(key, value));
  40806. } else if (isXlink(key)) {
  40807. if (isFalsyAttrValue(value)) {
  40808. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  40809. } else {
  40810. el.setAttributeNS(xlinkNS, key, value);
  40811. }
  40812. } else {
  40813. baseSetAttr(el, key, value);
  40814. }
  40815. }
  40816. function baseSetAttr (el, key, value) {
  40817. if (isFalsyAttrValue(value)) {
  40818. el.removeAttribute(key);
  40819. } else {
  40820. // #7138: IE10 & 11 fires input event when setting placeholder on
  40821. // <textarea>... block the first input event and remove the blocker
  40822. // immediately.
  40823. /* istanbul ignore if */
  40824. if (
  40825. isIE && !isIE9 &&
  40826. el.tagName === 'TEXTAREA' &&
  40827. key === 'placeholder' && value !== '' && !el.__ieph
  40828. ) {
  40829. var blocker = function (e) {
  40830. e.stopImmediatePropagation();
  40831. el.removeEventListener('input', blocker);
  40832. };
  40833. el.addEventListener('input', blocker);
  40834. // $flow-disable-line
  40835. el.__ieph = true; /* IE placeholder patched */
  40836. }
  40837. el.setAttribute(key, value);
  40838. }
  40839. }
  40840. var attrs = {
  40841. create: updateAttrs,
  40842. update: updateAttrs
  40843. };
  40844. /* */
  40845. function updateClass (oldVnode, vnode) {
  40846. var el = vnode.elm;
  40847. var data = vnode.data;
  40848. var oldData = oldVnode.data;
  40849. if (
  40850. isUndef(data.staticClass) &&
  40851. isUndef(data.class) && (
  40852. isUndef(oldData) || (
  40853. isUndef(oldData.staticClass) &&
  40854. isUndef(oldData.class)
  40855. )
  40856. )
  40857. ) {
  40858. return
  40859. }
  40860. var cls = genClassForVnode(vnode);
  40861. // handle transition classes
  40862. var transitionClass = el._transitionClasses;
  40863. if (isDef(transitionClass)) {
  40864. cls = concat(cls, stringifyClass(transitionClass));
  40865. }
  40866. // set the class
  40867. if (cls !== el._prevClass) {
  40868. el.setAttribute('class', cls);
  40869. el._prevClass = cls;
  40870. }
  40871. }
  40872. var klass = {
  40873. create: updateClass,
  40874. update: updateClass
  40875. };
  40876. /* */
  40877. var validDivisionCharRE = /[\w).+\-_$\]]/;
  40878. function parseFilters (exp) {
  40879. var inSingle = false;
  40880. var inDouble = false;
  40881. var inTemplateString = false;
  40882. var inRegex = false;
  40883. var curly = 0;
  40884. var square = 0;
  40885. var paren = 0;
  40886. var lastFilterIndex = 0;
  40887. var c, prev, i, expression, filters;
  40888. for (i = 0; i < exp.length; i++) {
  40889. prev = c;
  40890. c = exp.charCodeAt(i);
  40891. if (inSingle) {
  40892. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  40893. } else if (inDouble) {
  40894. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  40895. } else if (inTemplateString) {
  40896. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  40897. } else if (inRegex) {
  40898. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  40899. } else if (
  40900. c === 0x7C && // pipe
  40901. exp.charCodeAt(i + 1) !== 0x7C &&
  40902. exp.charCodeAt(i - 1) !== 0x7C &&
  40903. !curly && !square && !paren
  40904. ) {
  40905. if (expression === undefined) {
  40906. // first filter, end of expression
  40907. lastFilterIndex = i + 1;
  40908. expression = exp.slice(0, i).trim();
  40909. } else {
  40910. pushFilter();
  40911. }
  40912. } else {
  40913. switch (c) {
  40914. case 0x22: inDouble = true; break // "
  40915. case 0x27: inSingle = true; break // '
  40916. case 0x60: inTemplateString = true; break // `
  40917. case 0x28: paren++; break // (
  40918. case 0x29: paren--; break // )
  40919. case 0x5B: square++; break // [
  40920. case 0x5D: square--; break // ]
  40921. case 0x7B: curly++; break // {
  40922. case 0x7D: curly--; break // }
  40923. }
  40924. if (c === 0x2f) { // /
  40925. var j = i - 1;
  40926. var p = (void 0);
  40927. // find first non-whitespace prev char
  40928. for (; j >= 0; j--) {
  40929. p = exp.charAt(j);
  40930. if (p !== ' ') { break }
  40931. }
  40932. if (!p || !validDivisionCharRE.test(p)) {
  40933. inRegex = true;
  40934. }
  40935. }
  40936. }
  40937. }
  40938. if (expression === undefined) {
  40939. expression = exp.slice(0, i).trim();
  40940. } else if (lastFilterIndex !== 0) {
  40941. pushFilter();
  40942. }
  40943. function pushFilter () {
  40944. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  40945. lastFilterIndex = i + 1;
  40946. }
  40947. if (filters) {
  40948. for (i = 0; i < filters.length; i++) {
  40949. expression = wrapFilter(expression, filters[i]);
  40950. }
  40951. }
  40952. return expression
  40953. }
  40954. function wrapFilter (exp, filter) {
  40955. var i = filter.indexOf('(');
  40956. if (i < 0) {
  40957. // _f: resolveFilter
  40958. return ("_f(\"" + filter + "\")(" + exp + ")")
  40959. } else {
  40960. var name = filter.slice(0, i);
  40961. var args = filter.slice(i + 1);
  40962. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  40963. }
  40964. }
  40965. /* */
  40966. /* eslint-disable no-unused-vars */
  40967. function baseWarn (msg, range) {
  40968. console.error(("[Vue compiler]: " + msg));
  40969. }
  40970. /* eslint-enable no-unused-vars */
  40971. function pluckModuleFunction (
  40972. modules,
  40973. key
  40974. ) {
  40975. return modules
  40976. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  40977. : []
  40978. }
  40979. function addProp (el, name, value, range, dynamic) {
  40980. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  40981. el.plain = false;
  40982. }
  40983. function addAttr (el, name, value, range, dynamic) {
  40984. var attrs = dynamic
  40985. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  40986. : (el.attrs || (el.attrs = []));
  40987. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  40988. el.plain = false;
  40989. }
  40990. // add a raw attr (use this in preTransforms)
  40991. function addRawAttr (el, name, value, range) {
  40992. el.attrsMap[name] = value;
  40993. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  40994. }
  40995. function addDirective (
  40996. el,
  40997. name,
  40998. rawName,
  40999. value,
  41000. arg,
  41001. isDynamicArg,
  41002. modifiers,
  41003. range
  41004. ) {
  41005. (el.directives || (el.directives = [])).push(rangeSetItem({
  41006. name: name,
  41007. rawName: rawName,
  41008. value: value,
  41009. arg: arg,
  41010. isDynamicArg: isDynamicArg,
  41011. modifiers: modifiers
  41012. }, range));
  41013. el.plain = false;
  41014. }
  41015. function prependModifierMarker (symbol, name, dynamic) {
  41016. return dynamic
  41017. ? ("_p(" + name + ",\"" + symbol + "\")")
  41018. : symbol + name // mark the event as captured
  41019. }
  41020. function addHandler (
  41021. el,
  41022. name,
  41023. value,
  41024. modifiers,
  41025. important,
  41026. warn,
  41027. range,
  41028. dynamic
  41029. ) {
  41030. modifiers = modifiers || emptyObject;
  41031. // warn prevent and passive modifier
  41032. /* istanbul ignore if */
  41033. if (
  41034. warn &&
  41035. modifiers.prevent && modifiers.passive
  41036. ) {
  41037. warn(
  41038. 'passive and prevent can\'t be used together. ' +
  41039. 'Passive handler can\'t prevent default event.',
  41040. range
  41041. );
  41042. }
  41043. // normalize click.right and click.middle since they don't actually fire
  41044. // this is technically browser-specific, but at least for now browsers are
  41045. // the only target envs that have right/middle clicks.
  41046. if (modifiers.right) {
  41047. if (dynamic) {
  41048. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  41049. } else if (name === 'click') {
  41050. name = 'contextmenu';
  41051. delete modifiers.right;
  41052. }
  41053. } else if (modifiers.middle) {
  41054. if (dynamic) {
  41055. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  41056. } else if (name === 'click') {
  41057. name = 'mouseup';
  41058. }
  41059. }
  41060. // check capture modifier
  41061. if (modifiers.capture) {
  41062. delete modifiers.capture;
  41063. name = prependModifierMarker('!', name, dynamic);
  41064. }
  41065. if (modifiers.once) {
  41066. delete modifiers.once;
  41067. name = prependModifierMarker('~', name, dynamic);
  41068. }
  41069. /* istanbul ignore if */
  41070. if (modifiers.passive) {
  41071. delete modifiers.passive;
  41072. name = prependModifierMarker('&', name, dynamic);
  41073. }
  41074. var events;
  41075. if (modifiers.native) {
  41076. delete modifiers.native;
  41077. events = el.nativeEvents || (el.nativeEvents = {});
  41078. } else {
  41079. events = el.events || (el.events = {});
  41080. }
  41081. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  41082. if (modifiers !== emptyObject) {
  41083. newHandler.modifiers = modifiers;
  41084. }
  41085. var handlers = events[name];
  41086. /* istanbul ignore if */
  41087. if (Array.isArray(handlers)) {
  41088. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  41089. } else if (handlers) {
  41090. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  41091. } else {
  41092. events[name] = newHandler;
  41093. }
  41094. el.plain = false;
  41095. }
  41096. function getRawBindingAttr (
  41097. el,
  41098. name
  41099. ) {
  41100. return el.rawAttrsMap[':' + name] ||
  41101. el.rawAttrsMap['v-bind:' + name] ||
  41102. el.rawAttrsMap[name]
  41103. }
  41104. function getBindingAttr (
  41105. el,
  41106. name,
  41107. getStatic
  41108. ) {
  41109. var dynamicValue =
  41110. getAndRemoveAttr(el, ':' + name) ||
  41111. getAndRemoveAttr(el, 'v-bind:' + name);
  41112. if (dynamicValue != null) {
  41113. return parseFilters(dynamicValue)
  41114. } else if (getStatic !== false) {
  41115. var staticValue = getAndRemoveAttr(el, name);
  41116. if (staticValue != null) {
  41117. return JSON.stringify(staticValue)
  41118. }
  41119. }
  41120. }
  41121. // note: this only removes the attr from the Array (attrsList) so that it
  41122. // doesn't get processed by processAttrs.
  41123. // By default it does NOT remove it from the map (attrsMap) because the map is
  41124. // needed during codegen.
  41125. function getAndRemoveAttr (
  41126. el,
  41127. name,
  41128. removeFromMap
  41129. ) {
  41130. var val;
  41131. if ((val = el.attrsMap[name]) != null) {
  41132. var list = el.attrsList;
  41133. for (var i = 0, l = list.length; i < l; i++) {
  41134. if (list[i].name === name) {
  41135. list.splice(i, 1);
  41136. break
  41137. }
  41138. }
  41139. }
  41140. if (removeFromMap) {
  41141. delete el.attrsMap[name];
  41142. }
  41143. return val
  41144. }
  41145. function getAndRemoveAttrByRegex (
  41146. el,
  41147. name
  41148. ) {
  41149. var list = el.attrsList;
  41150. for (var i = 0, l = list.length; i < l; i++) {
  41151. var attr = list[i];
  41152. if (name.test(attr.name)) {
  41153. list.splice(i, 1);
  41154. return attr
  41155. }
  41156. }
  41157. }
  41158. function rangeSetItem (
  41159. item,
  41160. range
  41161. ) {
  41162. if (range) {
  41163. if (range.start != null) {
  41164. item.start = range.start;
  41165. }
  41166. if (range.end != null) {
  41167. item.end = range.end;
  41168. }
  41169. }
  41170. return item
  41171. }
  41172. /* */
  41173. /**
  41174. * Cross-platform code generation for component v-model
  41175. */
  41176. function genComponentModel (
  41177. el,
  41178. value,
  41179. modifiers
  41180. ) {
  41181. var ref = modifiers || {};
  41182. var number = ref.number;
  41183. var trim = ref.trim;
  41184. var baseValueExpression = '$$v';
  41185. var valueExpression = baseValueExpression;
  41186. if (trim) {
  41187. valueExpression =
  41188. "(typeof " + baseValueExpression + " === 'string'" +
  41189. "? " + baseValueExpression + ".trim()" +
  41190. ": " + baseValueExpression + ")";
  41191. }
  41192. if (number) {
  41193. valueExpression = "_n(" + valueExpression + ")";
  41194. }
  41195. var assignment = genAssignmentCode(value, valueExpression);
  41196. el.model = {
  41197. value: ("(" + value + ")"),
  41198. expression: JSON.stringify(value),
  41199. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  41200. };
  41201. }
  41202. /**
  41203. * Cross-platform codegen helper for generating v-model value assignment code.
  41204. */
  41205. function genAssignmentCode (
  41206. value,
  41207. assignment
  41208. ) {
  41209. var res = parseModel(value);
  41210. if (res.key === null) {
  41211. return (value + "=" + assignment)
  41212. } else {
  41213. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  41214. }
  41215. }
  41216. /**
  41217. * Parse a v-model expression into a base path and a final key segment.
  41218. * Handles both dot-path and possible square brackets.
  41219. *
  41220. * Possible cases:
  41221. *
  41222. * - test
  41223. * - test[key]
  41224. * - test[test1[key]]
  41225. * - test["a"][key]
  41226. * - xxx.test[a[a].test1[key]]
  41227. * - test.xxx.a["asa"][test1[key]]
  41228. *
  41229. */
  41230. var len, str, chr, index$1, expressionPos, expressionEndPos;
  41231. function parseModel (val) {
  41232. // Fix https://github.com/vuejs/vue/pull/7730
  41233. // allow v-model="obj.val " (trailing whitespace)
  41234. val = val.trim();
  41235. len = val.length;
  41236. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  41237. index$1 = val.lastIndexOf('.');
  41238. if (index$1 > -1) {
  41239. return {
  41240. exp: val.slice(0, index$1),
  41241. key: '"' + val.slice(index$1 + 1) + '"'
  41242. }
  41243. } else {
  41244. return {
  41245. exp: val,
  41246. key: null
  41247. }
  41248. }
  41249. }
  41250. str = val;
  41251. index$1 = expressionPos = expressionEndPos = 0;
  41252. while (!eof()) {
  41253. chr = next();
  41254. /* istanbul ignore if */
  41255. if (isStringStart(chr)) {
  41256. parseString(chr);
  41257. } else if (chr === 0x5B) {
  41258. parseBracket(chr);
  41259. }
  41260. }
  41261. return {
  41262. exp: val.slice(0, expressionPos),
  41263. key: val.slice(expressionPos + 1, expressionEndPos)
  41264. }
  41265. }
  41266. function next () {
  41267. return str.charCodeAt(++index$1)
  41268. }
  41269. function eof () {
  41270. return index$1 >= len
  41271. }
  41272. function isStringStart (chr) {
  41273. return chr === 0x22 || chr === 0x27
  41274. }
  41275. function parseBracket (chr) {
  41276. var inBracket = 1;
  41277. expressionPos = index$1;
  41278. while (!eof()) {
  41279. chr = next();
  41280. if (isStringStart(chr)) {
  41281. parseString(chr);
  41282. continue
  41283. }
  41284. if (chr === 0x5B) { inBracket++; }
  41285. if (chr === 0x5D) { inBracket--; }
  41286. if (inBracket === 0) {
  41287. expressionEndPos = index$1;
  41288. break
  41289. }
  41290. }
  41291. }
  41292. function parseString (chr) {
  41293. var stringQuote = chr;
  41294. while (!eof()) {
  41295. chr = next();
  41296. if (chr === stringQuote) {
  41297. break
  41298. }
  41299. }
  41300. }
  41301. /* */
  41302. var warn$1;
  41303. // in some cases, the event used has to be determined at runtime
  41304. // so we used some reserved tokens during compile.
  41305. var RANGE_TOKEN = '__r';
  41306. var CHECKBOX_RADIO_TOKEN = '__c';
  41307. function model (
  41308. el,
  41309. dir,
  41310. _warn
  41311. ) {
  41312. warn$1 = _warn;
  41313. var value = dir.value;
  41314. var modifiers = dir.modifiers;
  41315. var tag = el.tag;
  41316. var type = el.attrsMap.type;
  41317. {
  41318. // inputs with type="file" are read only and setting the input's
  41319. // value will throw an error.
  41320. if (tag === 'input' && type === 'file') {
  41321. warn$1(
  41322. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  41323. "File inputs are read only. Use a v-on:change listener instead.",
  41324. el.rawAttrsMap['v-model']
  41325. );
  41326. }
  41327. }
  41328. if (el.component) {
  41329. genComponentModel(el, value, modifiers);
  41330. // component v-model doesn't need extra runtime
  41331. return false
  41332. } else if (tag === 'select') {
  41333. genSelect(el, value, modifiers);
  41334. } else if (tag === 'input' && type === 'checkbox') {
  41335. genCheckboxModel(el, value, modifiers);
  41336. } else if (tag === 'input' && type === 'radio') {
  41337. genRadioModel(el, value, modifiers);
  41338. } else if (tag === 'input' || tag === 'textarea') {
  41339. genDefaultModel(el, value, modifiers);
  41340. } else if (!config.isReservedTag(tag)) {
  41341. genComponentModel(el, value, modifiers);
  41342. // component v-model doesn't need extra runtime
  41343. return false
  41344. } else {
  41345. warn$1(
  41346. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  41347. "v-model is not supported on this element type. " +
  41348. 'If you are working with contenteditable, it\'s recommended to ' +
  41349. 'wrap a library dedicated for that purpose inside a custom component.',
  41350. el.rawAttrsMap['v-model']
  41351. );
  41352. }
  41353. // ensure runtime directive metadata
  41354. return true
  41355. }
  41356. function genCheckboxModel (
  41357. el,
  41358. value,
  41359. modifiers
  41360. ) {
  41361. var number = modifiers && modifiers.number;
  41362. var valueBinding = getBindingAttr(el, 'value') || 'null';
  41363. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  41364. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  41365. addProp(el, 'checked',
  41366. "Array.isArray(" + value + ")" +
  41367. "?_i(" + value + "," + valueBinding + ")>-1" + (
  41368. trueValueBinding === 'true'
  41369. ? (":(" + value + ")")
  41370. : (":_q(" + value + "," + trueValueBinding + ")")
  41371. )
  41372. );
  41373. addHandler(el, 'change',
  41374. "var $$a=" + value + "," +
  41375. '$$el=$event.target,' +
  41376. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  41377. 'if(Array.isArray($$a)){' +
  41378. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  41379. '$$i=_i($$a,$$v);' +
  41380. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  41381. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  41382. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  41383. null, true
  41384. );
  41385. }
  41386. function genRadioModel (
  41387. el,
  41388. value,
  41389. modifiers
  41390. ) {
  41391. var number = modifiers && modifiers.number;
  41392. var valueBinding = getBindingAttr(el, 'value') || 'null';
  41393. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  41394. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  41395. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  41396. }
  41397. function genSelect (
  41398. el,
  41399. value,
  41400. modifiers
  41401. ) {
  41402. var number = modifiers && modifiers.number;
  41403. var selectedVal = "Array.prototype.filter" +
  41404. ".call($event.target.options,function(o){return o.selected})" +
  41405. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  41406. "return " + (number ? '_n(val)' : 'val') + "})";
  41407. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  41408. var code = "var $$selectedVal = " + selectedVal + ";";
  41409. code = code + " " + (genAssignmentCode(value, assignment));
  41410. addHandler(el, 'change', code, null, true);
  41411. }
  41412. function genDefaultModel (
  41413. el,
  41414. value,
  41415. modifiers
  41416. ) {
  41417. var type = el.attrsMap.type;
  41418. // warn if v-bind:value conflicts with v-model
  41419. // except for inputs with v-bind:type
  41420. {
  41421. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  41422. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  41423. if (value$1 && !typeBinding) {
  41424. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  41425. warn$1(
  41426. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  41427. 'because the latter already expands to a value binding internally',
  41428. el.rawAttrsMap[binding]
  41429. );
  41430. }
  41431. }
  41432. var ref = modifiers || {};
  41433. var lazy = ref.lazy;
  41434. var number = ref.number;
  41435. var trim = ref.trim;
  41436. var needCompositionGuard = !lazy && type !== 'range';
  41437. var event = lazy
  41438. ? 'change'
  41439. : type === 'range'
  41440. ? RANGE_TOKEN
  41441. : 'input';
  41442. var valueExpression = '$event.target.value';
  41443. if (trim) {
  41444. valueExpression = "$event.target.value.trim()";
  41445. }
  41446. if (number) {
  41447. valueExpression = "_n(" + valueExpression + ")";
  41448. }
  41449. var code = genAssignmentCode(value, valueExpression);
  41450. if (needCompositionGuard) {
  41451. code = "if($event.target.composing)return;" + code;
  41452. }
  41453. addProp(el, 'value', ("(" + value + ")"));
  41454. addHandler(el, event, code, null, true);
  41455. if (trim || number) {
  41456. addHandler(el, 'blur', '$forceUpdate()');
  41457. }
  41458. }
  41459. /* */
  41460. // normalize v-model event tokens that can only be determined at runtime.
  41461. // it's important to place the event as the first in the array because
  41462. // the whole point is ensuring the v-model callback gets called before
  41463. // user-attached handlers.
  41464. function normalizeEvents (on) {
  41465. /* istanbul ignore if */
  41466. if (isDef(on[RANGE_TOKEN])) {
  41467. // IE input[type=range] only supports `change` event
  41468. var event = isIE ? 'change' : 'input';
  41469. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  41470. delete on[RANGE_TOKEN];
  41471. }
  41472. // This was originally intended to fix #4521 but no longer necessary
  41473. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  41474. /* istanbul ignore if */
  41475. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  41476. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  41477. delete on[CHECKBOX_RADIO_TOKEN];
  41478. }
  41479. }
  41480. var target$1;
  41481. function createOnceHandler$1 (event, handler, capture) {
  41482. var _target = target$1; // save current target element in closure
  41483. return function onceHandler () {
  41484. var res = handler.apply(null, arguments);
  41485. if (res !== null) {
  41486. remove$2(event, onceHandler, capture, _target);
  41487. }
  41488. }
  41489. }
  41490. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  41491. // implementation and does not fire microtasks in between event propagation, so
  41492. // safe to exclude.
  41493. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  41494. function add$1 (
  41495. name,
  41496. handler,
  41497. capture,
  41498. passive
  41499. ) {
  41500. // async edge case #6566: inner click event triggers patch, event handler
  41501. // attached to outer element during patch, and triggered again. This
  41502. // happens because browsers fire microtask ticks between event propagation.
  41503. // the solution is simple: we save the timestamp when a handler is attached,
  41504. // and the handler would only fire if the event passed to it was fired
  41505. // AFTER it was attached.
  41506. if (useMicrotaskFix) {
  41507. var attachedTimestamp = currentFlushTimestamp;
  41508. var original = handler;
  41509. handler = original._wrapper = function (e) {
  41510. if (
  41511. // no bubbling, should always fire.
  41512. // this is just a safety net in case event.timeStamp is unreliable in
  41513. // certain weird environments...
  41514. e.target === e.currentTarget ||
  41515. // event is fired after handler attachment
  41516. e.timeStamp >= attachedTimestamp ||
  41517. // bail for environments that have buggy event.timeStamp implementations
  41518. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  41519. // #9681 QtWebEngine event.timeStamp is negative value
  41520. e.timeStamp <= 0 ||
  41521. // #9448 bail if event is fired in another document in a multi-page
  41522. // electron/nw.js app, since event.timeStamp will be using a different
  41523. // starting reference
  41524. e.target.ownerDocument !== document
  41525. ) {
  41526. return original.apply(this, arguments)
  41527. }
  41528. };
  41529. }
  41530. target$1.addEventListener(
  41531. name,
  41532. handler,
  41533. supportsPassive
  41534. ? { capture: capture, passive: passive }
  41535. : capture
  41536. );
  41537. }
  41538. function remove$2 (
  41539. name,
  41540. handler,
  41541. capture,
  41542. _target
  41543. ) {
  41544. (_target || target$1).removeEventListener(
  41545. name,
  41546. handler._wrapper || handler,
  41547. capture
  41548. );
  41549. }
  41550. function updateDOMListeners (oldVnode, vnode) {
  41551. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  41552. return
  41553. }
  41554. var on = vnode.data.on || {};
  41555. var oldOn = oldVnode.data.on || {};
  41556. target$1 = vnode.elm;
  41557. normalizeEvents(on);
  41558. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  41559. target$1 = undefined;
  41560. }
  41561. var events = {
  41562. create: updateDOMListeners,
  41563. update: updateDOMListeners
  41564. };
  41565. /* */
  41566. var svgContainer;
  41567. function updateDOMProps (oldVnode, vnode) {
  41568. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  41569. return
  41570. }
  41571. var key, cur;
  41572. var elm = vnode.elm;
  41573. var oldProps = oldVnode.data.domProps || {};
  41574. var props = vnode.data.domProps || {};
  41575. // clone observed objects, as the user probably wants to mutate it
  41576. if (isDef(props.__ob__)) {
  41577. props = vnode.data.domProps = extend({}, props);
  41578. }
  41579. for (key in oldProps) {
  41580. if (!(key in props)) {
  41581. elm[key] = '';
  41582. }
  41583. }
  41584. for (key in props) {
  41585. cur = props[key];
  41586. // ignore children if the node has textContent or innerHTML,
  41587. // as these will throw away existing DOM nodes and cause removal errors
  41588. // on subsequent patches (#3360)
  41589. if (key === 'textContent' || key === 'innerHTML') {
  41590. if (vnode.children) { vnode.children.length = 0; }
  41591. if (cur === oldProps[key]) { continue }
  41592. // #6601 work around Chrome version <= 55 bug where single textNode
  41593. // replaced by innerHTML/textContent retains its parentNode property
  41594. if (elm.childNodes.length === 1) {
  41595. elm.removeChild(elm.childNodes[0]);
  41596. }
  41597. }
  41598. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  41599. // store value as _value as well since
  41600. // non-string values will be stringified
  41601. elm._value = cur;
  41602. // avoid resetting cursor position when value is the same
  41603. var strCur = isUndef(cur) ? '' : String(cur);
  41604. if (shouldUpdateValue(elm, strCur)) {
  41605. elm.value = strCur;
  41606. }
  41607. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  41608. // IE doesn't support innerHTML for SVG elements
  41609. svgContainer = svgContainer || document.createElement('div');
  41610. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  41611. var svg = svgContainer.firstChild;
  41612. while (elm.firstChild) {
  41613. elm.removeChild(elm.firstChild);
  41614. }
  41615. while (svg.firstChild) {
  41616. elm.appendChild(svg.firstChild);
  41617. }
  41618. } else if (
  41619. // skip the update if old and new VDOM state is the same.
  41620. // `value` is handled separately because the DOM value may be temporarily
  41621. // out of sync with VDOM state due to focus, composition and modifiers.
  41622. // This #4521 by skipping the unnecessary `checked` update.
  41623. cur !== oldProps[key]
  41624. ) {
  41625. // some property updates can throw
  41626. // e.g. `value` on <progress> w/ non-finite value
  41627. try {
  41628. elm[key] = cur;
  41629. } catch (e) {}
  41630. }
  41631. }
  41632. }
  41633. // check platforms/web/util/attrs.js acceptValue
  41634. function shouldUpdateValue (elm, checkVal) {
  41635. return (!elm.composing && (
  41636. elm.tagName === 'OPTION' ||
  41637. isNotInFocusAndDirty(elm, checkVal) ||
  41638. isDirtyWithModifiers(elm, checkVal)
  41639. ))
  41640. }
  41641. function isNotInFocusAndDirty (elm, checkVal) {
  41642. // return true when textbox (.number and .trim) loses focus and its value is
  41643. // not equal to the updated value
  41644. var notInFocus = true;
  41645. // #6157
  41646. // work around IE bug when accessing document.activeElement in an iframe
  41647. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  41648. return notInFocus && elm.value !== checkVal
  41649. }
  41650. function isDirtyWithModifiers (elm, newVal) {
  41651. var value = elm.value;
  41652. var modifiers = elm._vModifiers; // injected by v-model runtime
  41653. if (isDef(modifiers)) {
  41654. if (modifiers.number) {
  41655. return toNumber(value) !== toNumber(newVal)
  41656. }
  41657. if (modifiers.trim) {
  41658. return value.trim() !== newVal.trim()
  41659. }
  41660. }
  41661. return value !== newVal
  41662. }
  41663. var domProps = {
  41664. create: updateDOMProps,
  41665. update: updateDOMProps
  41666. };
  41667. /* */
  41668. var parseStyleText = cached(function (cssText) {
  41669. var res = {};
  41670. var listDelimiter = /;(?![^(]*\))/g;
  41671. var propertyDelimiter = /:(.+)/;
  41672. cssText.split(listDelimiter).forEach(function (item) {
  41673. if (item) {
  41674. var tmp = item.split(propertyDelimiter);
  41675. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  41676. }
  41677. });
  41678. return res
  41679. });
  41680. // merge static and dynamic style data on the same vnode
  41681. function normalizeStyleData (data) {
  41682. var style = normalizeStyleBinding(data.style);
  41683. // static style is pre-processed into an object during compilation
  41684. // and is always a fresh object, so it's safe to merge into it
  41685. return data.staticStyle
  41686. ? extend(data.staticStyle, style)
  41687. : style
  41688. }
  41689. // normalize possible array / string values into Object
  41690. function normalizeStyleBinding (bindingStyle) {
  41691. if (Array.isArray(bindingStyle)) {
  41692. return toObject(bindingStyle)
  41693. }
  41694. if (typeof bindingStyle === 'string') {
  41695. return parseStyleText(bindingStyle)
  41696. }
  41697. return bindingStyle
  41698. }
  41699. /**
  41700. * parent component style should be after child's
  41701. * so that parent component's style could override it
  41702. */
  41703. function getStyle (vnode, checkChild) {
  41704. var res = {};
  41705. var styleData;
  41706. if (checkChild) {
  41707. var childNode = vnode;
  41708. while (childNode.componentInstance) {
  41709. childNode = childNode.componentInstance._vnode;
  41710. if (
  41711. childNode && childNode.data &&
  41712. (styleData = normalizeStyleData(childNode.data))
  41713. ) {
  41714. extend(res, styleData);
  41715. }
  41716. }
  41717. }
  41718. if ((styleData = normalizeStyleData(vnode.data))) {
  41719. extend(res, styleData);
  41720. }
  41721. var parentNode = vnode;
  41722. while ((parentNode = parentNode.parent)) {
  41723. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  41724. extend(res, styleData);
  41725. }
  41726. }
  41727. return res
  41728. }
  41729. /* */
  41730. var cssVarRE = /^--/;
  41731. var importantRE = /\s*!important$/;
  41732. var setProp = function (el, name, val) {
  41733. /* istanbul ignore if */
  41734. if (cssVarRE.test(name)) {
  41735. el.style.setProperty(name, val);
  41736. } else if (importantRE.test(val)) {
  41737. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  41738. } else {
  41739. var normalizedName = normalize(name);
  41740. if (Array.isArray(val)) {
  41741. // Support values array created by autoprefixer, e.g.
  41742. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  41743. // Set them one by one, and the browser will only set those it can recognize
  41744. for (var i = 0, len = val.length; i < len; i++) {
  41745. el.style[normalizedName] = val[i];
  41746. }
  41747. } else {
  41748. el.style[normalizedName] = val;
  41749. }
  41750. }
  41751. };
  41752. var vendorNames = ['Webkit', 'Moz', 'ms'];
  41753. var emptyStyle;
  41754. var normalize = cached(function (prop) {
  41755. emptyStyle = emptyStyle || document.createElement('div').style;
  41756. prop = camelize(prop);
  41757. if (prop !== 'filter' && (prop in emptyStyle)) {
  41758. return prop
  41759. }
  41760. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  41761. for (var i = 0; i < vendorNames.length; i++) {
  41762. var name = vendorNames[i] + capName;
  41763. if (name in emptyStyle) {
  41764. return name
  41765. }
  41766. }
  41767. });
  41768. function updateStyle (oldVnode, vnode) {
  41769. var data = vnode.data;
  41770. var oldData = oldVnode.data;
  41771. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  41772. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  41773. ) {
  41774. return
  41775. }
  41776. var cur, name;
  41777. var el = vnode.elm;
  41778. var oldStaticStyle = oldData.staticStyle;
  41779. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  41780. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  41781. var oldStyle = oldStaticStyle || oldStyleBinding;
  41782. var style = normalizeStyleBinding(vnode.data.style) || {};
  41783. // store normalized style under a different key for next diff
  41784. // make sure to clone it if it's reactive, since the user likely wants
  41785. // to mutate it.
  41786. vnode.data.normalizedStyle = isDef(style.__ob__)
  41787. ? extend({}, style)
  41788. : style;
  41789. var newStyle = getStyle(vnode, true);
  41790. for (name in oldStyle) {
  41791. if (isUndef(newStyle[name])) {
  41792. setProp(el, name, '');
  41793. }
  41794. }
  41795. for (name in newStyle) {
  41796. cur = newStyle[name];
  41797. if (cur !== oldStyle[name]) {
  41798. // ie9 setting to null has no effect, must use empty string
  41799. setProp(el, name, cur == null ? '' : cur);
  41800. }
  41801. }
  41802. }
  41803. var style = {
  41804. create: updateStyle,
  41805. update: updateStyle
  41806. };
  41807. /* */
  41808. var whitespaceRE = /\s+/;
  41809. /**
  41810. * Add class with compatibility for SVG since classList is not supported on
  41811. * SVG elements in IE
  41812. */
  41813. function addClass (el, cls) {
  41814. /* istanbul ignore if */
  41815. if (!cls || !(cls = cls.trim())) {
  41816. return
  41817. }
  41818. /* istanbul ignore else */
  41819. if (el.classList) {
  41820. if (cls.indexOf(' ') > -1) {
  41821. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  41822. } else {
  41823. el.classList.add(cls);
  41824. }
  41825. } else {
  41826. var cur = " " + (el.getAttribute('class') || '') + " ";
  41827. if (cur.indexOf(' ' + cls + ' ') < 0) {
  41828. el.setAttribute('class', (cur + cls).trim());
  41829. }
  41830. }
  41831. }
  41832. /**
  41833. * Remove class with compatibility for SVG since classList is not supported on
  41834. * SVG elements in IE
  41835. */
  41836. function removeClass (el, cls) {
  41837. /* istanbul ignore if */
  41838. if (!cls || !(cls = cls.trim())) {
  41839. return
  41840. }
  41841. /* istanbul ignore else */
  41842. if (el.classList) {
  41843. if (cls.indexOf(' ') > -1) {
  41844. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  41845. } else {
  41846. el.classList.remove(cls);
  41847. }
  41848. if (!el.classList.length) {
  41849. el.removeAttribute('class');
  41850. }
  41851. } else {
  41852. var cur = " " + (el.getAttribute('class') || '') + " ";
  41853. var tar = ' ' + cls + ' ';
  41854. while (cur.indexOf(tar) >= 0) {
  41855. cur = cur.replace(tar, ' ');
  41856. }
  41857. cur = cur.trim();
  41858. if (cur) {
  41859. el.setAttribute('class', cur);
  41860. } else {
  41861. el.removeAttribute('class');
  41862. }
  41863. }
  41864. }
  41865. /* */
  41866. function resolveTransition (def$$1) {
  41867. if (!def$$1) {
  41868. return
  41869. }
  41870. /* istanbul ignore else */
  41871. if (typeof def$$1 === 'object') {
  41872. var res = {};
  41873. if (def$$1.css !== false) {
  41874. extend(res, autoCssTransition(def$$1.name || 'v'));
  41875. }
  41876. extend(res, def$$1);
  41877. return res
  41878. } else if (typeof def$$1 === 'string') {
  41879. return autoCssTransition(def$$1)
  41880. }
  41881. }
  41882. var autoCssTransition = cached(function (name) {
  41883. return {
  41884. enterClass: (name + "-enter"),
  41885. enterToClass: (name + "-enter-to"),
  41886. enterActiveClass: (name + "-enter-active"),
  41887. leaveClass: (name + "-leave"),
  41888. leaveToClass: (name + "-leave-to"),
  41889. leaveActiveClass: (name + "-leave-active")
  41890. }
  41891. });
  41892. var hasTransition = inBrowser && !isIE9;
  41893. var TRANSITION = 'transition';
  41894. var ANIMATION = 'animation';
  41895. // Transition property/event sniffing
  41896. var transitionProp = 'transition';
  41897. var transitionEndEvent = 'transitionend';
  41898. var animationProp = 'animation';
  41899. var animationEndEvent = 'animationend';
  41900. if (hasTransition) {
  41901. /* istanbul ignore if */
  41902. if (window.ontransitionend === undefined &&
  41903. window.onwebkittransitionend !== undefined
  41904. ) {
  41905. transitionProp = 'WebkitTransition';
  41906. transitionEndEvent = 'webkitTransitionEnd';
  41907. }
  41908. if (window.onanimationend === undefined &&
  41909. window.onwebkitanimationend !== undefined
  41910. ) {
  41911. animationProp = 'WebkitAnimation';
  41912. animationEndEvent = 'webkitAnimationEnd';
  41913. }
  41914. }
  41915. // binding to window is necessary to make hot reload work in IE in strict mode
  41916. var raf = inBrowser
  41917. ? window.requestAnimationFrame
  41918. ? window.requestAnimationFrame.bind(window)
  41919. : setTimeout
  41920. : /* istanbul ignore next */ function (fn) { return fn(); };
  41921. function nextFrame (fn) {
  41922. raf(function () {
  41923. raf(fn);
  41924. });
  41925. }
  41926. function addTransitionClass (el, cls) {
  41927. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  41928. if (transitionClasses.indexOf(cls) < 0) {
  41929. transitionClasses.push(cls);
  41930. addClass(el, cls);
  41931. }
  41932. }
  41933. function removeTransitionClass (el, cls) {
  41934. if (el._transitionClasses) {
  41935. remove(el._transitionClasses, cls);
  41936. }
  41937. removeClass(el, cls);
  41938. }
  41939. function whenTransitionEnds (
  41940. el,
  41941. expectedType,
  41942. cb
  41943. ) {
  41944. var ref = getTransitionInfo(el, expectedType);
  41945. var type = ref.type;
  41946. var timeout = ref.timeout;
  41947. var propCount = ref.propCount;
  41948. if (!type) { return cb() }
  41949. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  41950. var ended = 0;
  41951. var end = function () {
  41952. el.removeEventListener(event, onEnd);
  41953. cb();
  41954. };
  41955. var onEnd = function (e) {
  41956. if (e.target === el) {
  41957. if (++ended >= propCount) {
  41958. end();
  41959. }
  41960. }
  41961. };
  41962. setTimeout(function () {
  41963. if (ended < propCount) {
  41964. end();
  41965. }
  41966. }, timeout + 1);
  41967. el.addEventListener(event, onEnd);
  41968. }
  41969. var transformRE = /\b(transform|all)(,|$)/;
  41970. function getTransitionInfo (el, expectedType) {
  41971. var styles = window.getComputedStyle(el);
  41972. // JSDOM may return undefined for transition properties
  41973. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  41974. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  41975. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  41976. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  41977. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  41978. var animationTimeout = getTimeout(animationDelays, animationDurations);
  41979. var type;
  41980. var timeout = 0;
  41981. var propCount = 0;
  41982. /* istanbul ignore if */
  41983. if (expectedType === TRANSITION) {
  41984. if (transitionTimeout > 0) {
  41985. type = TRANSITION;
  41986. timeout = transitionTimeout;
  41987. propCount = transitionDurations.length;
  41988. }
  41989. } else if (expectedType === ANIMATION) {
  41990. if (animationTimeout > 0) {
  41991. type = ANIMATION;
  41992. timeout = animationTimeout;
  41993. propCount = animationDurations.length;
  41994. }
  41995. } else {
  41996. timeout = Math.max(transitionTimeout, animationTimeout);
  41997. type = timeout > 0
  41998. ? transitionTimeout > animationTimeout
  41999. ? TRANSITION
  42000. : ANIMATION
  42001. : null;
  42002. propCount = type
  42003. ? type === TRANSITION
  42004. ? transitionDurations.length
  42005. : animationDurations.length
  42006. : 0;
  42007. }
  42008. var hasTransform =
  42009. type === TRANSITION &&
  42010. transformRE.test(styles[transitionProp + 'Property']);
  42011. return {
  42012. type: type,
  42013. timeout: timeout,
  42014. propCount: propCount,
  42015. hasTransform: hasTransform
  42016. }
  42017. }
  42018. function getTimeout (delays, durations) {
  42019. /* istanbul ignore next */
  42020. while (delays.length < durations.length) {
  42021. delays = delays.concat(delays);
  42022. }
  42023. return Math.max.apply(null, durations.map(function (d, i) {
  42024. return toMs(d) + toMs(delays[i])
  42025. }))
  42026. }
  42027. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  42028. // in a locale-dependent way, using a comma instead of a dot.
  42029. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  42030. // as a floor function) causing unexpected behaviors
  42031. function toMs (s) {
  42032. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  42033. }
  42034. /* */
  42035. function enter (vnode, toggleDisplay) {
  42036. var el = vnode.elm;
  42037. // call leave callback now
  42038. if (isDef(el._leaveCb)) {
  42039. el._leaveCb.cancelled = true;
  42040. el._leaveCb();
  42041. }
  42042. var data = resolveTransition(vnode.data.transition);
  42043. if (isUndef(data)) {
  42044. return
  42045. }
  42046. /* istanbul ignore if */
  42047. if (isDef(el._enterCb) || el.nodeType !== 1) {
  42048. return
  42049. }
  42050. var css = data.css;
  42051. var type = data.type;
  42052. var enterClass = data.enterClass;
  42053. var enterToClass = data.enterToClass;
  42054. var enterActiveClass = data.enterActiveClass;
  42055. var appearClass = data.appearClass;
  42056. var appearToClass = data.appearToClass;
  42057. var appearActiveClass = data.appearActiveClass;
  42058. var beforeEnter = data.beforeEnter;
  42059. var enter = data.enter;
  42060. var afterEnter = data.afterEnter;
  42061. var enterCancelled = data.enterCancelled;
  42062. var beforeAppear = data.beforeAppear;
  42063. var appear = data.appear;
  42064. var afterAppear = data.afterAppear;
  42065. var appearCancelled = data.appearCancelled;
  42066. var duration = data.duration;
  42067. // activeInstance will always be the <transition> component managing this
  42068. // transition. One edge case to check is when the <transition> is placed
  42069. // as the root node of a child component. In that case we need to check
  42070. // <transition>'s parent for appear check.
  42071. var context = activeInstance;
  42072. var transitionNode = activeInstance.$vnode;
  42073. while (transitionNode && transitionNode.parent) {
  42074. context = transitionNode.context;
  42075. transitionNode = transitionNode.parent;
  42076. }
  42077. var isAppear = !context._isMounted || !vnode.isRootInsert;
  42078. if (isAppear && !appear && appear !== '') {
  42079. return
  42080. }
  42081. var startClass = isAppear && appearClass
  42082. ? appearClass
  42083. : enterClass;
  42084. var activeClass = isAppear && appearActiveClass
  42085. ? appearActiveClass
  42086. : enterActiveClass;
  42087. var toClass = isAppear && appearToClass
  42088. ? appearToClass
  42089. : enterToClass;
  42090. var beforeEnterHook = isAppear
  42091. ? (beforeAppear || beforeEnter)
  42092. : beforeEnter;
  42093. var enterHook = isAppear
  42094. ? (typeof appear === 'function' ? appear : enter)
  42095. : enter;
  42096. var afterEnterHook = isAppear
  42097. ? (afterAppear || afterEnter)
  42098. : afterEnter;
  42099. var enterCancelledHook = isAppear
  42100. ? (appearCancelled || enterCancelled)
  42101. : enterCancelled;
  42102. var explicitEnterDuration = toNumber(
  42103. isObject(duration)
  42104. ? duration.enter
  42105. : duration
  42106. );
  42107. if (explicitEnterDuration != null) {
  42108. checkDuration(explicitEnterDuration, 'enter', vnode);
  42109. }
  42110. var expectsCSS = css !== false && !isIE9;
  42111. var userWantsControl = getHookArgumentsLength(enterHook);
  42112. var cb = el._enterCb = once(function () {
  42113. if (expectsCSS) {
  42114. removeTransitionClass(el, toClass);
  42115. removeTransitionClass(el, activeClass);
  42116. }
  42117. if (cb.cancelled) {
  42118. if (expectsCSS) {
  42119. removeTransitionClass(el, startClass);
  42120. }
  42121. enterCancelledHook && enterCancelledHook(el);
  42122. } else {
  42123. afterEnterHook && afterEnterHook(el);
  42124. }
  42125. el._enterCb = null;
  42126. });
  42127. if (!vnode.data.show) {
  42128. // remove pending leave element on enter by injecting an insert hook
  42129. mergeVNodeHook(vnode, 'insert', function () {
  42130. var parent = el.parentNode;
  42131. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  42132. if (pendingNode &&
  42133. pendingNode.tag === vnode.tag &&
  42134. pendingNode.elm._leaveCb
  42135. ) {
  42136. pendingNode.elm._leaveCb();
  42137. }
  42138. enterHook && enterHook(el, cb);
  42139. });
  42140. }
  42141. // start enter transition
  42142. beforeEnterHook && beforeEnterHook(el);
  42143. if (expectsCSS) {
  42144. addTransitionClass(el, startClass);
  42145. addTransitionClass(el, activeClass);
  42146. nextFrame(function () {
  42147. removeTransitionClass(el, startClass);
  42148. if (!cb.cancelled) {
  42149. addTransitionClass(el, toClass);
  42150. if (!userWantsControl) {
  42151. if (isValidDuration(explicitEnterDuration)) {
  42152. setTimeout(cb, explicitEnterDuration);
  42153. } else {
  42154. whenTransitionEnds(el, type, cb);
  42155. }
  42156. }
  42157. }
  42158. });
  42159. }
  42160. if (vnode.data.show) {
  42161. toggleDisplay && toggleDisplay();
  42162. enterHook && enterHook(el, cb);
  42163. }
  42164. if (!expectsCSS && !userWantsControl) {
  42165. cb();
  42166. }
  42167. }
  42168. function leave (vnode, rm) {
  42169. var el = vnode.elm;
  42170. // call enter callback now
  42171. if (isDef(el._enterCb)) {
  42172. el._enterCb.cancelled = true;
  42173. el._enterCb();
  42174. }
  42175. var data = resolveTransition(vnode.data.transition);
  42176. if (isUndef(data) || el.nodeType !== 1) {
  42177. return rm()
  42178. }
  42179. /* istanbul ignore if */
  42180. if (isDef(el._leaveCb)) {
  42181. return
  42182. }
  42183. var css = data.css;
  42184. var type = data.type;
  42185. var leaveClass = data.leaveClass;
  42186. var leaveToClass = data.leaveToClass;
  42187. var leaveActiveClass = data.leaveActiveClass;
  42188. var beforeLeave = data.beforeLeave;
  42189. var leave = data.leave;
  42190. var afterLeave = data.afterLeave;
  42191. var leaveCancelled = data.leaveCancelled;
  42192. var delayLeave = data.delayLeave;
  42193. var duration = data.duration;
  42194. var expectsCSS = css !== false && !isIE9;
  42195. var userWantsControl = getHookArgumentsLength(leave);
  42196. var explicitLeaveDuration = toNumber(
  42197. isObject(duration)
  42198. ? duration.leave
  42199. : duration
  42200. );
  42201. if (isDef(explicitLeaveDuration)) {
  42202. checkDuration(explicitLeaveDuration, 'leave', vnode);
  42203. }
  42204. var cb = el._leaveCb = once(function () {
  42205. if (el.parentNode && el.parentNode._pending) {
  42206. el.parentNode._pending[vnode.key] = null;
  42207. }
  42208. if (expectsCSS) {
  42209. removeTransitionClass(el, leaveToClass);
  42210. removeTransitionClass(el, leaveActiveClass);
  42211. }
  42212. if (cb.cancelled) {
  42213. if (expectsCSS) {
  42214. removeTransitionClass(el, leaveClass);
  42215. }
  42216. leaveCancelled && leaveCancelled(el);
  42217. } else {
  42218. rm();
  42219. afterLeave && afterLeave(el);
  42220. }
  42221. el._leaveCb = null;
  42222. });
  42223. if (delayLeave) {
  42224. delayLeave(performLeave);
  42225. } else {
  42226. performLeave();
  42227. }
  42228. function performLeave () {
  42229. // the delayed leave may have already been cancelled
  42230. if (cb.cancelled) {
  42231. return
  42232. }
  42233. // record leaving element
  42234. if (!vnode.data.show && el.parentNode) {
  42235. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  42236. }
  42237. beforeLeave && beforeLeave(el);
  42238. if (expectsCSS) {
  42239. addTransitionClass(el, leaveClass);
  42240. addTransitionClass(el, leaveActiveClass);
  42241. nextFrame(function () {
  42242. removeTransitionClass(el, leaveClass);
  42243. if (!cb.cancelled) {
  42244. addTransitionClass(el, leaveToClass);
  42245. if (!userWantsControl) {
  42246. if (isValidDuration(explicitLeaveDuration)) {
  42247. setTimeout(cb, explicitLeaveDuration);
  42248. } else {
  42249. whenTransitionEnds(el, type, cb);
  42250. }
  42251. }
  42252. }
  42253. });
  42254. }
  42255. leave && leave(el, cb);
  42256. if (!expectsCSS && !userWantsControl) {
  42257. cb();
  42258. }
  42259. }
  42260. }
  42261. // only used in dev mode
  42262. function checkDuration (val, name, vnode) {
  42263. if (typeof val !== 'number') {
  42264. warn(
  42265. "<transition> explicit " + name + " duration is not a valid number - " +
  42266. "got " + (JSON.stringify(val)) + ".",
  42267. vnode.context
  42268. );
  42269. } else if (isNaN(val)) {
  42270. warn(
  42271. "<transition> explicit " + name + " duration is NaN - " +
  42272. 'the duration expression might be incorrect.',
  42273. vnode.context
  42274. );
  42275. }
  42276. }
  42277. function isValidDuration (val) {
  42278. return typeof val === 'number' && !isNaN(val)
  42279. }
  42280. /**
  42281. * Normalize a transition hook's argument length. The hook may be:
  42282. * - a merged hook (invoker) with the original in .fns
  42283. * - a wrapped component method (check ._length)
  42284. * - a plain function (.length)
  42285. */
  42286. function getHookArgumentsLength (fn) {
  42287. if (isUndef(fn)) {
  42288. return false
  42289. }
  42290. var invokerFns = fn.fns;
  42291. if (isDef(invokerFns)) {
  42292. // invoker
  42293. return getHookArgumentsLength(
  42294. Array.isArray(invokerFns)
  42295. ? invokerFns[0]
  42296. : invokerFns
  42297. )
  42298. } else {
  42299. return (fn._length || fn.length) > 1
  42300. }
  42301. }
  42302. function _enter (_, vnode) {
  42303. if (vnode.data.show !== true) {
  42304. enter(vnode);
  42305. }
  42306. }
  42307. var transition = inBrowser ? {
  42308. create: _enter,
  42309. activate: _enter,
  42310. remove: function remove$$1 (vnode, rm) {
  42311. /* istanbul ignore else */
  42312. if (vnode.data.show !== true) {
  42313. leave(vnode, rm);
  42314. } else {
  42315. rm();
  42316. }
  42317. }
  42318. } : {};
  42319. var platformModules = [
  42320. attrs,
  42321. klass,
  42322. events,
  42323. domProps,
  42324. style,
  42325. transition
  42326. ];
  42327. /* */
  42328. // the directive module should be applied last, after all
  42329. // built-in modules have been applied.
  42330. var modules = platformModules.concat(baseModules);
  42331. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  42332. /**
  42333. * Not type checking this file because flow doesn't like attaching
  42334. * properties to Elements.
  42335. */
  42336. /* istanbul ignore if */
  42337. if (isIE9) {
  42338. // http://www.matts411.com/post/internet-explorer-9-oninput/
  42339. document.addEventListener('selectionchange', function () {
  42340. var el = document.activeElement;
  42341. if (el && el.vmodel) {
  42342. trigger(el, 'input');
  42343. }
  42344. });
  42345. }
  42346. var directive = {
  42347. inserted: function inserted (el, binding, vnode, oldVnode) {
  42348. if (vnode.tag === 'select') {
  42349. // #6903
  42350. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  42351. mergeVNodeHook(vnode, 'postpatch', function () {
  42352. directive.componentUpdated(el, binding, vnode);
  42353. });
  42354. } else {
  42355. setSelected(el, binding, vnode.context);
  42356. }
  42357. el._vOptions = [].map.call(el.options, getValue);
  42358. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  42359. el._vModifiers = binding.modifiers;
  42360. if (!binding.modifiers.lazy) {
  42361. el.addEventListener('compositionstart', onCompositionStart);
  42362. el.addEventListener('compositionend', onCompositionEnd);
  42363. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  42364. // switching focus before confirming composition choice
  42365. // this also fixes the issue where some browsers e.g. iOS Chrome
  42366. // fires "change" instead of "input" on autocomplete.
  42367. el.addEventListener('change', onCompositionEnd);
  42368. /* istanbul ignore if */
  42369. if (isIE9) {
  42370. el.vmodel = true;
  42371. }
  42372. }
  42373. }
  42374. },
  42375. componentUpdated: function componentUpdated (el, binding, vnode) {
  42376. if (vnode.tag === 'select') {
  42377. setSelected(el, binding, vnode.context);
  42378. // in case the options rendered by v-for have changed,
  42379. // it's possible that the value is out-of-sync with the rendered options.
  42380. // detect such cases and filter out values that no longer has a matching
  42381. // option in the DOM.
  42382. var prevOptions = el._vOptions;
  42383. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  42384. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  42385. // trigger change event if
  42386. // no matching option found for at least one value
  42387. var needReset = el.multiple
  42388. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  42389. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  42390. if (needReset) {
  42391. trigger(el, 'change');
  42392. }
  42393. }
  42394. }
  42395. }
  42396. };
  42397. function setSelected (el, binding, vm) {
  42398. actuallySetSelected(el, binding, vm);
  42399. /* istanbul ignore if */
  42400. if (isIE || isEdge) {
  42401. setTimeout(function () {
  42402. actuallySetSelected(el, binding, vm);
  42403. }, 0);
  42404. }
  42405. }
  42406. function actuallySetSelected (el, binding, vm) {
  42407. var value = binding.value;
  42408. var isMultiple = el.multiple;
  42409. if (isMultiple && !Array.isArray(value)) {
  42410. warn(
  42411. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  42412. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  42413. vm
  42414. );
  42415. return
  42416. }
  42417. var selected, option;
  42418. for (var i = 0, l = el.options.length; i < l; i++) {
  42419. option = el.options[i];
  42420. if (isMultiple) {
  42421. selected = looseIndexOf(value, getValue(option)) > -1;
  42422. if (option.selected !== selected) {
  42423. option.selected = selected;
  42424. }
  42425. } else {
  42426. if (looseEqual(getValue(option), value)) {
  42427. if (el.selectedIndex !== i) {
  42428. el.selectedIndex = i;
  42429. }
  42430. return
  42431. }
  42432. }
  42433. }
  42434. if (!isMultiple) {
  42435. el.selectedIndex = -1;
  42436. }
  42437. }
  42438. function hasNoMatchingOption (value, options) {
  42439. return options.every(function (o) { return !looseEqual(o, value); })
  42440. }
  42441. function getValue (option) {
  42442. return '_value' in option
  42443. ? option._value
  42444. : option.value
  42445. }
  42446. function onCompositionStart (e) {
  42447. e.target.composing = true;
  42448. }
  42449. function onCompositionEnd (e) {
  42450. // prevent triggering an input event for no reason
  42451. if (!e.target.composing) { return }
  42452. e.target.composing = false;
  42453. trigger(e.target, 'input');
  42454. }
  42455. function trigger (el, type) {
  42456. var e = document.createEvent('HTMLEvents');
  42457. e.initEvent(type, true, true);
  42458. el.dispatchEvent(e);
  42459. }
  42460. /* */
  42461. // recursively search for possible transition defined inside the component root
  42462. function locateNode (vnode) {
  42463. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  42464. ? locateNode(vnode.componentInstance._vnode)
  42465. : vnode
  42466. }
  42467. var show = {
  42468. bind: function bind (el, ref, vnode) {
  42469. var value = ref.value;
  42470. vnode = locateNode(vnode);
  42471. var transition$$1 = vnode.data && vnode.data.transition;
  42472. var originalDisplay = el.__vOriginalDisplay =
  42473. el.style.display === 'none' ? '' : el.style.display;
  42474. if (value && transition$$1) {
  42475. vnode.data.show = true;
  42476. enter(vnode, function () {
  42477. el.style.display = originalDisplay;
  42478. });
  42479. } else {
  42480. el.style.display = value ? originalDisplay : 'none';
  42481. }
  42482. },
  42483. update: function update (el, ref, vnode) {
  42484. var value = ref.value;
  42485. var oldValue = ref.oldValue;
  42486. /* istanbul ignore if */
  42487. if (!value === !oldValue) { return }
  42488. vnode = locateNode(vnode);
  42489. var transition$$1 = vnode.data && vnode.data.transition;
  42490. if (transition$$1) {
  42491. vnode.data.show = true;
  42492. if (value) {
  42493. enter(vnode, function () {
  42494. el.style.display = el.__vOriginalDisplay;
  42495. });
  42496. } else {
  42497. leave(vnode, function () {
  42498. el.style.display = 'none';
  42499. });
  42500. }
  42501. } else {
  42502. el.style.display = value ? el.__vOriginalDisplay : 'none';
  42503. }
  42504. },
  42505. unbind: function unbind (
  42506. el,
  42507. binding,
  42508. vnode,
  42509. oldVnode,
  42510. isDestroy
  42511. ) {
  42512. if (!isDestroy) {
  42513. el.style.display = el.__vOriginalDisplay;
  42514. }
  42515. }
  42516. };
  42517. var platformDirectives = {
  42518. model: directive,
  42519. show: show
  42520. };
  42521. /* */
  42522. var transitionProps = {
  42523. name: String,
  42524. appear: Boolean,
  42525. css: Boolean,
  42526. mode: String,
  42527. type: String,
  42528. enterClass: String,
  42529. leaveClass: String,
  42530. enterToClass: String,
  42531. leaveToClass: String,
  42532. enterActiveClass: String,
  42533. leaveActiveClass: String,
  42534. appearClass: String,
  42535. appearActiveClass: String,
  42536. appearToClass: String,
  42537. duration: [Number, String, Object]
  42538. };
  42539. // in case the child is also an abstract component, e.g. <keep-alive>
  42540. // we want to recursively retrieve the real component to be rendered
  42541. function getRealChild (vnode) {
  42542. var compOptions = vnode && vnode.componentOptions;
  42543. if (compOptions && compOptions.Ctor.options.abstract) {
  42544. return getRealChild(getFirstComponentChild(compOptions.children))
  42545. } else {
  42546. return vnode
  42547. }
  42548. }
  42549. function extractTransitionData (comp) {
  42550. var data = {};
  42551. var options = comp.$options;
  42552. // props
  42553. for (var key in options.propsData) {
  42554. data[key] = comp[key];
  42555. }
  42556. // events.
  42557. // extract listeners and pass them directly to the transition methods
  42558. var listeners = options._parentListeners;
  42559. for (var key$1 in listeners) {
  42560. data[camelize(key$1)] = listeners[key$1];
  42561. }
  42562. return data
  42563. }
  42564. function placeholder (h, rawChild) {
  42565. if (/\d-keep-alive$/.test(rawChild.tag)) {
  42566. return h('keep-alive', {
  42567. props: rawChild.componentOptions.propsData
  42568. })
  42569. }
  42570. }
  42571. function hasParentTransition (vnode) {
  42572. while ((vnode = vnode.parent)) {
  42573. if (vnode.data.transition) {
  42574. return true
  42575. }
  42576. }
  42577. }
  42578. function isSameChild (child, oldChild) {
  42579. return oldChild.key === child.key && oldChild.tag === child.tag
  42580. }
  42581. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  42582. var isVShowDirective = function (d) { return d.name === 'show'; };
  42583. var Transition = {
  42584. name: 'transition',
  42585. props: transitionProps,
  42586. abstract: true,
  42587. render: function render (h) {
  42588. var this$1 = this;
  42589. var children = this.$slots.default;
  42590. if (!children) {
  42591. return
  42592. }
  42593. // filter out text nodes (possible whitespaces)
  42594. children = children.filter(isNotTextNode);
  42595. /* istanbul ignore if */
  42596. if (!children.length) {
  42597. return
  42598. }
  42599. // warn multiple elements
  42600. if (children.length > 1) {
  42601. warn(
  42602. '<transition> can only be used on a single element. Use ' +
  42603. '<transition-group> for lists.',
  42604. this.$parent
  42605. );
  42606. }
  42607. var mode = this.mode;
  42608. // warn invalid mode
  42609. if (mode && mode !== 'in-out' && mode !== 'out-in'
  42610. ) {
  42611. warn(
  42612. 'invalid <transition> mode: ' + mode,
  42613. this.$parent
  42614. );
  42615. }
  42616. var rawChild = children[0];
  42617. // if this is a component root node and the component's
  42618. // parent container node also has transition, skip.
  42619. if (hasParentTransition(this.$vnode)) {
  42620. return rawChild
  42621. }
  42622. // apply transition data to child
  42623. // use getRealChild() to ignore abstract components e.g. keep-alive
  42624. var child = getRealChild(rawChild);
  42625. /* istanbul ignore if */
  42626. if (!child) {
  42627. return rawChild
  42628. }
  42629. if (this._leaving) {
  42630. return placeholder(h, rawChild)
  42631. }
  42632. // ensure a key that is unique to the vnode type and to this transition
  42633. // component instance. This key will be used to remove pending leaving nodes
  42634. // during entering.
  42635. var id = "__transition-" + (this._uid) + "-";
  42636. child.key = child.key == null
  42637. ? child.isComment
  42638. ? id + 'comment'
  42639. : id + child.tag
  42640. : isPrimitive(child.key)
  42641. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  42642. : child.key;
  42643. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  42644. var oldRawChild = this._vnode;
  42645. var oldChild = getRealChild(oldRawChild);
  42646. // mark v-show
  42647. // so that the transition module can hand over the control to the directive
  42648. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  42649. child.data.show = true;
  42650. }
  42651. if (
  42652. oldChild &&
  42653. oldChild.data &&
  42654. !isSameChild(child, oldChild) &&
  42655. !isAsyncPlaceholder(oldChild) &&
  42656. // #6687 component root is a comment node
  42657. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  42658. ) {
  42659. // replace old child transition data with fresh one
  42660. // important for dynamic transitions!
  42661. var oldData = oldChild.data.transition = extend({}, data);
  42662. // handle transition mode
  42663. if (mode === 'out-in') {
  42664. // return placeholder node and queue update when leave finishes
  42665. this._leaving = true;
  42666. mergeVNodeHook(oldData, 'afterLeave', function () {
  42667. this$1._leaving = false;
  42668. this$1.$forceUpdate();
  42669. });
  42670. return placeholder(h, rawChild)
  42671. } else if (mode === 'in-out') {
  42672. if (isAsyncPlaceholder(child)) {
  42673. return oldRawChild
  42674. }
  42675. var delayedLeave;
  42676. var performLeave = function () { delayedLeave(); };
  42677. mergeVNodeHook(data, 'afterEnter', performLeave);
  42678. mergeVNodeHook(data, 'enterCancelled', performLeave);
  42679. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  42680. }
  42681. }
  42682. return rawChild
  42683. }
  42684. };
  42685. /* */
  42686. var props = extend({
  42687. tag: String,
  42688. moveClass: String
  42689. }, transitionProps);
  42690. delete props.mode;
  42691. var TransitionGroup = {
  42692. props: props,
  42693. beforeMount: function beforeMount () {
  42694. var this$1 = this;
  42695. var update = this._update;
  42696. this._update = function (vnode, hydrating) {
  42697. var restoreActiveInstance = setActiveInstance(this$1);
  42698. // force removing pass
  42699. this$1.__patch__(
  42700. this$1._vnode,
  42701. this$1.kept,
  42702. false, // hydrating
  42703. true // removeOnly (!important, avoids unnecessary moves)
  42704. );
  42705. this$1._vnode = this$1.kept;
  42706. restoreActiveInstance();
  42707. update.call(this$1, vnode, hydrating);
  42708. };
  42709. },
  42710. render: function render (h) {
  42711. var tag = this.tag || this.$vnode.data.tag || 'span';
  42712. var map = Object.create(null);
  42713. var prevChildren = this.prevChildren = this.children;
  42714. var rawChildren = this.$slots.default || [];
  42715. var children = this.children = [];
  42716. var transitionData = extractTransitionData(this);
  42717. for (var i = 0; i < rawChildren.length; i++) {
  42718. var c = rawChildren[i];
  42719. if (c.tag) {
  42720. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  42721. children.push(c);
  42722. map[c.key] = c
  42723. ;(c.data || (c.data = {})).transition = transitionData;
  42724. } else {
  42725. var opts = c.componentOptions;
  42726. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  42727. warn(("<transition-group> children must be keyed: <" + name + ">"));
  42728. }
  42729. }
  42730. }
  42731. if (prevChildren) {
  42732. var kept = [];
  42733. var removed = [];
  42734. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  42735. var c$1 = prevChildren[i$1];
  42736. c$1.data.transition = transitionData;
  42737. c$1.data.pos = c$1.elm.getBoundingClientRect();
  42738. if (map[c$1.key]) {
  42739. kept.push(c$1);
  42740. } else {
  42741. removed.push(c$1);
  42742. }
  42743. }
  42744. this.kept = h(tag, null, kept);
  42745. this.removed = removed;
  42746. }
  42747. return h(tag, null, children)
  42748. },
  42749. updated: function updated () {
  42750. var children = this.prevChildren;
  42751. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  42752. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  42753. return
  42754. }
  42755. // we divide the work into three loops to avoid mixing DOM reads and writes
  42756. // in each iteration - which helps prevent layout thrashing.
  42757. children.forEach(callPendingCbs);
  42758. children.forEach(recordPosition);
  42759. children.forEach(applyTranslation);
  42760. // force reflow to put everything in position
  42761. // assign to this to avoid being removed in tree-shaking
  42762. // $flow-disable-line
  42763. this._reflow = document.body.offsetHeight;
  42764. children.forEach(function (c) {
  42765. if (c.data.moved) {
  42766. var el = c.elm;
  42767. var s = el.style;
  42768. addTransitionClass(el, moveClass);
  42769. s.transform = s.WebkitTransform = s.transitionDuration = '';
  42770. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  42771. if (e && e.target !== el) {
  42772. return
  42773. }
  42774. if (!e || /transform$/.test(e.propertyName)) {
  42775. el.removeEventListener(transitionEndEvent, cb);
  42776. el._moveCb = null;
  42777. removeTransitionClass(el, moveClass);
  42778. }
  42779. });
  42780. }
  42781. });
  42782. },
  42783. methods: {
  42784. hasMove: function hasMove (el, moveClass) {
  42785. /* istanbul ignore if */
  42786. if (!hasTransition) {
  42787. return false
  42788. }
  42789. /* istanbul ignore if */
  42790. if (this._hasMove) {
  42791. return this._hasMove
  42792. }
  42793. // Detect whether an element with the move class applied has
  42794. // CSS transitions. Since the element may be inside an entering
  42795. // transition at this very moment, we make a clone of it and remove
  42796. // all other transition classes applied to ensure only the move class
  42797. // is applied.
  42798. var clone = el.cloneNode();
  42799. if (el._transitionClasses) {
  42800. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  42801. }
  42802. addClass(clone, moveClass);
  42803. clone.style.display = 'none';
  42804. this.$el.appendChild(clone);
  42805. var info = getTransitionInfo(clone);
  42806. this.$el.removeChild(clone);
  42807. return (this._hasMove = info.hasTransform)
  42808. }
  42809. }
  42810. };
  42811. function callPendingCbs (c) {
  42812. /* istanbul ignore if */
  42813. if (c.elm._moveCb) {
  42814. c.elm._moveCb();
  42815. }
  42816. /* istanbul ignore if */
  42817. if (c.elm._enterCb) {
  42818. c.elm._enterCb();
  42819. }
  42820. }
  42821. function recordPosition (c) {
  42822. c.data.newPos = c.elm.getBoundingClientRect();
  42823. }
  42824. function applyTranslation (c) {
  42825. var oldPos = c.data.pos;
  42826. var newPos = c.data.newPos;
  42827. var dx = oldPos.left - newPos.left;
  42828. var dy = oldPos.top - newPos.top;
  42829. if (dx || dy) {
  42830. c.data.moved = true;
  42831. var s = c.elm.style;
  42832. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  42833. s.transitionDuration = '0s';
  42834. }
  42835. }
  42836. var platformComponents = {
  42837. Transition: Transition,
  42838. TransitionGroup: TransitionGroup
  42839. };
  42840. /* */
  42841. // install platform specific utils
  42842. Vue.config.mustUseProp = mustUseProp;
  42843. Vue.config.isReservedTag = isReservedTag;
  42844. Vue.config.isReservedAttr = isReservedAttr;
  42845. Vue.config.getTagNamespace = getTagNamespace;
  42846. Vue.config.isUnknownElement = isUnknownElement;
  42847. // install platform runtime directives & components
  42848. extend(Vue.options.directives, platformDirectives);
  42849. extend(Vue.options.components, platformComponents);
  42850. // install platform patch function
  42851. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  42852. // public mount method
  42853. Vue.prototype.$mount = function (
  42854. el,
  42855. hydrating
  42856. ) {
  42857. el = el && inBrowser ? query(el) : undefined;
  42858. return mountComponent(this, el, hydrating)
  42859. };
  42860. // devtools global hook
  42861. /* istanbul ignore next */
  42862. if (inBrowser) {
  42863. setTimeout(function () {
  42864. if (config.devtools) {
  42865. if (devtools) {
  42866. devtools.emit('init', Vue);
  42867. } else {
  42868. console[console.info ? 'info' : 'log'](
  42869. 'Download the Vue Devtools extension for a better development experience:\n' +
  42870. 'https://github.com/vuejs/vue-devtools'
  42871. );
  42872. }
  42873. }
  42874. if (config.productionTip !== false &&
  42875. typeof console !== 'undefined'
  42876. ) {
  42877. console[console.info ? 'info' : 'log'](
  42878. "You are running Vue in development mode.\n" +
  42879. "Make sure to turn on production mode when deploying for production.\n" +
  42880. "See more tips at https://vuejs.org/guide/deployment.html"
  42881. );
  42882. }
  42883. }, 0);
  42884. }
  42885. /* */
  42886. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  42887. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  42888. var buildRegex = cached(function (delimiters) {
  42889. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  42890. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  42891. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  42892. });
  42893. function parseText (
  42894. text,
  42895. delimiters
  42896. ) {
  42897. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  42898. if (!tagRE.test(text)) {
  42899. return
  42900. }
  42901. var tokens = [];
  42902. var rawTokens = [];
  42903. var lastIndex = tagRE.lastIndex = 0;
  42904. var match, index, tokenValue;
  42905. while ((match = tagRE.exec(text))) {
  42906. index = match.index;
  42907. // push text token
  42908. if (index > lastIndex) {
  42909. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  42910. tokens.push(JSON.stringify(tokenValue));
  42911. }
  42912. // tag token
  42913. var exp = parseFilters(match[1].trim());
  42914. tokens.push(("_s(" + exp + ")"));
  42915. rawTokens.push({ '@binding': exp });
  42916. lastIndex = index + match[0].length;
  42917. }
  42918. if (lastIndex < text.length) {
  42919. rawTokens.push(tokenValue = text.slice(lastIndex));
  42920. tokens.push(JSON.stringify(tokenValue));
  42921. }
  42922. return {
  42923. expression: tokens.join('+'),
  42924. tokens: rawTokens
  42925. }
  42926. }
  42927. /* */
  42928. function transformNode (el, options) {
  42929. var warn = options.warn || baseWarn;
  42930. var staticClass = getAndRemoveAttr(el, 'class');
  42931. if (staticClass) {
  42932. var res = parseText(staticClass, options.delimiters);
  42933. if (res) {
  42934. warn(
  42935. "class=\"" + staticClass + "\": " +
  42936. 'Interpolation inside attributes has been removed. ' +
  42937. 'Use v-bind or the colon shorthand instead. For example, ' +
  42938. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  42939. el.rawAttrsMap['class']
  42940. );
  42941. }
  42942. }
  42943. if (staticClass) {
  42944. el.staticClass = JSON.stringify(staticClass);
  42945. }
  42946. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  42947. if (classBinding) {
  42948. el.classBinding = classBinding;
  42949. }
  42950. }
  42951. function genData (el) {
  42952. var data = '';
  42953. if (el.staticClass) {
  42954. data += "staticClass:" + (el.staticClass) + ",";
  42955. }
  42956. if (el.classBinding) {
  42957. data += "class:" + (el.classBinding) + ",";
  42958. }
  42959. return data
  42960. }
  42961. var klass$1 = {
  42962. staticKeys: ['staticClass'],
  42963. transformNode: transformNode,
  42964. genData: genData
  42965. };
  42966. /* */
  42967. function transformNode$1 (el, options) {
  42968. var warn = options.warn || baseWarn;
  42969. var staticStyle = getAndRemoveAttr(el, 'style');
  42970. if (staticStyle) {
  42971. /* istanbul ignore if */
  42972. {
  42973. var res = parseText(staticStyle, options.delimiters);
  42974. if (res) {
  42975. warn(
  42976. "style=\"" + staticStyle + "\": " +
  42977. 'Interpolation inside attributes has been removed. ' +
  42978. 'Use v-bind or the colon shorthand instead. For example, ' +
  42979. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  42980. el.rawAttrsMap['style']
  42981. );
  42982. }
  42983. }
  42984. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  42985. }
  42986. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  42987. if (styleBinding) {
  42988. el.styleBinding = styleBinding;
  42989. }
  42990. }
  42991. function genData$1 (el) {
  42992. var data = '';
  42993. if (el.staticStyle) {
  42994. data += "staticStyle:" + (el.staticStyle) + ",";
  42995. }
  42996. if (el.styleBinding) {
  42997. data += "style:(" + (el.styleBinding) + "),";
  42998. }
  42999. return data
  43000. }
  43001. var style$1 = {
  43002. staticKeys: ['staticStyle'],
  43003. transformNode: transformNode$1,
  43004. genData: genData$1
  43005. };
  43006. /* */
  43007. var decoder;
  43008. var he = {
  43009. decode: function decode (html) {
  43010. decoder = decoder || document.createElement('div');
  43011. decoder.innerHTML = html;
  43012. return decoder.textContent
  43013. }
  43014. };
  43015. /* */
  43016. var isUnaryTag = makeMap(
  43017. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  43018. 'link,meta,param,source,track,wbr'
  43019. );
  43020. // Elements that you can, intentionally, leave open
  43021. // (and which close themselves)
  43022. var canBeLeftOpenTag = makeMap(
  43023. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  43024. );
  43025. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  43026. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  43027. var isNonPhrasingTag = makeMap(
  43028. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  43029. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  43030. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  43031. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  43032. 'title,tr,track'
  43033. );
  43034. /**
  43035. * Not type-checking this file because it's mostly vendor code.
  43036. */
  43037. // Regular Expressions for parsing tags and attributes
  43038. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  43039. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  43040. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  43041. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  43042. var startTagOpen = new RegExp(("^<" + qnameCapture));
  43043. var startTagClose = /^\s*(\/?)>/;
  43044. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  43045. var doctype = /^<!DOCTYPE [^>]+>/i;
  43046. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  43047. var comment = /^<!\--/;
  43048. var conditionalComment = /^<!\[/;
  43049. // Special Elements (can contain anything)
  43050. var isPlainTextElement = makeMap('script,style,textarea', true);
  43051. var reCache = {};
  43052. var decodingMap = {
  43053. '&lt;': '<',
  43054. '&gt;': '>',
  43055. '&quot;': '"',
  43056. '&amp;': '&',
  43057. '&#10;': '\n',
  43058. '&#9;': '\t',
  43059. '&#39;': "'"
  43060. };
  43061. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  43062. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  43063. // #5992
  43064. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  43065. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  43066. function decodeAttr (value, shouldDecodeNewlines) {
  43067. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  43068. return value.replace(re, function (match) { return decodingMap[match]; })
  43069. }
  43070. function parseHTML (html, options) {
  43071. var stack = [];
  43072. var expectHTML = options.expectHTML;
  43073. var isUnaryTag$$1 = options.isUnaryTag || no;
  43074. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  43075. var index = 0;
  43076. var last, lastTag;
  43077. while (html) {
  43078. last = html;
  43079. // Make sure we're not in a plaintext content element like script/style
  43080. if (!lastTag || !isPlainTextElement(lastTag)) {
  43081. var textEnd = html.indexOf('<');
  43082. if (textEnd === 0) {
  43083. // Comment:
  43084. if (comment.test(html)) {
  43085. var commentEnd = html.indexOf('-->');
  43086. if (commentEnd >= 0) {
  43087. if (options.shouldKeepComment) {
  43088. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  43089. }
  43090. advance(commentEnd + 3);
  43091. continue
  43092. }
  43093. }
  43094. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  43095. if (conditionalComment.test(html)) {
  43096. var conditionalEnd = html.indexOf(']>');
  43097. if (conditionalEnd >= 0) {
  43098. advance(conditionalEnd + 2);
  43099. continue
  43100. }
  43101. }
  43102. // Doctype:
  43103. var doctypeMatch = html.match(doctype);
  43104. if (doctypeMatch) {
  43105. advance(doctypeMatch[0].length);
  43106. continue
  43107. }
  43108. // End tag:
  43109. var endTagMatch = html.match(endTag);
  43110. if (endTagMatch) {
  43111. var curIndex = index;
  43112. advance(endTagMatch[0].length);
  43113. parseEndTag(endTagMatch[1], curIndex, index);
  43114. continue
  43115. }
  43116. // Start tag:
  43117. var startTagMatch = parseStartTag();
  43118. if (startTagMatch) {
  43119. handleStartTag(startTagMatch);
  43120. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  43121. advance(1);
  43122. }
  43123. continue
  43124. }
  43125. }
  43126. var text = (void 0), rest = (void 0), next = (void 0);
  43127. if (textEnd >= 0) {
  43128. rest = html.slice(textEnd);
  43129. while (
  43130. !endTag.test(rest) &&
  43131. !startTagOpen.test(rest) &&
  43132. !comment.test(rest) &&
  43133. !conditionalComment.test(rest)
  43134. ) {
  43135. // < in plain text, be forgiving and treat it as text
  43136. next = rest.indexOf('<', 1);
  43137. if (next < 0) { break }
  43138. textEnd += next;
  43139. rest = html.slice(textEnd);
  43140. }
  43141. text = html.substring(0, textEnd);
  43142. }
  43143. if (textEnd < 0) {
  43144. text = html;
  43145. }
  43146. if (text) {
  43147. advance(text.length);
  43148. }
  43149. if (options.chars && text) {
  43150. options.chars(text, index - text.length, index);
  43151. }
  43152. } else {
  43153. var endTagLength = 0;
  43154. var stackedTag = lastTag.toLowerCase();
  43155. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  43156. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  43157. endTagLength = endTag.length;
  43158. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  43159. text = text
  43160. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  43161. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  43162. }
  43163. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  43164. text = text.slice(1);
  43165. }
  43166. if (options.chars) {
  43167. options.chars(text);
  43168. }
  43169. return ''
  43170. });
  43171. index += html.length - rest$1.length;
  43172. html = rest$1;
  43173. parseEndTag(stackedTag, index - endTagLength, index);
  43174. }
  43175. if (html === last) {
  43176. options.chars && options.chars(html);
  43177. if (!stack.length && options.warn) {
  43178. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  43179. }
  43180. break
  43181. }
  43182. }
  43183. // Clean up any remaining tags
  43184. parseEndTag();
  43185. function advance (n) {
  43186. index += n;
  43187. html = html.substring(n);
  43188. }
  43189. function parseStartTag () {
  43190. var start = html.match(startTagOpen);
  43191. if (start) {
  43192. var match = {
  43193. tagName: start[1],
  43194. attrs: [],
  43195. start: index
  43196. };
  43197. advance(start[0].length);
  43198. var end, attr;
  43199. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  43200. attr.start = index;
  43201. advance(attr[0].length);
  43202. attr.end = index;
  43203. match.attrs.push(attr);
  43204. }
  43205. if (end) {
  43206. match.unarySlash = end[1];
  43207. advance(end[0].length);
  43208. match.end = index;
  43209. return match
  43210. }
  43211. }
  43212. }
  43213. function handleStartTag (match) {
  43214. var tagName = match.tagName;
  43215. var unarySlash = match.unarySlash;
  43216. if (expectHTML) {
  43217. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  43218. parseEndTag(lastTag);
  43219. }
  43220. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  43221. parseEndTag(tagName);
  43222. }
  43223. }
  43224. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  43225. var l = match.attrs.length;
  43226. var attrs = new Array(l);
  43227. for (var i = 0; i < l; i++) {
  43228. var args = match.attrs[i];
  43229. var value = args[3] || args[4] || args[5] || '';
  43230. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  43231. ? options.shouldDecodeNewlinesForHref
  43232. : options.shouldDecodeNewlines;
  43233. attrs[i] = {
  43234. name: args[1],
  43235. value: decodeAttr(value, shouldDecodeNewlines)
  43236. };
  43237. if (options.outputSourceRange) {
  43238. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  43239. attrs[i].end = args.end;
  43240. }
  43241. }
  43242. if (!unary) {
  43243. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  43244. lastTag = tagName;
  43245. }
  43246. if (options.start) {
  43247. options.start(tagName, attrs, unary, match.start, match.end);
  43248. }
  43249. }
  43250. function parseEndTag (tagName, start, end) {
  43251. var pos, lowerCasedTagName;
  43252. if (start == null) { start = index; }
  43253. if (end == null) { end = index; }
  43254. // Find the closest opened tag of the same type
  43255. if (tagName) {
  43256. lowerCasedTagName = tagName.toLowerCase();
  43257. for (pos = stack.length - 1; pos >= 0; pos--) {
  43258. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  43259. break
  43260. }
  43261. }
  43262. } else {
  43263. // If no tag name is provided, clean shop
  43264. pos = 0;
  43265. }
  43266. if (pos >= 0) {
  43267. // Close all the open elements, up the stack
  43268. for (var i = stack.length - 1; i >= pos; i--) {
  43269. if (i > pos || !tagName &&
  43270. options.warn
  43271. ) {
  43272. options.warn(
  43273. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  43274. { start: stack[i].start, end: stack[i].end }
  43275. );
  43276. }
  43277. if (options.end) {
  43278. options.end(stack[i].tag, start, end);
  43279. }
  43280. }
  43281. // Remove the open elements from the stack
  43282. stack.length = pos;
  43283. lastTag = pos && stack[pos - 1].tag;
  43284. } else if (lowerCasedTagName === 'br') {
  43285. if (options.start) {
  43286. options.start(tagName, [], true, start, end);
  43287. }
  43288. } else if (lowerCasedTagName === 'p') {
  43289. if (options.start) {
  43290. options.start(tagName, [], false, start, end);
  43291. }
  43292. if (options.end) {
  43293. options.end(tagName, start, end);
  43294. }
  43295. }
  43296. }
  43297. }
  43298. /* */
  43299. var onRE = /^@|^v-on:/;
  43300. var dirRE = /^v-|^@|^:|^#/;
  43301. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  43302. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  43303. var stripParensRE = /^\(|\)$/g;
  43304. var dynamicArgRE = /^\[.*\]$/;
  43305. var argRE = /:(.*)$/;
  43306. var bindRE = /^:|^\.|^v-bind:/;
  43307. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  43308. var slotRE = /^v-slot(:|$)|^#/;
  43309. var lineBreakRE = /[\r\n]/;
  43310. var whitespaceRE$1 = /[ \f\t\r\n]+/g;
  43311. var invalidAttributeRE = /[\s"'<>\/=]/;
  43312. var decodeHTMLCached = cached(he.decode);
  43313. var emptySlotScopeToken = "_empty_";
  43314. // configurable state
  43315. var warn$2;
  43316. var delimiters;
  43317. var transforms;
  43318. var preTransforms;
  43319. var postTransforms;
  43320. var platformIsPreTag;
  43321. var platformMustUseProp;
  43322. var platformGetTagNamespace;
  43323. var maybeComponent;
  43324. function createASTElement (
  43325. tag,
  43326. attrs,
  43327. parent
  43328. ) {
  43329. return {
  43330. type: 1,
  43331. tag: tag,
  43332. attrsList: attrs,
  43333. attrsMap: makeAttrsMap(attrs),
  43334. rawAttrsMap: {},
  43335. parent: parent,
  43336. children: []
  43337. }
  43338. }
  43339. /**
  43340. * Convert HTML string to AST.
  43341. */
  43342. function parse (
  43343. template,
  43344. options
  43345. ) {
  43346. warn$2 = options.warn || baseWarn;
  43347. platformIsPreTag = options.isPreTag || no;
  43348. platformMustUseProp = options.mustUseProp || no;
  43349. platformGetTagNamespace = options.getTagNamespace || no;
  43350. var isReservedTag = options.isReservedTag || no;
  43351. maybeComponent = function (el) { return !!(
  43352. el.component ||
  43353. el.attrsMap[':is'] ||
  43354. el.attrsMap['v-bind:is'] ||
  43355. !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
  43356. ); };
  43357. transforms = pluckModuleFunction(options.modules, 'transformNode');
  43358. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  43359. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  43360. delimiters = options.delimiters;
  43361. var stack = [];
  43362. var preserveWhitespace = options.preserveWhitespace !== false;
  43363. var whitespaceOption = options.whitespace;
  43364. var root;
  43365. var currentParent;
  43366. var inVPre = false;
  43367. var inPre = false;
  43368. var warned = false;
  43369. function warnOnce (msg, range) {
  43370. if (!warned) {
  43371. warned = true;
  43372. warn$2(msg, range);
  43373. }
  43374. }
  43375. function closeElement (element) {
  43376. trimEndingWhitespace(element);
  43377. if (!inVPre && !element.processed) {
  43378. element = processElement(element, options);
  43379. }
  43380. // tree management
  43381. if (!stack.length && element !== root) {
  43382. // allow root elements with v-if, v-else-if and v-else
  43383. if (root.if && (element.elseif || element.else)) {
  43384. {
  43385. checkRootConstraints(element);
  43386. }
  43387. addIfCondition(root, {
  43388. exp: element.elseif,
  43389. block: element
  43390. });
  43391. } else {
  43392. warnOnce(
  43393. "Component template should contain exactly one root element. " +
  43394. "If you are using v-if on multiple elements, " +
  43395. "use v-else-if to chain them instead.",
  43396. { start: element.start }
  43397. );
  43398. }
  43399. }
  43400. if (currentParent && !element.forbidden) {
  43401. if (element.elseif || element.else) {
  43402. processIfConditions(element, currentParent);
  43403. } else {
  43404. if (element.slotScope) {
  43405. // scoped slot
  43406. // keep it in the children list so that v-else(-if) conditions can
  43407. // find it as the prev node.
  43408. var name = element.slotTarget || '"default"'
  43409. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  43410. }
  43411. currentParent.children.push(element);
  43412. element.parent = currentParent;
  43413. }
  43414. }
  43415. // final children cleanup
  43416. // filter out scoped slots
  43417. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  43418. // remove trailing whitespace node again
  43419. trimEndingWhitespace(element);
  43420. // check pre state
  43421. if (element.pre) {
  43422. inVPre = false;
  43423. }
  43424. if (platformIsPreTag(element.tag)) {
  43425. inPre = false;
  43426. }
  43427. // apply post-transforms
  43428. for (var i = 0; i < postTransforms.length; i++) {
  43429. postTransforms[i](element, options);
  43430. }
  43431. }
  43432. function trimEndingWhitespace (el) {
  43433. // remove trailing whitespace node
  43434. if (!inPre) {
  43435. var lastNode;
  43436. while (
  43437. (lastNode = el.children[el.children.length - 1]) &&
  43438. lastNode.type === 3 &&
  43439. lastNode.text === ' '
  43440. ) {
  43441. el.children.pop();
  43442. }
  43443. }
  43444. }
  43445. function checkRootConstraints (el) {
  43446. if (el.tag === 'slot' || el.tag === 'template') {
  43447. warnOnce(
  43448. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  43449. 'contain multiple nodes.',
  43450. { start: el.start }
  43451. );
  43452. }
  43453. if (el.attrsMap.hasOwnProperty('v-for')) {
  43454. warnOnce(
  43455. 'Cannot use v-for on stateful component root element because ' +
  43456. 'it renders multiple elements.',
  43457. el.rawAttrsMap['v-for']
  43458. );
  43459. }
  43460. }
  43461. parseHTML(template, {
  43462. warn: warn$2,
  43463. expectHTML: options.expectHTML,
  43464. isUnaryTag: options.isUnaryTag,
  43465. canBeLeftOpenTag: options.canBeLeftOpenTag,
  43466. shouldDecodeNewlines: options.shouldDecodeNewlines,
  43467. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  43468. shouldKeepComment: options.comments,
  43469. outputSourceRange: options.outputSourceRange,
  43470. start: function start (tag, attrs, unary, start$1, end) {
  43471. // check namespace.
  43472. // inherit parent ns if there is one
  43473. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  43474. // handle IE svg bug
  43475. /* istanbul ignore if */
  43476. if (isIE && ns === 'svg') {
  43477. attrs = guardIESVGBug(attrs);
  43478. }
  43479. var element = createASTElement(tag, attrs, currentParent);
  43480. if (ns) {
  43481. element.ns = ns;
  43482. }
  43483. {
  43484. if (options.outputSourceRange) {
  43485. element.start = start$1;
  43486. element.end = end;
  43487. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  43488. cumulated[attr.name] = attr;
  43489. return cumulated
  43490. }, {});
  43491. }
  43492. attrs.forEach(function (attr) {
  43493. if (invalidAttributeRE.test(attr.name)) {
  43494. warn$2(
  43495. "Invalid dynamic argument expression: attribute names cannot contain " +
  43496. "spaces, quotes, <, >, / or =.",
  43497. {
  43498. start: attr.start + attr.name.indexOf("["),
  43499. end: attr.start + attr.name.length
  43500. }
  43501. );
  43502. }
  43503. });
  43504. }
  43505. if (isForbiddenTag(element) && !isServerRendering()) {
  43506. element.forbidden = true;
  43507. warn$2(
  43508. 'Templates should only be responsible for mapping the state to the ' +
  43509. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  43510. "<" + tag + ">" + ', as they will not be parsed.',
  43511. { start: element.start }
  43512. );
  43513. }
  43514. // apply pre-transforms
  43515. for (var i = 0; i < preTransforms.length; i++) {
  43516. element = preTransforms[i](element, options) || element;
  43517. }
  43518. if (!inVPre) {
  43519. processPre(element);
  43520. if (element.pre) {
  43521. inVPre = true;
  43522. }
  43523. }
  43524. if (platformIsPreTag(element.tag)) {
  43525. inPre = true;
  43526. }
  43527. if (inVPre) {
  43528. processRawAttrs(element);
  43529. } else if (!element.processed) {
  43530. // structural directives
  43531. processFor(element);
  43532. processIf(element);
  43533. processOnce(element);
  43534. }
  43535. if (!root) {
  43536. root = element;
  43537. {
  43538. checkRootConstraints(root);
  43539. }
  43540. }
  43541. if (!unary) {
  43542. currentParent = element;
  43543. stack.push(element);
  43544. } else {
  43545. closeElement(element);
  43546. }
  43547. },
  43548. end: function end (tag, start, end$1) {
  43549. var element = stack[stack.length - 1];
  43550. // pop stack
  43551. stack.length -= 1;
  43552. currentParent = stack[stack.length - 1];
  43553. if (options.outputSourceRange) {
  43554. element.end = end$1;
  43555. }
  43556. closeElement(element);
  43557. },
  43558. chars: function chars (text, start, end) {
  43559. if (!currentParent) {
  43560. {
  43561. if (text === template) {
  43562. warnOnce(
  43563. 'Component template requires a root element, rather than just text.',
  43564. { start: start }
  43565. );
  43566. } else if ((text = text.trim())) {
  43567. warnOnce(
  43568. ("text \"" + text + "\" outside root element will be ignored."),
  43569. { start: start }
  43570. );
  43571. }
  43572. }
  43573. return
  43574. }
  43575. // IE textarea placeholder bug
  43576. /* istanbul ignore if */
  43577. if (isIE &&
  43578. currentParent.tag === 'textarea' &&
  43579. currentParent.attrsMap.placeholder === text
  43580. ) {
  43581. return
  43582. }
  43583. var children = currentParent.children;
  43584. if (inPre || text.trim()) {
  43585. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  43586. } else if (!children.length) {
  43587. // remove the whitespace-only node right after an opening tag
  43588. text = '';
  43589. } else if (whitespaceOption) {
  43590. if (whitespaceOption === 'condense') {
  43591. // in condense mode, remove the whitespace node if it contains
  43592. // line break, otherwise condense to a single space
  43593. text = lineBreakRE.test(text) ? '' : ' ';
  43594. } else {
  43595. text = ' ';
  43596. }
  43597. } else {
  43598. text = preserveWhitespace ? ' ' : '';
  43599. }
  43600. if (text) {
  43601. if (!inPre && whitespaceOption === 'condense') {
  43602. // condense consecutive whitespaces into single space
  43603. text = text.replace(whitespaceRE$1, ' ');
  43604. }
  43605. var res;
  43606. var child;
  43607. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  43608. child = {
  43609. type: 2,
  43610. expression: res.expression,
  43611. tokens: res.tokens,
  43612. text: text
  43613. };
  43614. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  43615. child = {
  43616. type: 3,
  43617. text: text
  43618. };
  43619. }
  43620. if (child) {
  43621. if (options.outputSourceRange) {
  43622. child.start = start;
  43623. child.end = end;
  43624. }
  43625. children.push(child);
  43626. }
  43627. }
  43628. },
  43629. comment: function comment (text, start, end) {
  43630. // adding anything as a sibling to the root node is forbidden
  43631. // comments should still be allowed, but ignored
  43632. if (currentParent) {
  43633. var child = {
  43634. type: 3,
  43635. text: text,
  43636. isComment: true
  43637. };
  43638. if (options.outputSourceRange) {
  43639. child.start = start;
  43640. child.end = end;
  43641. }
  43642. currentParent.children.push(child);
  43643. }
  43644. }
  43645. });
  43646. return root
  43647. }
  43648. function processPre (el) {
  43649. if (getAndRemoveAttr(el, 'v-pre') != null) {
  43650. el.pre = true;
  43651. }
  43652. }
  43653. function processRawAttrs (el) {
  43654. var list = el.attrsList;
  43655. var len = list.length;
  43656. if (len) {
  43657. var attrs = el.attrs = new Array(len);
  43658. for (var i = 0; i < len; i++) {
  43659. attrs[i] = {
  43660. name: list[i].name,
  43661. value: JSON.stringify(list[i].value)
  43662. };
  43663. if (list[i].start != null) {
  43664. attrs[i].start = list[i].start;
  43665. attrs[i].end = list[i].end;
  43666. }
  43667. }
  43668. } else if (!el.pre) {
  43669. // non root node in pre blocks with no attributes
  43670. el.plain = true;
  43671. }
  43672. }
  43673. function processElement (
  43674. element,
  43675. options
  43676. ) {
  43677. processKey(element);
  43678. // determine whether this is a plain element after
  43679. // removing structural attributes
  43680. element.plain = (
  43681. !element.key &&
  43682. !element.scopedSlots &&
  43683. !element.attrsList.length
  43684. );
  43685. processRef(element);
  43686. processSlotContent(element);
  43687. processSlotOutlet(element);
  43688. processComponent(element);
  43689. for (var i = 0; i < transforms.length; i++) {
  43690. element = transforms[i](element, options) || element;
  43691. }
  43692. processAttrs(element);
  43693. return element
  43694. }
  43695. function processKey (el) {
  43696. var exp = getBindingAttr(el, 'key');
  43697. if (exp) {
  43698. {
  43699. if (el.tag === 'template') {
  43700. warn$2(
  43701. "<template> cannot be keyed. Place the key on real elements instead.",
  43702. getRawBindingAttr(el, 'key')
  43703. );
  43704. }
  43705. if (el.for) {
  43706. var iterator = el.iterator2 || el.iterator1;
  43707. var parent = el.parent;
  43708. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  43709. warn$2(
  43710. "Do not use v-for index as key on <transition-group> children, " +
  43711. "this is the same as not using keys.",
  43712. getRawBindingAttr(el, 'key'),
  43713. true /* tip */
  43714. );
  43715. }
  43716. }
  43717. }
  43718. el.key = exp;
  43719. }
  43720. }
  43721. function processRef (el) {
  43722. var ref = getBindingAttr(el, 'ref');
  43723. if (ref) {
  43724. el.ref = ref;
  43725. el.refInFor = checkInFor(el);
  43726. }
  43727. }
  43728. function processFor (el) {
  43729. var exp;
  43730. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  43731. var res = parseFor(exp);
  43732. if (res) {
  43733. extend(el, res);
  43734. } else {
  43735. warn$2(
  43736. ("Invalid v-for expression: " + exp),
  43737. el.rawAttrsMap['v-for']
  43738. );
  43739. }
  43740. }
  43741. }
  43742. function parseFor (exp) {
  43743. var inMatch = exp.match(forAliasRE);
  43744. if (!inMatch) { return }
  43745. var res = {};
  43746. res.for = inMatch[2].trim();
  43747. var alias = inMatch[1].trim().replace(stripParensRE, '');
  43748. var iteratorMatch = alias.match(forIteratorRE);
  43749. if (iteratorMatch) {
  43750. res.alias = alias.replace(forIteratorRE, '').trim();
  43751. res.iterator1 = iteratorMatch[1].trim();
  43752. if (iteratorMatch[2]) {
  43753. res.iterator2 = iteratorMatch[2].trim();
  43754. }
  43755. } else {
  43756. res.alias = alias;
  43757. }
  43758. return res
  43759. }
  43760. function processIf (el) {
  43761. var exp = getAndRemoveAttr(el, 'v-if');
  43762. if (exp) {
  43763. el.if = exp;
  43764. addIfCondition(el, {
  43765. exp: exp,
  43766. block: el
  43767. });
  43768. } else {
  43769. if (getAndRemoveAttr(el, 'v-else') != null) {
  43770. el.else = true;
  43771. }
  43772. var elseif = getAndRemoveAttr(el, 'v-else-if');
  43773. if (elseif) {
  43774. el.elseif = elseif;
  43775. }
  43776. }
  43777. }
  43778. function processIfConditions (el, parent) {
  43779. var prev = findPrevElement(parent.children);
  43780. if (prev && prev.if) {
  43781. addIfCondition(prev, {
  43782. exp: el.elseif,
  43783. block: el
  43784. });
  43785. } else {
  43786. warn$2(
  43787. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  43788. "used on element <" + (el.tag) + "> without corresponding v-if.",
  43789. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  43790. );
  43791. }
  43792. }
  43793. function findPrevElement (children) {
  43794. var i = children.length;
  43795. while (i--) {
  43796. if (children[i].type === 1) {
  43797. return children[i]
  43798. } else {
  43799. if (children[i].text !== ' ') {
  43800. warn$2(
  43801. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  43802. "will be ignored.",
  43803. children[i]
  43804. );
  43805. }
  43806. children.pop();
  43807. }
  43808. }
  43809. }
  43810. function addIfCondition (el, condition) {
  43811. if (!el.ifConditions) {
  43812. el.ifConditions = [];
  43813. }
  43814. el.ifConditions.push(condition);
  43815. }
  43816. function processOnce (el) {
  43817. var once$$1 = getAndRemoveAttr(el, 'v-once');
  43818. if (once$$1 != null) {
  43819. el.once = true;
  43820. }
  43821. }
  43822. // handle content being passed to a component as slot,
  43823. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  43824. function processSlotContent (el) {
  43825. var slotScope;
  43826. if (el.tag === 'template') {
  43827. slotScope = getAndRemoveAttr(el, 'scope');
  43828. /* istanbul ignore if */
  43829. if (slotScope) {
  43830. warn$2(
  43831. "the \"scope\" attribute for scoped slots have been deprecated and " +
  43832. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  43833. "can also be used on plain elements in addition to <template> to " +
  43834. "denote scoped slots.",
  43835. el.rawAttrsMap['scope'],
  43836. true
  43837. );
  43838. }
  43839. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  43840. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  43841. /* istanbul ignore if */
  43842. if (el.attrsMap['v-for']) {
  43843. warn$2(
  43844. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  43845. "(v-for takes higher priority). Use a wrapper <template> for the " +
  43846. "scoped slot to make it clearer.",
  43847. el.rawAttrsMap['slot-scope'],
  43848. true
  43849. );
  43850. }
  43851. el.slotScope = slotScope;
  43852. }
  43853. // slot="xxx"
  43854. var slotTarget = getBindingAttr(el, 'slot');
  43855. if (slotTarget) {
  43856. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  43857. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  43858. // preserve slot as an attribute for native shadow DOM compat
  43859. // only for non-scoped slots.
  43860. if (el.tag !== 'template' && !el.slotScope) {
  43861. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  43862. }
  43863. }
  43864. // 2.6 v-slot syntax
  43865. {
  43866. if (el.tag === 'template') {
  43867. // v-slot on <template>
  43868. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  43869. if (slotBinding) {
  43870. {
  43871. if (el.slotTarget || el.slotScope) {
  43872. warn$2(
  43873. "Unexpected mixed usage of different slot syntaxes.",
  43874. el
  43875. );
  43876. }
  43877. if (el.parent && !maybeComponent(el.parent)) {
  43878. warn$2(
  43879. "<template v-slot> can only appear at the root level inside " +
  43880. "the receiving component",
  43881. el
  43882. );
  43883. }
  43884. }
  43885. var ref = getSlotName(slotBinding);
  43886. var name = ref.name;
  43887. var dynamic = ref.dynamic;
  43888. el.slotTarget = name;
  43889. el.slotTargetDynamic = dynamic;
  43890. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  43891. }
  43892. } else {
  43893. // v-slot on component, denotes default slot
  43894. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  43895. if (slotBinding$1) {
  43896. {
  43897. if (!maybeComponent(el)) {
  43898. warn$2(
  43899. "v-slot can only be used on components or <template>.",
  43900. slotBinding$1
  43901. );
  43902. }
  43903. if (el.slotScope || el.slotTarget) {
  43904. warn$2(
  43905. "Unexpected mixed usage of different slot syntaxes.",
  43906. el
  43907. );
  43908. }
  43909. if (el.scopedSlots) {
  43910. warn$2(
  43911. "To avoid scope ambiguity, the default slot should also use " +
  43912. "<template> syntax when there are other named slots.",
  43913. slotBinding$1
  43914. );
  43915. }
  43916. }
  43917. // add the component's children to its default slot
  43918. var slots = el.scopedSlots || (el.scopedSlots = {});
  43919. var ref$1 = getSlotName(slotBinding$1);
  43920. var name$1 = ref$1.name;
  43921. var dynamic$1 = ref$1.dynamic;
  43922. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  43923. slotContainer.slotTarget = name$1;
  43924. slotContainer.slotTargetDynamic = dynamic$1;
  43925. slotContainer.children = el.children.filter(function (c) {
  43926. if (!c.slotScope) {
  43927. c.parent = slotContainer;
  43928. return true
  43929. }
  43930. });
  43931. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  43932. // remove children as they are returned from scopedSlots now
  43933. el.children = [];
  43934. // mark el non-plain so data gets generated
  43935. el.plain = false;
  43936. }
  43937. }
  43938. }
  43939. }
  43940. function getSlotName (binding) {
  43941. var name = binding.name.replace(slotRE, '');
  43942. if (!name) {
  43943. if (binding.name[0] !== '#') {
  43944. name = 'default';
  43945. } else {
  43946. warn$2(
  43947. "v-slot shorthand syntax requires a slot name.",
  43948. binding
  43949. );
  43950. }
  43951. }
  43952. return dynamicArgRE.test(name)
  43953. // dynamic [name]
  43954. ? { name: name.slice(1, -1), dynamic: true }
  43955. // static name
  43956. : { name: ("\"" + name + "\""), dynamic: false }
  43957. }
  43958. // handle <slot/> outlets
  43959. function processSlotOutlet (el) {
  43960. if (el.tag === 'slot') {
  43961. el.slotName = getBindingAttr(el, 'name');
  43962. if (el.key) {
  43963. warn$2(
  43964. "`key` does not work on <slot> because slots are abstract outlets " +
  43965. "and can possibly expand into multiple elements. " +
  43966. "Use the key on a wrapping element instead.",
  43967. getRawBindingAttr(el, 'key')
  43968. );
  43969. }
  43970. }
  43971. }
  43972. function processComponent (el) {
  43973. var binding;
  43974. if ((binding = getBindingAttr(el, 'is'))) {
  43975. el.component = binding;
  43976. }
  43977. if (getAndRemoveAttr(el, 'inline-template') != null) {
  43978. el.inlineTemplate = true;
  43979. }
  43980. }
  43981. function processAttrs (el) {
  43982. var list = el.attrsList;
  43983. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  43984. for (i = 0, l = list.length; i < l; i++) {
  43985. name = rawName = list[i].name;
  43986. value = list[i].value;
  43987. if (dirRE.test(name)) {
  43988. // mark element as dynamic
  43989. el.hasBindings = true;
  43990. // modifiers
  43991. modifiers = parseModifiers(name.replace(dirRE, ''));
  43992. // support .foo shorthand syntax for the .prop modifier
  43993. if (modifiers) {
  43994. name = name.replace(modifierRE, '');
  43995. }
  43996. if (bindRE.test(name)) { // v-bind
  43997. name = name.replace(bindRE, '');
  43998. value = parseFilters(value);
  43999. isDynamic = dynamicArgRE.test(name);
  44000. if (isDynamic) {
  44001. name = name.slice(1, -1);
  44002. }
  44003. if (
  44004. value.trim().length === 0
  44005. ) {
  44006. warn$2(
  44007. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  44008. );
  44009. }
  44010. if (modifiers) {
  44011. if (modifiers.prop && !isDynamic) {
  44012. name = camelize(name);
  44013. if (name === 'innerHtml') { name = 'innerHTML'; }
  44014. }
  44015. if (modifiers.camel && !isDynamic) {
  44016. name = camelize(name);
  44017. }
  44018. if (modifiers.sync) {
  44019. syncGen = genAssignmentCode(value, "$event");
  44020. if (!isDynamic) {
  44021. addHandler(
  44022. el,
  44023. ("update:" + (camelize(name))),
  44024. syncGen,
  44025. null,
  44026. false,
  44027. warn$2,
  44028. list[i]
  44029. );
  44030. if (hyphenate(name) !== camelize(name)) {
  44031. addHandler(
  44032. el,
  44033. ("update:" + (hyphenate(name))),
  44034. syncGen,
  44035. null,
  44036. false,
  44037. warn$2,
  44038. list[i]
  44039. );
  44040. }
  44041. } else {
  44042. // handler w/ dynamic event name
  44043. addHandler(
  44044. el,
  44045. ("\"update:\"+(" + name + ")"),
  44046. syncGen,
  44047. null,
  44048. false,
  44049. warn$2,
  44050. list[i],
  44051. true // dynamic
  44052. );
  44053. }
  44054. }
  44055. }
  44056. if ((modifiers && modifiers.prop) || (
  44057. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  44058. )) {
  44059. addProp(el, name, value, list[i], isDynamic);
  44060. } else {
  44061. addAttr(el, name, value, list[i], isDynamic);
  44062. }
  44063. } else if (onRE.test(name)) { // v-on
  44064. name = name.replace(onRE, '');
  44065. isDynamic = dynamicArgRE.test(name);
  44066. if (isDynamic) {
  44067. name = name.slice(1, -1);
  44068. }
  44069. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  44070. } else { // normal directives
  44071. name = name.replace(dirRE, '');
  44072. // parse arg
  44073. var argMatch = name.match(argRE);
  44074. var arg = argMatch && argMatch[1];
  44075. isDynamic = false;
  44076. if (arg) {
  44077. name = name.slice(0, -(arg.length + 1));
  44078. if (dynamicArgRE.test(arg)) {
  44079. arg = arg.slice(1, -1);
  44080. isDynamic = true;
  44081. }
  44082. }
  44083. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  44084. if (name === 'model') {
  44085. checkForAliasModel(el, value);
  44086. }
  44087. }
  44088. } else {
  44089. // literal attribute
  44090. {
  44091. var res = parseText(value, delimiters);
  44092. if (res) {
  44093. warn$2(
  44094. name + "=\"" + value + "\": " +
  44095. 'Interpolation inside attributes has been removed. ' +
  44096. 'Use v-bind or the colon shorthand instead. For example, ' +
  44097. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  44098. list[i]
  44099. );
  44100. }
  44101. }
  44102. addAttr(el, name, JSON.stringify(value), list[i]);
  44103. // #6887 firefox doesn't update muted state if set via attribute
  44104. // even immediately after element creation
  44105. if (!el.component &&
  44106. name === 'muted' &&
  44107. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  44108. addProp(el, name, 'true', list[i]);
  44109. }
  44110. }
  44111. }
  44112. }
  44113. function checkInFor (el) {
  44114. var parent = el;
  44115. while (parent) {
  44116. if (parent.for !== undefined) {
  44117. return true
  44118. }
  44119. parent = parent.parent;
  44120. }
  44121. return false
  44122. }
  44123. function parseModifiers (name) {
  44124. var match = name.match(modifierRE);
  44125. if (match) {
  44126. var ret = {};
  44127. match.forEach(function (m) { ret[m.slice(1)] = true; });
  44128. return ret
  44129. }
  44130. }
  44131. function makeAttrsMap (attrs) {
  44132. var map = {};
  44133. for (var i = 0, l = attrs.length; i < l; i++) {
  44134. if (
  44135. map[attrs[i].name] && !isIE && !isEdge
  44136. ) {
  44137. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  44138. }
  44139. map[attrs[i].name] = attrs[i].value;
  44140. }
  44141. return map
  44142. }
  44143. // for script (e.g. type="x/template") or style, do not decode content
  44144. function isTextTag (el) {
  44145. return el.tag === 'script' || el.tag === 'style'
  44146. }
  44147. function isForbiddenTag (el) {
  44148. return (
  44149. el.tag === 'style' ||
  44150. (el.tag === 'script' && (
  44151. !el.attrsMap.type ||
  44152. el.attrsMap.type === 'text/javascript'
  44153. ))
  44154. )
  44155. }
  44156. var ieNSBug = /^xmlns:NS\d+/;
  44157. var ieNSPrefix = /^NS\d+:/;
  44158. /* istanbul ignore next */
  44159. function guardIESVGBug (attrs) {
  44160. var res = [];
  44161. for (var i = 0; i < attrs.length; i++) {
  44162. var attr = attrs[i];
  44163. if (!ieNSBug.test(attr.name)) {
  44164. attr.name = attr.name.replace(ieNSPrefix, '');
  44165. res.push(attr);
  44166. }
  44167. }
  44168. return res
  44169. }
  44170. function checkForAliasModel (el, value) {
  44171. var _el = el;
  44172. while (_el) {
  44173. if (_el.for && _el.alias === value) {
  44174. warn$2(
  44175. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  44176. "You are binding v-model directly to a v-for iteration alias. " +
  44177. "This will not be able to modify the v-for source array because " +
  44178. "writing to the alias is like modifying a function local variable. " +
  44179. "Consider using an array of objects and use v-model on an object property instead.",
  44180. el.rawAttrsMap['v-model']
  44181. );
  44182. }
  44183. _el = _el.parent;
  44184. }
  44185. }
  44186. /* */
  44187. function preTransformNode (el, options) {
  44188. if (el.tag === 'input') {
  44189. var map = el.attrsMap;
  44190. if (!map['v-model']) {
  44191. return
  44192. }
  44193. var typeBinding;
  44194. if (map[':type'] || map['v-bind:type']) {
  44195. typeBinding = getBindingAttr(el, 'type');
  44196. }
  44197. if (!map.type && !typeBinding && map['v-bind']) {
  44198. typeBinding = "(" + (map['v-bind']) + ").type";
  44199. }
  44200. if (typeBinding) {
  44201. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  44202. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  44203. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  44204. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  44205. // 1. checkbox
  44206. var branch0 = cloneASTElement(el);
  44207. // process for on the main node
  44208. processFor(branch0);
  44209. addRawAttr(branch0, 'type', 'checkbox');
  44210. processElement(branch0, options);
  44211. branch0.processed = true; // prevent it from double-processed
  44212. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  44213. addIfCondition(branch0, {
  44214. exp: branch0.if,
  44215. block: branch0
  44216. });
  44217. // 2. add radio else-if condition
  44218. var branch1 = cloneASTElement(el);
  44219. getAndRemoveAttr(branch1, 'v-for', true);
  44220. addRawAttr(branch1, 'type', 'radio');
  44221. processElement(branch1, options);
  44222. addIfCondition(branch0, {
  44223. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  44224. block: branch1
  44225. });
  44226. // 3. other
  44227. var branch2 = cloneASTElement(el);
  44228. getAndRemoveAttr(branch2, 'v-for', true);
  44229. addRawAttr(branch2, ':type', typeBinding);
  44230. processElement(branch2, options);
  44231. addIfCondition(branch0, {
  44232. exp: ifCondition,
  44233. block: branch2
  44234. });
  44235. if (hasElse) {
  44236. branch0.else = true;
  44237. } else if (elseIfCondition) {
  44238. branch0.elseif = elseIfCondition;
  44239. }
  44240. return branch0
  44241. }
  44242. }
  44243. }
  44244. function cloneASTElement (el) {
  44245. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  44246. }
  44247. var model$1 = {
  44248. preTransformNode: preTransformNode
  44249. };
  44250. var modules$1 = [
  44251. klass$1,
  44252. style$1,
  44253. model$1
  44254. ];
  44255. /* */
  44256. function text (el, dir) {
  44257. if (dir.value) {
  44258. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  44259. }
  44260. }
  44261. /* */
  44262. function html (el, dir) {
  44263. if (dir.value) {
  44264. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  44265. }
  44266. }
  44267. var directives$1 = {
  44268. model: model,
  44269. text: text,
  44270. html: html
  44271. };
  44272. /* */
  44273. var baseOptions = {
  44274. expectHTML: true,
  44275. modules: modules$1,
  44276. directives: directives$1,
  44277. isPreTag: isPreTag,
  44278. isUnaryTag: isUnaryTag,
  44279. mustUseProp: mustUseProp,
  44280. canBeLeftOpenTag: canBeLeftOpenTag,
  44281. isReservedTag: isReservedTag,
  44282. getTagNamespace: getTagNamespace,
  44283. staticKeys: genStaticKeys(modules$1)
  44284. };
  44285. /* */
  44286. var isStaticKey;
  44287. var isPlatformReservedTag;
  44288. var genStaticKeysCached = cached(genStaticKeys$1);
  44289. /**
  44290. * Goal of the optimizer: walk the generated template AST tree
  44291. * and detect sub-trees that are purely static, i.e. parts of
  44292. * the DOM that never needs to change.
  44293. *
  44294. * Once we detect these sub-trees, we can:
  44295. *
  44296. * 1. Hoist them into constants, so that we no longer need to
  44297. * create fresh nodes for them on each re-render;
  44298. * 2. Completely skip them in the patching process.
  44299. */
  44300. function optimize (root, options) {
  44301. if (!root) { return }
  44302. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  44303. isPlatformReservedTag = options.isReservedTag || no;
  44304. // first pass: mark all non-static nodes.
  44305. markStatic$1(root);
  44306. // second pass: mark static roots.
  44307. markStaticRoots(root, false);
  44308. }
  44309. function genStaticKeys$1 (keys) {
  44310. return makeMap(
  44311. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  44312. (keys ? ',' + keys : '')
  44313. )
  44314. }
  44315. function markStatic$1 (node) {
  44316. node.static = isStatic(node);
  44317. if (node.type === 1) {
  44318. // do not make component slot content static. this avoids
  44319. // 1. components not able to mutate slot nodes
  44320. // 2. static slot content fails for hot-reloading
  44321. if (
  44322. !isPlatformReservedTag(node.tag) &&
  44323. node.tag !== 'slot' &&
  44324. node.attrsMap['inline-template'] == null
  44325. ) {
  44326. return
  44327. }
  44328. for (var i = 0, l = node.children.length; i < l; i++) {
  44329. var child = node.children[i];
  44330. markStatic$1(child);
  44331. if (!child.static) {
  44332. node.static = false;
  44333. }
  44334. }
  44335. if (node.ifConditions) {
  44336. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  44337. var block = node.ifConditions[i$1].block;
  44338. markStatic$1(block);
  44339. if (!block.static) {
  44340. node.static = false;
  44341. }
  44342. }
  44343. }
  44344. }
  44345. }
  44346. function markStaticRoots (node, isInFor) {
  44347. if (node.type === 1) {
  44348. if (node.static || node.once) {
  44349. node.staticInFor = isInFor;
  44350. }
  44351. // For a node to qualify as a static root, it should have children that
  44352. // are not just static text. Otherwise the cost of hoisting out will
  44353. // outweigh the benefits and it's better off to just always render it fresh.
  44354. if (node.static && node.children.length && !(
  44355. node.children.length === 1 &&
  44356. node.children[0].type === 3
  44357. )) {
  44358. node.staticRoot = true;
  44359. return
  44360. } else {
  44361. node.staticRoot = false;
  44362. }
  44363. if (node.children) {
  44364. for (var i = 0, l = node.children.length; i < l; i++) {
  44365. markStaticRoots(node.children[i], isInFor || !!node.for);
  44366. }
  44367. }
  44368. if (node.ifConditions) {
  44369. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  44370. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  44371. }
  44372. }
  44373. }
  44374. }
  44375. function isStatic (node) {
  44376. if (node.type === 2) { // expression
  44377. return false
  44378. }
  44379. if (node.type === 3) { // text
  44380. return true
  44381. }
  44382. return !!(node.pre || (
  44383. !node.hasBindings && // no dynamic bindings
  44384. !node.if && !node.for && // not v-if or v-for or v-else
  44385. !isBuiltInTag(node.tag) && // not a built-in
  44386. isPlatformReservedTag(node.tag) && // not a component
  44387. !isDirectChildOfTemplateFor(node) &&
  44388. Object.keys(node).every(isStaticKey)
  44389. ))
  44390. }
  44391. function isDirectChildOfTemplateFor (node) {
  44392. while (node.parent) {
  44393. node = node.parent;
  44394. if (node.tag !== 'template') {
  44395. return false
  44396. }
  44397. if (node.for) {
  44398. return true
  44399. }
  44400. }
  44401. return false
  44402. }
  44403. /* */
  44404. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  44405. var fnInvokeRE = /\([^)]*?\);*$/;
  44406. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  44407. // KeyboardEvent.keyCode aliases
  44408. var keyCodes = {
  44409. esc: 27,
  44410. tab: 9,
  44411. enter: 13,
  44412. space: 32,
  44413. up: 38,
  44414. left: 37,
  44415. right: 39,
  44416. down: 40,
  44417. 'delete': [8, 46]
  44418. };
  44419. // KeyboardEvent.key aliases
  44420. var keyNames = {
  44421. // #7880: IE11 and Edge use `Esc` for Escape key name.
  44422. esc: ['Esc', 'Escape'],
  44423. tab: 'Tab',
  44424. enter: 'Enter',
  44425. // #9112: IE11 uses `Spacebar` for Space key name.
  44426. space: [' ', 'Spacebar'],
  44427. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  44428. up: ['Up', 'ArrowUp'],
  44429. left: ['Left', 'ArrowLeft'],
  44430. right: ['Right', 'ArrowRight'],
  44431. down: ['Down', 'ArrowDown'],
  44432. // #9112: IE11 uses `Del` for Delete key name.
  44433. 'delete': ['Backspace', 'Delete', 'Del']
  44434. };
  44435. // #4868: modifiers that prevent the execution of the listener
  44436. // need to explicitly return null so that we can determine whether to remove
  44437. // the listener for .once
  44438. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  44439. var modifierCode = {
  44440. stop: '$event.stopPropagation();',
  44441. prevent: '$event.preventDefault();',
  44442. self: genGuard("$event.target !== $event.currentTarget"),
  44443. ctrl: genGuard("!$event.ctrlKey"),
  44444. shift: genGuard("!$event.shiftKey"),
  44445. alt: genGuard("!$event.altKey"),
  44446. meta: genGuard("!$event.metaKey"),
  44447. left: genGuard("'button' in $event && $event.button !== 0"),
  44448. middle: genGuard("'button' in $event && $event.button !== 1"),
  44449. right: genGuard("'button' in $event && $event.button !== 2")
  44450. };
  44451. function genHandlers (
  44452. events,
  44453. isNative
  44454. ) {
  44455. var prefix = isNative ? 'nativeOn:' : 'on:';
  44456. var staticHandlers = "";
  44457. var dynamicHandlers = "";
  44458. for (var name in events) {
  44459. var handlerCode = genHandler(events[name]);
  44460. if (events[name] && events[name].dynamic) {
  44461. dynamicHandlers += name + "," + handlerCode + ",";
  44462. } else {
  44463. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  44464. }
  44465. }
  44466. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  44467. if (dynamicHandlers) {
  44468. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  44469. } else {
  44470. return prefix + staticHandlers
  44471. }
  44472. }
  44473. function genHandler (handler) {
  44474. if (!handler) {
  44475. return 'function(){}'
  44476. }
  44477. if (Array.isArray(handler)) {
  44478. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  44479. }
  44480. var isMethodPath = simplePathRE.test(handler.value);
  44481. var isFunctionExpression = fnExpRE.test(handler.value);
  44482. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  44483. if (!handler.modifiers) {
  44484. if (isMethodPath || isFunctionExpression) {
  44485. return handler.value
  44486. }
  44487. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  44488. } else {
  44489. var code = '';
  44490. var genModifierCode = '';
  44491. var keys = [];
  44492. for (var key in handler.modifiers) {
  44493. if (modifierCode[key]) {
  44494. genModifierCode += modifierCode[key];
  44495. // left/right
  44496. if (keyCodes[key]) {
  44497. keys.push(key);
  44498. }
  44499. } else if (key === 'exact') {
  44500. var modifiers = (handler.modifiers);
  44501. genModifierCode += genGuard(
  44502. ['ctrl', 'shift', 'alt', 'meta']
  44503. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  44504. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  44505. .join('||')
  44506. );
  44507. } else {
  44508. keys.push(key);
  44509. }
  44510. }
  44511. if (keys.length) {
  44512. code += genKeyFilter(keys);
  44513. }
  44514. // Make sure modifiers like prevent and stop get executed after key filtering
  44515. if (genModifierCode) {
  44516. code += genModifierCode;
  44517. }
  44518. var handlerCode = isMethodPath
  44519. ? ("return " + (handler.value) + ".apply(null, arguments)")
  44520. : isFunctionExpression
  44521. ? ("return (" + (handler.value) + ").apply(null, arguments)")
  44522. : isFunctionInvocation
  44523. ? ("return " + (handler.value))
  44524. : handler.value;
  44525. return ("function($event){" + code + handlerCode + "}")
  44526. }
  44527. }
  44528. function genKeyFilter (keys) {
  44529. return (
  44530. // make sure the key filters only apply to KeyboardEvents
  44531. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  44532. // key events that do not have keyCode property...
  44533. "if(!$event.type.indexOf('key')&&" +
  44534. (keys.map(genFilterCode).join('&&')) + ")return null;"
  44535. )
  44536. }
  44537. function genFilterCode (key) {
  44538. var keyVal = parseInt(key, 10);
  44539. if (keyVal) {
  44540. return ("$event.keyCode!==" + keyVal)
  44541. }
  44542. var keyCode = keyCodes[key];
  44543. var keyName = keyNames[key];
  44544. return (
  44545. "_k($event.keyCode," +
  44546. (JSON.stringify(key)) + "," +
  44547. (JSON.stringify(keyCode)) + "," +
  44548. "$event.key," +
  44549. "" + (JSON.stringify(keyName)) +
  44550. ")"
  44551. )
  44552. }
  44553. /* */
  44554. function on (el, dir) {
  44555. if (dir.modifiers) {
  44556. warn("v-on without argument does not support modifiers.");
  44557. }
  44558. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  44559. }
  44560. /* */
  44561. function bind$1 (el, dir) {
  44562. el.wrapData = function (code) {
  44563. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  44564. };
  44565. }
  44566. /* */
  44567. var baseDirectives = {
  44568. on: on,
  44569. bind: bind$1,
  44570. cloak: noop
  44571. };
  44572. /* */
  44573. var CodegenState = function CodegenState (options) {
  44574. this.options = options;
  44575. this.warn = options.warn || baseWarn;
  44576. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  44577. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  44578. this.directives = extend(extend({}, baseDirectives), options.directives);
  44579. var isReservedTag = options.isReservedTag || no;
  44580. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  44581. this.onceId = 0;
  44582. this.staticRenderFns = [];
  44583. this.pre = false;
  44584. };
  44585. function generate (
  44586. ast,
  44587. options
  44588. ) {
  44589. var state = new CodegenState(options);
  44590. // fix #11483, Root level <script> tags should not be rendered.
  44591. var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
  44592. return {
  44593. render: ("with(this){return " + code + "}"),
  44594. staticRenderFns: state.staticRenderFns
  44595. }
  44596. }
  44597. function genElement (el, state) {
  44598. if (el.parent) {
  44599. el.pre = el.pre || el.parent.pre;
  44600. }
  44601. if (el.staticRoot && !el.staticProcessed) {
  44602. return genStatic(el, state)
  44603. } else if (el.once && !el.onceProcessed) {
  44604. return genOnce(el, state)
  44605. } else if (el.for && !el.forProcessed) {
  44606. return genFor(el, state)
  44607. } else if (el.if && !el.ifProcessed) {
  44608. return genIf(el, state)
  44609. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  44610. return genChildren(el, state) || 'void 0'
  44611. } else if (el.tag === 'slot') {
  44612. return genSlot(el, state)
  44613. } else {
  44614. // component or element
  44615. var code;
  44616. if (el.component) {
  44617. code = genComponent(el.component, el, state);
  44618. } else {
  44619. var data;
  44620. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  44621. data = genData$2(el, state);
  44622. }
  44623. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  44624. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  44625. }
  44626. // module transforms
  44627. for (var i = 0; i < state.transforms.length; i++) {
  44628. code = state.transforms[i](el, code);
  44629. }
  44630. return code
  44631. }
  44632. }
  44633. // hoist static sub-trees out
  44634. function genStatic (el, state) {
  44635. el.staticProcessed = true;
  44636. // Some elements (templates) need to behave differently inside of a v-pre
  44637. // node. All pre nodes are static roots, so we can use this as a location to
  44638. // wrap a state change and reset it upon exiting the pre node.
  44639. var originalPreState = state.pre;
  44640. if (el.pre) {
  44641. state.pre = el.pre;
  44642. }
  44643. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  44644. state.pre = originalPreState;
  44645. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  44646. }
  44647. // v-once
  44648. function genOnce (el, state) {
  44649. el.onceProcessed = true;
  44650. if (el.if && !el.ifProcessed) {
  44651. return genIf(el, state)
  44652. } else if (el.staticInFor) {
  44653. var key = '';
  44654. var parent = el.parent;
  44655. while (parent) {
  44656. if (parent.for) {
  44657. key = parent.key;
  44658. break
  44659. }
  44660. parent = parent.parent;
  44661. }
  44662. if (!key) {
  44663. state.warn(
  44664. "v-once can only be used inside v-for that is keyed. ",
  44665. el.rawAttrsMap['v-once']
  44666. );
  44667. return genElement(el, state)
  44668. }
  44669. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  44670. } else {
  44671. return genStatic(el, state)
  44672. }
  44673. }
  44674. function genIf (
  44675. el,
  44676. state,
  44677. altGen,
  44678. altEmpty
  44679. ) {
  44680. el.ifProcessed = true; // avoid recursion
  44681. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  44682. }
  44683. function genIfConditions (
  44684. conditions,
  44685. state,
  44686. altGen,
  44687. altEmpty
  44688. ) {
  44689. if (!conditions.length) {
  44690. return altEmpty || '_e()'
  44691. }
  44692. var condition = conditions.shift();
  44693. if (condition.exp) {
  44694. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  44695. } else {
  44696. return ("" + (genTernaryExp(condition.block)))
  44697. }
  44698. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  44699. function genTernaryExp (el) {
  44700. return altGen
  44701. ? altGen(el, state)
  44702. : el.once
  44703. ? genOnce(el, state)
  44704. : genElement(el, state)
  44705. }
  44706. }
  44707. function genFor (
  44708. el,
  44709. state,
  44710. altGen,
  44711. altHelper
  44712. ) {
  44713. var exp = el.for;
  44714. var alias = el.alias;
  44715. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  44716. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  44717. if (state.maybeComponent(el) &&
  44718. el.tag !== 'slot' &&
  44719. el.tag !== 'template' &&
  44720. !el.key
  44721. ) {
  44722. state.warn(
  44723. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  44724. "v-for should have explicit keys. " +
  44725. "See https://vuejs.org/guide/list.html#key for more info.",
  44726. el.rawAttrsMap['v-for'],
  44727. true /* tip */
  44728. );
  44729. }
  44730. el.forProcessed = true; // avoid recursion
  44731. return (altHelper || '_l') + "((" + exp + ")," +
  44732. "function(" + alias + iterator1 + iterator2 + "){" +
  44733. "return " + ((altGen || genElement)(el, state)) +
  44734. '})'
  44735. }
  44736. function genData$2 (el, state) {
  44737. var data = '{';
  44738. // directives first.
  44739. // directives may mutate the el's other properties before they are generated.
  44740. var dirs = genDirectives(el, state);
  44741. if (dirs) { data += dirs + ','; }
  44742. // key
  44743. if (el.key) {
  44744. data += "key:" + (el.key) + ",";
  44745. }
  44746. // ref
  44747. if (el.ref) {
  44748. data += "ref:" + (el.ref) + ",";
  44749. }
  44750. if (el.refInFor) {
  44751. data += "refInFor:true,";
  44752. }
  44753. // pre
  44754. if (el.pre) {
  44755. data += "pre:true,";
  44756. }
  44757. // record original tag name for components using "is" attribute
  44758. if (el.component) {
  44759. data += "tag:\"" + (el.tag) + "\",";
  44760. }
  44761. // module data generation functions
  44762. for (var i = 0; i < state.dataGenFns.length; i++) {
  44763. data += state.dataGenFns[i](el);
  44764. }
  44765. // attributes
  44766. if (el.attrs) {
  44767. data += "attrs:" + (genProps(el.attrs)) + ",";
  44768. }
  44769. // DOM props
  44770. if (el.props) {
  44771. data += "domProps:" + (genProps(el.props)) + ",";
  44772. }
  44773. // event handlers
  44774. if (el.events) {
  44775. data += (genHandlers(el.events, false)) + ",";
  44776. }
  44777. if (el.nativeEvents) {
  44778. data += (genHandlers(el.nativeEvents, true)) + ",";
  44779. }
  44780. // slot target
  44781. // only for non-scoped slots
  44782. if (el.slotTarget && !el.slotScope) {
  44783. data += "slot:" + (el.slotTarget) + ",";
  44784. }
  44785. // scoped slots
  44786. if (el.scopedSlots) {
  44787. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  44788. }
  44789. // component v-model
  44790. if (el.model) {
  44791. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  44792. }
  44793. // inline-template
  44794. if (el.inlineTemplate) {
  44795. var inlineTemplate = genInlineTemplate(el, state);
  44796. if (inlineTemplate) {
  44797. data += inlineTemplate + ",";
  44798. }
  44799. }
  44800. data = data.replace(/,$/, '') + '}';
  44801. // v-bind dynamic argument wrap
  44802. // v-bind with dynamic arguments must be applied using the same v-bind object
  44803. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  44804. if (el.dynamicAttrs) {
  44805. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  44806. }
  44807. // v-bind data wrap
  44808. if (el.wrapData) {
  44809. data = el.wrapData(data);
  44810. }
  44811. // v-on data wrap
  44812. if (el.wrapListeners) {
  44813. data = el.wrapListeners(data);
  44814. }
  44815. return data
  44816. }
  44817. function genDirectives (el, state) {
  44818. var dirs = el.directives;
  44819. if (!dirs) { return }
  44820. var res = 'directives:[';
  44821. var hasRuntime = false;
  44822. var i, l, dir, needRuntime;
  44823. for (i = 0, l = dirs.length; i < l; i++) {
  44824. dir = dirs[i];
  44825. needRuntime = true;
  44826. var gen = state.directives[dir.name];
  44827. if (gen) {
  44828. // compile-time directive that manipulates AST.
  44829. // returns true if it also needs a runtime counterpart.
  44830. needRuntime = !!gen(el, dir, state.warn);
  44831. }
  44832. if (needRuntime) {
  44833. hasRuntime = true;
  44834. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  44835. }
  44836. }
  44837. if (hasRuntime) {
  44838. return res.slice(0, -1) + ']'
  44839. }
  44840. }
  44841. function genInlineTemplate (el, state) {
  44842. var ast = el.children[0];
  44843. if (el.children.length !== 1 || ast.type !== 1) {
  44844. state.warn(
  44845. 'Inline-template components must have exactly one child element.',
  44846. { start: el.start }
  44847. );
  44848. }
  44849. if (ast && ast.type === 1) {
  44850. var inlineRenderFns = generate(ast, state.options);
  44851. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  44852. }
  44853. }
  44854. function genScopedSlots (
  44855. el,
  44856. slots,
  44857. state
  44858. ) {
  44859. // by default scoped slots are considered "stable", this allows child
  44860. // components with only scoped slots to skip forced updates from parent.
  44861. // but in some cases we have to bail-out of this optimization
  44862. // for example if the slot contains dynamic names, has v-if or v-for on them...
  44863. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  44864. var slot = slots[key];
  44865. return (
  44866. slot.slotTargetDynamic ||
  44867. slot.if ||
  44868. slot.for ||
  44869. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  44870. )
  44871. });
  44872. // #9534: if a component with scoped slots is inside a conditional branch,
  44873. // it's possible for the same component to be reused but with different
  44874. // compiled slot content. To avoid that, we generate a unique key based on
  44875. // the generated code of all the slot contents.
  44876. var needsKey = !!el.if;
  44877. // OR when it is inside another scoped slot or v-for (the reactivity may be
  44878. // disconnected due to the intermediate scope variable)
  44879. // #9438, #9506
  44880. // TODO: this can be further optimized by properly analyzing in-scope bindings
  44881. // and skip force updating ones that do not actually use scope variables.
  44882. if (!needsForceUpdate) {
  44883. var parent = el.parent;
  44884. while (parent) {
  44885. if (
  44886. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  44887. parent.for
  44888. ) {
  44889. needsForceUpdate = true;
  44890. break
  44891. }
  44892. if (parent.if) {
  44893. needsKey = true;
  44894. }
  44895. parent = parent.parent;
  44896. }
  44897. }
  44898. var generatedSlots = Object.keys(slots)
  44899. .map(function (key) { return genScopedSlot(slots[key], state); })
  44900. .join(',');
  44901. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  44902. }
  44903. function hash(str) {
  44904. var hash = 5381;
  44905. var i = str.length;
  44906. while(i) {
  44907. hash = (hash * 33) ^ str.charCodeAt(--i);
  44908. }
  44909. return hash >>> 0
  44910. }
  44911. function containsSlotChild (el) {
  44912. if (el.type === 1) {
  44913. if (el.tag === 'slot') {
  44914. return true
  44915. }
  44916. return el.children.some(containsSlotChild)
  44917. }
  44918. return false
  44919. }
  44920. function genScopedSlot (
  44921. el,
  44922. state
  44923. ) {
  44924. var isLegacySyntax = el.attrsMap['slot-scope'];
  44925. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  44926. return genIf(el, state, genScopedSlot, "null")
  44927. }
  44928. if (el.for && !el.forProcessed) {
  44929. return genFor(el, state, genScopedSlot)
  44930. }
  44931. var slotScope = el.slotScope === emptySlotScopeToken
  44932. ? ""
  44933. : String(el.slotScope);
  44934. var fn = "function(" + slotScope + "){" +
  44935. "return " + (el.tag === 'template'
  44936. ? el.if && isLegacySyntax
  44937. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  44938. : genChildren(el, state) || 'undefined'
  44939. : genElement(el, state)) + "}";
  44940. // reverse proxy v-slot without scope on this.$slots
  44941. var reverseProxy = slotScope ? "" : ",proxy:true";
  44942. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  44943. }
  44944. function genChildren (
  44945. el,
  44946. state,
  44947. checkSkip,
  44948. altGenElement,
  44949. altGenNode
  44950. ) {
  44951. var children = el.children;
  44952. if (children.length) {
  44953. var el$1 = children[0];
  44954. // optimize single v-for
  44955. if (children.length === 1 &&
  44956. el$1.for &&
  44957. el$1.tag !== 'template' &&
  44958. el$1.tag !== 'slot'
  44959. ) {
  44960. var normalizationType = checkSkip
  44961. ? state.maybeComponent(el$1) ? ",1" : ",0"
  44962. : "";
  44963. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  44964. }
  44965. var normalizationType$1 = checkSkip
  44966. ? getNormalizationType(children, state.maybeComponent)
  44967. : 0;
  44968. var gen = altGenNode || genNode;
  44969. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  44970. }
  44971. }
  44972. // determine the normalization needed for the children array.
  44973. // 0: no normalization needed
  44974. // 1: simple normalization needed (possible 1-level deep nested array)
  44975. // 2: full normalization needed
  44976. function getNormalizationType (
  44977. children,
  44978. maybeComponent
  44979. ) {
  44980. var res = 0;
  44981. for (var i = 0; i < children.length; i++) {
  44982. var el = children[i];
  44983. if (el.type !== 1) {
  44984. continue
  44985. }
  44986. if (needsNormalization(el) ||
  44987. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  44988. res = 2;
  44989. break
  44990. }
  44991. if (maybeComponent(el) ||
  44992. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  44993. res = 1;
  44994. }
  44995. }
  44996. return res
  44997. }
  44998. function needsNormalization (el) {
  44999. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  45000. }
  45001. function genNode (node, state) {
  45002. if (node.type === 1) {
  45003. return genElement(node, state)
  45004. } else if (node.type === 3 && node.isComment) {
  45005. return genComment(node)
  45006. } else {
  45007. return genText(node)
  45008. }
  45009. }
  45010. function genText (text) {
  45011. return ("_v(" + (text.type === 2
  45012. ? text.expression // no need for () because already wrapped in _s()
  45013. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  45014. }
  45015. function genComment (comment) {
  45016. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  45017. }
  45018. function genSlot (el, state) {
  45019. var slotName = el.slotName || '"default"';
  45020. var children = genChildren(el, state);
  45021. var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
  45022. var attrs = el.attrs || el.dynamicAttrs
  45023. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  45024. // slot props are camelized
  45025. name: camelize(attr.name),
  45026. value: attr.value,
  45027. dynamic: attr.dynamic
  45028. }); }))
  45029. : null;
  45030. var bind$$1 = el.attrsMap['v-bind'];
  45031. if ((attrs || bind$$1) && !children) {
  45032. res += ",null";
  45033. }
  45034. if (attrs) {
  45035. res += "," + attrs;
  45036. }
  45037. if (bind$$1) {
  45038. res += (attrs ? '' : ',null') + "," + bind$$1;
  45039. }
  45040. return res + ')'
  45041. }
  45042. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  45043. function genComponent (
  45044. componentName,
  45045. el,
  45046. state
  45047. ) {
  45048. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  45049. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  45050. }
  45051. function genProps (props) {
  45052. var staticProps = "";
  45053. var dynamicProps = "";
  45054. for (var i = 0; i < props.length; i++) {
  45055. var prop = props[i];
  45056. var value = transformSpecialNewlines(prop.value);
  45057. if (prop.dynamic) {
  45058. dynamicProps += (prop.name) + "," + value + ",";
  45059. } else {
  45060. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  45061. }
  45062. }
  45063. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  45064. if (dynamicProps) {
  45065. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  45066. } else {
  45067. return staticProps
  45068. }
  45069. }
  45070. // #3895, #4268
  45071. function transformSpecialNewlines (text) {
  45072. return text
  45073. .replace(/\u2028/g, '\\u2028')
  45074. .replace(/\u2029/g, '\\u2029')
  45075. }
  45076. /* */
  45077. // these keywords should not appear inside expressions, but operators like
  45078. // typeof, instanceof and in are allowed
  45079. var prohibitedKeywordRE = new RegExp('\\b' + (
  45080. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  45081. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  45082. 'extends,finally,continue,debugger,function,arguments'
  45083. ).split(',').join('\\b|\\b') + '\\b');
  45084. // these unary operators should not be used as property/method names
  45085. var unaryOperatorsRE = new RegExp('\\b' + (
  45086. 'delete,typeof,void'
  45087. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  45088. // strip strings in expressions
  45089. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  45090. // detect problematic expressions in a template
  45091. function detectErrors (ast, warn) {
  45092. if (ast) {
  45093. checkNode(ast, warn);
  45094. }
  45095. }
  45096. function checkNode (node, warn) {
  45097. if (node.type === 1) {
  45098. for (var name in node.attrsMap) {
  45099. if (dirRE.test(name)) {
  45100. var value = node.attrsMap[name];
  45101. if (value) {
  45102. var range = node.rawAttrsMap[name];
  45103. if (name === 'v-for') {
  45104. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  45105. } else if (name === 'v-slot' || name[0] === '#') {
  45106. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  45107. } else if (onRE.test(name)) {
  45108. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  45109. } else {
  45110. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  45111. }
  45112. }
  45113. }
  45114. }
  45115. if (node.children) {
  45116. for (var i = 0; i < node.children.length; i++) {
  45117. checkNode(node.children[i], warn);
  45118. }
  45119. }
  45120. } else if (node.type === 2) {
  45121. checkExpression(node.expression, node.text, warn, node);
  45122. }
  45123. }
  45124. function checkEvent (exp, text, warn, range) {
  45125. var stripped = exp.replace(stripStringRE, '');
  45126. var keywordMatch = stripped.match(unaryOperatorsRE);
  45127. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  45128. warn(
  45129. "avoid using JavaScript unary operator as property name: " +
  45130. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  45131. range
  45132. );
  45133. }
  45134. checkExpression(exp, text, warn, range);
  45135. }
  45136. function checkFor (node, text, warn, range) {
  45137. checkExpression(node.for || '', text, warn, range);
  45138. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  45139. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  45140. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  45141. }
  45142. function checkIdentifier (
  45143. ident,
  45144. type,
  45145. text,
  45146. warn,
  45147. range
  45148. ) {
  45149. if (typeof ident === 'string') {
  45150. try {
  45151. new Function(("var " + ident + "=_"));
  45152. } catch (e) {
  45153. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  45154. }
  45155. }
  45156. }
  45157. function checkExpression (exp, text, warn, range) {
  45158. try {
  45159. new Function(("return " + exp));
  45160. } catch (e) {
  45161. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  45162. if (keywordMatch) {
  45163. warn(
  45164. "avoid using JavaScript keyword as property name: " +
  45165. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  45166. range
  45167. );
  45168. } else {
  45169. warn(
  45170. "invalid expression: " + (e.message) + " in\n\n" +
  45171. " " + exp + "\n\n" +
  45172. " Raw expression: " + (text.trim()) + "\n",
  45173. range
  45174. );
  45175. }
  45176. }
  45177. }
  45178. function checkFunctionParameterExpression (exp, text, warn, range) {
  45179. try {
  45180. new Function(exp, '');
  45181. } catch (e) {
  45182. warn(
  45183. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  45184. " " + exp + "\n\n" +
  45185. " Raw expression: " + (text.trim()) + "\n",
  45186. range
  45187. );
  45188. }
  45189. }
  45190. /* */
  45191. var range = 2;
  45192. function generateCodeFrame (
  45193. source,
  45194. start,
  45195. end
  45196. ) {
  45197. if ( start === void 0 ) start = 0;
  45198. if ( end === void 0 ) end = source.length;
  45199. var lines = source.split(/\r?\n/);
  45200. var count = 0;
  45201. var res = [];
  45202. for (var i = 0; i < lines.length; i++) {
  45203. count += lines[i].length + 1;
  45204. if (count >= start) {
  45205. for (var j = i - range; j <= i + range || end > count; j++) {
  45206. if (j < 0 || j >= lines.length) { continue }
  45207. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  45208. var lineLength = lines[j].length;
  45209. if (j === i) {
  45210. // push underline
  45211. var pad = start - (count - lineLength) + 1;
  45212. var length = end > count ? lineLength - pad : end - start;
  45213. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  45214. } else if (j > i) {
  45215. if (end > count) {
  45216. var length$1 = Math.min(end - count, lineLength);
  45217. res.push(" | " + repeat$1("^", length$1));
  45218. }
  45219. count += lineLength + 1;
  45220. }
  45221. }
  45222. break
  45223. }
  45224. }
  45225. return res.join('\n')
  45226. }
  45227. function repeat$1 (str, n) {
  45228. var result = '';
  45229. if (n > 0) {
  45230. while (true) { // eslint-disable-line
  45231. if (n & 1) { result += str; }
  45232. n >>>= 1;
  45233. if (n <= 0) { break }
  45234. str += str;
  45235. }
  45236. }
  45237. return result
  45238. }
  45239. /* */
  45240. function createFunction (code, errors) {
  45241. try {
  45242. return new Function(code)
  45243. } catch (err) {
  45244. errors.push({ err: err, code: code });
  45245. return noop
  45246. }
  45247. }
  45248. function createCompileToFunctionFn (compile) {
  45249. var cache = Object.create(null);
  45250. return function compileToFunctions (
  45251. template,
  45252. options,
  45253. vm
  45254. ) {
  45255. options = extend({}, options);
  45256. var warn$$1 = options.warn || warn;
  45257. delete options.warn;
  45258. /* istanbul ignore if */
  45259. {
  45260. // detect possible CSP restriction
  45261. try {
  45262. new Function('return 1');
  45263. } catch (e) {
  45264. if (e.toString().match(/unsafe-eval|CSP/)) {
  45265. warn$$1(
  45266. 'It seems you are using the standalone build of Vue.js in an ' +
  45267. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  45268. 'The template compiler cannot work in this environment. Consider ' +
  45269. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  45270. 'templates into render functions.'
  45271. );
  45272. }
  45273. }
  45274. }
  45275. // check cache
  45276. var key = options.delimiters
  45277. ? String(options.delimiters) + template
  45278. : template;
  45279. if (cache[key]) {
  45280. return cache[key]
  45281. }
  45282. // compile
  45283. var compiled = compile(template, options);
  45284. // check compilation errors/tips
  45285. {
  45286. if (compiled.errors && compiled.errors.length) {
  45287. if (options.outputSourceRange) {
  45288. compiled.errors.forEach(function (e) {
  45289. warn$$1(
  45290. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  45291. generateCodeFrame(template, e.start, e.end),
  45292. vm
  45293. );
  45294. });
  45295. } else {
  45296. warn$$1(
  45297. "Error compiling template:\n\n" + template + "\n\n" +
  45298. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  45299. vm
  45300. );
  45301. }
  45302. }
  45303. if (compiled.tips && compiled.tips.length) {
  45304. if (options.outputSourceRange) {
  45305. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  45306. } else {
  45307. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  45308. }
  45309. }
  45310. }
  45311. // turn code into functions
  45312. var res = {};
  45313. var fnGenErrors = [];
  45314. res.render = createFunction(compiled.render, fnGenErrors);
  45315. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  45316. return createFunction(code, fnGenErrors)
  45317. });
  45318. // check function generation errors.
  45319. // this should only happen if there is a bug in the compiler itself.
  45320. // mostly for codegen development use
  45321. /* istanbul ignore if */
  45322. {
  45323. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  45324. warn$$1(
  45325. "Failed to generate render function:\n\n" +
  45326. fnGenErrors.map(function (ref) {
  45327. var err = ref.err;
  45328. var code = ref.code;
  45329. return ((err.toString()) + " in\n\n" + code + "\n");
  45330. }).join('\n'),
  45331. vm
  45332. );
  45333. }
  45334. }
  45335. return (cache[key] = res)
  45336. }
  45337. }
  45338. /* */
  45339. function createCompilerCreator (baseCompile) {
  45340. return function createCompiler (baseOptions) {
  45341. function compile (
  45342. template,
  45343. options
  45344. ) {
  45345. var finalOptions = Object.create(baseOptions);
  45346. var errors = [];
  45347. var tips = [];
  45348. var warn = function (msg, range, tip) {
  45349. (tip ? tips : errors).push(msg);
  45350. };
  45351. if (options) {
  45352. if (options.outputSourceRange) {
  45353. // $flow-disable-line
  45354. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  45355. warn = function (msg, range, tip) {
  45356. var data = { msg: msg };
  45357. if (range) {
  45358. if (range.start != null) {
  45359. data.start = range.start + leadingSpaceLength;
  45360. }
  45361. if (range.end != null) {
  45362. data.end = range.end + leadingSpaceLength;
  45363. }
  45364. }
  45365. (tip ? tips : errors).push(data);
  45366. };
  45367. }
  45368. // merge custom modules
  45369. if (options.modules) {
  45370. finalOptions.modules =
  45371. (baseOptions.modules || []).concat(options.modules);
  45372. }
  45373. // merge custom directives
  45374. if (options.directives) {
  45375. finalOptions.directives = extend(
  45376. Object.create(baseOptions.directives || null),
  45377. options.directives
  45378. );
  45379. }
  45380. // copy other options
  45381. for (var key in options) {
  45382. if (key !== 'modules' && key !== 'directives') {
  45383. finalOptions[key] = options[key];
  45384. }
  45385. }
  45386. }
  45387. finalOptions.warn = warn;
  45388. var compiled = baseCompile(template.trim(), finalOptions);
  45389. {
  45390. detectErrors(compiled.ast, warn);
  45391. }
  45392. compiled.errors = errors;
  45393. compiled.tips = tips;
  45394. return compiled
  45395. }
  45396. return {
  45397. compile: compile,
  45398. compileToFunctions: createCompileToFunctionFn(compile)
  45399. }
  45400. }
  45401. }
  45402. /* */
  45403. // `createCompilerCreator` allows creating compilers that use alternative
  45404. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  45405. // Here we just export a default compiler using the default parts.
  45406. var createCompiler = createCompilerCreator(function baseCompile (
  45407. template,
  45408. options
  45409. ) {
  45410. var ast = parse(template.trim(), options);
  45411. if (options.optimize !== false) {
  45412. optimize(ast, options);
  45413. }
  45414. var code = generate(ast, options);
  45415. return {
  45416. ast: ast,
  45417. render: code.render,
  45418. staticRenderFns: code.staticRenderFns
  45419. }
  45420. });
  45421. /* */
  45422. var ref$1 = createCompiler(baseOptions);
  45423. var compile = ref$1.compile;
  45424. var compileToFunctions = ref$1.compileToFunctions;
  45425. /* */
  45426. // check whether current browser encodes a char inside attribute values
  45427. var div;
  45428. function getShouldDecode (href) {
  45429. div = div || document.createElement('div');
  45430. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  45431. return div.innerHTML.indexOf('&#10;') > 0
  45432. }
  45433. // #3663: IE encodes newlines inside attribute values while other browsers don't
  45434. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  45435. // #6828: chrome encodes content in a[href]
  45436. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  45437. /* */
  45438. var idToTemplate = cached(function (id) {
  45439. var el = query(id);
  45440. return el && el.innerHTML
  45441. });
  45442. var mount = Vue.prototype.$mount;
  45443. Vue.prototype.$mount = function (
  45444. el,
  45445. hydrating
  45446. ) {
  45447. el = el && query(el);
  45448. /* istanbul ignore if */
  45449. if (el === document.body || el === document.documentElement) {
  45450. warn(
  45451. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  45452. );
  45453. return this
  45454. }
  45455. var options = this.$options;
  45456. // resolve template/el and convert to render function
  45457. if (!options.render) {
  45458. var template = options.template;
  45459. if (template) {
  45460. if (typeof template === 'string') {
  45461. if (template.charAt(0) === '#') {
  45462. template = idToTemplate(template);
  45463. /* istanbul ignore if */
  45464. if (!template) {
  45465. warn(
  45466. ("Template element not found or is empty: " + (options.template)),
  45467. this
  45468. );
  45469. }
  45470. }
  45471. } else if (template.nodeType) {
  45472. template = template.innerHTML;
  45473. } else {
  45474. {
  45475. warn('invalid template option:' + template, this);
  45476. }
  45477. return this
  45478. }
  45479. } else if (el) {
  45480. template = getOuterHTML(el);
  45481. }
  45482. if (template) {
  45483. /* istanbul ignore if */
  45484. if (config.performance && mark) {
  45485. mark('compile');
  45486. }
  45487. var ref = compileToFunctions(template, {
  45488. outputSourceRange: "development" !== 'production',
  45489. shouldDecodeNewlines: shouldDecodeNewlines,
  45490. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  45491. delimiters: options.delimiters,
  45492. comments: options.comments
  45493. }, this);
  45494. var render = ref.render;
  45495. var staticRenderFns = ref.staticRenderFns;
  45496. options.render = render;
  45497. options.staticRenderFns = staticRenderFns;
  45498. /* istanbul ignore if */
  45499. if (config.performance && mark) {
  45500. mark('compile end');
  45501. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  45502. }
  45503. }
  45504. }
  45505. return mount.call(this, el, hydrating)
  45506. };
  45507. /**
  45508. * Get outerHTML of elements, taking care
  45509. * of SVG elements in IE as well.
  45510. */
  45511. function getOuterHTML (el) {
  45512. if (el.outerHTML) {
  45513. return el.outerHTML
  45514. } else {
  45515. var container = document.createElement('div');
  45516. container.appendChild(el.cloneNode(true));
  45517. return container.innerHTML
  45518. }
  45519. }
  45520. Vue.compile = compileToFunctions;
  45521. module.exports = Vue;
  45522. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(31).setImmediate))
  45523. /***/ }),
  45524. /* 69 */
  45525. /***/ (function(module, exports, __webpack_require__) {
  45526. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  45527. "use strict";
  45528. if (global.setImmediate) {
  45529. return;
  45530. }
  45531. var nextHandle = 1; // Spec says greater than zero
  45532. var tasksByHandle = {};
  45533. var currentlyRunningATask = false;
  45534. var doc = global.document;
  45535. var registerImmediate;
  45536. function setImmediate(callback) {
  45537. // Callback can either be a function or a string
  45538. if (typeof callback !== "function") {
  45539. callback = new Function("" + callback);
  45540. }
  45541. // Copy function arguments
  45542. var args = new Array(arguments.length - 1);
  45543. for (var i = 0; i < args.length; i++) {
  45544. args[i] = arguments[i + 1];
  45545. }
  45546. // Store and register the task
  45547. var task = { callback: callback, args: args };
  45548. tasksByHandle[nextHandle] = task;
  45549. registerImmediate(nextHandle);
  45550. return nextHandle++;
  45551. }
  45552. function clearImmediate(handle) {
  45553. delete tasksByHandle[handle];
  45554. }
  45555. function run(task) {
  45556. var callback = task.callback;
  45557. var args = task.args;
  45558. switch (args.length) {
  45559. case 0:
  45560. callback();
  45561. break;
  45562. case 1:
  45563. callback(args[0]);
  45564. break;
  45565. case 2:
  45566. callback(args[0], args[1]);
  45567. break;
  45568. case 3:
  45569. callback(args[0], args[1], args[2]);
  45570. break;
  45571. default:
  45572. callback.apply(undefined, args);
  45573. break;
  45574. }
  45575. }
  45576. function runIfPresent(handle) {
  45577. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  45578. // So if we're currently running a task, we'll need to delay this invocation.
  45579. if (currentlyRunningATask) {
  45580. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  45581. // "too much recursion" error.
  45582. setTimeout(runIfPresent, 0, handle);
  45583. } else {
  45584. var task = tasksByHandle[handle];
  45585. if (task) {
  45586. currentlyRunningATask = true;
  45587. try {
  45588. run(task);
  45589. } finally {
  45590. clearImmediate(handle);
  45591. currentlyRunningATask = false;
  45592. }
  45593. }
  45594. }
  45595. }
  45596. function installNextTickImplementation() {
  45597. registerImmediate = function(handle) {
  45598. process.nextTick(function () { runIfPresent(handle); });
  45599. };
  45600. }
  45601. function canUsePostMessage() {
  45602. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  45603. // where `global.postMessage` means something completely different and can't be used for this purpose.
  45604. if (global.postMessage && !global.importScripts) {
  45605. var postMessageIsAsynchronous = true;
  45606. var oldOnMessage = global.onmessage;
  45607. global.onmessage = function() {
  45608. postMessageIsAsynchronous = false;
  45609. };
  45610. global.postMessage("", "*");
  45611. global.onmessage = oldOnMessage;
  45612. return postMessageIsAsynchronous;
  45613. }
  45614. }
  45615. function installPostMessageImplementation() {
  45616. // Installs an event handler on `global` for the `message` event: see
  45617. // * https://developer.mozilla.org/en/DOM/window.postMessage
  45618. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  45619. var messagePrefix = "setImmediate$" + Math.random() + "$";
  45620. var onGlobalMessage = function(event) {
  45621. if (event.source === global &&
  45622. typeof event.data === "string" &&
  45623. event.data.indexOf(messagePrefix) === 0) {
  45624. runIfPresent(+event.data.slice(messagePrefix.length));
  45625. }
  45626. };
  45627. if (global.addEventListener) {
  45628. global.addEventListener("message", onGlobalMessage, false);
  45629. } else {
  45630. global.attachEvent("onmessage", onGlobalMessage);
  45631. }
  45632. registerImmediate = function(handle) {
  45633. global.postMessage(messagePrefix + handle, "*");
  45634. };
  45635. }
  45636. function installMessageChannelImplementation() {
  45637. var channel = new MessageChannel();
  45638. channel.port1.onmessage = function(event) {
  45639. var handle = event.data;
  45640. runIfPresent(handle);
  45641. };
  45642. registerImmediate = function(handle) {
  45643. channel.port2.postMessage(handle);
  45644. };
  45645. }
  45646. function installReadyStateChangeImplementation() {
  45647. var html = doc.documentElement;
  45648. registerImmediate = function(handle) {
  45649. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  45650. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  45651. var script = doc.createElement("script");
  45652. script.onreadystatechange = function () {
  45653. runIfPresent(handle);
  45654. script.onreadystatechange = null;
  45655. html.removeChild(script);
  45656. script = null;
  45657. };
  45658. html.appendChild(script);
  45659. };
  45660. }
  45661. function installSetTimeoutImplementation() {
  45662. registerImmediate = function(handle) {
  45663. setTimeout(runIfPresent, 0, handle);
  45664. };
  45665. }
  45666. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  45667. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  45668. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  45669. // Don't get fooled by e.g. browserify environments.
  45670. if ({}.toString.call(global.process) === "[object process]") {
  45671. // For Node.js before 0.9
  45672. installNextTickImplementation();
  45673. } else if (canUsePostMessage()) {
  45674. // For non-IE10 modern browsers
  45675. installPostMessageImplementation();
  45676. } else if (global.MessageChannel) {
  45677. // For web workers, where supported
  45678. installMessageChannelImplementation();
  45679. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  45680. // For IE 6–8
  45681. installReadyStateChangeImplementation();
  45682. } else {
  45683. // For older browsers
  45684. installSetTimeoutImplementation();
  45685. }
  45686. attachTo.setImmediate = setImmediate;
  45687. attachTo.clearImmediate = clearImmediate;
  45688. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  45689. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6), __webpack_require__(52)))
  45690. /***/ }),
  45691. /* 70 */
  45692. /***/ (function(module, exports, __webpack_require__) {
  45693. var disposed = false
  45694. function injectStyle (ssrContext) {
  45695. if (disposed) return
  45696. __webpack_require__(71)
  45697. __webpack_require__(74)
  45698. }
  45699. var normalizeComponent = __webpack_require__(2)
  45700. /* script */
  45701. var __vue_script__ = __webpack_require__(76)
  45702. /* template */
  45703. var __vue_template__ = __webpack_require__(136)
  45704. /* template functional */
  45705. var __vue_template_functional__ = false
  45706. /* styles */
  45707. var __vue_styles__ = injectStyle
  45708. /* scopeId */
  45709. var __vue_scopeId__ = "data-v-0fbb5d46"
  45710. /* moduleIdentifier (server only) */
  45711. var __vue_module_identifier__ = null
  45712. var Component = normalizeComponent(
  45713. __vue_script__,
  45714. __vue_template__,
  45715. __vue_template_functional__,
  45716. __vue_styles__,
  45717. __vue_scopeId__,
  45718. __vue_module_identifier__
  45719. )
  45720. Component.options.__file = "resources/assets/js/main/App.vue"
  45721. /* hot reload */
  45722. if (false) {(function () {
  45723. var hotAPI = require("vue-hot-reload-api")
  45724. hotAPI.install(require("vue"), false)
  45725. if (!hotAPI.compatible) return
  45726. module.hot.accept()
  45727. if (!module.hot.data) {
  45728. hotAPI.createRecord("data-v-0fbb5d46", Component.options)
  45729. } else {
  45730. hotAPI.reload("data-v-0fbb5d46", Component.options)
  45731. }
  45732. module.hot.dispose(function (data) {
  45733. disposed = true
  45734. })
  45735. })()}
  45736. module.exports = Component.exports
  45737. /***/ }),
  45738. /* 71 */
  45739. /***/ (function(module, exports, __webpack_require__) {
  45740. // style-loader: Adds some css to the DOM by adding a <style> tag
  45741. // load the styles
  45742. var content = __webpack_require__(72);
  45743. if(typeof content === 'string') content = [[module.i, content, '']];
  45744. if(content.locals) module.exports = content.locals;
  45745. // add the styles to the DOM
  45746. var update = __webpack_require__(1)("29742c7e", content, false, {});
  45747. // Hot Module Replacement
  45748. if(false) {
  45749. // When the styles change, update the <style> tags
  45750. if(!content.locals) {
  45751. module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./App.vue", function() {
  45752. var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./App.vue");
  45753. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  45754. update(newContent);
  45755. });
  45756. }
  45757. // When the module is disposed, remove the <style> tags
  45758. module.hot.dispose(function() { update(); });
  45759. }
  45760. /***/ }),
  45761. /* 72 */
  45762. /***/ (function(module, exports, __webpack_require__) {
  45763. exports = module.exports = __webpack_require__(0)(false);
  45764. // imports
  45765. // module
  45766. exports.push([module.i, "\nbody { overflow-x: hidden;\n}\n", ""]);
  45767. // exports
  45768. /***/ }),
  45769. /* 73 */
  45770. /***/ (function(module, exports) {
  45771. /**
  45772. * Translates the list format produced by css-loader into something
  45773. * easier to manipulate.
  45774. */
  45775. module.exports = function listToStyles (parentId, list) {
  45776. var styles = []
  45777. var newStyles = {}
  45778. for (var i = 0; i < list.length; i++) {
  45779. var item = list[i]
  45780. var id = item[0]
  45781. var css = item[1]
  45782. var media = item[2]
  45783. var sourceMap = item[3]
  45784. var part = {
  45785. id: parentId + ':' + i,
  45786. css: css,
  45787. media: media,
  45788. sourceMap: sourceMap
  45789. }
  45790. if (!newStyles[id]) {
  45791. styles.push(newStyles[id] = { id: id, parts: [part] })
  45792. } else {
  45793. newStyles[id].parts.push(part)
  45794. }
  45795. }
  45796. return styles
  45797. }
  45798. /***/ }),
  45799. /* 74 */
  45800. /***/ (function(module, exports, __webpack_require__) {
  45801. // style-loader: Adds some css to the DOM by adding a <style> tag
  45802. // load the styles
  45803. var content = __webpack_require__(75);
  45804. if(typeof content === 'string') content = [[module.i, content, '']];
  45805. if(content.locals) module.exports = content.locals;
  45806. // add the styles to the DOM
  45807. var update = __webpack_require__(1)("4c209231", content, false, {});
  45808. // Hot Module Replacement
  45809. if(false) {
  45810. // When the styles change, update the <style> tags
  45811. if(!content.locals) {
  45812. module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./App.vue", function() {
  45813. var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0fbb5d46\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./App.vue");
  45814. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  45815. update(newContent);
  45816. });
  45817. }
  45818. // When the module is disposed, remove the <style> tags
  45819. module.hot.dispose(function() { update(); });
  45820. }
  45821. /***/ }),
  45822. /* 75 */
  45823. /***/ (function(module, exports, __webpack_require__) {
  45824. exports = module.exports = __webpack_require__(0)(false);
  45825. // imports
  45826. // module
  45827. exports.push([module.i, "\n.child-view[data-v-0fbb5d46] {\n position: absolute;\n width: 100%;\n min-height: 100%;\n background-color: #f1f2f7;\n -webkit-transition: all .3s cubic-bezier(.55, 0, .1, 1);\n transition: all .3s cubic-bezier(.55, 0, .1, 1);\n}\n.app-slide-no-leave-to[data-v-0fbb5d46] {display: none;\n}\n/**\n * 左右模式\n */\n.app-slide-left-leave-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-left-leave-to[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-left-enter-active[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(30%,0);transform:translate(30%,0)\n}\n.app-slide-left-enter-to[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-leave-active[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-leave-to[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(30%,0);transform:translate(30%,0)\n}\n.app-slide-right-enter-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-right-enter[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n\n/**\n * 上下模式\n */\n.app-slide-up-leave-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-up-leave-to[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-up-enter-active[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(0,20%);transform:translate(0,20%)\n}\n.app-slide-up-enter-to[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-leave-active[data-v-0fbb5d46]{opacity:1;z-index:2;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-leave-to[data-v-0fbb5d46]{opacity:0;z-index:2;-webkit-transform:translate(0,20%);transform:translate(0,20%)\n}\n.app-slide-down-enter-active[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n.app-slide-down-enter[data-v-0fbb5d46]{z-index:1;-webkit-transform:translate(0,0);transform:translate(0,0)\n}\n", ""]);
  45828. // exports
  45829. /***/ }),
  45830. /* 76 */
  45831. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  45832. "use strict";
  45833. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  45834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_WSpinner__ = __webpack_require__(77);
  45835. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__components_WSpinner___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__components_WSpinner__);
  45836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_WHeader__ = __webpack_require__(82);
  45837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__components_WHeader___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__components_WHeader__);
  45838. //
  45839. //
  45840. //
  45841. //
  45842. //
  45843. //
  45844. //
  45845. //
  45846. //
  45847. //
  45848. //
  45849. //
  45850. /* harmony default export */ __webpack_exports__["default"] = ({
  45851. components: { WHeader: __WEBPACK_IMPORTED_MODULE_1__components_WHeader___default.a, WSpinner: __WEBPACK_IMPORTED_MODULE_0__components_WSpinner___default.a },
  45852. data: function data() {
  45853. return {
  45854. transitionName: null
  45855. };
  45856. },
  45857. mounted: function mounted() {
  45858. var _this = this;
  45859. this.checkToken();
  45860. //
  45861. var hash = window.location.hash;
  45862. if (hash.indexOf("#") === 0) {
  45863. hash = hash.substr(1);
  45864. if (hash) {
  45865. this.$nextTick(function () {
  45866. hash = $A.removeURLParameter(hash, 'token');
  45867. _this.goForward({ path: hash });
  45868. });
  45869. }
  45870. }
  45871. this.sessionStorage('/', 1);
  45872. var pathname = window.location.pathname;
  45873. if (pathname && this.sessionStorage(pathname) === 0) {
  45874. this.sessionStorage(pathname, this.sessionStorage('::count') + 1);
  45875. }
  45876. //
  45877. setInterval(function () {
  45878. _this.searchEnter();
  45879. }, 1000);
  45880. //
  45881. this.handleWebSocket();
  45882. $A.setOnUserInfoListener("app", function () {
  45883. _this.handleWebSocket();
  45884. });
  45885. },
  45886. watch: {
  45887. '$route': function $route(To, From) {
  45888. if (this.transitionName === null) {
  45889. this.transitionName = 'app-slide-no';
  45890. return;
  45891. }
  45892. if (typeof To.name === 'undefined' || typeof From.name === 'undefined') {
  45893. return;
  45894. }
  45895. this.slideType(To, From);
  45896. }
  45897. },
  45898. methods: {
  45899. checkToken: function checkToken() {
  45900. var _this2 = this;
  45901. var token = $A.urlParameter("token");
  45902. if ($A.count(token) > 10) {
  45903. $.setToken(decodeURIComponent(token));
  45904. $A.getUserInfo(true);
  45905. var path = $A.removeURLParameter(window.location.href, 'token');
  45906. var uri = document.createElement('a');
  45907. uri.href = path;
  45908. if (uri.pathname) {
  45909. var query = $A.urlParameterAll();
  45910. if (typeof query['token'] !== "undefined") delete query['token'];
  45911. this.$nextTick(function () {
  45912. _this2.goForward({ path: uri.pathname, query: query }, true);
  45913. });
  45914. }
  45915. }
  45916. },
  45917. slideType: function slideType(To, From) {
  45918. var isBack = this.$router.isBack;
  45919. this.$router.isBack = false;
  45920. //
  45921. var ToIndex = this.sessionStorage(To.path);
  45922. var FromIndex = this.sessionStorage(From.path);
  45923. if (ToIndex && ToIndex < FromIndex) {
  45924. isBack = true; //后退
  45925. this.sessionStorage(true, ToIndex);
  45926. } else {
  45927. isBack = false; //前进
  45928. this.sessionStorage(To.path, this.sessionStorage('::count') + 1);
  45929. }
  45930. //
  45931. if (To.meta.slide === false || From.meta.slide === false) {
  45932. //取消动画
  45933. this.transitionName = 'app-slide-no';
  45934. } else if (To.meta.slide === 'up' || From.meta.slide === 'up' || To.meta.slide === 'down' || From.meta.slide === 'down') {
  45935. //上下动画
  45936. if (isBack) {
  45937. this.transitionName = 'app-slide-down';
  45938. } else {
  45939. this.transitionName = 'app-slide-up';
  45940. }
  45941. } else {
  45942. //左右动画(默认)
  45943. if (isBack) {
  45944. this.transitionName = 'app-slide-right';
  45945. } else {
  45946. this.transitionName = 'app-slide-left';
  45947. }
  45948. }
  45949. },
  45950. sessionStorage: function sessionStorage(path, num) {
  45951. var conut = 0;
  45952. var history = JSON.parse(window.sessionStorage['__history__'] || '{}');
  45953. if (path === true) {
  45954. var items = {};
  45955. for (var i in history) {
  45956. if (history.hasOwnProperty(i)) {
  45957. if (parseInt(history[i]) <= num) {
  45958. items[i] = history[i];
  45959. conut++;
  45960. }
  45961. }
  45962. }
  45963. history = items;
  45964. history['::count'] = Math.max(num, conut);
  45965. window.sessionStorage['__history__'] = JSON.stringify(history);
  45966. return history;
  45967. }
  45968. if (typeof num === 'undefined') {
  45969. return parseInt(history[path] || 0);
  45970. }
  45971. if (path === "/") num = 1;
  45972. history[path] = num;
  45973. for (var key in history) {
  45974. if (history.hasOwnProperty(key) && key !== '::count') {
  45975. conut++;
  45976. }
  45977. }
  45978. history['::count'] = Math.max(num, conut);
  45979. window.sessionStorage['__history__'] = JSON.stringify(history);
  45980. },
  45981. searchEnter: function searchEnter() {
  45982. var row = $A(".sreachBox");
  45983. if (row.length === 0) {
  45984. return;
  45985. }
  45986. if (row.attr("data-enter-init") === "init") {
  45987. return;
  45988. }
  45989. row.attr("data-enter-init", "init");
  45990. //
  45991. var buttons = row.find("button[type='button']");
  45992. var button = null;
  45993. if (buttons.length === 0) {
  45994. return;
  45995. }
  45996. buttons.each(function (index, item) {
  45997. if ($A(item).text().indexOf("搜索")) {
  45998. button = $A(item);
  45999. }
  46000. });
  46001. if (button === null) {
  46002. return;
  46003. }
  46004. row.find("input.ivu-input").keydown(function (e) {
  46005. if (e.keyCode == 13) {
  46006. if (!button.hasClass("ivu-btn-loading")) {
  46007. button.click();
  46008. }
  46009. }
  46010. });
  46011. },
  46012. handleWebSocket: function handleWebSocket() {
  46013. var _this3 = this;
  46014. if ($A.getToken() === false) {
  46015. $A.WSOB.close();
  46016. } else {
  46017. $A.WSOB.setOnMsgListener("app", function (msgDetail) {
  46018. if (msgDetail.username == _this3.usrName) {
  46019. return;
  46020. }
  46021. switch (msgDetail.messageType) {
  46022. case 'open':
  46023. window.localStorage.setItem("__::WookTeam:config", $A.jsonStringify(Object.assign(msgDetail.config, {
  46024. nickname: $A.getNickName(false)
  46025. })));
  46026. break;
  46027. case 'close':
  46028. window.localStorage.setItem("__::WookTeam:config", $A.jsonStringify({}));
  46029. break;
  46030. case 'info':
  46031. if (msgDetail.body.type == 'update') {
  46032. $A.getUserInfo(true);
  46033. }
  46034. break;
  46035. case 'user':
  46036. if (msgDetail.body.type == 'taskA') {
  46037. $A.triggerTaskInfoListener(msgDetail.body.act, msgDetail.body.taskDetail, false);
  46038. }
  46039. break;
  46040. case 'kick':
  46041. $A.token("");
  46042. $A.storage("userInfo", {});
  46043. $A.triggerUserInfoListener({});
  46044. //
  46045. var id = 'inip_' + Math.round(Math.random() * 10000);
  46046. var ip = msgDetail.body.ip;
  46047. var ip2 = ip.substring(0, ip.lastIndexOf('.')) + '.*';
  46048. _this3.$Modal.warning({
  46049. title: _this3.$L("系统提示"),
  46050. content: _this3.$L('您的帐号在其他地方(%)登录,您被迫退出,如果这不是您本人的操作,请注意帐号安全!', '<span id="' + id + '">' + ip2 + '</span>'),
  46051. onOk: function onOk() {
  46052. _this3.goForward({ path: '/' }, true);
  46053. }
  46054. });
  46055. _this3.$nextTick(function () {
  46056. $A.getIpInfo(ip, function (res) {
  46057. if (res.ret === 1) {
  46058. $A("span#" + id).text(res.data.textSmall);
  46059. $A("span#" + id).attr("title", ip2);
  46060. }
  46061. });
  46062. });
  46063. break;
  46064. }
  46065. });
  46066. }
  46067. }
  46068. }
  46069. });
  46070. /***/ }),
  46071. /* 77 */
  46072. /***/ (function(module, exports, __webpack_require__) {
  46073. var disposed = false
  46074. function injectStyle (ssrContext) {
  46075. if (disposed) return
  46076. __webpack_require__(78)
  46077. }
  46078. var normalizeComponent = __webpack_require__(2)
  46079. /* script */
  46080. var __vue_script__ = __webpack_require__(80)
  46081. /* template */
  46082. var __vue_template__ = __webpack_require__(81)
  46083. /* template functional */
  46084. var __vue_template_functional__ = false
  46085. /* styles */
  46086. var __vue_styles__ = injectStyle
  46087. /* scopeId */
  46088. var __vue_scopeId__ = "data-v-1f542a12"
  46089. /* moduleIdentifier (server only) */
  46090. var __vue_module_identifier__ = null
  46091. var Component = normalizeComponent(
  46092. __vue_script__,
  46093. __vue_template__,
  46094. __vue_template_functional__,
  46095. __vue_styles__,
  46096. __vue_scopeId__,
  46097. __vue_module_identifier__
  46098. )
  46099. Component.options.__file = "resources/assets/js/main/components/WSpinner.vue"
  46100. /* hot reload */
  46101. if (false) {(function () {
  46102. var hotAPI = require("vue-hot-reload-api")
  46103. hotAPI.install(require("vue"), false)
  46104. if (!hotAPI.compatible) return
  46105. module.hot.accept()
  46106. if (!module.hot.data) {
  46107. hotAPI.createRecord("data-v-1f542a12", Component.options)
  46108. } else {
  46109. hotAPI.reload("data-v-1f542a12", Component.options)
  46110. }
  46111. module.hot.dispose(function (data) {
  46112. disposed = true
  46113. })
  46114. })()}
  46115. module.exports = Component.exports
  46116. /***/ }),
  46117. /* 78 */
  46118. /***/ (function(module, exports, __webpack_require__) {
  46119. // style-loader: Adds some css to the DOM by adding a <style> tag
  46120. // load the styles
  46121. var content = __webpack_require__(79);
  46122. if(typeof content === 'string') content = [[module.i, content, '']];
  46123. if(content.locals) module.exports = content.locals;
  46124. // add the styles to the DOM
  46125. var update = __webpack_require__(1)("0de25de8", content, false, {});
  46126. // Hot Module Replacement
  46127. if(false) {
  46128. // When the styles change, update the <style> tags
  46129. if(!content.locals) {
  46130. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1f542a12\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WSpinner.vue", function() {
  46131. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1f542a12\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WSpinner.vue");
  46132. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  46133. update(newContent);
  46134. });
  46135. }
  46136. // When the module is disposed, remove the <style> tags
  46137. module.hot.dispose(function() { update(); });
  46138. }
  46139. /***/ }),
  46140. /* 79 */
  46141. /***/ (function(module, exports, __webpack_require__) {
  46142. exports = module.exports = __webpack_require__(0)(false);
  46143. // imports
  46144. // module
  46145. exports.push([module.i, "\n.w-spinner[data-v-1f542a12] {\n display: none;\n position: fixed;\n z-index: 9999;\n bottom: 20px;\n right: 20px;\n margin: 0 auto;\n width: 30px;\n height: 30px;\n}\n.w-spinner .w-circular[data-v-1f542a12] {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}\n", ""]);
  46146. // exports
  46147. /***/ }),
  46148. /* 80 */
  46149. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46150. "use strict";
  46151. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  46152. //
  46153. //
  46154. //
  46155. //
  46156. //
  46157. //
  46158. //
  46159. //
  46160. //
  46161. //
  46162. //
  46163. //
  46164. //
  46165. //
  46166. //
  46167. //
  46168. //
  46169. //
  46170. //
  46171. //
  46172. //
  46173. //
  46174. //
  46175. //
  46176. //
  46177. //
  46178. //
  46179. /* harmony default export */ __webpack_exports__["default"] = ({
  46180. name: 'WSpinner'
  46181. });
  46182. /***/ }),
  46183. /* 81 */
  46184. /***/ (function(module, exports, __webpack_require__) {
  46185. var render = function() {
  46186. var _vm = this
  46187. var _h = _vm.$createElement
  46188. var _c = _vm._self._c || _h
  46189. return _c(
  46190. "div",
  46191. { staticClass: "w-spinner" },
  46192. [_c("w-loading", { staticClass: "w-circular" })],
  46193. 1
  46194. )
  46195. }
  46196. var staticRenderFns = []
  46197. render._withStripped = true
  46198. module.exports = { render: render, staticRenderFns: staticRenderFns }
  46199. if (false) {
  46200. module.hot.accept()
  46201. if (module.hot.data) {
  46202. require("vue-hot-reload-api") .rerender("data-v-1f542a12", module.exports)
  46203. }
  46204. }
  46205. /***/ }),
  46206. /* 82 */
  46207. /***/ (function(module, exports, __webpack_require__) {
  46208. var disposed = false
  46209. function injectStyle (ssrContext) {
  46210. if (disposed) return
  46211. __webpack_require__(83)
  46212. __webpack_require__(85)
  46213. }
  46214. var normalizeComponent = __webpack_require__(2)
  46215. /* script */
  46216. var __vue_script__ = __webpack_require__(87)
  46217. /* template */
  46218. var __vue_template__ = __webpack_require__(135)
  46219. /* template functional */
  46220. var __vue_template_functional__ = false
  46221. /* styles */
  46222. var __vue_styles__ = injectStyle
  46223. /* scopeId */
  46224. var __vue_scopeId__ = "data-v-2df6db1f"
  46225. /* moduleIdentifier (server only) */
  46226. var __vue_module_identifier__ = null
  46227. var Component = normalizeComponent(
  46228. __vue_script__,
  46229. __vue_template__,
  46230. __vue_template_functional__,
  46231. __vue_styles__,
  46232. __vue_scopeId__,
  46233. __vue_module_identifier__
  46234. )
  46235. Component.options.__file = "resources/assets/js/main/components/WHeader.vue"
  46236. /* hot reload */
  46237. if (false) {(function () {
  46238. var hotAPI = require("vue-hot-reload-api")
  46239. hotAPI.install(require("vue"), false)
  46240. if (!hotAPI.compatible) return
  46241. module.hot.accept()
  46242. if (!module.hot.data) {
  46243. hotAPI.createRecord("data-v-2df6db1f", Component.options)
  46244. } else {
  46245. hotAPI.reload("data-v-2df6db1f", Component.options)
  46246. }
  46247. module.hot.dispose(function (data) {
  46248. disposed = true
  46249. })
  46250. })()}
  46251. module.exports = Component.exports
  46252. /***/ }),
  46253. /* 83 */
  46254. /***/ (function(module, exports, __webpack_require__) {
  46255. // style-loader: Adds some css to the DOM by adding a <style> tag
  46256. // load the styles
  46257. var content = __webpack_require__(84);
  46258. if(typeof content === 'string') content = [[module.i, content, '']];
  46259. if(content.locals) module.exports = content.locals;
  46260. // add the styles to the DOM
  46261. var update = __webpack_require__(1)("3e511ece", content, false, {});
  46262. // Hot Module Replacement
  46263. if(false) {
  46264. // When the styles change, update the <style> tags
  46265. if(!content.locals) {
  46266. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WHeader.vue", function() {
  46267. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WHeader.vue");
  46268. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  46269. update(newContent);
  46270. });
  46271. }
  46272. // When the module is disposed, remove the <style> tags
  46273. module.hot.dispose(function() { update(); });
  46274. }
  46275. /***/ }),
  46276. /* 84 */
  46277. /***/ (function(module, exports, __webpack_require__) {
  46278. exports = module.exports = __webpack_require__(0)(false);
  46279. // imports
  46280. // module
  46281. exports.push([module.i, "\n.w-header-chat-draver .ivu-drawer-wrap,\n.w-header-chat-draver .ivu-drawer-mask {\n z-index: 1001;\n}\n.w-header-chat-draver .w-header-chat-close {\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 1;\n color: #ffffff;\n font-size: 32px;\n width: 68px;\n height: 58px;\n line-height: 58px;\n text-align: center;\n cursor: pointer;\n}\n@media (max-width: 768px) {\n.w-header-chat-draver .w-header-chat-close {\n width: 50px;\n height: 50px;\n line-height: 50px;\n}\n}\n.w-header-chat-draver .w-header-chat-close > i {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.w-header-chat-draver .w-header-chat-close:hover > i {\n -webkit-transform: scale(1.12) rotate(90deg);\n transform: scale(1.12) rotate(90deg);\n}\n", ""]);
  46282. // exports
  46283. /***/ }),
  46284. /* 85 */
  46285. /***/ (function(module, exports, __webpack_require__) {
  46286. // style-loader: Adds some css to the DOM by adding a <style> tag
  46287. // load the styles
  46288. var content = __webpack_require__(86);
  46289. if(typeof content === 'string') content = [[module.i, content, '']];
  46290. if(content.locals) module.exports = content.locals;
  46291. // add the styles to the DOM
  46292. var update = __webpack_require__(1)("2b23ebf8", content, false, {});
  46293. // Hot Module Replacement
  46294. if(false) {
  46295. // When the styles change, update the <style> tags
  46296. if(!content.locals) {
  46297. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./WHeader.vue", function() {
  46298. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2df6db1f\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./WHeader.vue");
  46299. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  46300. update(newContent);
  46301. });
  46302. }
  46303. // When the module is disposed, remove the <style> tags
  46304. module.hot.dispose(function() { update(); });
  46305. }
  46306. /***/ }),
  46307. /* 86 */
  46308. /***/ (function(module, exports, __webpack_require__) {
  46309. exports = module.exports = __webpack_require__(0)(false);
  46310. // imports
  46311. // module
  46312. exports.push([module.i, "\n.w-header[data-v-2df6db1f] {\n z-index: 15;\n position: fixed;\n left: 0;\n top: 0;\n right: 0;\n font-size: 14px;\n background: #0396f2 linear-gradient(45deg, #0396f2 0%, #0285d7 100%);\n -webkit-box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.25);\n box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.25);\n}\n.w-header .icon[data-v-2df6db1f] {\n font-size: 16px;\n margin-right: 3px;\n}\n.w-header .w-header-row[data-v-2df6db1f] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n color: #fff;\n height: 40px;\n position: relative;\n z-index: 10;\n margin: 0 32px;\n}\n.w-header .w-header-row .w-header-row-left[data-v-2df6db1f] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n overflow-x: auto;\n -webkit-backface-visibility: hidden;\n -webkit-overflow-scrolling: touch;\n}\n.w-header .w-header-row .w-header-row-left li[data-v-2df6db1f] {\n line-height: 40px;\n color: #fff;\n display: inline-block;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f] {\n color: #fff;\n display: block;\n min-width: 116px;\n text-align: center;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f]:visited {\n color: #fff;\n}\n.w-header .w-header-row .w-header-row-left li a[data-v-2df6db1f]:hover {\n color: #f2f2f2;\n}\n.w-header .w-header-row .w-header-row-left li[data-v-2df6db1f]:hover, .w-header .w-header-row .w-header-row-left li.active[data-v-2df6db1f] {\n background: #0277c0;\n}\n.w-header .w-header-row .w-header-row-right[data-v-2df6db1f] {\n white-space: nowrap;\n text-align: right;\n line-height: 40px;\n margin-right: -5px;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f] {\n display: inline-block;\n position: relative;\n padding-left: 10px;\n padding-right: 10px;\n margin-right: -5px;\n cursor: pointer;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f]:hover {\n background: #0277c0;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-mticon[data-v-2df6db1f] {\n vertical-align: top;\n margin-top: 8px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-mticon-9[data-v-2df6db1f] {\n vertical-align: top;\n margin-top: 9px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .right-info-num[data-v-2df6db1f] {\n position: absolute;\n top: 2px;\n left: 22px;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9);\n transform: scale(0.9);\n z-index: 1;\n}\n.w-header .w-header-row .w-header-row-right .right-info .userimg[data-v-2df6db1f] {\n display: none;\n width: 26px;\n height: 26px;\n margin-top: 7px;\n vertical-align: top;\n border-radius: 50%;\n}\n.w-header .w-header-row .w-header-row-right .right-info .username[data-v-2df6db1f] {\n display: inline-block;\n}\n@media (max-width: 768px) {\n.w-header .w-header-row[data-v-2df6db1f] {\n margin: 0 16px;\n}\n.w-header .w-header-row .w-header-row-left .dropdown-menu[data-v-2df6db1f] {\n font-size: 28px;\n vertical-align: top;\n margin-top: 6px;\n}\n.w-header .w-header-row .w-header-row-right .right-info[data-v-2df6db1f] {\n padding-left: 8px;\n padding-right: 8px;\n}\n.w-header .w-header-row .w-header-row-right .right-info .userimg[data-v-2df6db1f] {\n display: inline-block;\n}\n.w-header .w-header-row .w-header-row-right .right-info .username[data-v-2df6db1f] {\n display: none;\n}\n}\n.setting-auto-day[data-v-2df6db1f] {\n display: block;\n width: 110px;\n margin-top: 12px;\n line-height: 32px;\n margin-bottom: -10px;\n}\n.setting-bg[data-v-2df6db1f] {\n margin-top: 6px;\n margin-bottom: -24px;\n}\n.setting-bg[data-v-2df6db1f]:after, .setting-bg[data-v-2df6db1f]:before {\n display: table;\n content: \"\";\n}\n.setting-bg li[data-v-2df6db1f] {\n margin: 0 16px 16px 0;\n width: 160px;\n height: 124px;\n display: inline-block;\n cursor: pointer;\n border: solid 2px #fff;\n background-repeat: no-repeat;\n background-position: center;\n background-size: cover;\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.setting-bg li.active[data-v-2df6db1f], .setting-bg li[data-v-2df6db1f]:hover {\n border-color: #0396f2;\n -webkit-transform: scale(1.02);\n transform: scale(1.02);\n}\n", ""]);
  46313. // exports
  46314. /***/ }),
  46315. /* 87 */
  46316. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46317. "use strict";
  46318. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  46319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ImgUpload__ = __webpack_require__(17);
  46320. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__ImgUpload__);
  46321. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__project_header_create__ = __webpack_require__(92);
  46322. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__project_header_create___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__project_header_create__);
  46323. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__project_header_archived__ = __webpack_require__(101);
  46324. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__project_header_archived___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__project_header_archived__);
  46325. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chat_Index__ = __webpack_require__(106);
  46326. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__chat_Index___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__chat_Index__);
  46327. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer__ = __webpack_require__(49);
  46328. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__iview_WDrawer__);
  46329. var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
  46330. //
  46331. //
  46332. //
  46333. //
  46334. //
  46335. //
  46336. //
  46337. //
  46338. //
  46339. //
  46340. //
  46341. //
  46342. //
  46343. //
  46344. //
  46345. //
  46346. //
  46347. //
  46348. //
  46349. //
  46350. //
  46351. //
  46352. //
  46353. //
  46354. //
  46355. //
  46356. //
  46357. //
  46358. //
  46359. //
  46360. //
  46361. //
  46362. //
  46363. //
  46364. //
  46365. //
  46366. //
  46367. //
  46368. //
  46369. //
  46370. //
  46371. //
  46372. //
  46373. //
  46374. //
  46375. //
  46376. //
  46377. //
  46378. //
  46379. //
  46380. //
  46381. //
  46382. //
  46383. //
  46384. //
  46385. //
  46386. //
  46387. //
  46388. //
  46389. //
  46390. //
  46391. //
  46392. //
  46393. //
  46394. //
  46395. //
  46396. //
  46397. //
  46398. //
  46399. //
  46400. //
  46401. //
  46402. //
  46403. //
  46404. //
  46405. //
  46406. //
  46407. //
  46408. //
  46409. //
  46410. //
  46411. //
  46412. //
  46413. //
  46414. //
  46415. //
  46416. //
  46417. //
  46418. //
  46419. //
  46420. //
  46421. //
  46422. //
  46423. //
  46424. //
  46425. //
  46426. //
  46427. //
  46428. //
  46429. //
  46430. //
  46431. //
  46432. //
  46433. //
  46434. //
  46435. //
  46436. //
  46437. //
  46438. //
  46439. //
  46440. //
  46441. //
  46442. //
  46443. //
  46444. //
  46445. //
  46446. //
  46447. //
  46448. //
  46449. //
  46450. //
  46451. //
  46452. //
  46453. //
  46454. //
  46455. //
  46456. //
  46457. //
  46458. //
  46459. //
  46460. //
  46461. //
  46462. //
  46463. //
  46464. //
  46465. //
  46466. //
  46467. //
  46468. //
  46469. //
  46470. //
  46471. //
  46472. //
  46473. //
  46474. //
  46475. //
  46476. //
  46477. //
  46478. //
  46479. //
  46480. //
  46481. //
  46482. //
  46483. //
  46484. //
  46485. //
  46486. //
  46487. //
  46488. //
  46489. //
  46490. //
  46491. //
  46492. //
  46493. //
  46494. //
  46495. //
  46496. //
  46497. //
  46498. //
  46499. //
  46500. //
  46501. //
  46502. //
  46503. //
  46504. //
  46505. //
  46506. //
  46507. //
  46508. //
  46509. //
  46510. //
  46511. //
  46512. //
  46513. //
  46514. //
  46515. //
  46516. //
  46517. //
  46518. //
  46519. //
  46520. //
  46521. //
  46522. //
  46523. //
  46524. //
  46525. //
  46526. //
  46527. //
  46528. //
  46529. //
  46530. //
  46531. //
  46532. //
  46533. //
  46534. //
  46535. //
  46536. //
  46537. //
  46538. //
  46539. //
  46540. //
  46541. //
  46542. //
  46543. //
  46544. //
  46545. //
  46546. //
  46547. //
  46548. //
  46549. //
  46550. //
  46551. //
  46552. //
  46553. //
  46554. //
  46555. //
  46556. //
  46557. //
  46558. //
  46559. //
  46560. //
  46561. //
  46562. //
  46563. //
  46564. //
  46565. //
  46566. //
  46567. //
  46568. //
  46569. //
  46570. //
  46571. //
  46572. //
  46573. //
  46574. //
  46575. //
  46576. //
  46577. //
  46578. //
  46579. //
  46580. //
  46581. //
  46582. //
  46583. //
  46584. //
  46585. //
  46586. //
  46587. //
  46588. //
  46589. //
  46590. //
  46591. //
  46592. //
  46593. //
  46594. //
  46595. //
  46596. //
  46597. //
  46598. //
  46599. //
  46600. //
  46601. //
  46602. //
  46603. //
  46604. //
  46605. //
  46606. //
  46607. //
  46608. //
  46609. //
  46610. //
  46611. //
  46612. //
  46613. //
  46614. //
  46615. //
  46616. //
  46617. //
  46618. //
  46619. //
  46620. //
  46621. //
  46622. //
  46623. //
  46624. //
  46625. //
  46626. //
  46627. //
  46628. //
  46629. //
  46630. //
  46631. //
  46632. //
  46633. //
  46634. //
  46635. //
  46636. //
  46637. //
  46638. //
  46639. //
  46640. //
  46641. //
  46642. //
  46643. //
  46644. //
  46645. //
  46646. //
  46647. //
  46648. //
  46649. //
  46650. //
  46651. //
  46652. //
  46653. //
  46654. //
  46655. //
  46656. //
  46657. //
  46658. //
  46659. //
  46660. //
  46661. //
  46662. //
  46663. //
  46664. //
  46665. //
  46666. //
  46667. //
  46668. //
  46669. //
  46670. //
  46671. //
  46672. //
  46673. //
  46674. //
  46675. //
  46676. //
  46677. //
  46678. //
  46679. //
  46680. //
  46681. //
  46682. //
  46683. //
  46684. //
  46685. //
  46686. //
  46687. //
  46688. //
  46689. //
  46690. //
  46691. //
  46692. //
  46693. /* harmony default export */ __webpack_exports__["default"] = ({
  46694. name: 'WHeader',
  46695. components: { WDrawer: __WEBPACK_IMPORTED_MODULE_4__iview_WDrawer___default.a, ChatIndex: __WEBPACK_IMPORTED_MODULE_3__chat_Index___default.a, HeaderArchived: __WEBPACK_IMPORTED_MODULE_2__project_header_archived___default.a, HeaderCreate: __WEBPACK_IMPORTED_MODULE_1__project_header_create___default.a, ImgUpload: __WEBPACK_IMPORTED_MODULE_0__ImgUpload___default.a },
  46696. data: function data() {
  46697. return {
  46698. tabActive: '',
  46699. loadIng: 0,
  46700. isAdmin: false,
  46701. systemDrawerShow: false,
  46702. userDrawerShow: false,
  46703. userDrawerTab: 'personal',
  46704. formSystem: {
  46705. github: 'show',
  46706. reg: 'open',
  46707. callav: 'open',
  46708. autoArchived: 'close',
  46709. archivedDay: 7
  46710. },
  46711. formDatum: {
  46712. userimg: '',
  46713. nickname: '',
  46714. profession: ''
  46715. },
  46716. ruleDatum: {},
  46717. formPass: {
  46718. oldpass: '',
  46719. newpass: '',
  46720. checkpass: ''
  46721. },
  46722. rulePass: {},
  46723. formSetting: {
  46724. bgid: 0
  46725. },
  46726. chatDrawerShow: false,
  46727. chatUnreadTotal: 0
  46728. };
  46729. },
  46730. mounted: function mounted() {
  46731. this.isAdmin = $A.identity('admin');
  46732. this.formatDatum();
  46733. //
  46734. this.tabActive = this.$route.meta.tabActive;
  46735. //
  46736. if ($A.urlParameter("open") === 'chat' && $A.getToken() !== false) {
  46737. this.chatDrawerShow = true;
  46738. }
  46739. },
  46740. watch: {
  46741. '$route': function $route() {
  46742. this.tabActive = this.$route.meta.tabActive;
  46743. this.systemDrawerShow = false;
  46744. this.chatDrawerShow = $A.urlParameter("open") === 'chat' && $A.getToken() !== false;
  46745. if (!this.usrInfo.changepass) {
  46746. this.userDrawerShow = false;
  46747. }
  46748. },
  46749. usrName: function usrName() {
  46750. this.isAdmin = $A.identity('admin');
  46751. this.formatDatum();
  46752. }
  46753. },
  46754. methods: {
  46755. initLanguage: function initLanguage() {
  46756. var _this = this;
  46757. this.ruleDatum = {
  46758. nickname: [{ required: true, message: this.$L('请输入昵称!'), trigger: 'change' }, { type: 'string', min: 2, message: this.$L('昵称长度至少2位!'), trigger: 'change' }]
  46759. };
  46760. this.rulePass = {
  46761. oldpass: [{ required: true, message: this.$L('请输入旧密码!'), trigger: 'change' }, { type: 'string', min: 6, message: this.$L('密码长度至少6位!'), trigger: 'change' }],
  46762. newpass: [{
  46763. validator: function validator(rule, value, callback) {
  46764. if (value === '') {
  46765. callback(new Error(_this.$L('请输入新密码!')));
  46766. } else {
  46767. if (_this.formPass.checkpass !== '') {
  46768. _this.$refs.formPass.validateField('checkpass');
  46769. }
  46770. callback();
  46771. }
  46772. },
  46773. required: true,
  46774. trigger: 'change'
  46775. }, { type: 'string', min: 6, message: this.$L('密码长度至少6位!'), trigger: 'change' }],
  46776. checkpass: [{
  46777. validator: function validator(rule, value, callback) {
  46778. if (value === '') {
  46779. callback(new Error(_this.$L('请重新输入新密码!')));
  46780. } else if (value !== _this.formPass.newpass) {
  46781. callback(new Error(_this.$L('两次密码输入不一致!')));
  46782. } else {
  46783. callback();
  46784. }
  46785. },
  46786. required: true,
  46787. trigger: 'change'
  46788. }]
  46789. };
  46790. },
  46791. formatDatum: function formatDatum() {
  46792. this.$set(this.formDatum, 'userimg', this.usrInfo.userimg);
  46793. this.$set(this.formDatum, 'nickname', this.usrInfo.nickname);
  46794. this.$set(this.formDatum, 'profession', this.usrInfo.profession);
  46795. this.$set(this.formSetting, 'bgid', this.usrInfo.bgid);
  46796. this.formDatum__reset = $A.cloneData(this.formDatum);
  46797. this.formSetting__reset = $A.cloneData(this.formSetting);
  46798. this.formPass__reset = $A.cloneData(this.formPass);
  46799. this.changepass();
  46800. },
  46801. changepass: function changepass() {
  46802. var _this2 = this;
  46803. if (this.usrInfo.changepass) {
  46804. this.userDrawerShow = true;
  46805. this.userDrawerTab = 'account';
  46806. setTimeout(function () {
  46807. _this2.changepass();
  46808. }, 500);
  46809. }
  46810. },
  46811. getBgUrl: function getBgUrl(id, thumb) {
  46812. id = Math.max(1, parseInt(id));
  46813. return 'url(' + window.location.origin + '/images/bg/' + (thumb ? 'thumb/' : '') + id + '.jpg' + ')';
  46814. },
  46815. tabPage: function tabPage(path) {
  46816. this.goForward({ path: '/' + path });
  46817. },
  46818. setRightSelect: function setRightSelect(act) {
  46819. switch (act) {
  46820. case 'system':
  46821. this.systemSetting(false);
  46822. this.systemDrawerShow = true;
  46823. break;
  46824. case 'user':
  46825. this.userDrawerShow = true;
  46826. break;
  46827. case 'out':
  46828. this.logout();
  46829. break;
  46830. }
  46831. },
  46832. logout: function logout() {
  46833. this.$Modal.confirm({
  46834. title: this.$L('退出登录'),
  46835. content: this.$L('您确定要退出登录吗?'),
  46836. onOk: function onOk() {
  46837. $A.userLogout();
  46838. }
  46839. });
  46840. },
  46841. systemSetting: function systemSetting(save) {
  46842. var _this3 = this;
  46843. this.loadIng++;
  46844. $A.apiAjax({
  46845. url: 'system/setting?type=' + (save ? 'save' : 'get'),
  46846. data: this.formSystem,
  46847. complete: function complete() {
  46848. _this3.loadIng--;
  46849. },
  46850. success: function success(res) {
  46851. if (res.ret === 1) {
  46852. var tempData = res.data;
  46853. tempData.github = tempData.github || 'show';
  46854. tempData.reg = tempData.reg || 'open';
  46855. tempData.callav = tempData.callav || 'open';
  46856. tempData.autoArchived = tempData.autoArchived || 'close';
  46857. tempData.archivedDay = tempData.archivedDay || 7;
  46858. _this3.formSystem = tempData;
  46859. _this3.formSystem__reset = $A.cloneData(_this3.formSystem);
  46860. if (save) {
  46861. _this3.$Message.success(_this3.$L('修改成功'));
  46862. }
  46863. } else {
  46864. if (save) {
  46865. _this3.$Modal.error({ title: _this3.$L('温馨提示'), content: res.msg });
  46866. }
  46867. }
  46868. }
  46869. });
  46870. },
  46871. handleSubmit: function handleSubmit(name) {
  46872. var _this4 = this;
  46873. this.$refs[name].validate(function (valid) {
  46874. if (valid) {
  46875. switch (name) {
  46876. case "formSystem":
  46877. {
  46878. _this4.systemSetting(true);
  46879. break;
  46880. }
  46881. case "formDatum":
  46882. {
  46883. _this4.loadIng++;
  46884. $A.apiAjax({
  46885. url: 'users/editdata',
  46886. data: _this4.formDatum,
  46887. complete: function complete() {
  46888. _this4.loadIng--;
  46889. },
  46890. success: function success(res) {
  46891. if (res.ret === 1) {
  46892. $A.getUserInfo(true);
  46893. $A.getUserBasic(_this4.usrInfo.username, function () {}, 0);
  46894. _this4.$Message.success(_this4.$L('修改成功'));
  46895. } else {
  46896. _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
  46897. }
  46898. }
  46899. });
  46900. break;
  46901. }
  46902. case "formPass":
  46903. {
  46904. _this4.loadIng++;
  46905. $A.apiAjax({
  46906. url: 'users/editpass',
  46907. data: _this4.formPass,
  46908. complete: function complete() {
  46909. _this4.loadIng--;
  46910. },
  46911. success: function success(res) {
  46912. if (res.ret === 1) {
  46913. _this4.userDrawerShow = false;
  46914. _this4.$Message.success(_this4.$L('修改成功,请重新登录!'));
  46915. _this4.$refs[name].resetFields();
  46916. $A.userLogout();
  46917. } else {
  46918. _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
  46919. }
  46920. }
  46921. });
  46922. break;
  46923. }
  46924. case "formSetting":
  46925. {
  46926. _this4.loadIng++;
  46927. $A.apiAjax({
  46928. url: 'users/editdata',
  46929. data: _this4.formSetting,
  46930. complete: function complete() {
  46931. _this4.loadIng--;
  46932. },
  46933. success: function success(res) {
  46934. if (res.ret === 1) {
  46935. $A.getUserInfo(true);
  46936. _this4.$Message.success(_this4.$L('修改成功'));
  46937. } else {
  46938. _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
  46939. }
  46940. }
  46941. });
  46942. break;
  46943. }
  46944. }
  46945. }
  46946. });
  46947. },
  46948. handleReset: function handleReset(name) {
  46949. if (typeof this[name + '__reset'] !== "undefined") {
  46950. this[name] = $A.cloneData(this[name + '__reset']);
  46951. return;
  46952. }
  46953. this.$refs[name].resetFields();
  46954. },
  46955. formArchived: function formArchived(value) {
  46956. this.formSystem = _extends({}, this.formSystem, { autoArchived: value });
  46957. }
  46958. }
  46959. });
  46960. /***/ }),
  46961. /* 88 */
  46962. /***/ (function(module, exports, __webpack_require__) {
  46963. // style-loader: Adds some css to the DOM by adding a <style> tag
  46964. // load the styles
  46965. var content = __webpack_require__(89);
  46966. if(typeof content === 'string') content = [[module.i, content, '']];
  46967. if(content.locals) module.exports = content.locals;
  46968. // add the styles to the DOM
  46969. var update = __webpack_require__(1)("3b50b398", content, false, {});
  46970. // Hot Module Replacement
  46971. if(false) {
  46972. // When the styles change, update the <style> tags
  46973. if(!content.locals) {
  46974. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-55c90fc2\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ImgUpload.vue", function() {
  46975. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-55c90fc2\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ImgUpload.vue");
  46976. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  46977. update(newContent);
  46978. });
  46979. }
  46980. // When the module is disposed, remove the <style> tags
  46981. module.hot.dispose(function() { update(); });
  46982. }
  46983. /***/ }),
  46984. /* 89 */
  46985. /***/ (function(module, exports, __webpack_require__) {
  46986. exports = module.exports = __webpack_require__(0)(false);
  46987. // imports
  46988. // module
  46989. exports.push([module.i, "\n.img-upload-modal .ivu-modal-mask {\n z-index: 1001;\n}\n.img-upload-modal .ivu-modal-no-mask {\n background-color: rgba(55, 55, 55, 0.2);\n}\n.img-upload-modal .ivu-modal-wrap {\n z-index: 1001;\n}\n.imgcomp-upload-list {\n display: inline-block;\n width: 60px;\n height: 60px;\n text-align: center;\n line-height: 60px;\n border: 1px solid transparent;\n border-radius: 4px;\n overflow: hidden;\n background: #fff;\n position: relative;\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n margin-right: 4px;\n vertical-align: top;\n}\n.imgcomp-upload-list .imgcomp-upload-img {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-position: center;\n background-size: cover;\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover {\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: rgba(0, 0, 0, 0.6);\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover i {\n color: #fff;\n font-size: 24px;\n cursor: pointer;\n vertical-align: middle;\n margin: 0;\n -webkit-transition: all .2s;\n transition: all .2s;\n}\n.imgcomp-upload-list .imgcomp-upload-list-cover i:hover {\n font-size: 28px;\n}\n.imgcomp-upload-list .ivu-progress-outer {\n background-color: rgba(0, 0, 0, 0.68);\n}\n.imgcomp-upload-list .ivu-progress-outer .ivu-progress-inner {\n width: 88%;\n}\n.imgcomp-upload-list:hover .imgcomp-upload-list-cover {\n display: block;\n}\n.img-upload-foot {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.img-upload-foot .img-upload-foot-input {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n text-align: left;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.img-upload-foot .img-upload-foot-input .img-upload-foot-httptitle {\n cursor: pointer;\n padding-left: 3px;\n margin-right: 22px;\n}\n.add-box {\n width: 60px;\n height: 60px;\n line-height: 60px;\n display: inline-block;\n background: #fff;\n border: 1px dashed #dddee1;\n border-radius: 4px;\n text-align: center;\n position: relative;\n overflow: hidden;\n vertical-align: top;\n}\n.add-box .add-box-icon i {\n vertical-align: middle;\n padding-bottom: 2px;\n}\n.add-box .add-box-upload {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: #ffffff;\n padding-top: 9px;\n background: rgba(0, 0, 0, 0.6);\n}\n.add-box .add-box-upload .add-box-item {\n height: 22px;\n line-height: 22px;\n cursor: pointer;\n}\n.add-box .add-box-upload .add-box-item .ivu-upload-drag, .add-box .add-box-upload .add-box-item .ivu-upload-drag:hover {\n background: transparent;\n border: 0;\n border-radius: 0;\n}\n.add-box .add-box-upload .add-box-item span {\n -webkit-transition: all .2s;\n transition: all .2s;\n font-size: 12px;\n}\n.add-box .add-box-upload .add-box-item:hover span {\n font-size: 14px;\n}\n.add-box em {\n font-style: normal;\n}\n.add-box:hover {\n border-color: rgba(0, 0, 0, 0.6);\n}\n.add-box:hover .add-box-upload {\n display: block;\n}\n.callback-add-box {\n display: block;\n width: auto;\n height: 25px;\n line-height: 25px;\n border: 0;\n background: transparent;\n}\n.callback-add-box .add-box-icon {\n display: none;\n}\n.callback-add-box .add-box-upload {\n display: block;\n width: auto;\n background: transparent;\n color: #333;\n padding: 0;\n}\n.callback-add-box .add-box-upload > div {\n display: inline-block;\n padding-right: 10px;\n}\n.browse-load {\n margin: 20px;\n text-align: center;\n}\n.browse-list {\n max-height: 540px;\n overflow: auto;\n}\n.browse-list .browse-item {\n margin: 10px 15px;\n display: inline-block;\n text-align: center;\n cursor: pointer;\n position: relative;\n}\n.browse-list .browse-item .browse-img {\n width: 64px;\n height: 64px;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAABxCAAAAABg5GeyAAACW0lEQVR4Ae3XVRLjMBAE0L3/rSwKM3OcSNPyLVYOLvM6UD0Bd03LVe9XH+RlhlRSSSWVVFJJJZVUUkkllVRSSSWVVFJJJZVUUkl9WyqppJJKKqmkkgpURP17xngOAR5NxW5wlJ9MaLQh83F4NHWmd/gZtdVBaOldfDB1bq5UpJFbFOC6LKnYrkRO209PAw+hIuzWB8Ep5es8HvYo4z4tE1X8UeRwlMM2D5Bzkc7kj6Bi3VTKDDwEeUcrMxrUvGDXTnHa6kK69SDN9sgq1clxKSbNHqqnYmdri81Q9QHf1JPt1Frncaib2XbiTKL2GkHaurnY9LOulMV0O7G6Kw+g9sw2ohhm62KezVJaaufjWC1TnOkr1exilJ7Ji0vxCCqO9V4UwV4PYr9+apouhGYLKfnahdpqegjmeoXOpXgANe70pKT6Zhu19qkY2nC0PZS527lQOyInqr8Uvc5jqfUb1X+PGh5IhW90S2quh3FQC2XRcF66TUkTXPcLKm5FtdR9RJq+2hWII7UpFtmsQLEyzsdJtkxxpr6gLotbUSlV9yeT0Trmzk2XPdUThLYarUbWOY9j04xXQ2u+pMZLYSumGmNUH3HbM9qOAwSHodN2Pks25F2j3aI7+IxqNsB+YLWb16ukSjiW4xNB0gMoMfApBS/XZQgi3p9/5RsiKNKZEOwYFVIF5VyTyD19sbyjIJiNJRZxpNbx2S8sGKvGZNHJBniBu9Wy5WxjGuQFqIAcBHiRGyt4ua5gSCWVVFJJJZVUUkkllVRSSSWVVFJJJZVUUkkllVRSSSWVVFI/AgO0SXIVYHeGAAAAAElFTkSuQmCC);\n background-position: center;\n background-repeat: no-repeat;\n background-size: cover;\n}\n.browse-list .browse-item .browse-title {\n display: block;\n width: 64px;\n margin-top: 5px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.browse-list .browse-item .browse-icon {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 64px;\n font-size: 36px;\n padding-top: 15px;\n color: #ffffff;\n background-color: rgba(0, 0, 0, 0.5);\n}\n.browse-list-disabled {\n position: relative;\n}\n.browse-list-disabled:after {\n position: absolute;\n content: '';\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(255, 255, 255, 0.9);\n z-index: 1;\n}\n", ""]);
  46990. // exports
  46991. /***/ }),
  46992. /* 90 */
  46993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  46994. "use strict";
  46995. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  46996. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  46997. //
  46998. //
  46999. //
  47000. //
  47001. //
  47002. //
  47003. //
  47004. //
  47005. //
  47006. //
  47007. //
  47008. //
  47009. //
  47010. //
  47011. //
  47012. //
  47013. //
  47014. //
  47015. //
  47016. //
  47017. //
  47018. //
  47019. //
  47020. //
  47021. //
  47022. //
  47023. //
  47024. //
  47025. //
  47026. //
  47027. //
  47028. //
  47029. //
  47030. //
  47031. //
  47032. //
  47033. //
  47034. //
  47035. //
  47036. //
  47037. //
  47038. //
  47039. //
  47040. //
  47041. //
  47042. //
  47043. //
  47044. //
  47045. //
  47046. //
  47047. //
  47048. //
  47049. //
  47050. //
  47051. //
  47052. //
  47053. //
  47054. //
  47055. //
  47056. //
  47057. //
  47058. //
  47059. //
  47060. //
  47061. //
  47062. //
  47063. //
  47064. //
  47065. //
  47066. //
  47067. //
  47068. //
  47069. //
  47070. //
  47071. //
  47072. //
  47073. //
  47074. //
  47075. //
  47076. //
  47077. //
  47078. //
  47079. //
  47080. //
  47081. //
  47082. //
  47083. //
  47084. //
  47085. //
  47086. //
  47087. //
  47088. //
  47089. //
  47090. //
  47091. //
  47092. //
  47093. //
  47094. //
  47095. //
  47096. //
  47097. //
  47098. //
  47099. //
  47100. //
  47101. //
  47102. //
  47103. //
  47104. //
  47105. //
  47106. //
  47107. //
  47108. //
  47109. //
  47110. //
  47111. //
  47112. //
  47113. //
  47114. //
  47115. //
  47116. //
  47117. //
  47118. //
  47119. //
  47120. //
  47121. //
  47122. //
  47123. //
  47124. //
  47125. //
  47126. //
  47127. //
  47128. //
  47129. //
  47130. //
  47131. //
  47132. //
  47133. //
  47134. //
  47135. //
  47136. //
  47137. //
  47138. //
  47139. //
  47140. //
  47141. //
  47142. //
  47143. //
  47144. //
  47145. //
  47146. //
  47147. //
  47148. //
  47149. //
  47150. //
  47151. //
  47152. //
  47153. //
  47154. //
  47155. //
  47156. //
  47157. //
  47158. //
  47159. //
  47160. //
  47161. //
  47162. //
  47163. //
  47164. //
  47165. //
  47166. //
  47167. //
  47168. //
  47169. //
  47170. //
  47171. //
  47172. //
  47173. //
  47174. //
  47175. //
  47176. //
  47177. //
  47178. //
  47179. //
  47180. //
  47181. //
  47182. //
  47183. //
  47184. //
  47185. //
  47186. //
  47187. //
  47188. //
  47189. //
  47190. //
  47191. //
  47192. //
  47193. //
  47194. //
  47195. //
  47196. //
  47197. //
  47198. //
  47199. //
  47200. //
  47201. //
  47202. //
  47203. //
  47204. //
  47205. //
  47206. //
  47207. //
  47208. //
  47209. //
  47210. //
  47211. //
  47212. //
  47213. //
  47214. //
  47215. //
  47216. //
  47217. //
  47218. //
  47219. //
  47220. //
  47221. //
  47222. //
  47223. //
  47224. //
  47225. //
  47226. //
  47227. //
  47228. //
  47229. //
  47230. //
  47231. //
  47232. //
  47233. //
  47234. //
  47235. //
  47236. //
  47237. //
  47238. //
  47239. //
  47240. //
  47241. //
  47242. //
  47243. //
  47244. //
  47245. //
  47246. //
  47247. //
  47248. //
  47249. //
  47250. //
  47251. //
  47252. //
  47253. //
  47254. //
  47255. //
  47256. //
  47257. //
  47258. //
  47259. //
  47260. //
  47261. //
  47262. //
  47263. //
  47264. //
  47265. //
  47266. //
  47267. //
  47268. //
  47269. //
  47270. //
  47271. //
  47272. //
  47273. //
  47274. //
  47275. //
  47276. //
  47277. //
  47278. //
  47279. //
  47280. //
  47281. //
  47282. //
  47283. //
  47284. //
  47285. //
  47286. //
  47287. //
  47288. //
  47289. //
  47290. //
  47291. /* harmony default export */ __webpack_exports__["default"] = ({
  47292. name: 'ImgUpload',
  47293. props: {
  47294. value: {},
  47295. num: {},
  47296. width: {},
  47297. height: {},
  47298. type: {},
  47299. http: {
  47300. type: Boolean,
  47301. default: false
  47302. },
  47303. otherParams: {
  47304. type: Object,
  47305. default: function _default() {
  47306. return {};
  47307. }
  47308. },
  47309. uploadIng: {
  47310. type: Number,
  47311. default: 0
  47312. }
  47313. },
  47314. data: function data() {
  47315. return {
  47316. actionUrl: $A.apiUrl('system/imgupload'),
  47317. params: {
  47318. token: $A.getToken(),
  47319. width: this.width,
  47320. height: this.height
  47321. },
  47322. multiple: this.num > 1,
  47323. visible: false,
  47324. browseVisible: false,
  47325. isLoading: false,
  47326. browseList: [],
  47327. browseListNext: [],
  47328. imgVisible: '',
  47329. defaultList: this.initItems(this.value),
  47330. uploadList: [],
  47331. maxNum: Math.min(Math.max($A.runNum(this.num), 1), 99),
  47332. httpValue: '',
  47333. httpType: '',
  47334. maxSize: 204800
  47335. };
  47336. },
  47337. mounted: function mounted() {
  47338. var _this = this;
  47339. this.uploadList = this.$refs.upload.fileList;
  47340. this.$emit('input', this.uploadList);
  47341. //
  47342. var browseBox = $A(this.$refs.browselistbox);
  47343. browseBox.scroll(function () {
  47344. var nHight = browseBox[0].scrollHeight;
  47345. var nTop = browseBox[0].scrollTop;
  47346. var boxHight = browseBox.height();
  47347. if (nTop + boxHight >= nHight) {
  47348. //到底了
  47349. if (_this.browseListNext.length > 0) {
  47350. var tmpNext = _this.browseListNext;
  47351. _this.browseListNext = [];
  47352. _this.browsePictureFor(tmpNext);
  47353. }
  47354. }
  47355. });
  47356. },
  47357. watch: {
  47358. value: function value(val) {
  47359. if (typeof val === 'string') {
  47360. this.$emit('input', this.initItems(val));
  47361. return;
  47362. }
  47363. if (val === this.$refs.upload.fileList) {
  47364. return;
  47365. }
  47366. this.$refs.upload.fileList = this.initItems(val);
  47367. this.uploadList = this.$refs.upload.fileList;
  47368. },
  47369. browseVisible: function browseVisible() {
  47370. this.httpType = '';
  47371. this.httpValue = '';
  47372. }
  47373. },
  47374. computed: {
  47375. uploadParams: function uploadParams() {
  47376. if (Object.keys(this.otherParams).length > 0) {
  47377. return Object.assign(this.params, this.otherParams);
  47378. } else {
  47379. return this.params;
  47380. }
  47381. }
  47382. },
  47383. methods: {
  47384. handleCallback: function handleCallback(file) {
  47385. if (this.type === 'callback') {
  47386. if (file === true) {
  47387. this.$emit('on-callback', this.uploadList);
  47388. this.$refs.upload.fileList = [];
  47389. this.uploadList = this.$refs.upload.fileList;
  47390. } else if ((typeof file === 'undefined' ? 'undefined' : _typeof(file)) === "object") {
  47391. this.$emit('on-callback', [file]);
  47392. }
  47393. }
  47394. this.browseVisible = false;
  47395. },
  47396. initItems: function initItems(items) {
  47397. //数据初始化
  47398. if (typeof items === 'string') {
  47399. items = [{ 'url': items }];
  47400. }
  47401. var lists = [];
  47402. $A.each(items, function (index, item) {
  47403. if (typeof item === 'string') item = { 'url': item };
  47404. if (item.url) {
  47405. item.active = true;
  47406. item.status = 'finished';
  47407. if (typeof item.path === 'undefined') item.path = item.url;
  47408. if (typeof item.thumb === 'undefined') item.thumb = item.url;
  47409. lists.push(item);
  47410. }
  47411. });
  47412. return lists;
  47413. },
  47414. handleView: function handleView(item) {
  47415. //查看
  47416. this.visible = true;
  47417. this.imgVisible = item.url;
  47418. },
  47419. handleRemove: function handleRemove(item) {
  47420. //删除
  47421. var fileList = this.$refs.upload.fileList;
  47422. this.$refs.upload.fileList.splice(fileList.indexOf(item), 1);
  47423. this.$emit('input', this.$refs.upload.fileList);
  47424. },
  47425. handleProgress: function handleProgress() {
  47426. //开始上传
  47427. this.$emit('update:uploadIng', this.uploadIng + 1);
  47428. },
  47429. handleSuccess: function handleSuccess(res, file) {
  47430. //上传完成
  47431. this.$emit('update:uploadIng', this.uploadIng - 1);
  47432. if (res.ret === 1) {
  47433. file.url = res.data.url;
  47434. file.path = res.data.path;
  47435. file.thumb = res.data.thumb;
  47436. this.handleCallback(file);
  47437. } else {
  47438. this.$Modal.warning({
  47439. title: this.$L('上传失败'),
  47440. content: this.$L('文件 % 上传失败 %', file.name, res.msg)
  47441. });
  47442. this.$refs.upload.fileList.pop();
  47443. }
  47444. this.$emit('input', this.$refs.upload.fileList);
  47445. },
  47446. handleError: function handleError() {
  47447. //上传错误
  47448. this.$emit('update:uploadIng', this.uploadIng - 1);
  47449. },
  47450. handleFormatError: function handleFormatError(file) {
  47451. //上传类型错误
  47452. this.$Modal.warning({
  47453. title: this.$L('文件格式不正确'),
  47454. content: this.$L('文件 % 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。', file.name)
  47455. });
  47456. },
  47457. handleMaxSize: function handleMaxSize(file) {
  47458. //上传大小错误
  47459. this.$Modal.warning({
  47460. title: this.$L('超出文件大小限制'),
  47461. content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
  47462. });
  47463. },
  47464. handleBeforeUpload: function handleBeforeUpload() {
  47465. //上传前判断
  47466. var check = this.uploadList.length < this.maxNum;
  47467. if (!check && this.uploadList.length == 1) {
  47468. this.handleRemove(this.uploadList[0]);
  47469. check = this.uploadList.length < this.maxNum;
  47470. }
  47471. if (!check) {
  47472. this.$Modal.warning({
  47473. title: this.$L('温馨提示'),
  47474. content: this.$L('最多只能上传 % 张图片。', this.maxNum)
  47475. });
  47476. }
  47477. this.params = {
  47478. token: $A.getToken(),
  47479. width: this.width,
  47480. height: this.height
  47481. };
  47482. return check;
  47483. },
  47484. handleClick: function handleClick() {
  47485. //手动上传
  47486. if (this.handleBeforeUpload()) {
  47487. this.$refs.upload.handleClick();
  47488. }
  47489. },
  47490. handleManual: function handleManual(file) {
  47491. //手动传file
  47492. if (this.handleBeforeUpload()) {
  47493. this.$refs.upload.upload(file);
  47494. }
  47495. },
  47496. browsePicture: function browsePicture(path) {
  47497. var _this2 = this;
  47498. //获取图片空间
  47499. this.browseVisible = true;
  47500. this.browseList = [];
  47501. this.browseListNext = [];
  47502. this.isLoading = true;
  47503. $A.apiAjax({
  47504. url: 'system/imgview',
  47505. data: { path: path ? path : '' },
  47506. beforeSend: true,
  47507. complete: true,
  47508. error: true,
  47509. success: function success(res) {
  47510. _this2.isLoading = false;
  47511. if (res.ret === 1) {
  47512. var dirs = res.data['dirs'];
  47513. for (var i = 0; i < dirs.length; i++) {
  47514. _this2.browseList.push(dirs[i]);
  47515. }
  47516. _this2.browsePictureFor(res.data['files']);
  47517. } else if (res.ret === -2) {
  47518. _this2.browseVisible = false;
  47519. _this2.$Modal.warning({ title: _this2.$L('温馨提示'), content: res.msg });
  47520. }
  47521. }
  47522. });
  47523. },
  47524. browsePictureFor: function browsePictureFor(files) {
  47525. for (var o = 0; o < files.length; o++) {
  47526. for (var j = 0; j < this.uploadList.length; j++) {
  47527. if (this.uploadList[j]['url'] === files[o]['url'] || this.uploadList[j]['url'] === files[o]['path']) {
  47528. files[o]['active'] = true;
  47529. break;
  47530. }
  47531. }
  47532. if (o < 100) {
  47533. this.browseList.push(files[o]);
  47534. } else {
  47535. this.browseListNext.push(files[o]);
  47536. }
  47537. }
  47538. },
  47539. browseItem: function browseItem(item) {
  47540. //点击选择图片
  47541. if (item.type === 'dir') {
  47542. //目录
  47543. this.browsePicture(item.path);
  47544. } else if (item.type === 'file') {
  47545. //文件
  47546. if (item.active) {
  47547. var fileList = this.$refs.upload.fileList;
  47548. this.$refs.upload.fileList.splice(fileList.indexOf(item), 1);
  47549. item.active = false;
  47550. } else {
  47551. if (this.maxNum === 1) {
  47552. for (var i = 0; i < this.browseList.length; i++) {
  47553. this.browseList[i].active = false;
  47554. }
  47555. this.$refs.upload.fileList = [];
  47556. this.uploadList = this.$refs.upload.fileList;
  47557. }
  47558. var check = this.uploadList.length < this.maxNum;
  47559. if (!check) {
  47560. this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('最多只能选择 % 张图片。', this.maxNum) });
  47561. return;
  47562. }
  47563. item.active = true;
  47564. item.status = 'finished';
  47565. this.$refs.upload.fileList.push(item);
  47566. this.uploadList = this.$refs.upload.fileList;
  47567. }
  47568. this.$emit('input', this.$refs.upload.fileList);
  47569. }
  47570. },
  47571. __thumb: function __thumb(url) {
  47572. if ($A.strExists(url, "?", false)) {
  47573. return url + "&__thumb=true";
  47574. } else {
  47575. return url + "?__thumb=true";
  47576. }
  47577. },
  47578. httpEnter: function httpEnter() {
  47579. this.$emit('input', this.initItems(this.httpValue));
  47580. this.browseVisible = false;
  47581. }
  47582. }
  47583. });
  47584. /***/ }),
  47585. /* 91 */
  47586. /***/ (function(module, exports, __webpack_require__) {
  47587. var render = function() {
  47588. var _vm = this
  47589. var _h = _vm.$createElement
  47590. var _c = _vm._self._c || _h
  47591. return _c(
  47592. "div",
  47593. [
  47594. _vm._l(_vm.uploadList, function(item) {
  47595. return _vm.type !== "callback"
  47596. ? _c(
  47597. "div",
  47598. { staticClass: "imgcomp-upload-list" },
  47599. [
  47600. item.status === "finished"
  47601. ? [
  47602. _c("div", {
  47603. staticClass: "imgcomp-upload-img",
  47604. style: {
  47605. "background-image":
  47606. "url(" + _vm.__thumb(item.thumb) + ")"
  47607. }
  47608. }),
  47609. _vm._v(" "),
  47610. _c(
  47611. "div",
  47612. { staticClass: "imgcomp-upload-list-cover" },
  47613. [
  47614. _c("Icon", {
  47615. attrs: { type: "ios-eye-outline" },
  47616. nativeOn: {
  47617. click: function($event) {
  47618. return _vm.handleView(item)
  47619. }
  47620. }
  47621. }),
  47622. _vm._v(" "),
  47623. _c("Icon", {
  47624. attrs: { type: "ios-trash-outline" },
  47625. nativeOn: {
  47626. click: function($event) {
  47627. return _vm.handleRemove(item)
  47628. }
  47629. }
  47630. })
  47631. ],
  47632. 1
  47633. )
  47634. ]
  47635. : [
  47636. item.showProgress
  47637. ? _c("Progress", {
  47638. attrs: { percent: item.percentage, "hide-info": "" }
  47639. })
  47640. : _vm._e()
  47641. ]
  47642. ],
  47643. 2
  47644. )
  47645. : _vm._e()
  47646. }),
  47647. _vm._v(" "),
  47648. _c(
  47649. "div",
  47650. {
  47651. staticClass: "add-box",
  47652. class: { "callback-add-box": _vm.type === "callback" }
  47653. },
  47654. [
  47655. _c(
  47656. "div",
  47657. { staticClass: "add-box-icon" },
  47658. [_c("Icon", { attrs: { type: "md-add", size: "32" } })],
  47659. 1
  47660. ),
  47661. _vm._v(" "),
  47662. _c("div", { staticClass: "add-box-upload" }, [
  47663. _c(
  47664. "div",
  47665. { staticClass: "add-box-item", on: { click: _vm.browsePicture } },
  47666. [
  47667. _c("span", [
  47668. _vm._v(_vm._s(_vm.$L("浏览"))),
  47669. _vm.type === "callback"
  47670. ? _c("em", [_vm._v(_vm._s(_vm.$L("图片")))])
  47671. : _vm._e()
  47672. ])
  47673. ]
  47674. ),
  47675. _vm._v(" "),
  47676. _c(
  47677. "div",
  47678. { staticClass: "add-box-item" },
  47679. [
  47680. _c(
  47681. "Upload",
  47682. {
  47683. ref: "upload",
  47684. attrs: {
  47685. name: "image",
  47686. accept: "image/*",
  47687. action: _vm.actionUrl,
  47688. data: _vm.uploadParams,
  47689. "show-upload-list": false,
  47690. "max-size": _vm.maxSize,
  47691. format: ["jpg", "jpeg", "gif", "png"],
  47692. "default-file-list": _vm.defaultList,
  47693. "on-progress": _vm.handleProgress,
  47694. "on-success": _vm.handleSuccess,
  47695. "on-error": _vm.handleError,
  47696. "on-format-error": _vm.handleFormatError,
  47697. "on-exceeded-size": _vm.handleMaxSize,
  47698. "before-upload": _vm.handleBeforeUpload,
  47699. multiple: _vm.multiple
  47700. }
  47701. },
  47702. [
  47703. _c("span", [
  47704. _vm._v(_vm._s(_vm.$L("上传"))),
  47705. _vm.type === "callback"
  47706. ? _c("em", [_vm._v(_vm._s(_vm.$L("图片")))])
  47707. : _vm._e()
  47708. ])
  47709. ]
  47710. )
  47711. ],
  47712. 1
  47713. )
  47714. ])
  47715. ]
  47716. ),
  47717. _vm._v(" "),
  47718. _c(
  47719. "Modal",
  47720. {
  47721. staticClass: "img-upload-modal",
  47722. attrs: {
  47723. title: _vm.$L("浏览图片空间的图片"),
  47724. "class-name": "simple-modal",
  47725. width: "710",
  47726. styles: { top: "35px", paddingBottom: "35px" }
  47727. },
  47728. model: {
  47729. value: _vm.browseVisible,
  47730. callback: function($$v) {
  47731. _vm.browseVisible = $$v
  47732. },
  47733. expression: "browseVisible"
  47734. }
  47735. },
  47736. [
  47737. _vm.isLoading
  47738. ? _c("div", { staticClass: "browse-load" }, [
  47739. _vm._v(_vm._s(_vm.$L("加载中...")))
  47740. ])
  47741. : _vm._e(),
  47742. _vm._v(" "),
  47743. _c(
  47744. "div",
  47745. {
  47746. ref: "browselistbox",
  47747. staticClass: "browse-list",
  47748. class: _vm.httpType === "input" ? "browse-list-disabled" : ""
  47749. },
  47750. _vm._l(_vm.browseList, function(item) {
  47751. return _c(
  47752. "div",
  47753. {
  47754. staticClass: "browse-item",
  47755. on: {
  47756. click: function($event) {
  47757. return _vm.browseItem(item)
  47758. }
  47759. }
  47760. },
  47761. [
  47762. item.active
  47763. ? _c("Icon", {
  47764. staticClass: "browse-icon",
  47765. attrs: { type: "ios-checkmark-circle" }
  47766. })
  47767. : _vm._e(),
  47768. _vm._v(" "),
  47769. _c("div", {
  47770. staticClass: "browse-img",
  47771. style: { "background-image": "url(" + item.thumb + ")" }
  47772. }),
  47773. _vm._v(" "),
  47774. _c("div", { staticClass: "browse-title" }, [
  47775. _vm._v(_vm._s(item.title))
  47776. ])
  47777. ],
  47778. 1
  47779. )
  47780. }),
  47781. 0
  47782. ),
  47783. _vm._v(" "),
  47784. _c(
  47785. "div",
  47786. {
  47787. staticClass: "img-upload-foot",
  47788. attrs: { slot: "footer" },
  47789. slot: "footer"
  47790. },
  47791. [
  47792. _vm.type !== "callback" && _vm.http && _vm.httpType === ""
  47793. ? _c(
  47794. "div",
  47795. {
  47796. staticClass: "img-upload-foot-input",
  47797. on: {
  47798. click: function($event) {
  47799. _vm.httpType = "input"
  47800. }
  47801. }
  47802. },
  47803. [
  47804. _c("Icon", { attrs: { type: "ios-image", size: "22" } }),
  47805. _vm._v(" "),
  47806. _c("div", { staticClass: "img-upload-foot-httptitle" }, [
  47807. _vm._v(_vm._s(_vm.$L("自定义图片地址")))
  47808. ])
  47809. ],
  47810. 1
  47811. )
  47812. : _vm._e(),
  47813. _vm._v(" "),
  47814. _vm.type !== "callback" && _vm.http && _vm.httpType === "input"
  47815. ? _c(
  47816. "div",
  47817. { staticClass: "img-upload-foot-input" },
  47818. [
  47819. _c(
  47820. "Input",
  47821. {
  47822. attrs: {
  47823. placeholder: _vm.$L("以“http://”或“https://”开头"),
  47824. search: "",
  47825. "enter-button": _vm.$L("确定")
  47826. },
  47827. on: { "on-search": _vm.httpEnter },
  47828. model: {
  47829. value: _vm.httpValue,
  47830. callback: function($$v) {
  47831. _vm.httpValue = $$v
  47832. },
  47833. expression: "httpValue"
  47834. }
  47835. },
  47836. [
  47837. _c(
  47838. "span",
  47839. {
  47840. staticStyle: { cursor: "pointer" },
  47841. attrs: { slot: "prepend" },
  47842. on: {
  47843. click: function($event) {
  47844. _vm.httpType = ""
  47845. }
  47846. },
  47847. slot: "prepend"
  47848. },
  47849. [_vm._v(_vm._s(_vm.$L("自定义地址")) + ": ")]
  47850. )
  47851. ]
  47852. )
  47853. ],
  47854. 1
  47855. )
  47856. : _vm._e(),
  47857. _vm._v(" "),
  47858. _vm.httpType === ""
  47859. ? _c(
  47860. "Button",
  47861. {
  47862. on: {
  47863. click: function($event) {
  47864. _vm.browseVisible = false
  47865. }
  47866. }
  47867. },
  47868. [_vm._v(_vm._s(_vm.$L("关闭")))]
  47869. )
  47870. : _vm._e(),
  47871. _vm._v(" "),
  47872. _vm.httpType === ""
  47873. ? _c(
  47874. "Button",
  47875. {
  47876. attrs: { type: "primary" },
  47877. on: {
  47878. click: function($event) {
  47879. return _vm.handleCallback(true)
  47880. }
  47881. }
  47882. },
  47883. [_vm._v(_vm._s(_vm.$L("完成")))]
  47884. )
  47885. : _vm._e()
  47886. ],
  47887. 1
  47888. )
  47889. ]
  47890. ),
  47891. _vm._v(" "),
  47892. _c(
  47893. "Modal",
  47894. {
  47895. staticClass: "img-upload-modal",
  47896. attrs: {
  47897. title: _vm.$L("查看图片"),
  47898. "class-name": "simple-modal",
  47899. draggable: ""
  47900. },
  47901. model: {
  47902. value: _vm.visible,
  47903. callback: function($$v) {
  47904. _vm.visible = $$v
  47905. },
  47906. expression: "visible"
  47907. }
  47908. },
  47909. [
  47910. _c(
  47911. "div",
  47912. { staticStyle: { "max-height": "480px", overflow: "auto" } },
  47913. [
  47914. _c("a", { attrs: { href: _vm.imgVisible, target: "_blank" } }, [
  47915. _vm.visible
  47916. ? _c("img", {
  47917. staticStyle: {
  47918. "max-width": "100%",
  47919. "max-height": "900px",
  47920. display: "block",
  47921. margin: "0 auto"
  47922. },
  47923. attrs: { src: _vm.imgVisible }
  47924. })
  47925. : _vm._e()
  47926. ])
  47927. ]
  47928. )
  47929. ]
  47930. )
  47931. ],
  47932. 2
  47933. )
  47934. }
  47935. var staticRenderFns = []
  47936. render._withStripped = true
  47937. module.exports = { render: render, staticRenderFns: staticRenderFns }
  47938. if (false) {
  47939. module.hot.accept()
  47940. if (module.hot.data) {
  47941. require("vue-hot-reload-api") .rerender("data-v-55c90fc2", module.exports)
  47942. }
  47943. }
  47944. /***/ }),
  47945. /* 92 */
  47946. /***/ (function(module, exports, __webpack_require__) {
  47947. var disposed = false
  47948. function injectStyle (ssrContext) {
  47949. if (disposed) return
  47950. __webpack_require__(93)
  47951. }
  47952. var normalizeComponent = __webpack_require__(2)
  47953. /* script */
  47954. var __vue_script__ = __webpack_require__(95)
  47955. /* template */
  47956. var __vue_template__ = __webpack_require__(100)
  47957. /* template functional */
  47958. var __vue_template_functional__ = false
  47959. /* styles */
  47960. var __vue_styles__ = injectStyle
  47961. /* scopeId */
  47962. var __vue_scopeId__ = "data-v-1ae87c63"
  47963. /* moduleIdentifier (server only) */
  47964. var __vue_module_identifier__ = null
  47965. var Component = normalizeComponent(
  47966. __vue_script__,
  47967. __vue_template__,
  47968. __vue_template_functional__,
  47969. __vue_styles__,
  47970. __vue_scopeId__,
  47971. __vue_module_identifier__
  47972. )
  47973. Component.options.__file = "resources/assets/js/main/components/project/header/create.vue"
  47974. /* hot reload */
  47975. if (false) {(function () {
  47976. var hotAPI = require("vue-hot-reload-api")
  47977. hotAPI.install(require("vue"), false)
  47978. if (!hotAPI.compatible) return
  47979. module.hot.accept()
  47980. if (!module.hot.data) {
  47981. hotAPI.createRecord("data-v-1ae87c63", Component.options)
  47982. } else {
  47983. hotAPI.reload("data-v-1ae87c63", Component.options)
  47984. }
  47985. module.hot.dispose(function (data) {
  47986. disposed = true
  47987. })
  47988. })()}
  47989. module.exports = Component.exports
  47990. /***/ }),
  47991. /* 93 */
  47992. /***/ (function(module, exports, __webpack_require__) {
  47993. // style-loader: Adds some css to the DOM by adding a <style> tag
  47994. // load the styles
  47995. var content = __webpack_require__(94);
  47996. if(typeof content === 'string') content = [[module.i, content, '']];
  47997. if(content.locals) module.exports = content.locals;
  47998. // add the styles to the DOM
  47999. var update = __webpack_require__(1)("e7232698", content, false, {});
  48000. // Hot Module Replacement
  48001. if(false) {
  48002. // When the styles change, update the <style> tags
  48003. if(!content.locals) {
  48004. module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1ae87c63\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./create.vue", function() {
  48005. var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1ae87c63\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./create.vue");
  48006. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  48007. update(newContent);
  48008. });
  48009. }
  48010. // When the module is disposed, remove the <style> tags
  48011. module.hot.dispose(function() { update(); });
  48012. }
  48013. /***/ }),
  48014. /* 94 */
  48015. /***/ (function(module, exports, __webpack_require__) {
  48016. exports = module.exports = __webpack_require__(0)(false);
  48017. // imports
  48018. // module
  48019. exports.push([module.i, "\n.project-header-create .tableFill[data-v-1ae87c63] {\n margin: 12px 12px 20px;\n}\n", ""]);
  48020. // exports
  48021. /***/ }),
  48022. /* 95 */
  48023. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48024. "use strict";
  48025. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  48026. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
  48027. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
  48028. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_task__ = __webpack_require__(30);
  48029. //
  48030. //
  48031. //
  48032. //
  48033. //
  48034. //
  48035. //
  48036. //
  48037. //
  48038. //
  48039. //
  48040. //
  48041. //
  48042. //
  48043. //
  48044. //
  48045. //
  48046. //
  48047. /**
  48048. * 我创建的任务
  48049. */
  48050. /* harmony default export */ __webpack_exports__["default"] = ({
  48051. name: 'HeaderCreate',
  48052. components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
  48053. props: {
  48054. canload: {
  48055. type: Boolean,
  48056. default: true
  48057. }
  48058. },
  48059. mixins: [__WEBPACK_IMPORTED_MODULE_1__mixins_task__["a" /* default */]],
  48060. data: function data() {
  48061. return {
  48062. loadYet: false,
  48063. loadIng: 0,
  48064. columns: [],
  48065. lists: [],
  48066. listPage: 1,
  48067. listTotal: 0,
  48068. noDataText: ""
  48069. };
  48070. },
  48071. mounted: function mounted() {
  48072. var _this = this;
  48073. if (this.canload) {
  48074. this.loadYet = true;
  48075. this.getLists(true);
  48076. }
  48077. $A.setOnTaskInfoListener('components/project/header/create', function (act, detail) {
  48078. if (detail.createuser != _this.usrName) {
  48079. return;
  48080. }
  48081. //
  48082. _this.lists.some(function (task, i) {
  48083. if (task.id == detail.id) {
  48084. _this.lists.splice(i, 1, detail);
  48085. return true;
  48086. }
  48087. });
  48088. //
  48089. switch (act) {
  48090. case "delete":
  48091. // 删除任务
  48092. _this.lists.some(function (task, i) {
  48093. if (task.id == detail.id) {
  48094. _this.lists.splice(i, 1);
  48095. return true;
  48096. }
  48097. });
  48098. break;
  48099. }
  48100. });
  48101. },
  48102. watch: {
  48103. canload: function canload(val) {
  48104. if (val && !this.loadYet) {
  48105. this.loadYet = true;
  48106. this.getLists(true);
  48107. }
  48108. }
  48109. },
  48110. methods: {
  48111. initLanguage: function initLanguage() {
  48112. var _this2 = this;
  48113. this.noDataText = this.$L("数据加载中.....");
  48114. this.columns = [{
  48115. "title": this.$L("任务名称"),
  48116. "key": 'title',
  48117. "minWidth": 120,
  48118. render: function render(h, params) {
  48119. return _this2.renderTaskTitle(h, params);
  48120. }
  48121. }, {
  48122. "title": this.$L("负责人"),
  48123. "key": 'username',
  48124. "minWidth": 80,
  48125. render: function render(h, params) {
  48126. return h('UserView', {
  48127. props: {
  48128. username: params.row.username
  48129. }
  48130. });
  48131. }
  48132. }, {
  48133. "title": this.$L("完成"),
  48134. "minWidth": 70,
  48135. "align": "center",
  48136. render: function render(h, params) {
  48137. return h('span', params.row.complete ? '√' : '-');
  48138. }
  48139. }, {
  48140. "title": this.$L("归档"),
  48141. "minWidth": 70,
  48142. "align": "center",
  48143. render: function render(h, params) {
  48144. return h('span', params.row.archived ? '√' : '-');
  48145. }
  48146. }, {
  48147. "title": this.$L("创建时间"),
  48148. "width": 160,
  48149. render: function render(h, params) {
  48150. return h('span', $A.formatDate("Y-m-d H:i:s", params.row.indate));
  48151. }
  48152. }];
  48153. },
  48154. setPage: function setPage(page) {
  48155. this.listPage = page;
  48156. this.getLists();
  48157. },
  48158. setPageSize: function setPageSize(size) {
  48159. if (Math.max($A.runNum(this.listPageSize), 10) != size) {
  48160. this.listPageSize = size;
  48161. this.getLists();
  48162. }
  48163. },
  48164. getLists: function getLists(resetLoad) {
  48165. var _this3 = this;
  48166. if (resetLoad === true) {
  48167. this.listPage = 1;
  48168. }
  48169. this.loadIng++;
  48170. this.noDataText = this.$L("数据加载中.....");
  48171. $A.apiAjax({
  48172. url: 'project/task/lists',
  48173. data: {
  48174. createuser: 1,
  48175. archived: '全部',
  48176. page: Math.max(this.listPage, 1),
  48177. pagesize: Math.max($A.runNum(this.listPageSize), 10)
  48178. },
  48179. complete: function complete() {
  48180. _this3.loadIng--;
  48181. },
  48182. error: function error() {
  48183. _this3.noDataText = _this3.$L("数据加载失败!");
  48184. },
  48185. success: function success(res) {
  48186. if (res.ret === 1) {
  48187. _this3.lists = res.data.lists;
  48188. _this3.listTotal = res.data.total;
  48189. _this3.noDataText = _this3.$L("没有相关的数据");
  48190. } else {
  48191. _this3.lists = [];
  48192. _this3.listTotal = 0;
  48193. _this3.noDataText = res.msg;
  48194. }
  48195. }
  48196. });
  48197. }
  48198. }
  48199. });
  48200. /***/ }),
  48201. /* 96 */
  48202. /***/ (function(module, exports, __webpack_require__) {
  48203. // style-loader: Adds some css to the DOM by adding a <style> tag
  48204. // load the styles
  48205. var content = __webpack_require__(97);
  48206. if(typeof content === 'string') content = [[module.i, content, '']];
  48207. if(content.locals) module.exports = content.locals;
  48208. // add the styles to the DOM
  48209. var update = __webpack_require__(1)("7490fac2", content, false, {});
  48210. // Hot Module Replacement
  48211. if(false) {
  48212. // When the styles change, update the <style> tags
  48213. if(!content.locals) {
  48214. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-329e9aed\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DrawerTabsContainer.vue", function() {
  48215. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-329e9aed\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DrawerTabsContainer.vue");
  48216. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  48217. update(newContent);
  48218. });
  48219. }
  48220. // When the module is disposed, remove the <style> tags
  48221. module.hot.dispose(function() { update(); });
  48222. }
  48223. /***/ }),
  48224. /* 97 */
  48225. /***/ (function(module, exports, __webpack_require__) {
  48226. exports = module.exports = __webpack_require__(0)(false);
  48227. // imports
  48228. // module
  48229. exports.push([module.i, "\n.dtc-main[data-v-329e9aed] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 100%;\n overflow: hidden;\n position: relative;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.dtc-main .dtc-body[data-v-329e9aed] {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n}\n", ""]);
  48230. // exports
  48231. /***/ }),
  48232. /* 98 */
  48233. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48234. "use strict";
  48235. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  48236. //
  48237. //
  48238. //
  48239. //
  48240. //
  48241. //
  48242. //
  48243. //
  48244. //
  48245. //
  48246. //
  48247. //
  48248. //
  48249. //
  48250. //
  48251. //
  48252. //
  48253. //
  48254. //
  48255. //
  48256. //
  48257. //
  48258. //
  48259. //
  48260. //
  48261. //
  48262. //
  48263. //
  48264. //
  48265. /* harmony default export */ __webpack_exports__["default"] = ({
  48266. name: 'DrawerTabsContainer',
  48267. data: function data() {
  48268. return {
  48269. idDrawerTabs: false,
  48270. calculateHeight: 0
  48271. };
  48272. },
  48273. mounted: function mounted() {
  48274. var _this = this;
  48275. var el = $A(this.$el);
  48276. var eb = el.parents(".ivu-drawer-body");
  48277. if (eb == 0 || eb.parents(".ivu-drawer-wrap").length == 0) {
  48278. return;
  48279. }
  48280. this.idDrawerTabs = true;
  48281. this.calculateHeight = Math.round(eb.outerHeight() - el.offset().top);
  48282. setInterval(function () {
  48283. _this.calculateHeight = Math.round(eb.outerHeight() - el.offset().top);
  48284. }, 300);
  48285. },
  48286. computed: {
  48287. myStyle: function myStyle() {
  48288. var calculateHeight = this.calculateHeight,
  48289. idDrawerTabs = this.idDrawerTabs;
  48290. if (!idDrawerTabs) {
  48291. return {};
  48292. }
  48293. return {
  48294. height: Math.max(0, calculateHeight - 16) + 'px'
  48295. };
  48296. }
  48297. }
  48298. });
  48299. /***/ }),
  48300. /* 99 */
  48301. /***/ (function(module, exports, __webpack_require__) {
  48302. var render = function() {
  48303. var _vm = this
  48304. var _h = _vm.$createElement
  48305. var _c = _vm._self._c || _h
  48306. return _c(
  48307. "div",
  48308. { class: [_vm.idDrawerTabs ? "dtc-main" : ""], style: _vm.myStyle },
  48309. [
  48310. _c(
  48311. "div",
  48312. { class: [_vm.idDrawerTabs ? "dtc-body" : ""] },
  48313. [_vm._t("default")],
  48314. 2
  48315. )
  48316. ]
  48317. )
  48318. }
  48319. var staticRenderFns = []
  48320. render._withStripped = true
  48321. module.exports = { render: render, staticRenderFns: staticRenderFns }
  48322. if (false) {
  48323. module.hot.accept()
  48324. if (module.hot.data) {
  48325. require("vue-hot-reload-api") .rerender("data-v-329e9aed", module.exports)
  48326. }
  48327. }
  48328. /***/ }),
  48329. /* 100 */
  48330. /***/ (function(module, exports, __webpack_require__) {
  48331. var render = function() {
  48332. var _vm = this
  48333. var _h = _vm.$createElement
  48334. var _c = _vm._self._c || _h
  48335. return _c("drawer-tabs-container", [
  48336. _c(
  48337. "div",
  48338. { staticClass: "project-header-create" },
  48339. [
  48340. _c("Table", {
  48341. ref: "tableRef",
  48342. staticClass: "tableFill",
  48343. attrs: {
  48344. columns: _vm.columns,
  48345. data: _vm.lists,
  48346. loading: _vm.loadIng > 0,
  48347. "no-data-text": _vm.noDataText,
  48348. stripe: ""
  48349. }
  48350. }),
  48351. _vm._v(" "),
  48352. _c("Page", {
  48353. staticClass: "pageBox",
  48354. attrs: {
  48355. total: _vm.listTotal,
  48356. current: _vm.listPage,
  48357. disabled: _vm.loadIng > 0,
  48358. "page-size-opts": [10, 20, 30, 50, 100],
  48359. placement: "top",
  48360. "show-elevator": "",
  48361. "show-sizer": "",
  48362. "show-total": "",
  48363. transfer: "",
  48364. simple: _vm.windowMax768
  48365. },
  48366. on: {
  48367. "on-change": _vm.setPage,
  48368. "on-page-size-change": _vm.setPageSize
  48369. }
  48370. })
  48371. ],
  48372. 1
  48373. )
  48374. ])
  48375. }
  48376. var staticRenderFns = []
  48377. render._withStripped = true
  48378. module.exports = { render: render, staticRenderFns: staticRenderFns }
  48379. if (false) {
  48380. module.hot.accept()
  48381. if (module.hot.data) {
  48382. require("vue-hot-reload-api") .rerender("data-v-1ae87c63", module.exports)
  48383. }
  48384. }
  48385. /***/ }),
  48386. /* 101 */
  48387. /***/ (function(module, exports, __webpack_require__) {
  48388. var disposed = false
  48389. function injectStyle (ssrContext) {
  48390. if (disposed) return
  48391. __webpack_require__(102)
  48392. }
  48393. var normalizeComponent = __webpack_require__(2)
  48394. /* script */
  48395. var __vue_script__ = __webpack_require__(104)
  48396. /* template */
  48397. var __vue_template__ = __webpack_require__(105)
  48398. /* template functional */
  48399. var __vue_template_functional__ = false
  48400. /* styles */
  48401. var __vue_styles__ = injectStyle
  48402. /* scopeId */
  48403. var __vue_scopeId__ = "data-v-fc048eee"
  48404. /* moduleIdentifier (server only) */
  48405. var __vue_module_identifier__ = null
  48406. var Component = normalizeComponent(
  48407. __vue_script__,
  48408. __vue_template__,
  48409. __vue_template_functional__,
  48410. __vue_styles__,
  48411. __vue_scopeId__,
  48412. __vue_module_identifier__
  48413. )
  48414. Component.options.__file = "resources/assets/js/main/components/project/header/archived.vue"
  48415. /* hot reload */
  48416. if (false) {(function () {
  48417. var hotAPI = require("vue-hot-reload-api")
  48418. hotAPI.install(require("vue"), false)
  48419. if (!hotAPI.compatible) return
  48420. module.hot.accept()
  48421. if (!module.hot.data) {
  48422. hotAPI.createRecord("data-v-fc048eee", Component.options)
  48423. } else {
  48424. hotAPI.reload("data-v-fc048eee", Component.options)
  48425. }
  48426. module.hot.dispose(function (data) {
  48427. disposed = true
  48428. })
  48429. })()}
  48430. module.exports = Component.exports
  48431. /***/ }),
  48432. /* 102 */
  48433. /***/ (function(module, exports, __webpack_require__) {
  48434. // style-loader: Adds some css to the DOM by adding a <style> tag
  48435. // load the styles
  48436. var content = __webpack_require__(103);
  48437. if(typeof content === 'string') content = [[module.i, content, '']];
  48438. if(content.locals) module.exports = content.locals;
  48439. // add the styles to the DOM
  48440. var update = __webpack_require__(1)("3ff66afc", content, false, {});
  48441. // Hot Module Replacement
  48442. if(false) {
  48443. // When the styles change, update the <style> tags
  48444. if(!content.locals) {
  48445. module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-fc048eee\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./archived.vue", function() {
  48446. var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-fc048eee\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./archived.vue");
  48447. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  48448. update(newContent);
  48449. });
  48450. }
  48451. // When the module is disposed, remove the <style> tags
  48452. module.hot.dispose(function() { update(); });
  48453. }
  48454. /***/ }),
  48455. /* 103 */
  48456. /***/ (function(module, exports, __webpack_require__) {
  48457. exports = module.exports = __webpack_require__(0)(false);
  48458. // imports
  48459. // module
  48460. exports.push([module.i, "\n.project-header-archived .tableFill[data-v-fc048eee] {\n margin: 12px 12px 20px;\n}\n", ""]);
  48461. // exports
  48462. /***/ }),
  48463. /* 104 */
  48464. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48465. "use strict";
  48466. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  48467. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
  48468. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
  48469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_task__ = __webpack_require__(30);
  48470. //
  48471. //
  48472. //
  48473. //
  48474. //
  48475. //
  48476. //
  48477. //
  48478. //
  48479. //
  48480. //
  48481. //
  48482. //
  48483. //
  48484. //
  48485. //
  48486. //
  48487. //
  48488. /**
  48489. * 我归档的任务
  48490. */
  48491. /* harmony default export */ __webpack_exports__["default"] = ({
  48492. name: 'HeaderArchived',
  48493. components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
  48494. props: {
  48495. canload: {
  48496. type: Boolean,
  48497. default: true
  48498. }
  48499. },
  48500. mixins: [__WEBPACK_IMPORTED_MODULE_1__mixins_task__["a" /* default */]],
  48501. data: function data() {
  48502. return {
  48503. loadYet: false,
  48504. loadIng: 0,
  48505. columns: [],
  48506. lists: [],
  48507. listPage: 1,
  48508. listTotal: 0,
  48509. noDataText: ""
  48510. };
  48511. },
  48512. mounted: function mounted() {
  48513. var _this = this;
  48514. if (this.canload) {
  48515. this.loadYet = true;
  48516. this.getLists(true);
  48517. }
  48518. $A.setOnTaskInfoListener('components/project/header/archived', function (act, detail) {
  48519. if (detail.username != _this.usrName) {
  48520. _this.lists.some(function (task, i) {
  48521. if (task.id == detail.id) {
  48522. _this.lists.splice(i, 1);
  48523. return true;
  48524. }
  48525. });
  48526. return;
  48527. }
  48528. //
  48529. _this.lists.some(function (task, i) {
  48530. if (task.id == detail.id) {
  48531. _this.lists.splice(i, 1, detail);
  48532. return true;
  48533. }
  48534. });
  48535. //
  48536. switch (act) {
  48537. case "delete": // 删除任务
  48538. case "unarchived":
  48539. // 取消归档
  48540. _this.lists.some(function (task, i) {
  48541. if (task.id == detail.id) {
  48542. _this.lists.splice(i, 1);
  48543. return true;
  48544. }
  48545. });
  48546. break;
  48547. case "archived":
  48548. // 归档
  48549. var has = false;
  48550. _this.lists.some(function (task) {
  48551. if (task.id == detail.id) {
  48552. return has = true;
  48553. }
  48554. });
  48555. if (!has) {
  48556. _this.lists.unshift(detail);
  48557. }
  48558. break;
  48559. }
  48560. });
  48561. },
  48562. watch: {
  48563. canload: function canload(val) {
  48564. if (val && !this.loadYet) {
  48565. this.loadYet = true;
  48566. this.getLists(true);
  48567. }
  48568. }
  48569. },
  48570. methods: {
  48571. initLanguage: function initLanguage() {
  48572. var _this2 = this;
  48573. this.noDataText = this.$L("数据加载中.....");
  48574. this.columns = [{
  48575. "title": this.$L("任务名称"),
  48576. "key": 'title',
  48577. "minWidth": 120,
  48578. render: function render(h, params) {
  48579. return _this2.renderTaskTitle(h, params);
  48580. }
  48581. }, {
  48582. "title": this.$L("创建人"),
  48583. "key": 'createuser',
  48584. "minWidth": 80,
  48585. render: function render(h, params) {
  48586. return h('UserView', {
  48587. props: {
  48588. username: params.row.createuser
  48589. }
  48590. });
  48591. }
  48592. }, {
  48593. "title": this.$L("负责人"),
  48594. "key": 'username',
  48595. "minWidth": 80,
  48596. render: function render(h, params) {
  48597. return h('UserView', {
  48598. props: {
  48599. username: params.row.username
  48600. }
  48601. });
  48602. }
  48603. }, {
  48604. "title": this.$L("完成"),
  48605. "minWidth": 70,
  48606. "align": "center",
  48607. render: function render(h, params) {
  48608. return h('span', params.row.complete ? '√' : '-');
  48609. }
  48610. }, {
  48611. "title": this.$L("归档时间"),
  48612. "width": 160,
  48613. render: function render(h, params) {
  48614. return h('span', $A.formatDate("Y-m-d H:i:s", params.row.archiveddate));
  48615. }
  48616. }, {
  48617. "title": this.$L("操作"),
  48618. "key": 'action',
  48619. "width": 100,
  48620. "align": 'center',
  48621. render: function render(h, params) {
  48622. return h('Button', {
  48623. props: {
  48624. type: 'primary',
  48625. size: 'small'
  48626. },
  48627. style: {
  48628. fontSize: '12px'
  48629. },
  48630. on: {
  48631. click: function click() {
  48632. _this2.$Modal.confirm({
  48633. title: _this2.$L('取消归档'),
  48634. content: _this2.$L('你确定要取消归档吗?'),
  48635. loading: true,
  48636. onOk: function onOk() {
  48637. $A.apiAjax({
  48638. url: 'project/task/edit',
  48639. method: 'post',
  48640. data: {
  48641. act: 'unarchived',
  48642. taskid: params.row.id
  48643. },
  48644. error: function error() {
  48645. _this2.$Modal.remove();
  48646. alert(_this2.$L('网络繁忙,请稍后再试!'));
  48647. },
  48648. success: function success(res) {
  48649. _this2.$Modal.remove();
  48650. _this2.getLists();
  48651. setTimeout(function () {
  48652. if (res.ret === 1) {
  48653. _this2.$Message.success(res.msg);
  48654. $A.triggerTaskInfoListener('unarchived', res.data);
  48655. $A.triggerTaskInfoChange(params.row.id);
  48656. } else {
  48657. _this2.$Modal.error({ title: _this2.$L('温馨提示'), content: res.msg });
  48658. }
  48659. }, 350);
  48660. }
  48661. });
  48662. }
  48663. });
  48664. }
  48665. }
  48666. }, _this2.$L('取消归档'));
  48667. }
  48668. }];
  48669. },
  48670. setPage: function setPage(page) {
  48671. this.listPage = page;
  48672. this.getLists();
  48673. },
  48674. setPageSize: function setPageSize(size) {
  48675. if (Math.max($A.runNum(this.listPageSize), 10) != size) {
  48676. this.listPageSize = size;
  48677. this.getLists();
  48678. }
  48679. },
  48680. getLists: function getLists(resetLoad) {
  48681. var _this3 = this;
  48682. if (resetLoad === true) {
  48683. this.listPage = 1;
  48684. }
  48685. this.loadIng++;
  48686. this.noDataText = this.$L("数据加载中.....");
  48687. $A.apiAjax({
  48688. url: 'project/task/lists',
  48689. data: {
  48690. page: Math.max(this.listPage, 1),
  48691. pagesize: Math.max($A.runNum(this.listPageSize), 10),
  48692. archived: '已归档'
  48693. },
  48694. complete: function complete() {
  48695. _this3.loadIng--;
  48696. },
  48697. error: function error() {
  48698. _this3.noDataText = _this3.$L("数据加载失败!");
  48699. },
  48700. success: function success(res) {
  48701. if (res.ret === 1) {
  48702. _this3.lists = res.data.lists;
  48703. _this3.listTotal = res.data.total;
  48704. _this3.noDataText = _this3.$L("没有相关的数据");
  48705. } else {
  48706. _this3.lists = [];
  48707. _this3.listTotal = 0;
  48708. _this3.noDataText = res.msg;
  48709. }
  48710. }
  48711. });
  48712. }
  48713. }
  48714. });
  48715. /***/ }),
  48716. /* 105 */
  48717. /***/ (function(module, exports, __webpack_require__) {
  48718. var render = function() {
  48719. var _vm = this
  48720. var _h = _vm.$createElement
  48721. var _c = _vm._self._c || _h
  48722. return _c("drawer-tabs-container", [
  48723. _c(
  48724. "div",
  48725. { staticClass: "project-header-archived" },
  48726. [
  48727. _c("Table", {
  48728. ref: "tableRef",
  48729. staticClass: "tableFill",
  48730. attrs: {
  48731. columns: _vm.columns,
  48732. data: _vm.lists,
  48733. loading: _vm.loadIng > 0,
  48734. "no-data-text": _vm.noDataText,
  48735. stripe: ""
  48736. }
  48737. }),
  48738. _vm._v(" "),
  48739. _c("Page", {
  48740. staticClass: "pageBox",
  48741. attrs: {
  48742. total: _vm.listTotal,
  48743. current: _vm.listPage,
  48744. disabled: _vm.loadIng > 0,
  48745. "page-size-opts": [10, 20, 30, 50, 100],
  48746. placement: "top",
  48747. "show-elevator": "",
  48748. "show-sizer": "",
  48749. "show-total": "",
  48750. transfer: "",
  48751. simple: _vm.windowMax768
  48752. },
  48753. on: {
  48754. "on-change": _vm.setPage,
  48755. "on-page-size-change": _vm.setPageSize
  48756. }
  48757. })
  48758. ],
  48759. 1
  48760. )
  48761. ])
  48762. }
  48763. var staticRenderFns = []
  48764. render._withStripped = true
  48765. module.exports = { render: render, staticRenderFns: staticRenderFns }
  48766. if (false) {
  48767. module.hot.accept()
  48768. if (module.hot.data) {
  48769. require("vue-hot-reload-api") .rerender("data-v-fc048eee", module.exports)
  48770. }
  48771. }
  48772. /***/ }),
  48773. /* 106 */
  48774. /***/ (function(module, exports, __webpack_require__) {
  48775. var disposed = false
  48776. function injectStyle (ssrContext) {
  48777. if (disposed) return
  48778. __webpack_require__(107)
  48779. __webpack_require__(109)
  48780. }
  48781. var normalizeComponent = __webpack_require__(2)
  48782. /* script */
  48783. var __vue_script__ = __webpack_require__(111)
  48784. /* template */
  48785. var __vue_template__ = __webpack_require__(125)
  48786. /* template functional */
  48787. var __vue_template_functional__ = false
  48788. /* styles */
  48789. var __vue_styles__ = injectStyle
  48790. /* scopeId */
  48791. var __vue_scopeId__ = "data-v-3f6b8ea0"
  48792. /* moduleIdentifier (server only) */
  48793. var __vue_module_identifier__ = null
  48794. var Component = normalizeComponent(
  48795. __vue_script__,
  48796. __vue_template__,
  48797. __vue_template_functional__,
  48798. __vue_styles__,
  48799. __vue_scopeId__,
  48800. __vue_module_identifier__
  48801. )
  48802. Component.options.__file = "resources/assets/js/main/components/chat/Index.vue"
  48803. /* hot reload */
  48804. if (false) {(function () {
  48805. var hotAPI = require("vue-hot-reload-api")
  48806. hotAPI.install(require("vue"), false)
  48807. if (!hotAPI.compatible) return
  48808. module.hot.accept()
  48809. if (!module.hot.data) {
  48810. hotAPI.createRecord("data-v-3f6b8ea0", Component.options)
  48811. } else {
  48812. hotAPI.reload("data-v-3f6b8ea0", Component.options)
  48813. }
  48814. module.hot.dispose(function (data) {
  48815. disposed = true
  48816. })
  48817. })()}
  48818. module.exports = Component.exports
  48819. /***/ }),
  48820. /* 107 */
  48821. /***/ (function(module, exports, __webpack_require__) {
  48822. // style-loader: Adds some css to the DOM by adding a <style> tag
  48823. // load the styles
  48824. var content = __webpack_require__(108);
  48825. if(typeof content === 'string') content = [[module.i, content, '']];
  48826. if(content.locals) module.exports = content.locals;
  48827. // add the styles to the DOM
  48828. var update = __webpack_require__(1)("75fe3a14", content, false, {});
  48829. // Hot Module Replacement
  48830. if(false) {
  48831. // When the styles change, update the <style> tags
  48832. if(!content.locals) {
  48833. module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Index.vue", function() {
  48834. var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Index.vue");
  48835. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  48836. update(newContent);
  48837. });
  48838. }
  48839. // When the module is disposed, remove the <style> tags
  48840. module.hot.dispose(function() { update(); });
  48841. }
  48842. /***/ }),
  48843. /* 108 */
  48844. /***/ (function(module, exports, __webpack_require__) {
  48845. exports = module.exports = __webpack_require__(0)(false);
  48846. // imports
  48847. // module
  48848. exports.push([module.i, "\n.chat-notice-box {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n cursor: pointer;\n}\n.chat-notice-box .chat-notice-userimg {\n width: 42px;\n height: 42px;\n font-size: 20px;\n line-height: 42px;\n border-radius: 4px;\n}\n.chat-notice-box .ivu-notice-with-desc {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n padding: 0 12px;\n}\n.chat-notice-box .chat-notice-btn-box {\n margin-top: 8px;\n margin-bottom: -4px;\n}\n.chat-notice-box .chat-notice-btn-box .ivu-btn {\n margin-right: 12px;\n font-size: 12px;\n min-width: 42px;\n}\n.chat-notice-box .ivu-notice-desc {\n font-size: 13px;\n word-break: break-all;\n line-height: 1.3;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n overflow: hidden;\n -webkit-box-orient: vertical;\n}\n.chat-notice-box .chat-user .user-msg-title .user-view-inline .user-view-name {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-notice-box .chat-message .manage-title .user-view-inline {\n max-width: 70%;\n}\n.chat-notice-box .chat-message .manage-title .user-view-inline .user-view-name {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n", ""]);
  48849. // exports
  48850. /***/ }),
  48851. /* 109 */
  48852. /***/ (function(module, exports, __webpack_require__) {
  48853. // style-loader: Adds some css to the DOM by adding a <style> tag
  48854. // load the styles
  48855. var content = __webpack_require__(110);
  48856. if(typeof content === 'string') content = [[module.i, content, '']];
  48857. if(content.locals) module.exports = content.locals;
  48858. // add the styles to the DOM
  48859. var update = __webpack_require__(1)("035002ea", content, false, {});
  48860. // Hot Module Replacement
  48861. if(false) {
  48862. // When the styles change, update the <style> tags
  48863. if(!content.locals) {
  48864. module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./Index.vue", function() {
  48865. var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f6b8ea0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./Index.vue");
  48866. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  48867. update(newContent);
  48868. });
  48869. }
  48870. // When the module is disposed, remove the <style> tags
  48871. module.hot.dispose(function() { update(); });
  48872. }
  48873. /***/ }),
  48874. /* 110 */
  48875. /***/ (function(module, exports, __webpack_require__) {
  48876. exports = module.exports = __webpack_require__(0)(false);
  48877. // imports
  48878. // module
  48879. exports.push([module.i, "\n.chat-index[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n.chat-index .chat-none[data-v-3f6b8ea0] {\n height: auto;\n color: #666666;\n padding: 22px 8px;\n text-align: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n margin: 0 !important;\n}\n.chat-index .chat-none[data-v-3f6b8ea0]:before {\n display: none;\n}\n.chat-index .chat-more[data-v-3f6b8ea0] {\n color: #666666;\n padding: 18px 0;\n text-align: center;\n cursor: pointer;\n margin: 0 !important;\n}\n.chat-index .chat-more[data-v-3f6b8ea0]:hover {\n color: #444444;\n}\n.chat-index .chat-menu[data-v-3f6b8ea0] {\n background-color: rgba(28, 29, 31, 0.92);\n width: 68px;\n height: 100%;\n padding-top: 20px;\n}\n.chat-index .chat-menu li[data-v-3f6b8ea0] {\n position: relative;\n padding: 12px 0;\n text-align: center;\n font-size: 28px;\n color: #919193;\n background-color: transparent;\n cursor: pointer;\n}\n.chat-index .chat-menu li.self[data-v-3f6b8ea0] {\n cursor: default;\n}\n.chat-index .chat-menu li.self .avatar[data-v-3f6b8ea0] {\n width: 36px;\n height: 36px;\n font-size: 20px;\n border-radius: 3px;\n}\n.chat-index .chat-menu li.active[data-v-3f6b8ea0] {\n color: #ffffff;\n background-color: rgba(255, 255, 255, 0.06);\n}\n.chat-index .chat-menu li:hover > i[data-v-3f6b8ea0] {\n -webkit-transform: scale(1.1);\n transform: scale(1.1);\n}\n.chat-index .chat-menu li > i[data-v-3f6b8ea0] {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n}\n.chat-index .chat-menu li .chat-num[data-v-3f6b8ea0] {\n position: absolute;\n top: 50%;\n left: 50%;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9) translate(5px, -20px);\n transform: scale(0.9) translate(5px, -20px);\n}\n.chat-index .chat-user[data-v-3f6b8ea0] {\n display: none;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 248px;\n height: 100%;\n background-color: #ffffff;\n border-right: 1px solid #ededed;\n}\n.chat-index .chat-user > li[data-v-3f6b8ea0] {\n position: relative;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 62px;\n margin: 0;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-user > li.lists[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n overflow: auto;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.chat-index .chat-user > li.lists > ul > li[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 70px;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-user > li.lists > ul > li[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-user > li.lists > ul > li.active[data-v-3f6b8ea0]:before {\n top: 0;\n height: 100%;\n}\n.chat-index .chat-user > li.lists > ul > li .avatar[data-v-3f6b8ea0] {\n -webkit-box-flex: 0;\n -ms-flex-positive: 0;\n flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n width: 42px;\n height: 42px;\n font-size: 20px;\n border-radius: 4px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n padding-left: 12px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n line-height: 24px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title span[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n max-width: 130px;\n color: #333333;\n font-size: 14px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-title em[data-v-3f6b8ea0] {\n color: #999999;\n font-size: 12px;\n}\n.chat-index .chat-user > li.lists > ul > li .user-msg-box .user-msg-text[data-v-3f6b8ea0] {\n max-width: 170px;\n color: #999999;\n font-size: 12px;\n line-height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-user > li .user-msg-num[data-v-3f6b8ea0] {\n position: absolute;\n top: 6px;\n left: 44px;\n height: auto;\n line-height: normal;\n color: #ffffff;\n background-color: #ff0000;\n text-align: center;\n border-radius: 10px;\n padding: 1px 5px;\n font-size: 12px;\n -webkit-transform: scale(0.9);\n transform: scale(0.9);\n border: 1px solid #ffffff;\n}\n.chat-index .chat-team[data-v-3f6b8ea0] {\n display: none;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n width: 248px;\n height: 100%;\n background-color: #ffffff;\n border-right: 1px solid #ededed;\n}\n.chat-index .chat-team > li[data-v-3f6b8ea0] {\n position: relative;\n}\n.chat-index .chat-team > li.sreach[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 62px;\n margin: 0;\n padding: 0 12px;\n position: relative;\n cursor: pointer;\n}\n.chat-index .chat-team > li.sreach[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1px;\n background-color: rgba(0, 0, 0, 0.06);\n}\n.chat-index .chat-team > li.lists[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n overflow: auto;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.chat-index .chat-team > li.lists > ul > li[data-v-3f6b8ea0] {\n margin-left: 24px;\n position: relative;\n}\n.chat-index .chat-team > li.lists > ul > li .team-label[data-v-3f6b8ea0] {\n padding-left: 4px;\n margin-top: 6px;\n margin-bottom: 6px;\n height: 34px;\n line-height: 34px;\n border-bottom: 1px solid #efefef;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 52px;\n cursor: pointer;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li .avatar[data-v-3f6b8ea0] {\n -webkit-box-flex: 0;\n -ms-flex-positive: 0;\n flex-grow: 0;\n -ms-flex-negative: 0;\n flex-shrink: 0;\n width: 30px;\n height: 30px;\n font-size: 16px;\n border-radius: 3px;\n}\n.chat-index .chat-team > li.lists > ul > li > ul > li .team-username[data-v-3f6b8ea0] {\n padding: 0 12px;\n font-size: 14px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.chat-index .chat-message[data-v-3f6b8ea0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n height: 100%;\n background-color: #F3F3F3;\n position: relative;\n}\n.chat-index .chat-message .manage-title[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 3;\n width: 100%;\n height: 62px;\n padding: 0 20px;\n line-height: 62px;\n font-size: 16px;\n font-weight: 500;\n text-align: left;\n background: #ffffff;\n border-bottom: 1px solid #ededed;\n}\n.chat-index .chat-message .manage-title .manage-title-right[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 9;\n width: 62px;\n height: 62px;\n line-height: 62px;\n text-align: center;\n font-size: 22px;\n color: #242424;\n}\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n top: 62px;\n z-index: 1;\n bottom: 120px;\n width: 100%;\n overflow: auto;\n padding: 8px 0;\n background-color: #E8EBF2;\n}\n.chat-index .chat-message .manage-lists .manage-more[data-v-3f6b8ea0] {\n color: #666666;\n padding: 8px 0;\n text-align: center;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-lists .manage-more[data-v-3f6b8ea0]:hover {\n color: #444444;\n}\n.chat-index .chat-message .manage-lists .manage-lists-message-new[data-v-3f6b8ea0] {\n position: fixed;\n bottom: 130px;\n right: 20px;\n color: #ffffff;\n background-color: rgba(0, 0, 0, 0.6);\n padding: 6px 12px;\n border-radius: 16px;\n font-size: 12px;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-send[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n bottom: 0;\n z-index: 2;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n height: 120px;\n background-color: #ffffff;\n border-top: 1px solid #e4e4e4;\n}\n.chat-index .chat-message .manage-send .manage-input[data-v-3f6b8ea0], .chat-index .chat-message .manage-send .manage-input[data-v-3f6b8ea0]:focus {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n -webkit-appearance: none;\n font-size: 14px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n padding: 0;\n margin: 38px 10px 6px;\n border: 0;\n line-height: 20px;\n -webkit-box-shadow: none;\n box-shadow: none;\n resize: none;\n outline: 0;\n}\n.chat-index .chat-message .manage-send .manage-join[data-v-3f6b8ea0],\n .chat-index .chat-message .manage-send .manage-spin[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: #ffffff;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.chat-index .chat-message .manage-quick[data-v-3f6b8ea0] {\n position: absolute;\n z-index: 2;\n left: 0;\n right: 0;\n bottom: 79px;\n padding: 8px 0;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n height: 40px;\n}\n.chat-index .chat-message .manage-quick .quick-item[data-v-3f6b8ea0] {\n color: #444444;\n font-size: 24px;\n margin: 0 7px;\n}\n.chat-index .chat-message .manage-quick .quick-item.voicecam[data-v-3f6b8ea0] {\n font-size: 26px;\n height: 24px;\n line-height: 24px;\n}\n.chat-index .chat-message .manage-quick .quick-item.videocam[data-v-3f6b8ea0] {\n color: #666666;\n font-size: 30px;\n height: 24px;\n line-height: 24px;\n}\n.chat-index .chat-message .manage-quick .emoji-box[data-v-3f6b8ea0] {\n position: absolute;\n left: 0;\n bottom: 40px;\n max-height: 320px;\n width: 100%;\n overflow: auto;\n background-color: #ffffff;\n padding: 12px;\n border-bottom: 1px solid #efefef;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emoji-input[data-v-3f6b8ea0] {\n margin: 6px 0;\n}\n.chat-index .chat-message .manage-quick .emoji-box h5[data-v-3f6b8ea0] {\n padding: 0;\n margin: 8px 0 0 0;\n color: #b1b1b1;\n text-transform: uppercase;\n font-size: 14px;\n cursor: default;\n font-weight: normal;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis[data-v-3f6b8ea0]:after {\n content: \"\";\n -webkit-box-flex: 1;\n -ms-flex: auto;\n flex: auto;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis span[data-v-3f6b8ea0] {\n padding: 2px 4px;\n cursor: pointer;\n font-size: 22px;\n}\n.chat-index .chat-message .manage-quick .emoji-box .emojis span[data-v-3f6b8ea0]:hover {\n background: #ececec;\n cursor: pointer;\n}\n.chat-index .chat-message .manage-quick .message-upload[data-v-3f6b8ea0] {\n display: none;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n.chat-index .chat-message .manage-drag-over[data-v-3f6b8ea0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 3;\n background-color: rgba(255, 255, 255, 0.78);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.chat-index .chat-message .manage-drag-over[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n top: 16px;\n left: 16px;\n right: 16px;\n bottom: 16px;\n border: 2px dashed #7b7b7b;\n border-radius: 12px;\n}\n.chat-index .chat-message .manage-drag-over .manage-drag-text[data-v-3f6b8ea0] {\n padding: 12px;\n font-size: 18px;\n color: #666666;\n}\n@media screen and (max-width: 768px) {\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n bottom: 96px;\n}\n.chat-index .chat-message .manage-lists .manage-lists-message-new[data-v-3f6b8ea0] {\n bottom: 106px;\n}\n.chat-index .chat-message .manage-send[data-v-3f6b8ea0] {\n height: 96px;\n}\n.chat-index .chat-message .manage-quick[data-v-3f6b8ea0] {\n bottom: 54px;\n}\n.chat-index .chat-message .manage-quick .quick-item[data-v-3f6b8ea0] {\n font-size: 24px;\n margin-right: 8px;\n}\n}\n.chat-index .chat-video[data-v-3f6b8ea0] {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: #000000;\n background-size: cover;\n background-position: center center;\n background-repeat: no-repeat;\n z-index: 9;\n}\n.chat-index .chat-video[data-v-3f6b8ea0]:before {\n content: \"\";\n position: absolute;\n left: -10%;\n right: -10%;\n top: -10%;\n bottom: -10%;\n background: inherit;\n -webkit-filter: blur(25px);\n filter: blur(25px);\n z-index: 1;\n}\n.chat-index .chat-video[data-v-3f6b8ea0]:after {\n content: \"\";\n position: absolute;\n left: -10%;\n right: -10%;\n top: -10%;\n bottom: -10%;\n background: rgba(0, 0, 0, 0.82);\n z-index: 2;\n}\n.chat-index .chat-video .video-opacity[data-v-3f6b8ea0] {\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n font-size: 26px;\n color: #aaaaaa;\n padding: 24px;\n z-index: 3;\n -webkit-animation: opacity-data-v-3f6b8ea0 2s infinite alternate;\n animation: opacity-data-v-3f6b8ea0 2s infinite alternate;\n}\n@-webkit-keyframes opacity-data-v-3f6b8ea0 {\n0% {\n opacity: 0.1;\n}\n100% {\n opacity: 1;\n}\n}\n@keyframes opacity-data-v-3f6b8ea0 {\n0% {\n opacity: 0.1;\n}\n100% {\n opacity: 1;\n}\n}\n.chat-index .chat-video .video-mini[data-v-3f6b8ea0],\n .chat-index .chat-video .video-active[data-v-3f6b8ea0] {\n position: absolute;\n max-width: 640px;\n max-height: 100%;\n -o-object-fit: cover;\n object-fit: cover;\n -webkit-transition: opacity 1s;\n transition: opacity 1s;\n}\n.chat-index .chat-video .video-active[data-v-3f6b8ea0] {\n top: 0;\n left: 50%;\n width: 100%;\n height: 100%;\n -webkit-transform: rotateY(180deg) translateX(50%);\n transform: rotateY(180deg) translateX(50%);\n z-index: 4;\n}\n.chat-index .chat-video .video-mini[data-v-3f6b8ea0] {\n top: 0;\n right: 0;\n width: 260px;\n height: 180px;\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n z-index: 5;\n}\n.chat-index .chat-video .video-close[data-v-3f6b8ea0] {\n position: absolute;\n max-width: 720px;\n bottom: 18px;\n left: 50%;\n width: 100%;\n -webkit-transform: translateX(-50%);\n transform: translateX(-50%);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n z-index: 6;\n}\n.chat-index .chat-video .video-close > i[data-v-3f6b8ea0] {\n font-weight: 600;\n font-size: 46px;\n color: #ffffff;\n cursor: pointer;\n}\n.chat-index .chat-video .video-close > i[data-v-3f6b8ea0]:hover {\n color: #ff0000;\n}\n.chat-index .chat-audio[data-v-3f6b8ea0] {\n width: 0;\n height: 0;\n display: none;\n}\n.chat-index .chat-flex[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n@media (max-width: 768px) {\n.chat-index .chat-menu[data-v-3f6b8ea0] {\n width: 50px;\n}\n.chat-index .chat-menu li[data-v-3f6b8ea0] {\n padding: 6px 0;\n margin: 6px 0;\n font-size: 24px;\n}\n.chat-index .chat-menu li.self .avatar[data-v-3f6b8ea0] {\n width: 32px;\n height: 32px;\n font-size: 18px;\n}\n.chat-index .chat-user[data-v-3f6b8ea0],\n .chat-index .chat-team[data-v-3f6b8ea0] {\n display: none;\n position: absolute;\n left: 50px;\n right: 0;\n z-index: 2;\n width: auto;\n}\n.chat-index .chat-user > li.sreach[data-v-3f6b8ea0],\n .chat-index .chat-team > li.sreach[data-v-3f6b8ea0] {\n height: 54px;\n}\n.chat-index .chat-user.chat-tam[data-v-3f6b8ea0],\n .chat-index .chat-team.chat-tam[data-v-3f6b8ea0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.chat-index .chat-message .manage-title[data-v-3f6b8ea0] {\n height: 54px;\n line-height: 54px;\n}\n.chat-index .chat-message .manage-title .manage-title-right[data-v-3f6b8ea0] {\n width: 54px;\n height: 54px;\n line-height: 54px;\n}\n.chat-index .chat-message .manage-lists[data-v-3f6b8ea0] {\n top: 54px;\n}\n}\n", ""]);
  48880. // exports
  48881. /***/ }),
  48882. /* 111 */
  48883. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  48884. "use strict";
  48885. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  48886. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker__ = __webpack_require__(112);
  48887. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker__);
  48888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer__ = __webpack_require__(7);
  48889. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer__);
  48890. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY__ = __webpack_require__(56);
  48891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__components_ScrollerY__);
  48892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Message__ = __webpack_require__(117);
  48893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Message___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__Message__);
  48894. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ImgUpload__ = __webpack_require__(17);
  48895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__ImgUpload__);
  48896. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Upload__ = __webpack_require__(122);
  48897. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__Upload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__Upload__);
  48898. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  48899. //
  48900. //
  48901. //
  48902. //
  48903. //
  48904. //
  48905. //
  48906. //
  48907. //
  48908. //
  48909. //
  48910. //
  48911. //
  48912. //
  48913. //
  48914. //
  48915. //
  48916. //
  48917. //
  48918. //
  48919. //
  48920. //
  48921. //
  48922. //
  48923. //
  48924. //
  48925. //
  48926. //
  48927. //
  48928. //
  48929. //
  48930. //
  48931. //
  48932. //
  48933. //
  48934. //
  48935. //
  48936. //
  48937. //
  48938. //
  48939. //
  48940. //
  48941. //
  48942. //
  48943. //
  48944. //
  48945. //
  48946. //
  48947. //
  48948. //
  48949. //
  48950. //
  48951. //
  48952. //
  48953. //
  48954. //
  48955. //
  48956. //
  48957. //
  48958. //
  48959. //
  48960. //
  48961. //
  48962. //
  48963. //
  48964. //
  48965. //
  48966. //
  48967. //
  48968. //
  48969. //
  48970. //
  48971. //
  48972. //
  48973. //
  48974. //
  48975. //
  48976. //
  48977. //
  48978. //
  48979. //
  48980. //
  48981. //
  48982. //
  48983. //
  48984. //
  48985. //
  48986. //
  48987. //
  48988. //
  48989. //
  48990. //
  48991. //
  48992. //
  48993. //
  48994. //
  48995. //
  48996. //
  48997. //
  48998. //
  48999. //
  49000. //
  49001. //
  49002. //
  49003. //
  49004. //
  49005. //
  49006. //
  49007. //
  49008. //
  49009. //
  49010. //
  49011. //
  49012. //
  49013. //
  49014. //
  49015. //
  49016. //
  49017. //
  49018. //
  49019. //
  49020. //
  49021. //
  49022. //
  49023. //
  49024. //
  49025. //
  49026. //
  49027. //
  49028. //
  49029. //
  49030. //
  49031. //
  49032. //
  49033. //
  49034. //
  49035. //
  49036. //
  49037. //
  49038. //
  49039. //
  49040. //
  49041. //
  49042. //
  49043. //
  49044. //
  49045. //
  49046. //
  49047. //
  49048. //
  49049. //
  49050. //
  49051. //
  49052. //
  49053. //
  49054. //
  49055. //
  49056. //
  49057. //
  49058. //
  49059. //
  49060. //
  49061. //
  49062. //
  49063. //
  49064. //
  49065. //
  49066. //
  49067. //
  49068. //
  49069. //
  49070. //
  49071. //
  49072. //
  49073. //
  49074. //
  49075. //
  49076. //
  49077. //
  49078. //
  49079. //
  49080. //
  49081. //
  49082. //
  49083. //
  49084. //
  49085. //
  49086. //
  49087. //
  49088. //
  49089. //
  49090. //
  49091. //
  49092. //
  49093. //
  49094. //
  49095. //
  49096. //
  49097. //
  49098. //
  49099. //
  49100. //
  49101. //
  49102. //
  49103. //
  49104. //
  49105. //
  49106. //
  49107. //
  49108. //
  49109. //
  49110. //
  49111. //
  49112. //
  49113. //
  49114. //
  49115. //
  49116. //
  49117. //
  49118. //
  49119. //
  49120. //
  49121. //
  49122. //
  49123. //
  49124. //
  49125. //
  49126. //
  49127. //
  49128. //
  49129. //
  49130. //
  49131. //
  49132. //
  49133. //
  49134. //
  49135. //
  49136. //
  49137. //
  49138. //
  49139. //
  49140. //
  49141. //
  49142. //
  49143. //
  49144. //
  49145. //
  49146. //
  49147. //
  49148. //
  49149. //
  49150. //
  49151. //
  49152. //
  49153. //
  49154. //
  49155. //
  49156. //
  49157. //
  49158. //
  49159. //
  49160. //
  49161. //
  49162. //
  49163. //
  49164. //
  49165. //
  49166. //
  49167. //
  49168. //
  49169. //
  49170. //
  49171. //
  49172. //
  49173. //
  49174. //
  49175. //
  49176. //
  49177. //
  49178. //
  49179. //
  49180. //
  49181. //
  49182. //
  49183. //
  49184. //
  49185. //
  49186. //
  49187. //
  49188. //
  49189. //
  49190. //
  49191. //
  49192. //
  49193. //
  49194. //
  49195. //
  49196. //
  49197. //
  49198. //
  49199. //
  49200. //
  49201. //
  49202. //
  49203. //
  49204. //
  49205. //
  49206. //
  49207. //
  49208. //
  49209. //
  49210. //
  49211. //
  49212. //
  49213. //
  49214. //
  49215. //
  49216. //
  49217. //
  49218. //
  49219. //
  49220. //
  49221. //
  49222. //
  49223. //
  49224. //
  49225. //
  49226. //
  49227. //
  49228. //
  49229. //
  49230. //
  49231. //
  49232. //
  49233. //
  49234. //
  49235. //
  49236. //
  49237. //
  49238. //
  49239. //
  49240. //
  49241. //
  49242. //
  49243. //
  49244. //
  49245. //
  49246. //
  49247. //
  49248. //
  49249. //
  49250. //
  49251. //
  49252. //
  49253. //
  49254. //
  49255. //
  49256. //
  49257. //
  49258. //
  49259. //
  49260. //
  49261. //
  49262. //
  49263. //
  49264. //
  49265. //
  49266. //
  49267. //
  49268. //
  49269. //
  49270. //
  49271. //
  49272. //
  49273. //
  49274. //
  49275. //
  49276. //
  49277. //
  49278. //
  49279. //
  49280. //
  49281. //
  49282. //
  49283. //
  49284. //
  49285. //
  49286. //
  49287. //
  49288. //
  49289. //
  49290. //
  49291. //
  49292. //
  49293. //
  49294. //
  49295. //
  49296. //
  49297. //
  49298. //
  49299. //
  49300. //
  49301. //
  49302. //
  49303. //
  49304. //
  49305. //
  49306. //
  49307. //
  49308. //
  49309. //
  49310. //
  49311. //
  49312. //
  49313. //
  49314. //
  49315. //
  49316. //
  49317. //
  49318. //
  49319. //
  49320. //
  49321. //
  49322. //
  49323. //
  49324. //
  49325. //
  49326. //
  49327. //
  49328. //
  49329. //
  49330. //
  49331. //
  49332. //
  49333. //
  49334. //
  49335. //
  49336. //
  49337. //
  49338. //
  49339. //
  49340. //
  49341. //
  49342. //
  49343. //
  49344. //
  49345. //
  49346. //
  49347. //
  49348. //
  49349. //
  49350. //
  49351. //
  49352. //
  49353. //
  49354. //
  49355. //
  49356. //
  49357. //
  49358. //
  49359. //
  49360. //
  49361. //
  49362. //
  49363. //
  49364. //
  49365. //
  49366. //
  49367. //
  49368. //
  49369. //
  49370. //
  49371. //
  49372. //
  49373. //
  49374. //
  49375. //
  49376. //
  49377. //
  49378. //
  49379. //
  49380. //
  49381. //
  49382. //
  49383. //
  49384. //
  49385. //
  49386. //
  49387. //
  49388. //
  49389. //
  49390. //
  49391. //
  49392. //
  49393. //
  49394. //
  49395. //
  49396. //
  49397. //
  49398. //
  49399. //
  49400. //
  49401. //
  49402. //
  49403. //
  49404. //
  49405. //
  49406. //
  49407. //
  49408. //
  49409. //
  49410. //
  49411. //
  49412. //
  49413. //
  49414. //
  49415. //
  49416. //
  49417. //
  49418. //
  49419. //
  49420. //
  49421. //
  49422. //
  49423. //
  49424. //
  49425. //
  49426. //
  49427. //
  49428. //
  49429. //
  49430. //
  49431. //
  49432. //
  49433. //
  49434. //
  49435. //
  49436. //
  49437. //
  49438. //
  49439. //
  49440. //
  49441. //
  49442. //
  49443. //
  49444. //
  49445. //
  49446. //
  49447. //
  49448. //
  49449. //
  49450. //
  49451. //
  49452. //
  49453. //
  49454. //
  49455. //
  49456. //
  49457. //
  49458. //
  49459. //
  49460. //
  49461. //
  49462. //
  49463. //
  49464. //
  49465. //
  49466. //
  49467. //
  49468. //
  49469. //
  49470. //
  49471. //
  49472. //
  49473. //
  49474. //
  49475. //
  49476. //
  49477. //
  49478. //
  49479. //
  49480. //
  49481. //
  49482. //
  49483. //
  49484. //
  49485. //
  49486. //
  49487. //
  49488. //
  49489. //
  49490. //
  49491. //
  49492. //
  49493. //
  49494. //
  49495. //
  49496. //
  49497. //
  49498. //
  49499. //
  49500. //
  49501. //
  49502. //
  49503. //
  49504. //
  49505. //
  49506. //
  49507. //
  49508. //
  49509. //
  49510. //
  49511. //
  49512. //
  49513. //
  49514. //
  49515. //
  49516. //
  49517. //
  49518. //
  49519. //
  49520. //
  49521. //
  49522. //
  49523. //
  49524. //
  49525. //
  49526. //
  49527. //
  49528. //
  49529. //
  49530. //
  49531. //
  49532. //
  49533. //
  49534. //
  49535. //
  49536. //
  49537. //
  49538. //
  49539. //
  49540. //
  49541. //
  49542. //
  49543. //
  49544. //
  49545. //
  49546. //
  49547. //
  49548. //
  49549. //
  49550. //
  49551. //
  49552. //
  49553. //
  49554. //
  49555. //
  49556. //
  49557. //
  49558. //
  49559. //
  49560. //
  49561. //
  49562. //
  49563. //
  49564. //
  49565. //
  49566. //
  49567. //
  49568. //
  49569. //
  49570. //
  49571. //
  49572. //
  49573. //
  49574. //
  49575. //
  49576. //
  49577. //
  49578. //
  49579. //
  49580. //
  49581. //
  49582. //
  49583. //
  49584. //
  49585. //
  49586. //
  49587. //
  49588. //
  49589. //
  49590. //
  49591. //
  49592. //
  49593. //
  49594. //
  49595. //
  49596. //
  49597. //
  49598. //
  49599. //
  49600. //
  49601. //
  49602. //
  49603. //
  49604. //
  49605. //
  49606. //
  49607. //
  49608. //
  49609. //
  49610. //
  49611. //
  49612. //
  49613. //
  49614. //
  49615. //
  49616. //
  49617. //
  49618. //
  49619. //
  49620. //
  49621. //
  49622. //
  49623. //
  49624. //
  49625. //
  49626. //
  49627. //
  49628. //
  49629. //
  49630. //
  49631. //
  49632. //
  49633. //
  49634. //
  49635. //
  49636. //
  49637. //
  49638. //
  49639. //
  49640. //
  49641. //
  49642. //
  49643. //
  49644. //
  49645. //
  49646. //
  49647. //
  49648. //
  49649. //
  49650. //
  49651. //
  49652. //
  49653. //
  49654. //
  49655. //
  49656. //
  49657. //
  49658. //
  49659. //
  49660. //
  49661. //
  49662. //
  49663. //
  49664. //
  49665. //
  49666. //
  49667. //
  49668. //
  49669. //
  49670. //
  49671. //
  49672. //
  49673. //
  49674. //
  49675. //
  49676. //
  49677. //
  49678. //
  49679. //
  49680. //
  49681. //
  49682. //
  49683. //
  49684. //
  49685. //
  49686. //
  49687. //
  49688. //
  49689. //
  49690. //
  49691. //
  49692. //
  49693. //
  49694. //
  49695. //
  49696. //
  49697. //
  49698. //
  49699. //
  49700. //
  49701. //
  49702. //
  49703. //
  49704. //
  49705. //
  49706. //
  49707. //
  49708. //
  49709. //
  49710. //
  49711. //
  49712. //
  49713. //
  49714. //
  49715. //
  49716. //
  49717. //
  49718. //
  49719. //
  49720. //
  49721. //
  49722. //
  49723. //
  49724. //
  49725. //
  49726. //
  49727. //
  49728. //
  49729. //
  49730. //
  49731. //
  49732. //
  49733. //
  49734. //
  49735. //
  49736. //
  49737. //
  49738. //
  49739. //
  49740. //
  49741. //
  49742. //
  49743. //
  49744. //
  49745. //
  49746. //
  49747. //
  49748. //
  49749. //
  49750. //
  49751. //
  49752. //
  49753. //
  49754. //
  49755. //
  49756. //
  49757. //
  49758. //
  49759. //
  49760. //
  49761. //
  49762. //
  49763. //
  49764. //
  49765. //
  49766. //
  49767. //
  49768. //
  49769. //
  49770. //
  49771. //
  49772. //
  49773. /* harmony default export */ __webpack_exports__["default"] = ({
  49774. name: 'ChatIndex',
  49775. components: { ChatLoad: __WEBPACK_IMPORTED_MODULE_5__Upload___default.a, ImgUpload: __WEBPACK_IMPORTED_MODULE_4__ImgUpload___default.a, ChatMessage: __WEBPACK_IMPORTED_MODULE_3__Message___default.a, EmojiPicker: __WEBPACK_IMPORTED_MODULE_0_vue_emoji_picker___default.a, ScrollerY: __WEBPACK_IMPORTED_MODULE_2__components_ScrollerY___default.a, DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_1__DrawerTabsContainer___default.a },
  49776. props: {
  49777. value: {
  49778. default: 0
  49779. },
  49780. openWindow: {
  49781. type: Boolean,
  49782. default: false
  49783. }
  49784. },
  49785. data: function data() {
  49786. return {
  49787. loadIng: 0,
  49788. openAlready: false,
  49789. chatTap: 'dialog',
  49790. chatTam: 'dialog',
  49791. messageAudio: window.location.origin + '/audio/',
  49792. dialogSearch: '',
  49793. dialogTarget: {},
  49794. dialogLists: [],
  49795. dialogNoDataText: '',
  49796. dialogDragOver: false,
  49797. teamSearch: '',
  49798. teamReady: false,
  49799. teamLists: {},
  49800. teamNoDataText: '',
  49801. teamCurrentPage: 1,
  49802. teamHasMorePages: false,
  49803. autoBottom: true,
  49804. messageNew: 0,
  49805. messageText: '',
  49806. messageLists: [],
  49807. messageNoDataText: '',
  49808. messageEmojiSearch: '',
  49809. messageCurrentPage: 1,
  49810. messageHasMorePages: false,
  49811. unreadTotal: 0,
  49812. videoUserName: '', //视频对话用户名
  49813. videoUserImg: '', //视频对话用户头像
  49814. videoStartTime: 0, //视频开始时间
  49815. videoInitiator: false, //是否发起人
  49816. videoChat: false, //是否视频通话(否则音频通话)
  49817. videoRtc: null, //视频Rtc
  49818. videoLocalStream: null, //视频流
  49819. systemConfig: $A.jsonParse($A.storage("systemSetting"), {
  49820. callav: ''
  49821. })
  49822. };
  49823. },
  49824. mounted: function mounted() {
  49825. var _this = this;
  49826. this.formatCall();
  49827. this.getSetting();
  49828. //
  49829. window.onChatOpenUserName = function (username) {
  49830. _this.$emit("on-open-notice", username);
  49831. _this.clickDialog(username, true);
  49832. };
  49833. //
  49834. if (this.openWindow) {
  49835. $A.WSOB.connection();
  49836. if (!this.openAlready) {
  49837. this.openAlready = true;
  49838. this.getDialogLists();
  49839. }
  49840. }
  49841. //
  49842. $A.WSOB.setOnMsgListener("chat/index", function (msgDetail) {
  49843. if (msgDetail.username == _this.usrName) {
  49844. return;
  49845. }
  49846. switch (msgDetail.messageType) {
  49847. case 'open':
  49848. if (_this.openWindow) {
  49849. _this.getDialogLists();
  49850. _this.getDialogMessage();
  49851. } else {
  49852. _this.openAlready = false;
  49853. _this.dialogTarget = {};
  49854. }
  49855. break;
  49856. case 'info':
  49857. if (msgDetail.body.type == 'video') {
  49858. _this.videoMessage(msgDetail);
  49859. }
  49860. break;
  49861. case 'user':
  49862. var body = msgDetail.body;
  49863. if (['taskA'].indexOf(body.type) !== -1) {
  49864. return;
  49865. }
  49866. var lasttext = $A.WSOB.getMsgDesc(body);
  49867. _this.unreadTotal += 1;
  49868. _this.addDialog({
  49869. username: body.username,
  49870. userimg: body.userimg,
  49871. lasttext: lasttext,
  49872. lastdate: body.indate,
  49873. unread: body.unread
  49874. });
  49875. if (msgDetail.username == _this.dialogTarget.username) {
  49876. _this.addMessageData(body, true);
  49877. }
  49878. if (!_this.openWindow) {
  49879. _this.$Notice.close('chat-notice');
  49880. _this.$Notice.open({
  49881. name: 'chat-notice',
  49882. duration: 0,
  49883. render: function render(h) {
  49884. return h('div', {
  49885. class: 'chat-notice-box',
  49886. on: {
  49887. click: function click() {
  49888. _this.$Notice.close('chat-notice');
  49889. _this.$emit("on-open-notice", body.username);
  49890. _this.clickDialog(body.username);
  49891. }
  49892. }
  49893. }, [h('UserImg', { class: 'chat-notice-userimg', props: { info: body } }), h('div', { class: 'ivu-notice-with-desc' }, [h('div', { class: 'ivu-notice-title' }, [h('UserView', { props: { username: body.username } })]), h('div', { class: 'ivu-notice-desc' }, lasttext)])]);
  49894. }
  49895. });
  49896. }
  49897. try {
  49898. _this.$refs.messageAudio.play();
  49899. } catch (e) {}
  49900. break;
  49901. }
  49902. });
  49903. $A.WSOB.setOnSpecialListener("chat/index", function (simpleMsg) {
  49904. _this.addDialog({
  49905. username: simpleMsg.target,
  49906. lasttext: $A.WSOB.getMsgDesc(simpleMsg.body),
  49907. lastdate: simpleMsg.body.indate
  49908. });
  49909. if (simpleMsg.target == _this.dialogTarget.username) {
  49910. _this.addMessageData(simpleMsg.body, true);
  49911. }
  49912. });
  49913. },
  49914. watch: {
  49915. usrName: function usrName() {
  49916. this.formatCall();
  49917. },
  49918. chatTap: function chatTap(val) {
  49919. var _this2 = this;
  49920. if (val === 'team' && this.teamReady == false) {
  49921. this.teamReady = true;
  49922. this.getTeamLists();
  49923. } else if (val === 'dialog') {
  49924. this.autoBottom = true;
  49925. this.$nextTick(function () {
  49926. _this2.messageBottomGo();
  49927. });
  49928. }
  49929. },
  49930. openWindow: function openWindow(val) {
  49931. var _this3 = this;
  49932. if (val) {
  49933. $A.WSOB.connection();
  49934. if (!this.openAlready) {
  49935. this.openAlready = true;
  49936. this.getDialogLists();
  49937. }
  49938. }
  49939. //
  49940. var tmpRand = $A.randomString(8);
  49941. this.__openWindowRand = tmpRand;
  49942. setTimeout(function () {
  49943. if (_this3.__openWindowRand !== tmpRand) {
  49944. return;
  49945. }
  49946. $A.WSOB.sendTo('unread', function (res) {
  49947. if (res.status === 1) {
  49948. _this3.unreadTotal = $A.runNum(res.message);
  49949. } else {
  49950. _this3.unreadTotal = 0;
  49951. }
  49952. });
  49953. }, 500);
  49954. },
  49955. unreadTotal: function unreadTotal(val) {
  49956. if (val < 0) {
  49957. this.unreadTotal = 0;
  49958. return;
  49959. }
  49960. this.$emit('input', val);
  49961. },
  49962. dialogTarget: {
  49963. handler: function handler() {
  49964. var username = this.dialogTarget.username;
  49965. if (username === this.__dialogTargetUsername) {
  49966. return;
  49967. }
  49968. this.__dialogTargetUsername = username;
  49969. this.getDialogMessage();
  49970. },
  49971. deep: true
  49972. }
  49973. },
  49974. computed: {
  49975. dialogListsS: function dialogListsS() {
  49976. var _this4 = this;
  49977. return this.dialogLists.filter(function (item) {
  49978. return (item.username + "").indexOf(_this4.dialogSearch) > -1 || (item.lasttext + "").indexOf(_this4.dialogSearch) > -1 || (item.nickname + "").indexOf(_this4.dialogSearch) > -1;
  49979. });
  49980. },
  49981. teamListsS: function teamListsS() {
  49982. return function (lists) {
  49983. var _this5 = this;
  49984. return lists.filter(function (item) {
  49985. return (item.username + "").indexOf(_this5.teamSearch) > -1 || (item.nickname + "").indexOf(_this5.teamSearch) > -1;
  49986. });
  49987. };
  49988. }
  49989. },
  49990. methods: {
  49991. initLanguage: function initLanguage() {
  49992. this.dialogNoDataText = this.$L("数据加载中.....");
  49993. this.teamNoDataText = this.$L("数据加载中.....");
  49994. this.messageNoDataText = this.$L("数据加载中.....");
  49995. },
  49996. formatCall: function formatCall() {
  49997. var _this6 = this;
  49998. if ($A.getToken() === false) {
  49999. return;
  50000. }
  50001. $A.WSOB.sendTo('unread', function (res) {
  50002. if (res.status === 1) {
  50003. _this6.unreadTotal = $A.runNum(res.message);
  50004. } else {
  50005. _this6.unreadTotal = 0;
  50006. }
  50007. });
  50008. this.getDialogLists();
  50009. this.messageBottomAuto();
  50010. },
  50011. getSetting: function getSetting() {
  50012. var _this7 = this;
  50013. $A.apiAjax({
  50014. url: 'system/setting',
  50015. error: function error() {
  50016. $A.storage("systemSetting", {});
  50017. },
  50018. success: function success(res) {
  50019. if (res.ret === 1) {
  50020. _this7.systemConfig = res.data;
  50021. _this7.systemConfig.callav = _this7.systemConfig.callav || 'open';
  50022. $A.storage("systemSetting", _this7.systemConfig);
  50023. } else {
  50024. $A.storage("systemSetting", {});
  50025. }
  50026. }
  50027. });
  50028. },
  50029. formatCDate: function formatCDate(v) {
  50030. var string = '';
  50031. if ($A.runNum(v) > 0) {
  50032. if ($A.formatDate('Ymd') === $A.formatDate('Ymd', v)) {
  50033. string = $A.formatDate('H:i', v);
  50034. } else if ($A.formatDate('Y') === $A.formatDate('Y', v)) {
  50035. string = $A.formatDate('m-d', v);
  50036. } else {
  50037. string = $A.formatDate('Y-m-d', v);
  50038. }
  50039. }
  50040. return string || '';
  50041. },
  50042. getDialogLists: function getDialogLists() {
  50043. var _this8 = this;
  50044. if (!this.openAlready) {
  50045. return;
  50046. }
  50047. this.loadIng++;
  50048. this.dialogNoDataText = this.$L("数据加载中.....");
  50049. $A.apiAjax({
  50050. url: 'chat/dialog/lists',
  50051. complete: function complete() {
  50052. _this8.loadIng--;
  50053. },
  50054. error: function error() {
  50055. _this8.dialogNoDataText = _this8.$L("数据加载失败!");
  50056. },
  50057. success: function success(res) {
  50058. if (res.ret === 1) {
  50059. _this8.dialogLists = res.data;
  50060. _this8.dialogNoDataText = _this8.$L("没有相关的数据");
  50061. _this8.scrollToActive();
  50062. } else {
  50063. _this8.dialogLists = [];
  50064. _this8.dialogNoDataText = res.msg;
  50065. }
  50066. }
  50067. });
  50068. },
  50069. getDialogMessage: function getDialogMessage() {
  50070. var _this9 = this;
  50071. var isNextPage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  50072. var username = this.dialogTarget.username;
  50073. if (!username) {
  50074. return;
  50075. }
  50076. //
  50077. if (isNextPage === true) {
  50078. if (!this.messageHasMorePages) {
  50079. return;
  50080. }
  50081. this.messageCurrentPage += 1;
  50082. } else {
  50083. this.messageCurrentPage = 1;
  50084. this.autoBottom = true;
  50085. this.messageNew = 0;
  50086. this.messageLists = [];
  50087. }
  50088. this.messageHasMorePages = false;
  50089. //
  50090. this.loadIng++;
  50091. this.messageNoDataText = this.$L("数据加载中.....");
  50092. $A.apiAjax({
  50093. url: 'chat/message/lists',
  50094. data: {
  50095. username: username,
  50096. page: this.messageCurrentPage,
  50097. pagesize: 30
  50098. },
  50099. complete: function complete() {
  50100. _this9.loadIng--;
  50101. },
  50102. error: function error() {
  50103. _this9.messageNoDataText = _this9.$L("数据加载失败!");
  50104. },
  50105. success: function success(res) {
  50106. if (username != _this9.dialogTarget.username) {
  50107. return;
  50108. }
  50109. if (res.ret === 1) {
  50110. var tempId = "notice_" + $A.randomString(6);
  50111. var tempLists = res.data.lists;
  50112. if (isNextPage) {
  50113. _this9.addMessageData({
  50114. id: tempId,
  50115. type: 'notice',
  50116. notice: _this9.$L('历史消息')
  50117. }, false, isNextPage);
  50118. } else {
  50119. tempLists = tempLists.reverse();
  50120. }
  50121. tempLists.forEach(function (item) {
  50122. _this9.addMessageData(Object.assign(item.message, {
  50123. id: item.id,
  50124. username: item.username,
  50125. userimg: item.userimg,
  50126. indate: item.indate
  50127. }), false, isNextPage);
  50128. });
  50129. if (isNextPage) {
  50130. _this9.$nextTick(function () {
  50131. var tempObj = $A('div[data-id="' + tempId + '"]');
  50132. if (tempObj.length > 0) {
  50133. _this9.$refs.manageLists.scrollTo(tempObj.offset().top - tempObj.height() - 24, false);
  50134. }
  50135. });
  50136. }
  50137. _this9.messageNoDataText = '';
  50138. _this9.messageHasMorePages = res.data.hasMorePages;
  50139. } else {
  50140. _this9.messageNoDataText = res.msg;
  50141. _this9.messageHasMorePages = false;
  50142. }
  50143. }
  50144. });
  50145. },
  50146. getTeamLists: function getTeamLists() {
  50147. var _this10 = this;
  50148. var isNextPage = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  50149. if (isNextPage === true) {
  50150. if (!this.teamHasMorePages) {
  50151. return;
  50152. }
  50153. this.teamCurrentPage += 1;
  50154. } else {
  50155. this.teamCurrentPage = 1;
  50156. }
  50157. this.teamHasMorePages = false;
  50158. //
  50159. this.loadIng++;
  50160. this.teamNoDataText = this.$L("数据加载中.....");
  50161. $A.apiAjax({
  50162. url: 'users/team/lists',
  50163. data: {
  50164. sorts: {
  50165. key: 'az',
  50166. order: 'asc'
  50167. },
  50168. page: this.teamCurrentPage,
  50169. pagesize: 100
  50170. },
  50171. complete: function complete() {
  50172. _this10.loadIng--;
  50173. },
  50174. error: function error() {
  50175. _this10.teamNoDataText = _this10.$L("数据加载失败!");
  50176. },
  50177. success: function success(res) {
  50178. if (res.ret === 1) {
  50179. res.data.lists.forEach(function (item) {
  50180. if (typeof _this10.teamLists[item.az] === "undefined") {
  50181. _this10.$set(_this10.teamLists, item.az, []);
  50182. }
  50183. _this10.teamLists[item.az].push(item);
  50184. });
  50185. _this10.teamNoDataText = _this10.$L("没有相关的数据");
  50186. _this10.teamHasMorePages = res.data.hasMorePages;
  50187. //
  50188. if (_this10.teamHasMorePages && res.data.currentPage < 5) {
  50189. _this10.getTeamLists(true);
  50190. }
  50191. } else {
  50192. _this10.teamLists = {};
  50193. _this10.teamNoDataText = res.msg;
  50194. _this10.teamHasMorePages = false;
  50195. }
  50196. }
  50197. });
  50198. },
  50199. addDialog: function addDialog(data) {
  50200. if (!data.username) {
  50201. return;
  50202. }
  50203. var lists = this.dialogLists.filter(function (item) {
  50204. return item.username == data.username;
  50205. });
  50206. var unread = 0;
  50207. if (lists.length > 0) {
  50208. if (typeof data.userimg === "undefined") {
  50209. data.userimg = lists[0].userimg;
  50210. }
  50211. unread = $A.runNum(lists[0].unread);
  50212. this.dialogLists = this.dialogLists.filter(function (item) {
  50213. return item.username != data.username;
  50214. });
  50215. }
  50216. if (typeof data.unread === "undefined") {
  50217. data.unread = unread;
  50218. }
  50219. this.dialogLists.unshift(data);
  50220. },
  50221. openDialog: function openDialog(user) {
  50222. var autoAddDialog = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  50223. if (autoAddDialog === true) {
  50224. var lists = this.dialogLists.filter(function (item) {
  50225. return item.username == user.username;
  50226. });
  50227. if (lists.length === 0) {
  50228. this.addDialog(user);
  50229. }
  50230. }
  50231. this.chatTap = 'dialog';
  50232. this.chatTam = '';
  50233. this.dialogTarget = user;
  50234. if (typeof user.unread === "number" && user.unread > 0) {
  50235. this.unreadTotal -= user.unread;
  50236. this.$set(user, 'unread', 0);
  50237. $A.WSOB.sendTo('read', user.username);
  50238. }
  50239. if (autoAddDialog === true) {
  50240. this.scrollToActive();
  50241. }
  50242. },
  50243. scrollToActive: function scrollToActive() {
  50244. var _this11 = this;
  50245. //自动滚到焦点
  50246. this.$nextTick(function () {
  50247. var dialogObj = $A(_this11.$refs.dialogLists);
  50248. var activeObj = dialogObj.find("li.active");
  50249. if (activeObj.length > 0) {
  50250. var offsetTop = activeObj.offset().top;
  50251. if (offsetTop < 0) {
  50252. dialogObj.stop().scrollTop(activeObj[0].offsetTop - 50);
  50253. } else if (offsetTop > dialogObj.height()) {
  50254. dialogObj.stop().scrollTop(activeObj[0].offsetTop + 50 + activeObj.height() - dialogObj.height());
  50255. }
  50256. }
  50257. });
  50258. },
  50259. clickDialog: function clickDialog(username) {
  50260. var _this12 = this;
  50261. var autoPush = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  50262. var lists = this.dialogLists.filter(function (item) {
  50263. return item.username == username;
  50264. });
  50265. if (lists.length > 0) {
  50266. this.openDialog(lists[0]);
  50267. if (autoPush === true) {
  50268. this.scrollToActive();
  50269. }
  50270. } else if (autoPush === true) {
  50271. $A.apiAjax({
  50272. url: 'users/team/lists',
  50273. data: {
  50274. username: username
  50275. },
  50276. success: function success(res) {
  50277. if (res.ret === 1 && $A.isPlainObject(res.data)) {
  50278. _this12.$nextTick(function () {
  50279. typeof _this12.dialogTarget.username === "undefined" && _this12.openDialog(res.data, true);
  50280. });
  50281. }
  50282. }
  50283. });
  50284. }
  50285. },
  50286. dialogDropdown: function dialogDropdown(type) {
  50287. var _this13 = this;
  50288. switch (type) {
  50289. case 'clear':
  50290. case 'delete':
  50291. this.$Modal.confirm({
  50292. title: this.$L('确认操作'),
  50293. content: type === 'delete' ? this.$L('你确定要删除此对话吗?') : this.$L('你确定要清除聊天记录吗?'),
  50294. loading: true,
  50295. onOk: function onOk() {
  50296. var username = _this13.dialogTarget.username;
  50297. $A.apiAjax({
  50298. url: 'chat/dialog/clear',
  50299. data: {
  50300. username: username,
  50301. delete: type === 'delete' ? 1 : 0
  50302. },
  50303. error: function error() {
  50304. _this13.$Modal.remove();
  50305. alert(_this13.$L('网络繁忙,请稍后再试!'));
  50306. },
  50307. success: function success(res) {
  50308. _this13.$Modal.remove();
  50309. if (res.ret === 1) {
  50310. if (type === 'delete') {
  50311. _this13.dialogLists = _this13.dialogLists.filter(function (item) {
  50312. return item.username != username;
  50313. });
  50314. _this13.dialogTarget = {};
  50315. } else {
  50316. _this13.$set(_this13.dialogTarget, 'lasttext', '');
  50317. _this13.getDialogMessage();
  50318. }
  50319. }
  50320. setTimeout(function () {
  50321. if (res.ret === 1) {
  50322. _this13.$Message.success(res.msg);
  50323. } else {
  50324. _this13.$Modal.error({ title: _this13.$L('温馨提示'), content: res.msg });
  50325. }
  50326. }, 350);
  50327. }
  50328. });
  50329. }
  50330. });
  50331. break;
  50332. }
  50333. },
  50334. messageListsScroll: function messageListsScroll(res) {
  50335. if (res.directionreal === 'up') {
  50336. if (res.scrollE < 10) {
  50337. this.autoBottom = true;
  50338. }
  50339. } else if (res.directionreal === 'down') {
  50340. this.autoBottom = false;
  50341. }
  50342. },
  50343. messageBottomAuto: function messageBottomAuto() {
  50344. var _this14 = this;
  50345. var randString = $A.randomString(8);
  50346. window.__messageBottomAuto = randString;
  50347. setTimeout(function () {
  50348. if (randString === window.__messageBottomAuto) {
  50349. window.__messageBottomAuto = null;
  50350. if (_this14.autoBottom) {
  50351. _this14.messageBottomGo();
  50352. }
  50353. _this14.messageBottomAuto();
  50354. }
  50355. }, 1000);
  50356. },
  50357. messageBottomGo: function messageBottomGo() {
  50358. var _this15 = this;
  50359. var animation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  50360. this.$nextTick(function () {
  50361. _this15.messageNew = 0;
  50362. if (typeof _this15.$refs.manageLists !== "undefined") {
  50363. _this15.$refs.manageLists.scrollTo(_this15.$refs.manageBody.clientHeight, animation);
  50364. _this15.autoBottom = true;
  50365. }
  50366. });
  50367. },
  50368. messageInsertText: function messageInsertText(emoji) {
  50369. this.messageText += emoji;
  50370. },
  50371. messageInsertFile: function messageInsertFile(item) {
  50372. var _this16 = this;
  50373. if ((typeof item === "undefined" ? "undefined" : _typeof(item)) === 'object' && typeof item.url === "string") {
  50374. var data = {
  50375. type: ['jpg', 'jpeg', 'png', 'gif'].indexOf(item.ext) !== -1 ? 'image' : 'file',
  50376. filename: item.name,
  50377. filesize: item.size,
  50378. filethumb: item.thumb,
  50379. username: this.usrInfo.username,
  50380. userimg: this.usrInfo.userimg,
  50381. indate: Math.round(new Date().getTime() / 1000),
  50382. url: item.url,
  50383. width: $A.getObject(item, 'response.data.width'),
  50384. height: $A.getObject(item, 'response.data.height'),
  50385. replaceId: item.tempId
  50386. };
  50387. $A.WSOB.sendTo('user', this.dialogTarget.username, data, function (res) {
  50388. _this16.$set(data, res.status === 1 ? 'id' : 'error', res.message);
  50389. });
  50390. //
  50391. this.addDialog(Object.assign(this.dialogTarget, {
  50392. lasttext: this.$L(data.type == 'image' ? '[图片]' : '[文件]'),
  50393. lastdate: data.indate
  50394. }));
  50395. this.openDialog(this.dialogTarget);
  50396. this.addMessageData(data, true);
  50397. }
  50398. },
  50399. addMessageData: function addMessageData(data) {
  50400. var _this17 = this;
  50401. var animation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  50402. var isUnshift = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  50403. data.self = data.username === this.usrInfo.username;
  50404. var sikp = false;
  50405. if (data.id || data.replaceId) {
  50406. this.messageLists.some(function (item, index) {
  50407. if (item.id == data.id || item.id == data.replaceId) {
  50408. data.nickname = data.nickname || item.nickname;
  50409. _this17.messageLists.splice(index, 1, data);
  50410. return sikp = true;
  50411. }
  50412. });
  50413. if (sikp) {
  50414. return;
  50415. }
  50416. }
  50417. if (isUnshift) {
  50418. this.messageLists.unshift(data);
  50419. } else {
  50420. this.messageLists.push(data);
  50421. if (this.autoBottom) {
  50422. this.messageBottomGo(animation);
  50423. } else {
  50424. this.messageNew++;
  50425. }
  50426. }
  50427. },
  50428. messageSend: function messageSend(e) {
  50429. if (e.keyCode == 13) {
  50430. if (e.shiftKey) {
  50431. return;
  50432. }
  50433. e.preventDefault();
  50434. this.messageSubmit();
  50435. }
  50436. },
  50437. messageDragOver: function messageDragOver(show) {
  50438. var _this18 = this;
  50439. var random = this.__dialogDragOver = $A.randomString(8);
  50440. if (!show) {
  50441. setTimeout(function () {
  50442. if (random === _this18.__dialogDragOver) {
  50443. _this18.dialogDragOver = show;
  50444. }
  50445. }, 150);
  50446. } else {
  50447. this.dialogDragOver = show;
  50448. }
  50449. },
  50450. messagePasteDrag: function messagePasteDrag(e, type) {
  50451. var _this19 = this;
  50452. this.dialogDragOver = false;
  50453. var files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
  50454. var postFiles = Array.prototype.slice.call(files);
  50455. if (postFiles.length > 0) {
  50456. e.preventDefault();
  50457. postFiles.forEach(function (file) {
  50458. _this19.$refs.messageUpload.upload(file);
  50459. });
  50460. }
  50461. },
  50462. messageFile: function messageFile(type, file) {
  50463. var _this20 = this;
  50464. switch (type) {
  50465. case 'progress':
  50466. this.addMessageData({
  50467. id: file.tempId,
  50468. type: 'image',
  50469. username: this.usrInfo.username,
  50470. userimg: this.usrInfo.userimg,
  50471. indate: Math.round(new Date().getTime() / 1000),
  50472. url: 'loading'
  50473. }, true);
  50474. break;
  50475. case 'error':
  50476. this.messageLists.some(function (item, index) {
  50477. if (item.id == file.tempId) {
  50478. _this20.messageLists.splice(index, 1);
  50479. return true;
  50480. }
  50481. });
  50482. break;
  50483. case 'success':
  50484. this.messageInsertFile(file);
  50485. break;
  50486. }
  50487. },
  50488. messageSubmit: function messageSubmit() {
  50489. var _this21 = this;
  50490. var dialogUser = this.dialogLists.filter(function (item) {
  50491. return item.username == _this21.dialogTarget.username;
  50492. });
  50493. if (dialogUser.length > 0) {
  50494. var user = dialogUser[0];
  50495. if (typeof user.unread === "number" && user.unread > 0) {
  50496. this.unreadTotal -= user.unread;
  50497. this.$set(user, 'unread', 0);
  50498. $A.WSOB.sendTo('read', user.username);
  50499. }
  50500. }
  50501. //
  50502. this.autoBottom = true;
  50503. var text = this.messageText.trim();
  50504. if ($A.count(text) > 0) {
  50505. var data = {
  50506. type: 'text',
  50507. username: this.usrInfo.username,
  50508. userimg: this.usrInfo.userimg,
  50509. indate: Math.round(new Date().getTime() / 1000),
  50510. text: text
  50511. };
  50512. $A.WSOB.sendTo('user', this.dialogTarget.username, data, function (res) {
  50513. _this21.$set(data, res.status === 1 ? 'id' : 'error', res.message);
  50514. });
  50515. //
  50516. this.addDialog(Object.assign(this.dialogTarget, {
  50517. lasttext: text,
  50518. lastdate: data.indate
  50519. }));
  50520. this.openDialog(this.dialogTarget);
  50521. this.addMessageData(data, true);
  50522. }
  50523. this.$nextTick(function () {
  50524. _this21.messageText = "";
  50525. });
  50526. },
  50527. userViewResult: function userViewResult(user, data) {
  50528. this.$set(user, 'nickname', data.nickname);
  50529. this.$set(user, 'userimg', data.userimg);
  50530. },
  50531. videoConnect: function videoConnect(username, videoChat) {
  50532. var _this22 = this;
  50533. if (!$A.leftExists(window.location.protocol, "https")) {
  50534. this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('浏览器阻止音视频访问不是https的网站,所以尝试安装SSL!') });
  50535. return;
  50536. }
  50537. this.videoChat = videoChat;
  50538. navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
  50539. try {
  50540. navigator.mediaDevices.getUserMedia({
  50541. audio: true,
  50542. video: this.videoChat
  50543. }).then(function (stream) {
  50544. _this22.videoLocalStream = stream;
  50545. _this22.$refs.localVideo.srcObject = stream;
  50546. _this22.$refs.localVideo.removeEventListener('loadedmetadata', _this22.videoListener);
  50547. //
  50548. if (username === null) {
  50549. // 发起者
  50550. _this22.videoUserName = _this22.dialogTarget.username;
  50551. _this22.videoUserImg = _this22.dialogTarget.userimg;
  50552. _this22.videoStartTime = 0;
  50553. _this22.videoInitiator = true;
  50554. _this22.$refs.localVideo.addEventListener('loadedmetadata', _this22.videoListener);
  50555. } else {
  50556. // 接受者
  50557. _this22.videoIcecandidate(_this22.videoLocalStream, username);
  50558. _this22.videoRtc.createOffer({
  50559. offerToReceiveAudio: true,
  50560. offerToReceiveVideo: _this22.videoChat
  50561. }).then(function (desc) {
  50562. _this22.videoRtc.setLocalDescription(desc).then(function () {
  50563. $A.WSOB.sendTo('info', username, {
  50564. 'type': 'video',
  50565. 'subtype': 'offer',
  50566. 'data': _this22.videoRtc.localDescription
  50567. });
  50568. }).catch(function (e) {
  50569. _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
  50570. _this22.videoClose(username, _this22.$L('对方:') + e);
  50571. });
  50572. }).catch(function (e) {
  50573. _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
  50574. _this22.videoClose(username, _this22.$L('对方:') + e);
  50575. });
  50576. }
  50577. }).catch(function (e) {
  50578. _this22.$Modal.warning({ title: _this22.$L('温馨提示'), content: e });
  50579. username && _this22.videoClose(username, _this22.$L('对方:') + e);
  50580. });
  50581. } catch (e) {
  50582. this.$Modal.warning({ title: this.$L('温馨提示'), content: this.$L('当前浏览器不支持音视频通话!') });
  50583. username && this.videoClose(username, this.$L('对方:') + this.$L('浏览器不支持音视频通话!'));
  50584. }
  50585. },
  50586. videoListener: function videoListener() {
  50587. var _this23 = this;
  50588. $A.WSOB.sendTo('info', this.videoUserName, {
  50589. 'type': 'video',
  50590. 'subtype': 'call',
  50591. 'username': this.usrInfo.username,
  50592. 'userimg': this.usrInfo.userimg,
  50593. 'video': this.videoChat
  50594. }, function (res) {
  50595. if (res.status !== 1) {
  50596. _this23.videoClose(_this23.videoUserName, _this23.$L('呼叫失败!'));
  50597. }
  50598. });
  50599. },
  50600. videoIcecandidate: function videoIcecandidate(localStream, username) {
  50601. var _this24 = this;
  50602. this.videoRtc = new RTCPeerConnection({ "iceServers": [{ "urls": ["turn:business.swoole.com:3478?transport=udp", "turn:business.swoole.com:3478?transport=tcp"], "username": "ceshi", "credential": "ceshi" }] });
  50603. this.videoRtc.onicecandidate = function (event) {
  50604. if (event.candidate) {
  50605. $A.WSOB.sendTo('info', username, {
  50606. 'type': 'video',
  50607. 'subtype': 'candidate',
  50608. 'data': event.candidate
  50609. });
  50610. }
  50611. };
  50612. try {
  50613. this.videoRtc.addStream(localStream);
  50614. } catch (e) {
  50615. var tracks = localStream.getTracks();
  50616. for (var i = 0; i < tracks.length; i++) {
  50617. this.videoRtc.addTrack(tracks[i], localStream);
  50618. }
  50619. }
  50620. this.videoRtc.onaddstream = function (e) {
  50621. _this24.$refs.remoteVideo.srcObject = e.stream;
  50622. };
  50623. },
  50624. videoClose: function videoClose(username, reason) {
  50625. if (username && reason !== false) {
  50626. $A.WSOB.sendTo('info', username, {
  50627. 'type': 'video',
  50628. 'subtype': 'close',
  50629. 'reason': reason
  50630. });
  50631. }
  50632. if (this.videoInitiator) {
  50633. this.videoInitiator = false;
  50634. if (this.videoStartTime > 0) {
  50635. var second = Math.round(new Date().getTime() / 1000) - this.videoStartTime;
  50636. if (second >= 2) {
  50637. $A.WSOB.sendTo('user', this.videoUserName, {
  50638. type: this.videoChat ? 'video' : 'voice',
  50639. username: this.usrInfo.username,
  50640. userimg: this.usrInfo.userimg,
  50641. indate: Math.round(new Date().getTime() / 1000),
  50642. text: this.videoChat ? '视频通话' : '语音通话',
  50643. other: {
  50644. second: second
  50645. }
  50646. }, 'special');
  50647. }
  50648. }
  50649. }
  50650. if (username == this.videoUserName) {
  50651. this.videoUserName = '';
  50652. this.videoUserImg = '';
  50653. this.videoStartTime = 0;
  50654. if (this.videoLocalStream !== null) {
  50655. this.videoLocalStream.getTracks().forEach(function (track) {
  50656. track.stop();
  50657. });
  50658. this.videoLocalStream = null;
  50659. }
  50660. this.$refs.localVideo.srcObject = null;
  50661. this.$refs.remoteVideo.srcObject = null;
  50662. }
  50663. },
  50664. videoMessage: function videoMessage(msgDetail) {
  50665. var _this25 = this;
  50666. var body = msgDetail.body;
  50667. var username = msgDetail.username;
  50668. if (['offer', 'candidate', 'answer'].indexOf(body.subtype) !== -1) {
  50669. if (!this.videoLocalStream) {
  50670. this.videoClose(username);
  50671. return;
  50672. }
  50673. }
  50674. //
  50675. switch (body.subtype) {
  50676. case 'call':
  50677. var callIng = true;
  50678. var callAudio = this.$refs.callAudio;
  50679. if (callAudio.getAttribute("data-listener") !== 'yes') {
  50680. callAudio.setAttribute("data-listener", "yes");
  50681. callAudio.addEventListener('ended', function () {
  50682. if (callIng) {
  50683. $A.WSOB.sendTo('info', username, {
  50684. 'type': 'video',
  50685. 'subtype': 'judge'
  50686. });
  50687. callAudio.play();
  50688. }
  50689. }, false);
  50690. }
  50691. callAudio.currentTime = 0;
  50692. callAudio.play();
  50693. //
  50694. this.$Notice.close('chat-call');
  50695. this.$Notice.open({
  50696. name: 'chat-call',
  50697. duration: 0,
  50698. onClose: function onClose() {
  50699. callIng = false;
  50700. callAudio.pause();
  50701. _this25.videoClose(username, _this25.$L('对方:拒绝接听'));
  50702. },
  50703. render: function render(h) {
  50704. return h('div', {
  50705. class: 'chat-notice-box'
  50706. }, [h('UserImg', { class: 'chat-notice-userimg', props: { info: body } }), h('div', { class: 'ivu-notice-with-desc' }, [h('div', { class: 'ivu-notice-title' }, [h('UserView', { props: { username: username } })]), h('div', { class: 'ivu-notice-desc' }, _this25.$L(body.video ? "邀请视频通话..." : "邀请语音通话...")), h('div', { class: 'chat-notice-btn-box' }, [h('Button', {
  50707. props: { type: 'success', size: 'small' },
  50708. on: {
  50709. click: function click() {
  50710. callIng = false;
  50711. callAudio.pause();
  50712. _this25.$Notice.close('chat-call');
  50713. _this25.$emit("on-open-notice", username);
  50714. _this25.clickDialog(username);
  50715. _this25.videoConnect(username, body.video);
  50716. _this25.videoUserName = username;
  50717. _this25.videoUserImg = body.userimg;
  50718. _this25.videoStartTime = 0;
  50719. _this25.videoInitiator = false;
  50720. }
  50721. }
  50722. }, _this25.$L("接受")), h('Button', {
  50723. props: { type: 'error', size: 'small' },
  50724. on: {
  50725. click: function click() {
  50726. callIng = false;
  50727. callAudio.pause();
  50728. _this25.$Notice.close('chat-call');
  50729. _this25.videoClose(username, _this25.$L('对方:拒绝接听'));
  50730. }
  50731. }
  50732. }, _this25.$L("拒绝"))])])]);
  50733. }
  50734. });
  50735. break;
  50736. case 'judge':
  50737. if (username != this.videoUserName) {
  50738. $A.WSOB.sendTo('info', username, {
  50739. 'type': 'video',
  50740. 'subtype': 'close'
  50741. });
  50742. }
  50743. break;
  50744. case 'close':
  50745. this.$refs.callAudio.pause();
  50746. this.$Notice.close('chat-call');
  50747. this.videoClose(username, false);
  50748. body.reason && this.$Message.warning(body.reason);
  50749. break;
  50750. case 'offer':
  50751. this.videoIcecandidate(this.videoLocalStream, username);
  50752. this.videoRtc.setRemoteDescription(new RTCSessionDescription(body.data)).then(function () {
  50753. if (_this25.videoStartTime === 0) {
  50754. _this25.videoRtc.createAnswer().then(function (desc) {
  50755. _this25.videoRtc.setLocalDescription(desc).then(function () {
  50756. $A.WSOB.sendTo('info', username, {
  50757. 'type': 'video',
  50758. 'subtype': 'answer',
  50759. 'data': _this25.videoRtc.localDescription
  50760. });
  50761. }).catch(function (e) {
  50762. _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
  50763. });
  50764. }).catch(function (e) {
  50765. _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
  50766. });
  50767. _this25.videoStartTime = Math.round(new Date().getTime() / 1000);
  50768. }
  50769. }).catch(function (e) {
  50770. _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
  50771. });
  50772. break;
  50773. case 'answer':
  50774. if (this.videoRtc) {
  50775. this.videoRtc.setRemoteDescription(new RTCSessionDescription(body.data)).then(function () {}).catch(function (e) {
  50776. _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
  50777. });
  50778. }
  50779. break;
  50780. case 'candidate':
  50781. if (this.videoRtc) {
  50782. this.videoRtc.addIceCandidate(new RTCIceCandidate(body.data)).then(function () {}).catch(function (e) {
  50783. _this25.$Modal.warning({ title: _this25.$L('温馨提示'), content: e });
  50784. });
  50785. }
  50786. break;
  50787. }
  50788. }
  50789. }
  50790. });
  50791. /***/ }),
  50792. /* 112 */
  50793. /***/ (function(module, exports, __webpack_require__) {
  50794. !function(e,o){ true?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.es6Module=o():e.es6Module=o()}(this,function(){return function(e){function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}var t={};return o.m=e,o.c=t,o.i=function(e){return e},o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},o.p="/dist-module/",o(o.s=3)}([function(e,o,t){var a=t(4)(t(1),t(5),null,null,null);e.exports=a.exports},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=t(2),n=function(e){return e&&e.__esModule?e:{default:e}}(a),i=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")};o.default={props:{search:{type:String,required:!1,default:""},emojiTable:{type:Object,required:!1,default:function(){return n.default}}},data:function(){return{display:{x:0,y:0,visible:!1}}},computed:{emojis:function(){if(this.search){var e={};for(var o in this.emojiTable){e[o]={};for(var t in this.emojiTable[o])new RegExp(".*"+i(this.search)+".*").test(t)&&(e[o][t]=this.emojiTable[o][t]);0===Object.keys(e[o]).length&&delete e[o]}return e}return this.emojiTable}},methods:{insert:function(e){this.$emit("emoji",e)},toggle:function(e){this.display.visible=!this.display.visible,this.display.x=e.clientX,this.display.y=e.clientY},hide:function(){this.display.visible=!1},escape:function(e){!0===this.display.visible&&27===e.keyCode&&(this.display.visible=!1)}},directives:{"click-outside":{bind:function(e,o,t){if("function"==typeof o.value){var a=o.modifiers.bubble,n=function(t){(a||!e.contains(t.target)&&e!==t.target)&&o.value(t)};e.__vueClickOutside__=n,document.addEventListener("click",n)}},unbind:function(e,o){document.removeEventListener("click",e.__vueClickOutside__),e.__vueClickOutside__=null}}},mounted:function(){document.addEventListener("keyup",this.escape)},destroyed:function(){document.removeEventListener("keyup",this.escape)}}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default={"Frequently used":{thumbs_up:"👍","-1":"👎",sob:"😭",confused:"😕",neutral_face:"😐",blush:"😊",heart_eyes:"😍"},People:{smile:"😄",smiley:"😃",grinning:"😀",blush:"😊",wink:"😉",heart_eyes:"😍",kissing_heart:"😘",kissing_closed_eyes:"😚",kissing:"😗",kissing_smiling_eyes:"😙",stuck_out_tongue_winking_eye:"😜",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue:"😛",flushed:"😳",grin:"😁",pensive:"😔",relieved:"😌",unamused:"😒",disappointed:"😞",persevere:"😣",cry:"😢",joy:"😂",sob:"😭",sleepy:"😪",disappointed_relieved:"😥",cold_sweat:"😰",sweat_smile:"😅",sweat:"😓",weary:"😩",tired_face:"😫",fearful:"😨",scream:"😱",angry:"😠",rage:"😡",triumph:"😤",confounded:"😖",laughing:"😆",yum:"😋",mask:"😷",sunglasses:"😎",sleeping:"😴",dizzy_face:"😵",astonished:"😲",worried:"😟",frowning:"😦",anguished:"😧",imp:"👿",open_mouth:"😮",grimacing:"😬",neutral_face:"😐",confused:"😕",hushed:"😯",smirk:"😏",expressionless:"😑",man_with_gua_pi_mao:"👲",man_with_turban:"👳",cop:"👮",construction_worker:"👷",guardsman:"💂",baby:"👶",boy:"👦",girl:"👧",man:"👨",woman:"👩",older_man:"👴",older_woman:"👵",person_with_blond_hair:"👱",angel:"👼",princess:"👸",smiley_cat:"😺",smile_cat:"😸",heart_eyes_cat:"😻",kissing_cat:"😽",smirk_cat:"😼",scream_cat:"🙀",crying_cat_face:"😿",joy_cat:"😹",pouting_cat:"😾",japanese_ogre:"👹",japanese_goblin:"👺",see_no_evil:"🙈",hear_no_evil:"🙉",speak_no_evil:"🙊",skull:"💀",alien:"👽",hankey:"💩",fire:"🔥",sparkles:"✨",star2:"🌟",dizzy:"💫",boom:"💥",anger:"💢",sweat_drops:"💦",droplet:"💧",zzz:"💤",dash:"💨",ear:"👂",eyes:"👀",nose:"👃",tongue:"👅",lips:"👄",thumbs_up:"👍","-1":"👎",ok_hand:"👌",facepunch:"👊",fist:"✊",wave:"👋",hand:"✋",open_hands:"👐",point_up_2:"👆",point_down:"👇",point_right:"👉",point_left:"👈",raised_hands:"🙌",pray:"🙏",clap:"👏",muscle:"💪",walking:"🚶",runner:"🏃",dancer:"💃",couple:"👫",family:"👪",couplekiss:"💏",couple_with_heart:"💑",dancers:"👯",ok_woman:"🙆",no_good:"🙅",information_desk_person:"💁",raising_hand:"🙋",massage:"💆",haircut:"💇",nail_care:"💅",bride_with_veil:"👰",person_with_pouting_face:"🙎",person_frowning:"🙍",bow:"🙇",tophat:"🎩",crown:"👑",womans_hat:"👒",athletic_shoe:"👟",mans_shoe:"👞",sandal:"👡",high_heel:"👠",boot:"👢",shirt:"👕",necktie:"👔",womans_clothes:"👚",dress:"👗",running_shirt_with_sash:"🎽",jeans:"👖",kimono:"👘",bikini:"👙",briefcase:"💼",handbag:"👜",pouch:"👝",purse:"👛",eyeglasses:"👓",ribbon:"🎀",closed_umbrella:"🌂",lipstick:"💄",yellow_heart:"💛",blue_heart:"💙",purple_heart:"💜",green_heart:"💚",broken_heart:"💔",heartpulse:"💗",heartbeat:"💓",two_hearts:"💕",sparkling_heart:"💖",revolving_hearts:"💞",cupid:"💘",love_letter:"💌",kiss:"💋",ring:"💍",gem:"💎",bust_in_silhouette:"👤",speech_balloon:"💬",footprints:"👣"},Nature:{dog:"🐶",wolf:"🐺",cat:"🐱",mouse:"🐭",hamster:"🐹",rabbit:"🐰",frog:"🐸",tiger:"🐯",koala:"🐨",bear:"🐻",pig:"🐷",pig_nose:"🐽",cow:"🐮",boar:"🐗",monkey_face:"🐵",monkey:"🐒",horse:"🐴",sheep:"🐑",elephant:"🐘",panda_face:"🐼",penguin:"🐧",bird:"🐦",baby_chick:"🐤",hatched_chick:"🐥",hatching_chick:"🐣",chicken:"🐔",snake:"🐍",turtle:"🐢",bug:"🐛",bee:"🐝",ant:"🐜",beetle:"🐞",snail:"🐌",octopus:"🐙",shell:"🐚",tropical_fish:"🐠",fish:"🐟",dolphin:"🐬",whale:"🐳",racehorse:"🐎",dragon_face:"🐲",blowfish:"🐡",camel:"🐫",poodle:"🐩",feet:"🐾",bouquet:"💐",cherry_blossom:"🌸",tulip:"🌷",four_leaf_clover:"🍀",rose:"🌹",sunflower:"🌻",hibiscus:"🌺",maple_leaf:"🍁",leaves:"🍃",fallen_leaf:"🍂",herb:"🌿",ear_of_rice:"🌾",mushroom:"🍄",cactus:"🌵",palm_tree:"🌴",chestnut:"🌰",seedling:"🌱",blossom:"🌼",new_moon:"🌑",first_quarter_moon:"🌓",moon:"🌔",full_moon:"🌕",first_quarter_moon_with_face:"🌛",crescent_moon:"🌙",earth_asia:"🌏",volcano:"🌋",milky_way:"🌌",stars:"🌠",partly_sunny:"⛅",snowman:"⛄",cyclone:"🌀",foggy:"🌁",rainbow:"🌈",ocean:"🌊"},Objects:{bamboo:"🎍",gift_heart:"💝",dolls:"🎎",school_satchel:"🎒",mortar_board:"🎓",flags:"🎏",fireworks:"🎆",sparkler:"🎇",wind_chime:"🎐",rice_scene:"🎑",jack_o_lantern:"🎃",ghost:"👻",santa:"🎅",christmas_tree:"🎄",gift:"🎁",tanabata_tree:"🎋",tada:"🎉",confetti_ball:"🎊",balloon:"🎈",crossed_flags:"🎌",crystal_ball:"🔮",movie_camera:"🎥",camera:"📷",video_camera:"📹",vhs:"📼",cd:"💿",dvd:"📀",minidisc:"💽",floppy_disk:"💾",computer:"💻",iphone:"📱",telephone_receiver:"📞",pager:"📟",fax:"📠",satellite:"📡",tv:"📺",radio:"📻",loud_sound:"🔊",bell:"🔔",loudspeaker:"📢",mega:"📣",hourglass_flowing_sand:"⏳",hourglass:"⌛",alarm_clock:"⏰",watch:"⌚",unlock:"🔓",lock:"🔒",lock_with_ink_pen:"🔏",closed_lock_with_key:"🔐",key:"🔑",mag_right:"🔎",bulb:"💡",flashlight:"🔦",electric_plug:"🔌",battery:"🔋",mag:"🔍",bath:"🛀",toilet:"🚽",wrench:"🔧",nut_and_bolt:"🔩",hammer:"🔨",door:"🚪",smoking:"🚬",bomb:"💣",gun:"🔫",hocho:"🔪",pill:"💊",syringe:"💉",moneybag:"💰",yen:"💴",dollar:"💵",credit_card:"💳",money_with_wings:"💸",calling:"📲","e-mail":"📧",inbox_tray:"📥",outbox_tray:"📤",envelope_with_arrow:"📩",incoming_envelope:"📨",mailbox:"📫",mailbox_closed:"📪",postbox:"📮",package:"📦",memo:"📝",page_facing_up:"📄",page_with_curl:"📃",bookmark_tabs:"📑",bar_chart:"📊",chart_with_upwards_trend:"📈",chart_with_downwards_trend:"📉",scroll:"📜",clipboard:"📋",date:"📅",calendar:"📆",card_index:"📇",file_folder:"📁",open_file_folder:"📂",pushpin:"📌",paperclip:"📎",straight_ruler:"📏",triangular_ruler:"📐",closed_book:"📕",green_book:"📗",blue_book:"📘",orange_book:"📙",notebook:"📓",notebook_with_decorative_cover:"📔",ledger:"📒",books:"📚",book:"📖",bookmark:"🔖",name_badge:"📛",newspaper:"📰",art:"🎨",clapper:"🎬",microphone:"🎤",headphones:"🎧",musical_score:"🎼",musical_note:"🎵",notes:"🎶",musical_keyboard:"🎹",violin:"🎻",trumpet:"🎺",saxophone:"🎷",guitar:"🎸",space_invader:"👾",video_game:"🎮",black_joker:"🃏",flower_playing_cards:"🎴",mahjong:"🀄",game_die:"🎲",dart:"🎯",football:"🏈",basketball:"🏀",soccer:"⚽",baseball:"⚾",tennis:"🎾","8ball":"🎱",bowling:"🎳",golf:"⛳",checkered_flag:"🏁",trophy:"🏆",ski:"🎿",snowboarder:"🏂",swimmer:"🏊",surfer:"🏄",fishing_pole_and_fish:"🎣",tea:"🍵",sake:"🍶",beer:"🍺",beers:"🍻",cocktail:"🍸",tropical_drink:"🍹",wine_glass:"🍷",fork_and_knife:"🍴",pizza:"🍕",hamburger:"🍔",fries:"🍟",poultry_leg:"🍗",meat_on_bone:"🍖",spaghetti:"🍝",curry:"🍛",fried_shrimp:"🍤",bento:"🍱",sushi:"🍣",fish_cake:"🍥",rice_ball:"🍙",rice_cracker:"🍘",rice:"🍚",ramen:"🍜",stew:"🍲",oden:"🍢",dango:"🍡",egg:"🍳",bread:"🍞",doughnut:"🍩",custard:"🍮",icecream:"🍦",ice_cream:"🍨",shaved_ice:"🍧",birthday:"🎂",cake:"🍰",cookie:"🍪",chocolate_bar:"🍫",candy:"🍬",lollipop:"🍭",honey_pot:"🍯",apple:"🍎",green_apple:"🍏",tangerine:"🍊",cherries:"🍒",grapes:"🍇",watermelon:"🍉",strawberry:"🍓",peach:"🍑",melon:"🍈",banana:"🍌",pineapple:"🍍",sweet_potato:"🍠",eggplant:"🍆",tomato:"🍅",corn:"🌽"},Places:{house:"🏠",house_with_garden:"🏡",school:"🏫",office:"🏢",post_office:"🏣",hospital:"🏥",bank:"🏦",convenience_store:"🏪",love_hotel:"🏩",hotel:"🏨",wedding:"💒",church:"⛪",department_store:"🏬",city_sunrise:"🌇",city_sunset:"🌆",japanese_castle:"🏯",european_castle:"🏰",tent:"⛺",factory:"🏭",tokyo_tower:"🗼",japan:"🗾",mount_fuji:"🗻",sunrise_over_mountains:"🌄",sunrise:"🌅",night_with_stars:"🌃",statue_of_liberty:"🗽",bridge_at_night:"🌉",carousel_horse:"🎠",ferris_wheel:"🎡",fountain:"⛲",roller_coaster:"🎢",ship:"🚢",boat:"⛵",speedboat:"🚤",rocket:"🚀",seat:"💺",station:"🚉",bullettrain_side:"🚄",bullettrain_front:"🚅",metro:"🚇",railway_car:"🚃",bus:"🚌",blue_car:"🚙",car:"🚗",taxi:"🚕",truck:"🚚",rotating_light:"🚨",police_car:"🚓",fire_engine:"🚒",ambulance:"🚑",bike:"🚲",barber:"💈",busstop:"🚏",ticket:"🎫",traffic_light:"🚥",construction:"🚧",beginner:"🔰",fuelpump:"⛽",izakaya_lantern:"🏮",slot_machine:"🎰",moyai:"🗿",circus_tent:"🎪",performing_arts:"🎭",round_pushpin:"📍",triangular_flag_on_post:"🚩"},Symbols:{keycap_ten:"🔟",1234:"🔢",symbols:"🔣",capital_abcd:"🔠",abcd:"🔡",abc:"🔤",arrow_up_small:"🔼",arrow_down_small:"🔽",rewind:"⏪",fast_forward:"⏩",arrow_double_up:"⏫",arrow_double_down:"⏬",ok:"🆗",new:"🆕",up:"🆙",cool:"🆒",free:"🆓",ng:"🆖",signal_strength:"📶",cinema:"🎦",koko:"🈁",u6307:"🈯",u7a7a:"🈳",u6e80:"🈵",u5408:"🈴",u7981:"🈲",ideograph_advantage:"🉐",u5272:"🈹",u55b6:"🈺",u6709:"🈶",u7121:"🈚",restroom:"🚻",mens:"🚹",womens:"🚺",baby_symbol:"🚼",wc:"🚾",no_smoking:"🚭",u7533:"🈸",accept:"🉑",cl:"🆑",sos:"🆘",id:"🆔",no_entry_sign:"🚫",underage:"🔞",no_entry:"⛔",negative_squared_cross_mark:"❎",white_check_mark:"✅",heart_decoration:"💟",vs:"🆚",vibration_mode:"📳",mobile_phone_off:"📴",ab:"🆎",diamond_shape_with_a_dot_inside:"💠",ophiuchus:"⛎",six_pointed_star:"🔯",atm:"🏧",chart:"💹",heavy_dollar_sign:"💲",currency_exchange:"💱",x:"❌",exclamation:"❗",question:"❓",grey_exclamation:"❕",grey_question:"❔",o:"⭕",top:"🔝",end:"🔚",back:"🔙",on:"🔛",soon:"🔜",arrows_clockwise:"🔃",clock12:"🕛",clock1:"🕐",clock2:"🕑",clock3:"🕒",clock4:"🕓",clock5:"🕔",clock6:"🕕",clock7:"🕖",clock8:"🕗",clock9:"🕘",clock10:"🕙",clock11:"🕚",heavy_plus_sign:"➕",heavy_minus_sign:"➖",heavy_division_sign:"➗",white_flower:"💮",100:"💯",radio_button:"🔘",link:"🔗",curly_loop:"➰",trident:"🔱",small_red_triangle:"🔺",black_square_button:"🔲",white_square_button:"🔳",red_circle:"🔴",large_blue_circle:"🔵",small_red_triangle_down:"🔻",white_large_square:"⬜",black_large_square:"⬛",large_orange_diamond:"🔶",large_blue_diamond:"🔷",small_orange_diamond:"🔸",small_blue_diamond:"🔹"}}},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.EmojiPickerPlugin=o.EmojiPicker=void 0;var a=t(0),n=function(e){return e&&e.__esModule?e:{default:e}}(a),i={install:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.component("emoji-picker",n.default)}};"undefined"!=typeof window&&(window.EmojiPicker=i),o.EmojiPicker=n.default,o.EmojiPickerPlugin=i,o.default=n.default},function(e,o){e.exports=function(e,o,t,a,n){var i,r=e=e||{},s=typeof e.default;"object"!==s&&"function"!==s||(i=e,r=e.default);var l="function"==typeof r?r.options:r;o&&(l.render=o.render,l.staticRenderFns=o.staticRenderFns),a&&(l._scopeId=a);var _;if(n?(_=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},l._ssrRegister=_):t&&(_=t),_){var c=l.functional,u=c?l.render:l.beforeCreate;c?l.render=function(e,o){return _.call(o),u(e,o)}:l.beforeCreate=u?[].concat(u,_):[_]}return{esModule:i,exports:r,options:l}}},function(e,o){e.exports={render:function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("div",[e._t("emoji-invoker",null,{events:{click:function(o){return e.toggle(o)}}}),e._v(" "),e.display.visible?t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.hide,expression:"hide"}]},[e._t("emoji-picker",null,{emojis:e.emojis,insert:e.insert,display:e.display})],2):e._e()],2)},staticRenderFns:[]}}])});
  50795. //# sourceMappingURL=main.js.map
  50796. /***/ }),
  50797. /* 113 */
  50798. /***/ (function(module, exports, __webpack_require__) {
  50799. // style-loader: Adds some css to the DOM by adding a <style> tag
  50800. // load the styles
  50801. var content = __webpack_require__(114);
  50802. if(typeof content === 'string') content = [[module.i, content, '']];
  50803. if(content.locals) module.exports = content.locals;
  50804. // add the styles to the DOM
  50805. var update = __webpack_require__(1)("ea5947be", content, false, {});
  50806. // Hot Module Replacement
  50807. if(false) {
  50808. // When the styles change, update the <style> tags
  50809. if(!content.locals) {
  50810. module.hot.accept("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-5eba4923\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/sass-loader/lib/loader.js!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ScrollerY.vue", function() {
  50811. var newContent = require("!!../../../../node_modules/css-loader/index.js!../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-5eba4923\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../node_modules/sass-loader/lib/loader.js!../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ScrollerY.vue");
  50812. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  50813. update(newContent);
  50814. });
  50815. }
  50816. // When the module is disposed, remove the <style> tags
  50817. module.hot.dispose(function() { update(); });
  50818. }
  50819. /***/ }),
  50820. /* 114 */
  50821. /***/ (function(module, exports, __webpack_require__) {
  50822. exports = module.exports = __webpack_require__(0)(false);
  50823. // imports
  50824. // module
  50825. exports.push([module.i, "\n.app-scroller[data-v-5eba4923] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow-x: hidden;\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n}\n.app-scroller-static[data-v-5eba4923] {\n position: static;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n", ""]);
  50826. // exports
  50827. /***/ }),
  50828. /* 115 */
  50829. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  50830. "use strict";
  50831. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  50832. //
  50833. //
  50834. //
  50835. //
  50836. //
  50837. //
  50838. //
  50839. //
  50840. //
  50841. //
  50842. //
  50843. //
  50844. //
  50845. //
  50846. //
  50847. //
  50848. //
  50849. //
  50850. //
  50851. //
  50852. //
  50853. //
  50854. //
  50855. /* harmony default export */ __webpack_exports__["default"] = ({
  50856. name: 'ScrollerY',
  50857. props: {
  50858. static: {
  50859. type: Boolean,
  50860. default: false
  50861. }
  50862. },
  50863. data: function data() {
  50864. return {
  50865. scrollY: 0,
  50866. scrollDiff: 0,
  50867. scrollInfo: {}
  50868. };
  50869. },
  50870. mounted: function mounted() {
  50871. var _this = this;
  50872. this.$nextTick(function () {
  50873. var scrollListener = typeof _this.$listeners['on-scroll'] === "function";
  50874. var scrollerView = $A(_this.$refs.scrollerView);
  50875. scrollerView.scroll(function () {
  50876. var wInnerH = Math.round(scrollerView.innerHeight());
  50877. var wScrollY = scrollerView.scrollTop();
  50878. var bScrollH = _this.$refs.scrollerView.scrollHeight;
  50879. _this.scrollY = wScrollY;
  50880. if (scrollListener) {
  50881. var direction = 'static';
  50882. var directionreal = 'static';
  50883. if (_this.scrollDiff - wScrollY > 50) {
  50884. _this.scrollDiff = wScrollY;
  50885. direction = 'down';
  50886. } else if (_this.scrollDiff - wScrollY < -100) {
  50887. _this.scrollDiff = wScrollY;
  50888. direction = 'up';
  50889. }
  50890. if (_this.scrollDiff - wScrollY > 1) {
  50891. _this.scrollDiff = wScrollY;
  50892. directionreal = 'down';
  50893. } else if (_this.scrollDiff - wScrollY < -1) {
  50894. _this.scrollDiff = wScrollY;
  50895. directionreal = 'up';
  50896. }
  50897. _this.$emit('on-scroll', {
  50898. scale: wScrollY / (bScrollH - wInnerH), //已滚动比例
  50899. scrollY: wScrollY, //滚动的距离
  50900. scrollE: bScrollH - wInnerH - wScrollY, //与底部距离
  50901. direction: direction, //滚动方向
  50902. directionreal: directionreal //滚动方向(即时)
  50903. });
  50904. }
  50905. });
  50906. });
  50907. },
  50908. activated: function activated() {
  50909. var _this2 = this;
  50910. if (this.scrollY > 0) {
  50911. this.$nextTick(function () {
  50912. _this2.scrollTo(_this2.scrollY);
  50913. });
  50914. }
  50915. },
  50916. methods: {
  50917. scrollTo: function scrollTo(top, animate) {
  50918. if (animate === false) {
  50919. $A(this.$refs.scrollerView).stop().scrollTop(top);
  50920. } else {
  50921. $A(this.$refs.scrollerView).stop().animate({ "scrollTop": top });
  50922. }
  50923. },
  50924. scrollToBottom: function scrollToBottom(animate) {
  50925. this.scrollTo(this.$refs.scrollerView.scrollHeight, animate);
  50926. }
  50927. }
  50928. });
  50929. /***/ }),
  50930. /* 116 */
  50931. /***/ (function(module, exports, __webpack_require__) {
  50932. var render = function() {
  50933. var _vm = this
  50934. var _h = _vm.$createElement
  50935. var _c = _vm._self._c || _h
  50936. return _c(
  50937. "div",
  50938. {
  50939. ref: "scrollerView",
  50940. staticClass: "app-scroller",
  50941. class: [_vm.static ? "app-scroller-static" : ""]
  50942. },
  50943. [_vm._t("default")],
  50944. 2
  50945. )
  50946. }
  50947. var staticRenderFns = []
  50948. render._withStripped = true
  50949. module.exports = { render: render, staticRenderFns: staticRenderFns }
  50950. if (false) {
  50951. module.hot.accept()
  50952. if (module.hot.data) {
  50953. require("vue-hot-reload-api") .rerender("data-v-5eba4923", module.exports)
  50954. }
  50955. }
  50956. /***/ }),
  50957. /* 117 */
  50958. /***/ (function(module, exports, __webpack_require__) {
  50959. var disposed = false
  50960. function injectStyle (ssrContext) {
  50961. if (disposed) return
  50962. __webpack_require__(118)
  50963. }
  50964. var normalizeComponent = __webpack_require__(2)
  50965. /* script */
  50966. var __vue_script__ = __webpack_require__(120)
  50967. /* template */
  50968. var __vue_template__ = __webpack_require__(121)
  50969. /* template functional */
  50970. var __vue_template_functional__ = false
  50971. /* styles */
  50972. var __vue_styles__ = injectStyle
  50973. /* scopeId */
  50974. var __vue_scopeId__ = "data-v-9d161836"
  50975. /* moduleIdentifier (server only) */
  50976. var __vue_module_identifier__ = null
  50977. var Component = normalizeComponent(
  50978. __vue_script__,
  50979. __vue_template__,
  50980. __vue_template_functional__,
  50981. __vue_styles__,
  50982. __vue_scopeId__,
  50983. __vue_module_identifier__
  50984. )
  50985. Component.options.__file = "resources/assets/js/main/components/chat/Message.vue"
  50986. /* hot reload */
  50987. if (false) {(function () {
  50988. var hotAPI = require("vue-hot-reload-api")
  50989. hotAPI.install(require("vue"), false)
  50990. if (!hotAPI.compatible) return
  50991. module.hot.accept()
  50992. if (!module.hot.data) {
  50993. hotAPI.createRecord("data-v-9d161836", Component.options)
  50994. } else {
  50995. hotAPI.reload("data-v-9d161836", Component.options)
  50996. }
  50997. module.hot.dispose(function (data) {
  50998. disposed = true
  50999. })
  51000. })()}
  51001. module.exports = Component.exports
  51002. /***/ }),
  51003. /* 118 */
  51004. /***/ (function(module, exports, __webpack_require__) {
  51005. // style-loader: Adds some css to the DOM by adding a <style> tag
  51006. // load the styles
  51007. var content = __webpack_require__(119);
  51008. if(typeof content === 'string') content = [[module.i, content, '']];
  51009. if(content.locals) module.exports = content.locals;
  51010. // add the styles to the DOM
  51011. var update = __webpack_require__(1)("4cbc0aec", content, false, {});
  51012. // Hot Module Replacement
  51013. if(false) {
  51014. // When the styles change, update the <style> tags
  51015. if(!content.locals) {
  51016. module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-9d161836\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Message.vue", function() {
  51017. var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-9d161836\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./Message.vue");
  51018. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  51019. update(newContent);
  51020. });
  51021. }
  51022. // When the module is disposed, remove the <style> tags
  51023. module.hot.dispose(function() { update(); });
  51024. }
  51025. /***/ }),
  51026. /* 119 */
  51027. /***/ (function(module, exports, __webpack_require__) {
  51028. exports = module.exports = __webpack_require__(0)(false);
  51029. // imports
  51030. // module
  51031. exports.push([module.i, "\n@charset \"UTF-8\";\n/*通用*/\n.list-item[data-v-9d161836], .list-right[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n width: 100%;\n padding-top: 7px;\n padding-bottom: 7px;\n background-color: #E8EBF2;\n}\n.list-item .item-left[data-v-9d161836], .list-item .item-right[data-v-9d161836], .list-right .item-left[data-v-9d161836], .list-right .item-right[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n max-width: 80%;\n}\n.list-item .item-left .item-username[data-v-9d161836], .list-item .item-right .item-username[data-v-9d161836], .list-right .item-left .item-username[data-v-9d161836], .list-right .item-right .item-username[data-v-9d161836] {\n font-size: 12px;\n padding-top: 1px;\n padding-bottom: 4px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.list-item .item-left .item-username em[data-v-9d161836], .list-item .item-right .item-username em[data-v-9d161836], .list-right .item-left .item-username em[data-v-9d161836], .list-right .item-right .item-username em[data-v-9d161836] {\n display: inline-block;\n font-style: normal;\n}\n.list-item .item-left .item-username em.item-name[data-v-9d161836], .list-item .item-right .item-username em.item-name[data-v-9d161836], .list-right .item-left .item-username em.item-name[data-v-9d161836], .list-right .item-right .item-username em.item-name[data-v-9d161836] {\n color: #888888;\n}\n.list-item .item-left .item-username em.item-tag[data-v-9d161836], .list-item .item-right .item-username em.item-tag[data-v-9d161836], .list-right .item-left .item-username em.item-tag[data-v-9d161836], .list-right .item-right .item-username em.item-tag[data-v-9d161836] {\n color: #ffffff;\n background-color: #ff0000;\n line-height: 16px;\n padding: 2px 4px;\n margin-left: 3px;\n border-radius: 2px;\n font-size: 12px;\n -webkit-transform: scale(0.8);\n transform: scale(0.8);\n font-weight: 600;\n}\n.list-item .item-left .item-username em.item-date[data-v-9d161836], .list-item .item-right .item-username em.item-date[data-v-9d161836], .list-right .item-left .item-username em.item-date[data-v-9d161836], .list-right .item-right .item-username em.item-date[data-v-9d161836] {\n margin-left: 4px;\n color: #aaaaaa;\n}\n.list-item .item-left[data-v-9d161836], .list-right .item-left[data-v-9d161836] {\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n.list-item .item-right[data-v-9d161836], .list-right .item-right[data-v-9d161836] {\n -webkit-box-align: end;\n -ms-flex-align: end;\n align-items: flex-end;\n}\n.list-item .item-right .item-username[data-v-9d161836], .list-right .item-right .item-username[data-v-9d161836] {\n text-align: right;\n}\n.list-item .item-right .item-link[data-v-9d161836], .list-right .item-right .item-link[data-v-9d161836] {\n -webkit-transform-origin: right center;\n transform-origin: right center;\n}\n.list-item .item-userimg[data-v-9d161836], .list-right .item-userimg[data-v-9d161836] {\n width: 38px;\n height: 38px;\n margin-left: 8px;\n margin-right: 8px;\n border-radius: 3px;\n font-size: 20px;\n}\n.list-item .item-error[data-v-9d161836], .list-right .item-error[data-v-9d161836] {\n cursor: pointer;\n width: 48px;\n position: relative;\n}\n.list-item .item-error > i[data-v-9d161836], .list-right .item-error > i[data-v-9d161836] {\n color: #ff0000;\n font-size: 18px;\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n}\n.list-right[data-v-9d161836] {\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n\n/*文本*/\n.item-text[data-v-9d161836] {\n display: inline-block;\n border-radius: 6px;\n padding: 8px;\n background-color: #ffffff;\n max-height: 580px;\n overflow: auto;\n}\n.item-text.text-emoji[data-v-9d161836] {\n background-color: transparent;\n}\n.item-text.text-emoji .item-text-view[data-v-9d161836] {\n font-size: 52px;\n line-height: normal;\n}\n.item-text.text-error[data-v-9d161836] {\n -webkit-box-shadow: 0 0 4px 0 #ffa1a1;\n box-shadow: 0 0 4px 0 #ffa1a1;\n}\n.item-text .item-text-view[data-v-9d161836] {\n max-width: 520px;\n color: #242424;\n font-size: 14px;\n line-height: 18px;\n word-break: break-all;\n}\n\n/*信息底标*/\n.item-link[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n max-width: 100%;\n font-size: 12px;\n color: #ffffff;\n background-color: #cacaca;\n margin-top: 6px;\n margin-bottom: -2px;\n height: 20px;\n line-height: 20px;\n padding: 0 5px;\n border-radius: 4px;\n -webkit-transform: scale(0.96);\n transform: scale(0.96);\n -webkit-transform-origin: left center;\n transform-origin: left center;\n}\n.item-link > i[data-v-9d161836] {\n font-size: 14px;\n padding-right: 2px;\n}\n.item-link > span[data-v-9d161836] {\n white-space: nowrap;\n}\n.item-link > a[data-v-9d161836] {\n color: #3D90E2;\n padding-left: 3px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 100%;\n}\n\n/*加载中*/\n.item-loading[data-v-9d161836] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n width: 28px;\n height: 28px;\n margin: 24px;\n}\n\n/*文件、图片*/\n.item-file[data-v-9d161836] {\n display: inline-block;\n text-decoration: none;\n}\n.item-file .item-file-box[data-v-9d161836] {\n background: #ffffff;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n padding: 10px 14px;\n border-radius: 3px;\n width: 220px;\n}\n.item-file .item-file-box .item-file-thumb[data-v-9d161836] {\n width: 36px;\n}\n.item-file .item-file-box .item-file-info[data-v-9d161836] {\n margin-left: 12px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.item-file .item-file-box .item-file-info .item-file-name[data-v-9d161836] {\n color: #333333;\n font-size: 14px;\n line-height: 18px;\n word-break: break-all;\n text-overflow: ellipsis;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n.item-file .item-file-box .item-file-info .item-file-size[data-v-9d161836] {\n padding-top: 4px;\n color: #666666;\n font-size: 14px;\n}\n.item-file .item-file-img[data-v-9d161836] {\n max-width: 220px;\n max-height: 220px;\n border-radius: 6px;\n}\n\n/*通知*/\n.item-notice[data-v-9d161836] {\n color: #777777;\n font-size: 12px;\n text-align: center;\n padding: 12px 24px;\n}\n", ""]);
  51032. // exports
  51033. /***/ }),
  51034. /* 120 */
  51035. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  51036. "use strict";
  51037. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  51038. //
  51039. //
  51040. //
  51041. //
  51042. //
  51043. //
  51044. //
  51045. //
  51046. //
  51047. //
  51048. //
  51049. //
  51050. //
  51051. //
  51052. //
  51053. //
  51054. //
  51055. //
  51056. //
  51057. //
  51058. //
  51059. //
  51060. //
  51061. //
  51062. //
  51063. //
  51064. //
  51065. //
  51066. //
  51067. //
  51068. //
  51069. //
  51070. //
  51071. //
  51072. //
  51073. //
  51074. //
  51075. //
  51076. //
  51077. //
  51078. //
  51079. //
  51080. //
  51081. //
  51082. //
  51083. //
  51084. //
  51085. //
  51086. //
  51087. //
  51088. //
  51089. //
  51090. //
  51091. //
  51092. //
  51093. //
  51094. //
  51095. //
  51096. //
  51097. //
  51098. //
  51099. //
  51100. //
  51101. //
  51102. //
  51103. //
  51104. //
  51105. //
  51106. //
  51107. //
  51108. //
  51109. //
  51110. //
  51111. //
  51112. //
  51113. //
  51114. //
  51115. //
  51116. //
  51117. //
  51118. //
  51119. //
  51120. //
  51121. //
  51122. //
  51123. //
  51124. //
  51125. //
  51126. //
  51127. //
  51128. //
  51129. //
  51130. //
  51131. //
  51132. //
  51133. //
  51134. //
  51135. //
  51136. //
  51137. //
  51138. //
  51139. //
  51140. //
  51141. //
  51142. //
  51143. //
  51144. //
  51145. //
  51146. //
  51147. //
  51148. //
  51149. //
  51150. //
  51151. //
  51152. //
  51153. //
  51154. //
  51155. //
  51156. //
  51157. //
  51158. //
  51159. //
  51160. //
  51161. //
  51162. //
  51163. //
  51164. //
  51165. //
  51166. //
  51167. //
  51168. //
  51169. //
  51170. //
  51171. //
  51172. //
  51173. //
  51174. //
  51175. //
  51176. //
  51177. //
  51178. //
  51179. //
  51180. //
  51181. //
  51182. //
  51183. //
  51184. //
  51185. //
  51186. //
  51187. //
  51188. //
  51189. //
  51190. //
  51191. //
  51192. //
  51193. //
  51194. //
  51195. //
  51196. //
  51197. //
  51198. //
  51199. //
  51200. //
  51201. //
  51202. //
  51203. //
  51204. //
  51205. //
  51206. //
  51207. //
  51208. //
  51209. //
  51210. //
  51211. //
  51212. //
  51213. //
  51214. //
  51215. //
  51216. //
  51217. //
  51218. //
  51219. //
  51220. //
  51221. //
  51222. //
  51223. //
  51224. //
  51225. //
  51226. //
  51227. //
  51228. //
  51229. //
  51230. //
  51231. //
  51232. //
  51233. //
  51234. //
  51235. //
  51236. //
  51237. //
  51238. //
  51239. //
  51240. //
  51241. //
  51242. //
  51243. //
  51244. //
  51245. //
  51246. //
  51247. //
  51248. //
  51249. //
  51250. //
  51251. //
  51252. //
  51253. //
  51254. //
  51255. //
  51256. //
  51257. //
  51258. //
  51259. //
  51260. //
  51261. //
  51262. //
  51263. //
  51264. //
  51265. //
  51266. //
  51267. //
  51268. //
  51269. //
  51270. //
  51271. //
  51272. //
  51273. //
  51274. //
  51275. //
  51276. //
  51277. //
  51278. //
  51279. //
  51280. //
  51281. //
  51282. //
  51283. //
  51284. //
  51285. //
  51286. //
  51287. //
  51288. //
  51289. //
  51290. //
  51291. //
  51292. //
  51293. //
  51294. //
  51295. //
  51296. //
  51297. //
  51298. //
  51299. //
  51300. //
  51301. //
  51302. //
  51303. //
  51304. //
  51305. //
  51306. //
  51307. //
  51308. //
  51309. //
  51310. //
  51311. //
  51312. //
  51313. //
  51314. //
  51315. //
  51316. //
  51317. //
  51318. //
  51319. //
  51320. //
  51321. //
  51322. //
  51323. //
  51324. //
  51325. //
  51326. //
  51327. //
  51328. //
  51329. //
  51330. //
  51331. //
  51332. //
  51333. //
  51334. //
  51335. //
  51336. //
  51337. //
  51338. //
  51339. //
  51340. //
  51341. //
  51342. //
  51343. //
  51344. //
  51345. //
  51346. //
  51347. //
  51348. //
  51349. //
  51350. //
  51351. //
  51352. //
  51353. //
  51354. //
  51355. //
  51356. //
  51357. //
  51358. /* harmony default export */ __webpack_exports__["default"] = ({
  51359. name: 'ChatMessage',
  51360. props: {
  51361. info: {
  51362. type: Object,
  51363. default: {}
  51364. }
  51365. },
  51366. mounted: function mounted() {},
  51367. computed: {
  51368. userName: function userName() {
  51369. return this.info.send_username || this.info.username;
  51370. },
  51371. userImg: function userImg() {
  51372. return this.info.send_userimg || this.info.userimg;
  51373. },
  51374. imageStyle: function imageStyle() {
  51375. return function (info) {
  51376. var width = info.width,
  51377. height = info.height;
  51378. if (width && height) {
  51379. var maxWidth = 220,
  51380. maxHeight = 220,
  51381. tempWidth = width,
  51382. tempHeight = height;
  51383. if (width > maxWidth || height > maxHeight) {
  51384. if (width > height) {
  51385. tempWidth = maxWidth;
  51386. tempHeight = height * (maxWidth / width);
  51387. } else {
  51388. tempWidth = width * (maxHeight / height);
  51389. tempHeight = maxHeight;
  51390. }
  51391. }
  51392. return {
  51393. width: tempWidth + 'px',
  51394. height: tempHeight + 'px'
  51395. };
  51396. }
  51397. return {};
  51398. };
  51399. }
  51400. },
  51401. methods: {
  51402. textMsg: function textMsg(text) {
  51403. return (text + "").replace(/\n/, '<br/>');
  51404. },
  51405. textIsEmoji: function textIsEmoji(text) {
  51406. return text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_") === "_";
  51407. },
  51408. formatCDate: function formatCDate(v) {
  51409. var string = '';
  51410. if ($A.runNum(v) > 0) {
  51411. if ($A.formatDate('Ymd') === $A.formatDate('Ymd', v)) {
  51412. string = $A.formatDate('H:i', v);
  51413. } else if ($A.formatDate('Y') === $A.formatDate('Y', v)) {
  51414. string = $A.formatDate('m-d', v);
  51415. } else {
  51416. string = $A.formatDate('Y-m-d', v);
  51417. }
  51418. }
  51419. return string ? '(' + string + ')' : '';
  51420. },
  51421. clickError: function clickError(err) {
  51422. this.$Modal.error({
  51423. title: this.$L("错误详情"),
  51424. content: err
  51425. });
  51426. },
  51427. clickUser: function clickUser(e) {
  51428. this.$emit('clickUser', this.info, e);
  51429. },
  51430. fileDownUrl: function fileDownUrl(id) {
  51431. return $A.apiUrl('project/files/download?fileid=' + id);
  51432. },
  51433. formatSecond: function formatSecond(d) {
  51434. if (d > 3600) {
  51435. return Math.ceil(d / 3600) + '小时';
  51436. } else if (d > 60) {
  51437. return Math.ceil(d / 60) + '分钟';
  51438. } else {
  51439. return d + '秒';
  51440. }
  51441. }
  51442. }
  51443. });
  51444. /***/ }),
  51445. /* 121 */
  51446. /***/ (function(module, exports, __webpack_require__) {
  51447. var render = function() {
  51448. var _vm = this
  51449. var _h = _vm.$createElement
  51450. var _c = _vm._self._c || _h
  51451. return _c("div", { attrs: { "data-id": _vm.info.id } }, [
  51452. _vm.info.type === "text" ||
  51453. _vm.info.type === "taskB" ||
  51454. _vm.info.type === "report" ||
  51455. _vm.info.type === "video" ||
  51456. _vm.info.type === "voice"
  51457. ? _c("div", [
  51458. _vm.info.self === true
  51459. ? _c(
  51460. "div",
  51461. { staticClass: "list-right" },
  51462. [
  51463. _vm.info.error
  51464. ? _c(
  51465. "div",
  51466. {
  51467. staticClass: "item-error",
  51468. on: {
  51469. click: function($event) {
  51470. return _vm.clickError(_vm.info.error)
  51471. }
  51472. }
  51473. },
  51474. [_c("Icon", { attrs: { type: "md-alert" } })],
  51475. 1
  51476. )
  51477. : _vm._e(),
  51478. _vm._v(" "),
  51479. _c(
  51480. "div",
  51481. { staticClass: "item-right" },
  51482. [
  51483. _c(
  51484. "div",
  51485. {
  51486. staticClass: "item-username",
  51487. on: { click: _vm.clickUser }
  51488. },
  51489. [
  51490. _c(
  51491. "em",
  51492. { staticClass: "item-name" },
  51493. [
  51494. _c("UserView", {
  51495. attrs: {
  51496. username: _vm.userName,
  51497. info: _vm.info,
  51498. placement: "left"
  51499. }
  51500. })
  51501. ],
  51502. 1
  51503. ),
  51504. _vm._v(" "),
  51505. _vm.info.indate
  51506. ? _c("em", { staticClass: "item-date" }, [
  51507. _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
  51508. ])
  51509. : _vm._e()
  51510. ]
  51511. ),
  51512. _vm._v(" "),
  51513. _c(
  51514. "div",
  51515. {
  51516. staticClass: "item-text",
  51517. class: {
  51518. "text-emoji": _vm.textIsEmoji(_vm.info.text),
  51519. "text-error": _vm.info.error
  51520. }
  51521. },
  51522. [
  51523. _c("div", { staticClass: "item-text-view" }, [
  51524. _vm._v(_vm._s(_vm.textMsg(_vm.info.text)))
  51525. ])
  51526. ]
  51527. ),
  51528. _vm._v(" "),
  51529. _vm.info.type === "taskB"
  51530. ? [
  51531. _vm.info.other.type === "task"
  51532. ? _c(
  51533. "div",
  51534. {
  51535. staticClass: "item-link",
  51536. on: {
  51537. click: function($event) {
  51538. return _vm.taskDetail(_vm.info.other.id)
  51539. }
  51540. }
  51541. },
  51542. [
  51543. _c("span", [
  51544. _vm._v(
  51545. _vm._s(_vm.$L("来自关注任务")) + ":"
  51546. )
  51547. ]),
  51548. _c(
  51549. "a",
  51550. { attrs: { href: "javascript:void(0)" } },
  51551. [_vm._v(_vm._s(_vm.info.other.title))]
  51552. )
  51553. ]
  51554. )
  51555. : _vm._e(),
  51556. _vm._v(" "),
  51557. _vm.info.other.type === "file"
  51558. ? _c("div", { staticClass: "item-link" }, [
  51559. _c("span", [
  51560. _vm._v(_vm._s(_vm.$L("来自关注任务")) + ":")
  51561. ]),
  51562. _c(
  51563. "a",
  51564. {
  51565. attrs: {
  51566. target: "_blank",
  51567. href: _vm.fileDownUrl(_vm.info.other.id)
  51568. }
  51569. },
  51570. [_vm._v(_vm._s(_vm.info.other.name))]
  51571. )
  51572. ])
  51573. : _vm._e()
  51574. ]
  51575. : _vm.info.type === "report"
  51576. ? _c(
  51577. "div",
  51578. {
  51579. staticClass: "item-link",
  51580. on: {
  51581. click: function($event) {
  51582. return _vm.reportDetail(
  51583. _vm.info.other.id,
  51584. _vm.info.other.title
  51585. )
  51586. }
  51587. }
  51588. },
  51589. [
  51590. _c("span", [
  51591. _vm._v(_vm._s(_vm.$L("来自工作报告")) + ":")
  51592. ]),
  51593. _c(
  51594. "a",
  51595. { attrs: { href: "javascript:void(0)" } },
  51596. [_vm._v(_vm._s(_vm.info.other.title))]
  51597. )
  51598. ]
  51599. )
  51600. : _vm.info.type === "video" || _vm.info.type === "voice"
  51601. ? _c(
  51602. "div",
  51603. { staticClass: "item-link" },
  51604. [
  51605. _vm.info.type === "voice"
  51606. ? _c("Icon", {
  51607. attrs: { type: "ios-call-outline" }
  51608. })
  51609. : _c("Icon", {
  51610. attrs: { type: "ios-videocam-outline" }
  51611. }),
  51612. _vm._v(" "),
  51613. _c("span", [
  51614. _vm._v(
  51615. _vm._s(
  51616. _vm.$L(
  51617. "通话时长:%",
  51618. _vm.formatSecond(_vm.info.other.second)
  51619. )
  51620. )
  51621. )
  51622. ])
  51623. ],
  51624. 1
  51625. )
  51626. : _vm._e()
  51627. ],
  51628. 2
  51629. ),
  51630. _vm._v(" "),
  51631. _c("UserImg", {
  51632. staticClass: "item-userimg",
  51633. attrs: { info: _vm.info },
  51634. on: { click: _vm.clickUser }
  51635. })
  51636. ],
  51637. 1
  51638. )
  51639. : _vm.info.self === false
  51640. ? _c(
  51641. "div",
  51642. { staticClass: "list-item" },
  51643. [
  51644. _c("UserImg", {
  51645. staticClass: "item-userimg",
  51646. attrs: { info: _vm.info },
  51647. on: { click: _vm.clickUser }
  51648. }),
  51649. _vm._v(" "),
  51650. _c(
  51651. "div",
  51652. { staticClass: "item-left" },
  51653. [
  51654. _c(
  51655. "div",
  51656. {
  51657. staticClass: "item-username",
  51658. on: { click: _vm.clickUser }
  51659. },
  51660. [
  51661. _c(
  51662. "em",
  51663. { staticClass: "item-name" },
  51664. [
  51665. _c("UserView", {
  51666. attrs: {
  51667. username: _vm.userName,
  51668. info: _vm.info,
  51669. placement: "right"
  51670. }
  51671. })
  51672. ],
  51673. 1
  51674. ),
  51675. _vm._v(" "),
  51676. _vm.info.__usertag
  51677. ? _c("em", { staticClass: "item-tag" }, [
  51678. _vm._v(_vm._s(_vm.info.__usertag))
  51679. ])
  51680. : _vm._e(),
  51681. _vm._v(" "),
  51682. _vm.info.indate
  51683. ? _c("em", { staticClass: "item-date" }, [
  51684. _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
  51685. ])
  51686. : _vm._e()
  51687. ]
  51688. ),
  51689. _vm._v(" "),
  51690. _c(
  51691. "div",
  51692. {
  51693. staticClass: "item-text",
  51694. class: {
  51695. "text-emoji": _vm.textIsEmoji(_vm.info.text),
  51696. "text-error": _vm.info.error
  51697. }
  51698. },
  51699. [
  51700. _c("div", { staticClass: "item-text-view" }, [
  51701. _vm._v(_vm._s(_vm.textMsg(_vm.info.text)))
  51702. ])
  51703. ]
  51704. ),
  51705. _vm._v(" "),
  51706. _vm.info.type === "taskB"
  51707. ? [
  51708. _vm.info.other.type === "task"
  51709. ? _c(
  51710. "div",
  51711. {
  51712. staticClass: "item-link",
  51713. on: {
  51714. click: function($event) {
  51715. return _vm.taskDetail(_vm.info.other.id)
  51716. }
  51717. }
  51718. },
  51719. [
  51720. _c("span", [
  51721. _vm._v(
  51722. _vm._s(_vm.$L("来自关注任务")) + ":"
  51723. )
  51724. ]),
  51725. _c(
  51726. "a",
  51727. { attrs: { href: "javascript:void(0)" } },
  51728. [_vm._v(_vm._s(_vm.info.other.title))]
  51729. )
  51730. ]
  51731. )
  51732. : _vm._e(),
  51733. _vm._v(" "),
  51734. _vm.info.other.type === "file"
  51735. ? _c("div", { staticClass: "item-link" }, [
  51736. _c("span", [
  51737. _vm._v(_vm._s(_vm.$L("来自关注任务")) + ":")
  51738. ]),
  51739. _c(
  51740. "a",
  51741. {
  51742. attrs: {
  51743. target: "_blank",
  51744. href: _vm.fileDownUrl(_vm.info.other.id)
  51745. }
  51746. },
  51747. [_vm._v(_vm._s(_vm.info.other.name))]
  51748. )
  51749. ])
  51750. : _vm._e()
  51751. ]
  51752. : _vm.info.type === "report"
  51753. ? _c(
  51754. "div",
  51755. {
  51756. staticClass: "item-link",
  51757. on: {
  51758. click: function($event) {
  51759. return _vm.reportDetail(
  51760. _vm.info.other.id,
  51761. _vm.info.other.title
  51762. )
  51763. }
  51764. }
  51765. },
  51766. [
  51767. _c("span", [
  51768. _vm._v(_vm._s(_vm.$L("来自工作报告")) + ":")
  51769. ]),
  51770. _c(
  51771. "a",
  51772. { attrs: { href: "javascript:void(0)" } },
  51773. [_vm._v(_vm._s(_vm.info.other.title))]
  51774. )
  51775. ]
  51776. )
  51777. : _vm.info.type === "video" || _vm.info.type === "voice"
  51778. ? _c(
  51779. "div",
  51780. { staticClass: "item-link" },
  51781. [
  51782. _vm.info.type === "voice"
  51783. ? _c("Icon", {
  51784. attrs: { type: "ios-call-outline" }
  51785. })
  51786. : _c("Icon", {
  51787. attrs: { type: "ios-videocam-outline" }
  51788. }),
  51789. _vm._v(" "),
  51790. _c("span", [
  51791. _vm._v(
  51792. _vm._s(
  51793. _vm.$L(
  51794. "通话时长:%",
  51795. _vm.formatSecond(_vm.info.other.second)
  51796. )
  51797. )
  51798. )
  51799. ])
  51800. ],
  51801. 1
  51802. )
  51803. : _vm._e()
  51804. ],
  51805. 2
  51806. )
  51807. ],
  51808. 1
  51809. )
  51810. : _vm._e()
  51811. ])
  51812. : _vm.info.type === "image" || _vm.info.type === "file"
  51813. ? _c("div", [
  51814. _vm.info.self === true
  51815. ? _c(
  51816. "div",
  51817. { staticClass: "list-right" },
  51818. [
  51819. _vm.info.error
  51820. ? _c(
  51821. "div",
  51822. {
  51823. staticClass: "item-error",
  51824. on: {
  51825. click: function($event) {
  51826. return _vm.clickError(_vm.info.error)
  51827. }
  51828. }
  51829. },
  51830. [_c("Icon", { attrs: { type: "md-alert" } })],
  51831. 1
  51832. )
  51833. : _vm._e(),
  51834. _vm._v(" "),
  51835. _c("div", { staticClass: "item-right" }, [
  51836. _c(
  51837. "div",
  51838. {
  51839. staticClass: "item-username",
  51840. on: { click: _vm.clickUser }
  51841. },
  51842. [
  51843. _c(
  51844. "em",
  51845. { staticClass: "item-name" },
  51846. [
  51847. _c("UserView", {
  51848. attrs: {
  51849. username: _vm.userName,
  51850. info: _vm.info,
  51851. placement: "left"
  51852. }
  51853. })
  51854. ],
  51855. 1
  51856. ),
  51857. _vm._v(" "),
  51858. _vm.info.indate
  51859. ? _c("em", { staticClass: "item-date" }, [
  51860. _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
  51861. ])
  51862. : _vm._e()
  51863. ]
  51864. ),
  51865. _vm._v(" "),
  51866. _vm.info.url === "loading"
  51867. ? _c(
  51868. "div",
  51869. { staticClass: "item-loading" },
  51870. [_c("WLoading")],
  51871. 1
  51872. )
  51873. : _c(
  51874. "a",
  51875. {
  51876. staticClass: "item-file",
  51877. attrs: { href: _vm.info.url, target: "_blank" }
  51878. },
  51879. [
  51880. _vm.info.type === "file"
  51881. ? _c("div", { staticClass: "item-file-box" }, [
  51882. _c("img", {
  51883. staticClass: "item-file-thumb",
  51884. attrs: { src: _vm.info.filethumb }
  51885. }),
  51886. _vm._v(" "),
  51887. _c("div", { staticClass: "item-file-info" }, [
  51888. _c(
  51889. "div",
  51890. { staticClass: "item-file-name" },
  51891. [_vm._v(_vm._s(_vm.info.filename))]
  51892. ),
  51893. _vm._v(" "),
  51894. _c(
  51895. "div",
  51896. { staticClass: "item-file-size" },
  51897. [
  51898. _vm._v(
  51899. _vm._s(
  51900. _vm.$A.bytesToSize(
  51901. _vm.$A.runNum(_vm.info.filesize) *
  51902. 1024
  51903. )
  51904. )
  51905. )
  51906. ]
  51907. )
  51908. ])
  51909. ])
  51910. : _c("img", {
  51911. staticClass: "item-file-img",
  51912. style: _vm.imageStyle(_vm.info),
  51913. attrs: { src: _vm.info.url }
  51914. })
  51915. ]
  51916. )
  51917. ]),
  51918. _vm._v(" "),
  51919. _c("UserImg", {
  51920. staticClass: "item-userimg",
  51921. attrs: { info: _vm.info },
  51922. on: { click: _vm.clickUser }
  51923. })
  51924. ],
  51925. 1
  51926. )
  51927. : _vm.info.self === false
  51928. ? _c(
  51929. "div",
  51930. { staticClass: "list-item" },
  51931. [
  51932. _c("UserImg", {
  51933. staticClass: "item-userimg",
  51934. attrs: { info: _vm.info },
  51935. on: { click: _vm.clickUser }
  51936. }),
  51937. _vm._v(" "),
  51938. _c("div", { staticClass: "item-left" }, [
  51939. _c(
  51940. "div",
  51941. {
  51942. staticClass: "item-username",
  51943. on: { click: _vm.clickUser }
  51944. },
  51945. [
  51946. _c(
  51947. "em",
  51948. { staticClass: "item-name" },
  51949. [
  51950. _c("UserView", {
  51951. attrs: {
  51952. username: _vm.userName,
  51953. info: _vm.info,
  51954. placement: "right"
  51955. }
  51956. })
  51957. ],
  51958. 1
  51959. ),
  51960. _vm._v(" "),
  51961. _vm.info.__usertag
  51962. ? _c("em", { staticClass: "item-tag" }, [
  51963. _vm._v(_vm._s(_vm.info.__usertag))
  51964. ])
  51965. : _vm._e(),
  51966. _vm._v(" "),
  51967. _vm.info.indate
  51968. ? _c("em", { staticClass: "item-date" }, [
  51969. _vm._v(_vm._s(_vm.formatCDate(_vm.info.indate)))
  51970. ])
  51971. : _vm._e()
  51972. ]
  51973. ),
  51974. _vm._v(" "),
  51975. _vm.info.url === "loading"
  51976. ? _c(
  51977. "div",
  51978. { staticClass: "item-loading" },
  51979. [_c("WLoading")],
  51980. 1
  51981. )
  51982. : _c(
  51983. "a",
  51984. {
  51985. staticClass: "item-file",
  51986. attrs: { href: _vm.info.url, target: "_blank" }
  51987. },
  51988. [
  51989. _vm.info.type === "file"
  51990. ? _c("div", { staticClass: "item-file-box" }, [
  51991. _c("img", {
  51992. staticClass: "item-file-thumb",
  51993. attrs: { src: _vm.info.filethumb }
  51994. }),
  51995. _vm._v(" "),
  51996. _c("div", { staticClass: "item-file-info" }, [
  51997. _c(
  51998. "div",
  51999. { staticClass: "item-file-name" },
  52000. [_vm._v(_vm._s(_vm.info.filename))]
  52001. ),
  52002. _vm._v(" "),
  52003. _c(
  52004. "div",
  52005. { staticClass: "item-file-size" },
  52006. [
  52007. _vm._v(
  52008. _vm._s(
  52009. _vm.$A.bytesToSize(
  52010. _vm.$A.runNum(_vm.info.filesize) *
  52011. 1024
  52012. )
  52013. )
  52014. )
  52015. ]
  52016. )
  52017. ])
  52018. ])
  52019. : _c("img", {
  52020. staticClass: "item-file-img",
  52021. style: _vm.imageStyle(_vm.info),
  52022. attrs: { src: _vm.info.url }
  52023. })
  52024. ]
  52025. )
  52026. ])
  52027. ],
  52028. 1
  52029. )
  52030. : _vm._e()
  52031. ])
  52032. : _vm.info.type === "notice"
  52033. ? _c("div", [
  52034. _c("div", { staticClass: "item-notice" }, [
  52035. _vm._v(_vm._s(_vm.info.notice))
  52036. ])
  52037. ])
  52038. : _vm._e()
  52039. ])
  52040. }
  52041. var staticRenderFns = []
  52042. render._withStripped = true
  52043. module.exports = { render: render, staticRenderFns: staticRenderFns }
  52044. if (false) {
  52045. module.hot.accept()
  52046. if (module.hot.data) {
  52047. require("vue-hot-reload-api") .rerender("data-v-9d161836", module.exports)
  52048. }
  52049. }
  52050. /***/ }),
  52051. /* 122 */
  52052. /***/ (function(module, exports, __webpack_require__) {
  52053. var disposed = false
  52054. var normalizeComponent = __webpack_require__(2)
  52055. /* script */
  52056. var __vue_script__ = __webpack_require__(123)
  52057. /* template */
  52058. var __vue_template__ = __webpack_require__(124)
  52059. /* template functional */
  52060. var __vue_template_functional__ = false
  52061. /* styles */
  52062. var __vue_styles__ = null
  52063. /* scopeId */
  52064. var __vue_scopeId__ = null
  52065. /* moduleIdentifier (server only) */
  52066. var __vue_module_identifier__ = null
  52067. var Component = normalizeComponent(
  52068. __vue_script__,
  52069. __vue_template__,
  52070. __vue_template_functional__,
  52071. __vue_styles__,
  52072. __vue_scopeId__,
  52073. __vue_module_identifier__
  52074. )
  52075. Component.options.__file = "resources/assets/js/main/components/chat/Upload.vue"
  52076. /* hot reload */
  52077. if (false) {(function () {
  52078. var hotAPI = require("vue-hot-reload-api")
  52079. hotAPI.install(require("vue"), false)
  52080. if (!hotAPI.compatible) return
  52081. module.hot.accept()
  52082. if (!module.hot.data) {
  52083. hotAPI.createRecord("data-v-1ed0eada", Component.options)
  52084. } else {
  52085. hotAPI.reload("data-v-1ed0eada", Component.options)
  52086. }
  52087. module.hot.dispose(function (data) {
  52088. disposed = true
  52089. })
  52090. })()}
  52091. module.exports = Component.exports
  52092. /***/ }),
  52093. /* 123 */
  52094. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52095. "use strict";
  52096. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  52097. //
  52098. //
  52099. //
  52100. //
  52101. //
  52102. //
  52103. //
  52104. //
  52105. //
  52106. //
  52107. //
  52108. //
  52109. //
  52110. //
  52111. //
  52112. //
  52113. //
  52114. //
  52115. /* harmony default export */ __webpack_exports__["default"] = ({
  52116. name: 'ChatLoad',
  52117. props: {
  52118. target: {
  52119. default: ''
  52120. },
  52121. maxSize: {
  52122. type: Number,
  52123. default: 204800
  52124. }
  52125. },
  52126. data: function data() {
  52127. return {
  52128. uploadFormat: ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'],
  52129. actionUrl: $A.apiUrl('chat/files/upload'),
  52130. params: {
  52131. username: this.target,
  52132. token: $A.getToken()
  52133. }
  52134. };
  52135. },
  52136. watch: {
  52137. target: function target(val) {
  52138. this.$set(this.params, 'username', val);
  52139. }
  52140. },
  52141. methods: {
  52142. handleProgress: function handleProgress(event, file) {
  52143. //上传时
  52144. if (typeof file.tempId === "undefined") {
  52145. file.tempId = $A.randomString(8);
  52146. this.$emit('on-progress', file);
  52147. }
  52148. },
  52149. handleSuccess: function handleSuccess(res, file) {
  52150. //上传完成
  52151. if (res.ret === 1) {
  52152. for (var key in res.data) {
  52153. if (res.data.hasOwnProperty(key)) {
  52154. file[key] = res.data[key];
  52155. }
  52156. }
  52157. this.$emit('on-success', file);
  52158. } else {
  52159. this.$Modal.warning({
  52160. title: this.$L('上传失败'),
  52161. content: this.$L('文件 % 上传失败,%', file.name, res.msg)
  52162. });
  52163. this.$emit('on-error', file);
  52164. this.$refs.upload.fileList.pop();
  52165. }
  52166. },
  52167. handleFormatError: function handleFormatError(file) {
  52168. //上传类型错误
  52169. this.$Modal.warning({
  52170. title: this.$L('文件格式不正确'),
  52171. content: this.$L('文件 % 格式不正确,仅支持上传:%', file.name, this.uploadFormat.join(','))
  52172. });
  52173. },
  52174. handleMaxSize: function handleMaxSize(file) {
  52175. //上传大小错误
  52176. this.$Modal.warning({
  52177. title: this.$L('超出文件大小限制'),
  52178. content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
  52179. });
  52180. },
  52181. handleBeforeUpload: function handleBeforeUpload() {
  52182. //上传前判断
  52183. this.params = {
  52184. username: this.target,
  52185. token: $A.getToken()
  52186. };
  52187. return true;
  52188. },
  52189. handleClick: function handleClick() {
  52190. //手动上传
  52191. if (this.handleBeforeUpload()) {
  52192. this.$refs.upload.handleClick();
  52193. }
  52194. },
  52195. upload: function upload(file) {
  52196. //手动传file
  52197. if (this.handleBeforeUpload()) {
  52198. this.$refs.upload.upload(file);
  52199. }
  52200. }
  52201. }
  52202. });
  52203. /***/ }),
  52204. /* 124 */
  52205. /***/ (function(module, exports, __webpack_require__) {
  52206. var render = function() {
  52207. var _vm = this
  52208. var _h = _vm.$createElement
  52209. var _c = _vm._self._c || _h
  52210. return _c("Upload", {
  52211. ref: "upload",
  52212. attrs: {
  52213. name: "files",
  52214. action: _vm.actionUrl,
  52215. data: _vm.params,
  52216. multiple: "",
  52217. format: _vm.uploadFormat,
  52218. "show-upload-list": false,
  52219. "max-size": _vm.maxSize,
  52220. "on-progress": _vm.handleProgress,
  52221. "on-success": _vm.handleSuccess,
  52222. "on-format-error": _vm.handleFormatError,
  52223. "on-exceeded-size": _vm.handleMaxSize,
  52224. "before-upload": _vm.handleBeforeUpload
  52225. }
  52226. })
  52227. }
  52228. var staticRenderFns = []
  52229. render._withStripped = true
  52230. module.exports = { render: render, staticRenderFns: staticRenderFns }
  52231. if (false) {
  52232. module.hot.accept()
  52233. if (module.hot.data) {
  52234. require("vue-hot-reload-api") .rerender("data-v-1ed0eada", module.exports)
  52235. }
  52236. }
  52237. /***/ }),
  52238. /* 125 */
  52239. /***/ (function(module, exports, __webpack_require__) {
  52240. var render = function() {
  52241. var _vm = this
  52242. var _h = _vm.$createElement
  52243. var _c = _vm._self._c || _h
  52244. return _c("div", { staticClass: "chat-index" }, [
  52245. _c("ul", { staticClass: "chat-menu" }, [
  52246. _c(
  52247. "li",
  52248. { staticClass: "self" },
  52249. [
  52250. _c("UserImg", { staticClass: "avatar", attrs: { info: _vm.usrInfo } })
  52251. ],
  52252. 1
  52253. ),
  52254. _vm._v(" "),
  52255. _c(
  52256. "li",
  52257. {
  52258. class: { active: _vm.chatTap == "dialog" },
  52259. on: {
  52260. click: function($event) {
  52261. ;[(_vm.chatTap = "dialog"), (_vm.chatTam = "dialog")]
  52262. }
  52263. }
  52264. },
  52265. [
  52266. _c("Icon", { attrs: { type: "md-text" } }),
  52267. _vm._v(" "),
  52268. _vm.unreadTotal > 0
  52269. ? _c("em", { staticClass: "chat-num" }, [
  52270. _vm._v(_vm._s(_vm.unreadTotal > 99 ? "99+" : _vm.unreadTotal))
  52271. ])
  52272. : _vm._e()
  52273. ],
  52274. 1
  52275. ),
  52276. _vm._v(" "),
  52277. _c(
  52278. "li",
  52279. {
  52280. class: { active: _vm.chatTap == "team" },
  52281. on: {
  52282. click: function($event) {
  52283. ;[(_vm.chatTap = "team"), (_vm.chatTam = "team")]
  52284. }
  52285. }
  52286. },
  52287. [_c("Icon", { attrs: { type: "md-person" } })],
  52288. 1
  52289. )
  52290. ]),
  52291. _vm._v(" "),
  52292. _c(
  52293. "ul",
  52294. {
  52295. staticClass: "chat-user",
  52296. class: {
  52297. "chat-flex": _vm.chatTap == "dialog",
  52298. "chat-tam": _vm.chatTam == "dialog"
  52299. }
  52300. },
  52301. [
  52302. _c(
  52303. "li",
  52304. { staticClass: "sreach" },
  52305. [
  52306. _c("Input", {
  52307. attrs: { placeholder: _vm.$L("搜索"), prefix: "ios-search" },
  52308. model: {
  52309. value: _vm.dialogSearch,
  52310. callback: function($$v) {
  52311. _vm.dialogSearch = $$v
  52312. },
  52313. expression: "dialogSearch"
  52314. }
  52315. })
  52316. ],
  52317. 1
  52318. ),
  52319. _vm._v(" "),
  52320. _c("li", { ref: "dialogLists", staticClass: "lists" }, [
  52321. _c(
  52322. "ul",
  52323. [
  52324. _vm._l(_vm.dialogListsS, function(dialog, index) {
  52325. return _c(
  52326. "li",
  52327. {
  52328. key: index,
  52329. class: {
  52330. active: dialog.username == _vm.dialogTarget.username
  52331. },
  52332. attrs: { "data-id": dialog.id },
  52333. on: {
  52334. click: function($event) {
  52335. return _vm.openDialog(dialog)
  52336. }
  52337. }
  52338. },
  52339. [
  52340. _c("UserImg", {
  52341. staticClass: "avatar",
  52342. attrs: { info: dialog }
  52343. }),
  52344. _vm._v(" "),
  52345. _c("div", { staticClass: "user-msg-box" }, [
  52346. _c("div", { staticClass: "user-msg-title" }, [
  52347. _c(
  52348. "span",
  52349. [
  52350. _c("UserView", {
  52351. attrs: {
  52352. username: dialog.username,
  52353. placement: "right"
  52354. },
  52355. on: {
  52356. "on-result": function($event) {
  52357. return _vm.userViewResult(dialog, $event)
  52358. }
  52359. }
  52360. })
  52361. ],
  52362. 1
  52363. ),
  52364. _vm._v(" "),
  52365. _c("em", [
  52366. _vm._v(_vm._s(_vm.formatCDate(dialog.lastdate)))
  52367. ])
  52368. ]),
  52369. _vm._v(" "),
  52370. _c("div", { staticClass: "user-msg-text" }, [
  52371. _vm._v(_vm._s(dialog.lasttext))
  52372. ])
  52373. ]),
  52374. _vm._v(" "),
  52375. dialog.unread > 0
  52376. ? _c("em", { staticClass: "user-msg-num" }, [
  52377. _vm._v(_vm._s(dialog.unread))
  52378. ])
  52379. : _vm._e()
  52380. ],
  52381. 1
  52382. )
  52383. }),
  52384. _vm._v(" "),
  52385. _vm.dialogNoDataText == _vm.$L("数据加载中.....")
  52386. ? _c("li", { staticClass: "chat-none" }, [_c("w-loading")], 1)
  52387. : _vm.dialogLists.length == 0
  52388. ? _c("li", { staticClass: "chat-none" }, [
  52389. _vm._v(_vm._s(_vm.dialogNoDataText))
  52390. ])
  52391. : _vm._e()
  52392. ],
  52393. 2
  52394. )
  52395. ])
  52396. ]
  52397. ),
  52398. _vm._v(" "),
  52399. _c(
  52400. "ul",
  52401. {
  52402. staticClass: "chat-team",
  52403. class: {
  52404. "chat-flex": _vm.chatTap == "team",
  52405. "chat-tam": _vm.chatTam == "team"
  52406. }
  52407. },
  52408. [
  52409. _c(
  52410. "li",
  52411. { staticClass: "sreach" },
  52412. [
  52413. _c("Input", {
  52414. attrs: { placeholder: _vm.$L("搜索"), prefix: "ios-search" },
  52415. model: {
  52416. value: _vm.teamSearch,
  52417. callback: function($$v) {
  52418. _vm.teamSearch = $$v
  52419. },
  52420. expression: "teamSearch"
  52421. }
  52422. })
  52423. ],
  52424. 1
  52425. ),
  52426. _vm._v(" "),
  52427. _c("li", { staticClass: "lists" }, [
  52428. _c(
  52429. "ul",
  52430. [
  52431. _vm._l(_vm.teamLists, function(lists, key) {
  52432. return _vm.teamListsS(lists).length > 0
  52433. ? _c("li", { key: key }, [
  52434. _c("div", { staticClass: "team-label" }, [
  52435. _vm._v(_vm._s(key))
  52436. ]),
  52437. _vm._v(" "),
  52438. _c(
  52439. "ul",
  52440. _vm._l(_vm.teamListsS(lists), function(item, index) {
  52441. return _c(
  52442. "li",
  52443. {
  52444. key: index,
  52445. on: {
  52446. click: function($event) {
  52447. return _vm.openDialog(item, true)
  52448. }
  52449. }
  52450. },
  52451. [
  52452. _c("UserImg", {
  52453. staticClass: "avatar",
  52454. attrs: { info: item }
  52455. }),
  52456. _vm._v(" "),
  52457. _c("div", { staticClass: "team-username" }, [
  52458. _vm._v(_vm._s(item.nickname || item.username))
  52459. ])
  52460. ],
  52461. 1
  52462. )
  52463. }),
  52464. 0
  52465. )
  52466. ])
  52467. : _vm._e()
  52468. }),
  52469. _vm._v(" "),
  52470. _vm.teamNoDataText == _vm.$L("数据加载中.....")
  52471. ? _c("li", { staticClass: "chat-none" }, [_c("w-loading")], 1)
  52472. : Object.keys(_vm.teamLists).length == 0
  52473. ? _c("li", { staticClass: "chat-none" }, [
  52474. _vm._v(_vm._s(_vm.teamNoDataText))
  52475. ])
  52476. : _vm._e(),
  52477. _vm._v(" "),
  52478. _vm.teamHasMorePages
  52479. ? _c(
  52480. "li",
  52481. {
  52482. staticClass: "chat-more",
  52483. on: {
  52484. click: function($event) {
  52485. return _vm.getTeamLists(true)
  52486. }
  52487. }
  52488. },
  52489. [_vm._v(_vm._s(_vm.$L("加载更多...")))]
  52490. )
  52491. : _vm._e()
  52492. ],
  52493. 2
  52494. )
  52495. ])
  52496. ]
  52497. ),
  52498. _vm._v(" "),
  52499. _c(
  52500. "div",
  52501. {
  52502. staticClass: "chat-message",
  52503. style: {
  52504. display:
  52505. _vm.chatTap == "dialog" && _vm.dialogTarget.username
  52506. ? "block"
  52507. : "none"
  52508. },
  52509. on: {
  52510. drop: function($event) {
  52511. $event.preventDefault()
  52512. return _vm.messagePasteDrag($event, "drag")
  52513. },
  52514. dragover: function($event) {
  52515. $event.preventDefault()
  52516. return _vm.messageDragOver(true)
  52517. },
  52518. dragleave: function($event) {
  52519. $event.preventDefault()
  52520. return _vm.messageDragOver(false)
  52521. }
  52522. }
  52523. },
  52524. [
  52525. _c(
  52526. "div",
  52527. { staticClass: "manage-title" },
  52528. [
  52529. _c("UserView", { attrs: { username: _vm.dialogTarget.username } }),
  52530. _vm._v(" "),
  52531. _c(
  52532. "Dropdown",
  52533. {
  52534. staticClass: "manage-title-right",
  52535. attrs: {
  52536. placement: "bottom-end",
  52537. trigger: "click",
  52538. transfer: ""
  52539. },
  52540. on: { "on-click": _vm.dialogDropdown }
  52541. },
  52542. [
  52543. _c("Icon", { attrs: { type: "ios-more" } }),
  52544. _vm._v(" "),
  52545. _c(
  52546. "DropdownMenu",
  52547. { attrs: { slot: "list" }, slot: "list" },
  52548. [
  52549. _c("DropdownItem", { attrs: { name: "delete" } }, [
  52550. _vm._v(_vm._s(_vm.$L("删除对话")))
  52551. ]),
  52552. _vm._v(" "),
  52553. _c("DropdownItem", { attrs: { name: "clear" } }, [
  52554. _vm._v(_vm._s(_vm.$L("清除聊天记录")))
  52555. ])
  52556. ],
  52557. 1
  52558. )
  52559. ],
  52560. 1
  52561. )
  52562. ],
  52563. 1
  52564. ),
  52565. _vm._v(" "),
  52566. _c(
  52567. "ScrollerY",
  52568. {
  52569. ref: "manageLists",
  52570. staticClass: "manage-lists",
  52571. on: { "on-scroll": _vm.messageListsScroll }
  52572. },
  52573. [
  52574. _c(
  52575. "div",
  52576. { ref: "manageBody", staticClass: "manage-body" },
  52577. [
  52578. _vm.messageHasMorePages
  52579. ? _c(
  52580. "div",
  52581. {
  52582. staticClass: "manage-more",
  52583. on: {
  52584. click: function($event) {
  52585. return _vm.getDialogMessage(true)
  52586. }
  52587. }
  52588. },
  52589. [_vm._v(_vm._s(_vm.$L("加载更多...")))]
  52590. )
  52591. : _vm._e(),
  52592. _vm._v(" "),
  52593. _vm.messageNoDataText == _vm.$L("数据加载中.....")
  52594. ? _c(
  52595. "div",
  52596. { staticClass: "manage-more" },
  52597. [_c("w-loading")],
  52598. 1
  52599. )
  52600. : _vm.messageNoDataText
  52601. ? _c("div", { staticClass: "manage-more" }, [
  52602. _vm._v(_vm._s(_vm.messageNoDataText))
  52603. ])
  52604. : _vm._e(),
  52605. _vm._v(" "),
  52606. _vm._l(_vm.messageLists, function(info, index) {
  52607. return _c("chat-message", {
  52608. key: index,
  52609. attrs: { info: info }
  52610. })
  52611. })
  52612. ],
  52613. 2
  52614. ),
  52615. _vm._v(" "),
  52616. _vm.messageNew > 0
  52617. ? _c(
  52618. "div",
  52619. {
  52620. staticClass: "manage-lists-message-new",
  52621. on: {
  52622. click: function($event) {
  52623. return _vm.messageBottomGo(true)
  52624. }
  52625. }
  52626. },
  52627. [_vm._v(_vm._s(_vm.$L("有%条新消息", _vm.messageNew)))]
  52628. )
  52629. : _vm._e()
  52630. ]
  52631. ),
  52632. _vm._v(" "),
  52633. _c(
  52634. "div",
  52635. {
  52636. staticClass: "manage-send",
  52637. on: {
  52638. click: function($event) {
  52639. return _vm.clickDialog(_vm.dialogTarget.username)
  52640. }
  52641. }
  52642. },
  52643. [
  52644. _c("textarea", {
  52645. directives: [
  52646. {
  52647. name: "model",
  52648. rawName: "v-model",
  52649. value: _vm.messageText,
  52650. expression: "messageText"
  52651. }
  52652. ],
  52653. ref: "textarea",
  52654. staticClass: "manage-input",
  52655. attrs: {
  52656. maxlength: "20000",
  52657. placeholder: _vm.$L("请输入要发送的消息")
  52658. },
  52659. domProps: { value: _vm.messageText },
  52660. on: {
  52661. keydown: function($event) {
  52662. return _vm.messageSend($event)
  52663. },
  52664. paste: _vm.messagePasteDrag,
  52665. input: function($event) {
  52666. if ($event.target.composing) {
  52667. return
  52668. }
  52669. _vm.messageText = $event.target.value
  52670. }
  52671. }
  52672. })
  52673. ]
  52674. ),
  52675. _vm._v(" "),
  52676. _c(
  52677. "div",
  52678. { staticClass: "manage-quick" },
  52679. [
  52680. _c("emoji-picker", {
  52681. attrs: { search: _vm.messageEmojiSearch },
  52682. on: { emoji: _vm.messageInsertText },
  52683. scopedSlots: _vm._u([
  52684. {
  52685. key: "emoji-invoker",
  52686. fn: function(ref) {
  52687. var clickEvent = ref.events.click
  52688. return _c(
  52689. "div",
  52690. {
  52691. on: {
  52692. click: function($event) {
  52693. $event.stopPropagation()
  52694. return function(event) {
  52695. clickEvent(event)
  52696. }.apply(null, arguments)
  52697. }
  52698. }
  52699. },
  52700. [
  52701. _c(
  52702. "Tooltip",
  52703. {
  52704. attrs: { content: _vm.$L("表情"), placement: "top" }
  52705. },
  52706. [
  52707. _c("Icon", {
  52708. staticClass: "quick-item",
  52709. attrs: { type: "ios-happy-outline" }
  52710. })
  52711. ],
  52712. 1
  52713. )
  52714. ],
  52715. 1
  52716. )
  52717. }
  52718. },
  52719. {
  52720. key: "emoji-picker",
  52721. fn: function(ref) {
  52722. var emojis = ref.emojis
  52723. var insert = ref.insert
  52724. var display = ref.display
  52725. return _c("div", {}, [
  52726. _c(
  52727. "div",
  52728. { staticClass: "emoji-box" },
  52729. [
  52730. _c("Input", {
  52731. staticClass: "emoji-input",
  52732. attrs: {
  52733. placeholder: _vm.$L("搜索"),
  52734. prefix: "ios-search"
  52735. },
  52736. model: {
  52737. value: _vm.messageEmojiSearch,
  52738. callback: function($$v) {
  52739. _vm.messageEmojiSearch = $$v
  52740. },
  52741. expression: "messageEmojiSearch"
  52742. }
  52743. }),
  52744. _vm._v(" "),
  52745. _c(
  52746. "div",
  52747. _vm._l(emojis, function(emojiGroup, category) {
  52748. return _c("div", { key: category }, [
  52749. _c("h5", [_vm._v(_vm._s(category))]),
  52750. _vm._v(" "),
  52751. _c(
  52752. "div",
  52753. { staticClass: "emojis" },
  52754. _vm._l(emojiGroup, function(
  52755. emoji,
  52756. emojiName
  52757. ) {
  52758. return _c(
  52759. "span",
  52760. {
  52761. key: emojiName,
  52762. attrs: { title: emojiName },
  52763. on: {
  52764. click: function($event) {
  52765. return insert(emoji)
  52766. }
  52767. }
  52768. },
  52769. [_vm._v(_vm._s(emoji))]
  52770. )
  52771. }),
  52772. 0
  52773. )
  52774. ])
  52775. }),
  52776. 0
  52777. )
  52778. ],
  52779. 1
  52780. )
  52781. ])
  52782. }
  52783. }
  52784. ])
  52785. }),
  52786. _vm._v(" "),
  52787. _c(
  52788. "Tooltip",
  52789. { attrs: { content: _vm.$L("文件/图片"), placement: "top" } },
  52790. [
  52791. _c("Icon", {
  52792. staticClass: "quick-item",
  52793. attrs: { type: "ios-photos-outline" },
  52794. on: {
  52795. click: function($event) {
  52796. return _vm.$refs.messageUpload.handleClick()
  52797. }
  52798. }
  52799. }),
  52800. _vm._v(" "),
  52801. _c("ChatLoad", {
  52802. ref: "messageUpload",
  52803. staticClass: "message-upload",
  52804. attrs: { target: _vm.dialogTarget.username },
  52805. on: {
  52806. "on-progress": function($event) {
  52807. return _vm.messageFile("progress", $event)
  52808. },
  52809. "on-success": function($event) {
  52810. return _vm.messageFile("success", $event)
  52811. },
  52812. "on-error": function($event) {
  52813. return _vm.messageFile("error", $event)
  52814. }
  52815. }
  52816. })
  52817. ],
  52818. 1
  52819. ),
  52820. _vm._v(" "),
  52821. _vm.systemConfig.callav == "open"
  52822. ? [
  52823. _c(
  52824. "Tooltip",
  52825. {
  52826. attrs: { content: _vm.$L("语音聊天"), placement: "top" }
  52827. },
  52828. [
  52829. _c("Icon", {
  52830. staticClass: "quick-item voicecam",
  52831. attrs: { type: "ios-call-outline" },
  52832. on: {
  52833. click: function($event) {
  52834. return _vm.videoConnect(null, false)
  52835. }
  52836. }
  52837. })
  52838. ],
  52839. 1
  52840. ),
  52841. _vm._v(" "),
  52842. _c(
  52843. "Tooltip",
  52844. {
  52845. attrs: { content: _vm.$L("视频聊天"), placement: "top" }
  52846. },
  52847. [
  52848. _c("Icon", {
  52849. staticClass: "quick-item videocam",
  52850. attrs: { type: "ios-videocam-outline" },
  52851. on: {
  52852. click: function($event) {
  52853. return _vm.videoConnect(null, true)
  52854. }
  52855. }
  52856. })
  52857. ],
  52858. 1
  52859. )
  52860. ]
  52861. : _vm._e()
  52862. ],
  52863. 2
  52864. ),
  52865. _vm._v(" "),
  52866. _vm.dialogDragOver
  52867. ? _c("div", { staticClass: "manage-drag-over" }, [
  52868. _c("div", { staticClass: "manage-drag-text" }, [
  52869. _vm._v(
  52870. _vm._s(
  52871. _vm.$L(
  52872. "拖动到这里发送给 %",
  52873. _vm.dialogTarget.nickname || _vm.dialogTarget.username
  52874. )
  52875. )
  52876. )
  52877. ])
  52878. ])
  52879. : _vm._e()
  52880. ],
  52881. 1
  52882. ),
  52883. _vm._v(" "),
  52884. _c(
  52885. "div",
  52886. {
  52887. staticClass: "chat-video",
  52888. style: {
  52889. display: _vm.videoUserName ? "block" : "none",
  52890. backgroundImage: "url(" + _vm.videoUserImg + ")"
  52891. }
  52892. },
  52893. [
  52894. _vm.videoChat
  52895. ? _c("div", { staticClass: "video-opacity" }, [
  52896. _vm._v(_vm._s(_vm.$L("正在视频通话...")))
  52897. ])
  52898. : _c("div", { staticClass: "video-opacity" }, [
  52899. _vm._v(_vm._s(_vm.$L("正在语音通话...")))
  52900. ]),
  52901. _vm._v(" "),
  52902. _c("video", {
  52903. ref: "remoteVideo",
  52904. staticClass: "video-active",
  52905. attrs: { autoplay: "" }
  52906. }),
  52907. _vm._v(" "),
  52908. _c("video", {
  52909. ref: "localVideo",
  52910. staticClass: "video-mini",
  52911. attrs: { autoplay: "", muted: "true" },
  52912. domProps: { muted: true }
  52913. }),
  52914. _vm._v(" "),
  52915. _c(
  52916. "div",
  52917. { staticClass: "video-close" },
  52918. [
  52919. _c("Icon", {
  52920. attrs: { type: "ios-close-circle-outline" },
  52921. on: {
  52922. click: function($event) {
  52923. return _vm.videoClose(_vm.videoUserName)
  52924. }
  52925. }
  52926. })
  52927. ],
  52928. 1
  52929. )
  52930. ]
  52931. ),
  52932. _vm._v(" "),
  52933. _c(
  52934. "audio",
  52935. {
  52936. ref: "messageAudio",
  52937. staticClass: "chat-audio",
  52938. attrs: { preload: "none" }
  52939. },
  52940. [
  52941. _c("source", {
  52942. attrs: { src: _vm.messageAudio + "message.mp3", type: "audio/mpeg" }
  52943. }),
  52944. _vm._v(" "),
  52945. _c("source", {
  52946. attrs: { src: _vm.messageAudio + "message.wav", type: "audio/wav" }
  52947. })
  52948. ]
  52949. ),
  52950. _vm._v(" "),
  52951. _c(
  52952. "audio",
  52953. {
  52954. ref: "callAudio",
  52955. staticClass: "chat-audio",
  52956. attrs: { preload: "none" }
  52957. },
  52958. [
  52959. _c("source", {
  52960. attrs: { src: _vm.messageAudio + "call.mp3", type: "audio/mpeg" }
  52961. }),
  52962. _vm._v(" "),
  52963. _c("source", {
  52964. attrs: { src: _vm.messageAudio + "call.wav", type: "audio/wav" }
  52965. })
  52966. ]
  52967. )
  52968. ])
  52969. }
  52970. var staticRenderFns = []
  52971. render._withStripped = true
  52972. module.exports = { render: render, staticRenderFns: staticRenderFns }
  52973. if (false) {
  52974. module.hot.accept()
  52975. if (module.hot.data) {
  52976. require("vue-hot-reload-api") .rerender("data-v-3f6b8ea0", module.exports)
  52977. }
  52978. }
  52979. /***/ }),
  52980. /* 126 */
  52981. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  52982. "use strict";
  52983. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  52984. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_view_design_src_components_icon__ = __webpack_require__(127);
  52985. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__ = __webpack_require__(22);
  52986. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_view_design_src_directives_transfer_dom__ = __webpack_require__(131);
  52987. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_emitter__ = __webpack_require__(36);
  52988. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_view_design_src_components_modal_mixins_scrollbar__ = __webpack_require__(132);
  52989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__ = __webpack_require__(133);
  52990. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  52991. //
  52992. //
  52993. //
  52994. //
  52995. //
  52996. //
  52997. //
  52998. //
  52999. //
  53000. //
  53001. //
  53002. //
  53003. //
  53004. //
  53005. //
  53006. //
  53007. //
  53008. //
  53009. //
  53010. //
  53011. //
  53012. //
  53013. //
  53014. //
  53015. //
  53016. //
  53017. //
  53018. //
  53019. //
  53020. //
  53021. //
  53022. var prefixCls = 'ivu-drawer';
  53023. /* harmony default export */ __webpack_exports__["default"] = ({
  53024. name: 'WDrawer',
  53025. mixins: [__WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_emitter__["a" /* default */], __WEBPACK_IMPORTED_MODULE_4_view_design_src_components_modal_mixins_scrollbar__["a" /* default */]],
  53026. components: { Icon: __WEBPACK_IMPORTED_MODULE_0_view_design_src_components_icon__["a" /* default */] },
  53027. directives: { TransferDom: __WEBPACK_IMPORTED_MODULE_2_view_design_src_directives_transfer_dom__["a" /* default */] },
  53028. props: {
  53029. value: {
  53030. type: Boolean,
  53031. default: false
  53032. },
  53033. title: {
  53034. type: String
  53035. },
  53036. width: {
  53037. type: [Number, String],
  53038. default: '100%'
  53039. },
  53040. minWidth: {
  53041. type: [Number, String],
  53042. default: 0
  53043. },
  53044. maxWidth: {
  53045. type: [Number, String],
  53046. default: 0
  53047. },
  53048. closable: {
  53049. type: Boolean,
  53050. default: true
  53051. },
  53052. maskClosable: {
  53053. type: Boolean,
  53054. default: true
  53055. },
  53056. mask: {
  53057. type: Boolean,
  53058. default: true
  53059. },
  53060. maskStyle: {
  53061. type: Object
  53062. },
  53063. styles: {
  53064. type: Object
  53065. },
  53066. scrollable: {
  53067. type: Boolean,
  53068. default: false
  53069. },
  53070. placement: {
  53071. validator: function validator(value) {
  53072. return Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["e" /* oneOf */])(value, ['left', 'right']);
  53073. },
  53074. default: 'right'
  53075. },
  53076. zIndex: {
  53077. type: Number,
  53078. default: 1000
  53079. },
  53080. transfer: {
  53081. type: Boolean,
  53082. default: function _default() {
  53083. return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
  53084. }
  53085. },
  53086. className: {
  53087. type: String
  53088. },
  53089. inner: {
  53090. type: Boolean,
  53091. default: false
  53092. },
  53093. // Whether drag and drop is allowed to adjust width
  53094. draggable: {
  53095. type: Boolean,
  53096. default: false
  53097. },
  53098. beforeClose: Function
  53099. },
  53100. data: function data() {
  53101. return {
  53102. prefixCls: prefixCls,
  53103. visible: this.value,
  53104. wrapShow: false,
  53105. showHead: true,
  53106. canMove: false,
  53107. dragWidth: this.width,
  53108. wrapperWidth: this.width,
  53109. wrapperLeft: 0,
  53110. minHandleWidth: 256
  53111. };
  53112. },
  53113. computed: {
  53114. wrapClasses: function wrapClasses() {
  53115. var _ref;
  53116. return [prefixCls + '-wrap', (_ref = {}, _defineProperty(_ref, prefixCls + '-hidden', !this.wrapShow), _defineProperty(_ref, '' + this.className, !!this.className), _defineProperty(_ref, prefixCls + '-no-mask', !this.mask), _defineProperty(_ref, prefixCls + '-wrap-inner', this.inner), _defineProperty(_ref, prefixCls + '-wrap-dragging', this.canMove), _ref)];
  53117. },
  53118. mainStyles: function mainStyles() {
  53119. var style = {};
  53120. var minWidth = parseInt(this.minWidth);
  53121. if (minWidth > 0) {
  53122. style.minWidth = minWidth <= 100 ? minWidth + '%' : minWidth + 'px';
  53123. }
  53124. var maxWidth = parseInt(this.maxWidth);
  53125. if (maxWidth > 0) {
  53126. style.maxWidth = maxWidth <= 100 ? maxWidth + '%' : maxWidth + 'px';
  53127. }
  53128. var width = parseInt(this.dragWidth);
  53129. var styleWidth = {
  53130. width: width <= 100 ? width + '%' : width + 'px'
  53131. };
  53132. Object.assign(style, styleWidth);
  53133. return style;
  53134. },
  53135. contentClasses: function contentClasses() {
  53136. return [prefixCls + '-content', _defineProperty({}, prefixCls + '-content-no-mask', !this.mask)];
  53137. },
  53138. classes: function classes() {
  53139. var _ref3;
  53140. return ['' + prefixCls, prefixCls + '-' + this.placement, (_ref3 = {}, _defineProperty(_ref3, prefixCls + '-no-header', !this.showHead), _defineProperty(_ref3, prefixCls + '-inner', this.inner), _ref3)];
  53141. },
  53142. maskClasses: function maskClasses() {
  53143. return [prefixCls + '-mask', _defineProperty({}, prefixCls + '-mask-inner', this.inner)];
  53144. }
  53145. },
  53146. methods: {
  53147. close: function close() {
  53148. var _this = this;
  53149. if (!this.beforeClose) {
  53150. return this.handleClose();
  53151. }
  53152. var before = this.beforeClose();
  53153. if (before && before.then) {
  53154. before.then(function () {
  53155. _this.handleClose();
  53156. });
  53157. } else {
  53158. this.handleClose();
  53159. }
  53160. },
  53161. handleClose: function handleClose() {
  53162. this.visible = false;
  53163. this.$emit('input', false);
  53164. this.$emit('on-close');
  53165. },
  53166. handleMask: function handleMask() {
  53167. if (this.maskClosable && this.mask) {
  53168. this.close();
  53169. }
  53170. },
  53171. handleWrapClick: function handleWrapClick(event) {
  53172. // use indexOf,do not use === ,because ivu-modal-wrap can have other custom className
  53173. var className = event.target.getAttribute('class');
  53174. if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
  53175. },
  53176. handleMousemove: function handleMousemove(event) {
  53177. if (!this.canMove || !this.draggable) return;
  53178. // 更新容器宽度和距离左侧页面距离,如果是window则距左侧距离为0
  53179. this.handleSetWrapperWidth();
  53180. var left = event.pageX - this.wrapperLeft;
  53181. // 如果抽屉方向为右边,宽度计算需用容器宽度减去left
  53182. var width = this.placement === 'right' ? this.wrapperWidth - left : left;
  53183. // 限定最小宽度
  53184. width = Math.max(width, parseFloat(this.minHandleWidth));
  53185. event.atMin = width === parseFloat(this.minHandleWidth);
  53186. // 如果当前width不大于100,视为百分比
  53187. if (width <= 100) width = width / this.wrapperWidth * 100;
  53188. this.dragWidth = width;
  53189. this.$emit('on-resize-width', parseInt(this.dragWidth));
  53190. },
  53191. handleSetWrapperWidth: function handleSetWrapperWidth() {
  53192. var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
  53193. width = _$el$getBoundingClien.width,
  53194. left = _$el$getBoundingClien.left;
  53195. this.wrapperWidth = width;
  53196. this.wrapperLeft = left;
  53197. },
  53198. handleMouseup: function handleMouseup() {
  53199. if (!this.draggable) return;
  53200. this.canMove = false;
  53201. },
  53202. handleTriggerMousedown: function handleTriggerMousedown() {
  53203. this.canMove = true;
  53204. // 防止鼠标选中抽屉中文字,造成拖动trigger触发浏览器原生拖动行为
  53205. window.getSelection().removeAllRanges();
  53206. }
  53207. },
  53208. mounted: function mounted() {
  53209. if (this.visible) {
  53210. this.wrapShow = true;
  53211. }
  53212. var showHead = true;
  53213. if (this.$slots.header === undefined && !this.title) {
  53214. showHead = false;
  53215. }
  53216. this.showHead = showHead;
  53217. Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["b" /* on */])(document, 'mousemove', this.handleMousemove);
  53218. Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["b" /* on */])(document, 'mouseup', this.handleMouseup);
  53219. this.handleSetWrapperWidth();
  53220. },
  53221. beforeDestroy: function beforeDestroy() {
  53222. Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["a" /* off */])(document, 'mousemove', this.handleMousemove);
  53223. Object(__WEBPACK_IMPORTED_MODULE_5_view_design_src_utils_dom__["a" /* off */])(document, 'mouseup', this.handleMouseup);
  53224. this.removeScrollEffect();
  53225. },
  53226. watch: {
  53227. value: function value(val) {
  53228. this.visible = val;
  53229. },
  53230. visible: function visible(val) {
  53231. var _this2 = this;
  53232. if (val === false) {
  53233. this.timer = setTimeout(function () {
  53234. _this2.wrapShow = false;
  53235. // #4831 Check if there are any drawers left at the parent level
  53236. var brotherDrawers = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["a" /* findBrothersComponents */])(_this2, 'Drawer') || [];
  53237. var parentDrawers = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_assist__["c" /* findComponentsUpward */])(_this2, 'Drawer') || [];
  53238. var otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
  53239. var isScrollDrawer = otherDrawers.some(function (item) {
  53240. return item.visible && !item.scrollable;
  53241. });
  53242. if (!isScrollDrawer) {
  53243. _this2.removeScrollEffect();
  53244. }
  53245. }, 300);
  53246. } else {
  53247. if (this.timer) clearTimeout(this.timer);
  53248. this.wrapShow = true;
  53249. if (!this.scrollable) {
  53250. this.addScrollEffect();
  53251. }
  53252. }
  53253. this.broadcast('Table', 'on-visible-change', val);
  53254. this.broadcast('Slider', 'on-visible-change', val); // #2852
  53255. this.$emit('on-visible-change', val);
  53256. },
  53257. scrollable: function scrollable(val) {
  53258. if (!val) {
  53259. this.addScrollEffect();
  53260. } else {
  53261. this.removeScrollEffect();
  53262. }
  53263. },
  53264. title: function title(val) {
  53265. if (this.$slots.header === undefined) {
  53266. this.showHead = !!val;
  53267. }
  53268. },
  53269. width: function width(val) {
  53270. this.dragWidth = val;
  53271. }
  53272. }
  53273. });
  53274. /***/ }),
  53275. /* 127 */
  53276. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53277. "use strict";
  53278. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_vue__ = __webpack_require__(128);
  53279. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__icon_vue__);
  53280. /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0__icon_vue___default.a);
  53281. /***/ }),
  53282. /* 128 */
  53283. /***/ (function(module, exports, __webpack_require__) {
  53284. var disposed = false
  53285. var normalizeComponent = __webpack_require__(2)
  53286. /* script */
  53287. var __vue_script__ = __webpack_require__(129)
  53288. /* template */
  53289. var __vue_template__ = __webpack_require__(130)
  53290. /* template functional */
  53291. var __vue_template_functional__ = false
  53292. /* styles */
  53293. var __vue_styles__ = null
  53294. /* scopeId */
  53295. var __vue_scopeId__ = null
  53296. /* moduleIdentifier (server only) */
  53297. var __vue_module_identifier__ = null
  53298. var Component = normalizeComponent(
  53299. __vue_script__,
  53300. __vue_template__,
  53301. __vue_template_functional__,
  53302. __vue_styles__,
  53303. __vue_scopeId__,
  53304. __vue_module_identifier__
  53305. )
  53306. Component.options.__file = "node_modules/view-design/src/components/icon/icon.vue"
  53307. /* hot reload */
  53308. if (false) {(function () {
  53309. var hotAPI = require("vue-hot-reload-api")
  53310. hotAPI.install(require("vue"), false)
  53311. if (!hotAPI.compatible) return
  53312. module.hot.accept()
  53313. if (!module.hot.data) {
  53314. hotAPI.createRecord("data-v-1c71251e", Component.options)
  53315. } else {
  53316. hotAPI.reload("data-v-1c71251e", Component.options)
  53317. }
  53318. module.hot.dispose(function (data) {
  53319. disposed = true
  53320. })
  53321. })()}
  53322. module.exports = Component.exports
  53323. /***/ }),
  53324. /* 129 */
  53325. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53326. "use strict";
  53327. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  53328. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  53329. //
  53330. //
  53331. //
  53332. var prefixCls = 'ivu-icon';
  53333. /* harmony default export */ __webpack_exports__["default"] = ({
  53334. name: 'Icon',
  53335. props: {
  53336. type: {
  53337. type: String,
  53338. default: ''
  53339. },
  53340. size: [Number, String],
  53341. color: String,
  53342. custom: {
  53343. type: String,
  53344. default: ''
  53345. }
  53346. },
  53347. computed: {
  53348. classes: function classes() {
  53349. var _ref;
  53350. return ['' + prefixCls, (_ref = {}, _defineProperty(_ref, prefixCls + '-' + this.type, this.type !== ''), _defineProperty(_ref, '' + this.custom, this.custom !== ''), _ref)];
  53351. },
  53352. styles: function styles() {
  53353. var style = {};
  53354. if (this.size) {
  53355. style['font-size'] = this.size + 'px';
  53356. }
  53357. if (this.color) {
  53358. style.color = this.color;
  53359. }
  53360. return style;
  53361. }
  53362. },
  53363. methods: {
  53364. handleClick: function handleClick(event) {
  53365. this.$emit('click', event);
  53366. }
  53367. }
  53368. });
  53369. /***/ }),
  53370. /* 130 */
  53371. /***/ (function(module, exports, __webpack_require__) {
  53372. var render = function() {
  53373. var _vm = this
  53374. var _h = _vm.$createElement
  53375. var _c = _vm._self._c || _h
  53376. return _c("i", {
  53377. class: _vm.classes,
  53378. style: _vm.styles,
  53379. on: { click: _vm.handleClick }
  53380. })
  53381. }
  53382. var staticRenderFns = []
  53383. render._withStripped = true
  53384. module.exports = { render: render, staticRenderFns: staticRenderFns }
  53385. if (false) {
  53386. module.hot.accept()
  53387. if (module.hot.data) {
  53388. require("vue-hot-reload-api") .rerender("data-v-1c71251e", module.exports)
  53389. }
  53390. }
  53391. /***/ }),
  53392. /* 131 */
  53393. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53394. "use strict";
  53395. // Thanks to: https://github.com/airyland/vux/blob/v2/src/directives/transfer-dom/index.js
  53396. // Thanks to: https://github.com/calebroseland/vue-dom-portal
  53397. /**
  53398. * Get target DOM Node
  53399. * @param {(Node|string|Boolean)} [node=document.body] DOM Node, CSS selector, or Boolean
  53400. * @return {Node} The target that the el will be appended to
  53401. */
  53402. function getTarget (node) {
  53403. if (node === void 0) {
  53404. node = document.body
  53405. }
  53406. if (node === true) { return document.body }
  53407. return node instanceof window.Node ? node : document.querySelector(node)
  53408. }
  53409. const directive = {
  53410. inserted (el, { value }, vnode) {
  53411. if ( el.dataset && el.dataset.transfer !== 'true') return false;
  53412. el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
  53413. const parentNode = el.parentNode;
  53414. if (!parentNode) return;
  53415. const home = document.createComment('');
  53416. let hasMovedOut = false;
  53417. if (value !== false) {
  53418. parentNode.replaceChild(home, el); // moving out, el is no longer in the document
  53419. getTarget(value).appendChild(el); // moving into new place
  53420. hasMovedOut = true
  53421. }
  53422. if (!el.__transferDomData) {
  53423. el.__transferDomData = {
  53424. parentNode: parentNode,
  53425. home: home,
  53426. target: getTarget(value),
  53427. hasMovedOut: hasMovedOut
  53428. }
  53429. }
  53430. },
  53431. componentUpdated (el, { value }) {
  53432. if ( el.dataset && el.dataset.transfer !== 'true') return false;
  53433. // need to make sure children are done updating (vs. `update`)
  53434. const ref$1 = el.__transferDomData;
  53435. if (!ref$1) return;
  53436. // homes.get(el)
  53437. const parentNode = ref$1.parentNode;
  53438. const home = ref$1.home;
  53439. const hasMovedOut = ref$1.hasMovedOut; // recall where home is
  53440. if (!hasMovedOut && value) {
  53441. // remove from document and leave placeholder
  53442. parentNode.replaceChild(home, el);
  53443. // append to target
  53444. getTarget(value).appendChild(el);
  53445. el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
  53446. } else if (hasMovedOut && value === false) {
  53447. // previously moved, coming back home
  53448. parentNode.replaceChild(el, home);
  53449. el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
  53450. } else if (value) {
  53451. // already moved, going somewhere else
  53452. getTarget(value).appendChild(el);
  53453. }
  53454. },
  53455. unbind (el) {
  53456. if (el.dataset && el.dataset.transfer !== 'true') return false;
  53457. el.className = el.className.replace('v-transfer-dom', '');
  53458. const ref$1 = el.__transferDomData;
  53459. if (!ref$1) return;
  53460. if (el.__transferDomData.hasMovedOut === true) {
  53461. el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el)
  53462. }
  53463. el.__transferDomData = null
  53464. }
  53465. };
  53466. /* harmony default export */ __webpack_exports__["a"] = (directive);
  53467. /***/ }),
  53468. /* 132 */
  53469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53470. "use strict";
  53471. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_assist__ = __webpack_require__(22);
  53472. // used for Modal & $Spin & Drawer
  53473. /* harmony default export */ __webpack_exports__["a"] = ({
  53474. props: {
  53475. lockScroll: {
  53476. type: Boolean,
  53477. default: true
  53478. }
  53479. },
  53480. methods: {
  53481. checkScrollBar () {
  53482. let fullWindowWidth = window.innerWidth;
  53483. if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
  53484. const documentElementRect = document.documentElement.getBoundingClientRect();
  53485. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
  53486. }
  53487. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
  53488. if (this.bodyIsOverflowing) {
  53489. this.scrollBarWidth = Object(__WEBPACK_IMPORTED_MODULE_0__utils_assist__["d" /* getScrollBarSize */])();
  53490. }
  53491. },
  53492. checkMaskInVisible () {
  53493. let masks = document.getElementsByClassName('ivu-modal-mask') || [];
  53494. return Array.from(masks).every(m => m.style.display === 'none' || m.classList.contains('fade-leave-to'));
  53495. },
  53496. setScrollBar () {
  53497. if (this.bodyIsOverflowing && this.scrollBarWidth !== undefined) {
  53498. document.body.style.paddingRight = `${this.scrollBarWidth}px`;
  53499. }
  53500. },
  53501. resetScrollBar () {
  53502. document.body.style.paddingRight = '';
  53503. },
  53504. addScrollEffect () {
  53505. if (!this.lockScroll) return;
  53506. this.checkScrollBar();
  53507. this.setScrollBar();
  53508. document.body.style.overflow = 'hidden';
  53509. },
  53510. removeScrollEffect() {
  53511. if (!this.lockScroll) return;
  53512. if (this.checkMaskInVisible()) {
  53513. document.body.style.overflow = '';
  53514. this.resetScrollBar();
  53515. }
  53516. }
  53517. }
  53518. });
  53519. /***/ }),
  53520. /* 133 */
  53521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  53522. "use strict";
  53523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  53524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  53525. const isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
  53526. /* istanbul ignore next */
  53527. const on = (function() {
  53528. if (!isServer && document.addEventListener) {
  53529. return function(element, event, handler, useCapture = false) {
  53530. if (element && event && handler) {
  53531. element.addEventListener(event, handler, useCapture);
  53532. }
  53533. };
  53534. } else {
  53535. return function(element, event, handler) {
  53536. if (element && event && handler) {
  53537. element.attachEvent('on' + event, handler);
  53538. }
  53539. };
  53540. }
  53541. })();
  53542. /* harmony export (immutable) */ __webpack_exports__["b"] = on;
  53543. /* istanbul ignore next */
  53544. const off = (function() {
  53545. if (!isServer && document.removeEventListener) {
  53546. return function(element, event, handler, useCapture = false) {
  53547. if (element && event) {
  53548. element.removeEventListener(event, handler, useCapture);
  53549. }
  53550. };
  53551. } else {
  53552. return function(element, event, handler) {
  53553. if (element && event) {
  53554. element.detachEvent('on' + event, handler);
  53555. }
  53556. };
  53557. }
  53558. })();
  53559. /* harmony export (immutable) */ __webpack_exports__["a"] = off;
  53560. /***/ }),
  53561. /* 134 */
  53562. /***/ (function(module, exports, __webpack_require__) {
  53563. var render = function() {
  53564. var _vm = this
  53565. var _h = _vm.$createElement
  53566. var _c = _vm._self._c || _h
  53567. return _c(
  53568. "div",
  53569. {
  53570. directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }],
  53571. attrs: { "data-transfer": _vm.transfer }
  53572. },
  53573. [
  53574. _c("transition", { attrs: { name: "fade" } }, [
  53575. _vm.mask
  53576. ? _c("div", {
  53577. directives: [
  53578. {
  53579. name: "show",
  53580. rawName: "v-show",
  53581. value: _vm.visible,
  53582. expression: "visible"
  53583. }
  53584. ],
  53585. class: _vm.maskClasses,
  53586. style: _vm.maskStyle,
  53587. on: { click: _vm.handleMask }
  53588. })
  53589. : _vm._e()
  53590. ]),
  53591. _vm._v(" "),
  53592. _c(
  53593. "div",
  53594. { class: _vm.wrapClasses, on: { click: _vm.handleWrapClick } },
  53595. [
  53596. _c("transition", { attrs: { name: "move-" + _vm.placement } }, [
  53597. _c(
  53598. "div",
  53599. {
  53600. directives: [
  53601. {
  53602. name: "show",
  53603. rawName: "v-show",
  53604. value: _vm.visible,
  53605. expression: "visible"
  53606. }
  53607. ],
  53608. class: _vm.classes,
  53609. style: _vm.mainStyles
  53610. },
  53611. [
  53612. _c("div", { ref: "content", class: _vm.contentClasses }, [
  53613. _vm.closable
  53614. ? _c(
  53615. "a",
  53616. {
  53617. staticClass: "ivu-drawer-close",
  53618. on: { click: _vm.close }
  53619. },
  53620. [
  53621. _vm._t("close", function() {
  53622. return [
  53623. _c("Icon", { attrs: { type: "ios-close" } })
  53624. ]
  53625. })
  53626. ],
  53627. 2
  53628. )
  53629. : _vm._e(),
  53630. _vm._v(" "),
  53631. _vm.showHead
  53632. ? _c(
  53633. "div",
  53634. { class: [_vm.prefixCls + "-header"] },
  53635. [
  53636. _vm._t("header", function() {
  53637. return [
  53638. _c(
  53639. "div",
  53640. { class: [_vm.prefixCls + "-header-inner"] },
  53641. [_vm._v(_vm._s(_vm.title))]
  53642. )
  53643. ]
  53644. })
  53645. ],
  53646. 2
  53647. )
  53648. : _vm._e(),
  53649. _vm._v(" "),
  53650. _c(
  53651. "div",
  53652. { class: [_vm.prefixCls + "-body"], style: _vm.styles },
  53653. [_vm._t("default")],
  53654. 2
  53655. )
  53656. ]),
  53657. _vm._v(" "),
  53658. _vm.draggable
  53659. ? _c(
  53660. "div",
  53661. {
  53662. staticClass: "ivu-drawer-drag",
  53663. class: {
  53664. "ivu-drawer-drag-left": _vm.placement === "left"
  53665. },
  53666. on: { mousedown: _vm.handleTriggerMousedown }
  53667. },
  53668. [
  53669. _vm._t("trigger", function() {
  53670. return [
  53671. _c(
  53672. "div",
  53673. { staticClass: "ivu-drawer-drag-move-trigger" },
  53674. [
  53675. _c(
  53676. "div",
  53677. {
  53678. staticClass:
  53679. "ivu-drawer-drag-move-trigger-point"
  53680. },
  53681. [_c("i"), _c("i"), _c("i"), _c("i"), _c("i")]
  53682. )
  53683. ]
  53684. )
  53685. ]
  53686. })
  53687. ],
  53688. 2
  53689. )
  53690. : _vm._e()
  53691. ]
  53692. )
  53693. ])
  53694. ],
  53695. 1
  53696. )
  53697. ],
  53698. 1
  53699. )
  53700. }
  53701. var staticRenderFns = []
  53702. render._withStripped = true
  53703. module.exports = { render: render, staticRenderFns: staticRenderFns }
  53704. if (false) {
  53705. module.hot.accept()
  53706. if (module.hot.data) {
  53707. require("vue-hot-reload-api") .rerender("data-v-37c31742", module.exports)
  53708. }
  53709. }
  53710. /***/ }),
  53711. /* 135 */
  53712. /***/ (function(module, exports, __webpack_require__) {
  53713. var render = function() {
  53714. var _vm = this
  53715. var _h = _vm.$createElement
  53716. var _c = _vm._self._c || _h
  53717. return _c(
  53718. "div",
  53719. { staticClass: "w-header" },
  53720. [
  53721. _vm.tabActive
  53722. ? _c("div", { staticClass: "w-header-row" }, [
  53723. _c(
  53724. "div",
  53725. { staticClass: "w-header-row-left" },
  53726. [
  53727. _c(
  53728. "Dropdown",
  53729. {
  53730. staticClass: "m768-show",
  53731. attrs: { trigger: "click", transfer: "" },
  53732. on: { "on-click": _vm.tabPage }
  53733. },
  53734. [
  53735. _c("Icon", {
  53736. staticClass: "dropdown-menu",
  53737. attrs: { type: "md-menu" }
  53738. }),
  53739. _vm._v(" "),
  53740. _c(
  53741. "DropdownMenu",
  53742. { attrs: { slot: "list" }, slot: "list" },
  53743. [
  53744. _c("DropdownItem", { attrs: { name: "todo" } }, [
  53745. _vm._v(_vm._s(_vm.$L("待办")))
  53746. ]),
  53747. _vm._v(" "),
  53748. _c("DropdownItem", { attrs: { name: "project" } }, [
  53749. _vm._v(_vm._s(_vm.$L("项目")))
  53750. ]),
  53751. _vm._v(" "),
  53752. _c("DropdownItem", { attrs: { name: "docs" } }, [
  53753. _vm._v(_vm._s(_vm.$L("知识库")))
  53754. ]),
  53755. _vm._v(" "),
  53756. _c("DropdownItem", { attrs: { name: "team" } }, [
  53757. _vm._v(_vm._s(_vm.$L("团队")))
  53758. ])
  53759. ],
  53760. 1
  53761. )
  53762. ],
  53763. 1
  53764. ),
  53765. _vm._v(" "),
  53766. _c("ul", { staticClass: "m768-hide" }, [
  53767. _c(
  53768. "li",
  53769. { class: _vm.tabActive === "todo" ? "active" : "" },
  53770. [
  53771. _c(
  53772. "a",
  53773. {
  53774. attrs: { href: "javascript:void(0)" },
  53775. on: {
  53776. click: function($event) {
  53777. return _vm.tabPage("todo")
  53778. }
  53779. }
  53780. },
  53781. [
  53782. _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
  53783. _vm._v(_vm._s(_vm.$L("待办")))
  53784. ]
  53785. )
  53786. ]
  53787. ),
  53788. _c(
  53789. "li",
  53790. { class: _vm.tabActive === "project" ? "active" : "" },
  53791. [
  53792. _c(
  53793. "a",
  53794. {
  53795. attrs: { href: "javascript:void(0)" },
  53796. on: {
  53797. click: function($event) {
  53798. return _vm.tabPage("project")
  53799. }
  53800. }
  53801. },
  53802. [
  53803. _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
  53804. _vm._v(_vm._s(_vm.$L("项目")))
  53805. ]
  53806. )
  53807. ]
  53808. ),
  53809. _c(
  53810. "li",
  53811. { class: _vm.tabActive === "docs" ? "active" : "" },
  53812. [
  53813. _c(
  53814. "a",
  53815. {
  53816. attrs: { href: "javascript:void(0)" },
  53817. on: {
  53818. click: function($event) {
  53819. return _vm.tabPage("docs")
  53820. }
  53821. }
  53822. },
  53823. [
  53824. _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
  53825. _vm._v(_vm._s(_vm.$L("知识库")))
  53826. ]
  53827. )
  53828. ]
  53829. ),
  53830. _c(
  53831. "li",
  53832. { class: _vm.tabActive === "team" ? "active" : "" },
  53833. [
  53834. _c(
  53835. "a",
  53836. {
  53837. attrs: { href: "javascript:void(0)" },
  53838. on: {
  53839. click: function($event) {
  53840. return _vm.tabPage("team")
  53841. }
  53842. }
  53843. },
  53844. [
  53845. _c("i", { staticClass: "ft icon" }, [_vm._v("")]),
  53846. _vm._v(_vm._s(_vm.$L("团队")))
  53847. ]
  53848. )
  53849. ]
  53850. )
  53851. ])
  53852. ],
  53853. 1
  53854. ),
  53855. _vm._v(" "),
  53856. _c(
  53857. "div",
  53858. { staticClass: "w-header-row-right" },
  53859. [
  53860. _c(
  53861. "Dropdown",
  53862. {
  53863. staticClass: "right-info",
  53864. attrs: {
  53865. trigger: "click",
  53866. placement: "bottom-end",
  53867. transfer: ""
  53868. },
  53869. on: { "on-click": _vm.setRightSelect }
  53870. },
  53871. [
  53872. _c(
  53873. "div",
  53874. [
  53875. _c("UserImg", {
  53876. staticClass: "userimg",
  53877. attrs: { info: _vm.usrInfo }
  53878. }),
  53879. _vm._v(" "),
  53880. _c("span", { staticClass: "username" }, [
  53881. _vm._v(
  53882. _vm._s(_vm.$L("欢迎您")) +
  53883. ", " +
  53884. _vm._s(
  53885. _vm.usrInfo.nickname ||
  53886. _vm.usrInfo.username ||
  53887. _vm.$L("尊敬的会员")
  53888. )
  53889. )
  53890. ]),
  53891. _vm._v(" "),
  53892. _c("Icon", { attrs: { type: "md-arrow-dropdown" } })
  53893. ],
  53894. 1
  53895. ),
  53896. _vm._v(" "),
  53897. _c(
  53898. "Dropdown-menu",
  53899. { attrs: { slot: "list" }, slot: "list" },
  53900. [
  53901. _vm.isAdmin
  53902. ? _c("Dropdown-item", { attrs: { name: "system" } }, [
  53903. _vm._v(_vm._s(_vm.$L("系统设置")))
  53904. ])
  53905. : _vm._e(),
  53906. _vm._v(" "),
  53907. _c("Dropdown-item", { attrs: { name: "user" } }, [
  53908. _vm._v(_vm._s(_vm.$L("个人中心")))
  53909. ]),
  53910. _vm._v(" "),
  53911. _c("Dropdown-item", { attrs: { name: "out" } }, [
  53912. _vm._v(_vm._s(_vm.$L("退出登录")))
  53913. ])
  53914. ],
  53915. 1
  53916. )
  53917. ],
  53918. 1
  53919. ),
  53920. _vm._v(" "),
  53921. _c(
  53922. "div",
  53923. {
  53924. staticClass: "right-info",
  53925. on: {
  53926. click: function($event) {
  53927. _vm.chatDrawerShow = true
  53928. }
  53929. }
  53930. },
  53931. [
  53932. _c("Icon", {
  53933. staticClass: "right-mticon-9",
  53934. attrs: { type: "md-text", size: "24" }
  53935. }),
  53936. _vm._v(" "),
  53937. _vm.chatUnreadTotal > 0
  53938. ? _c("em", { staticClass: "right-info-num" }, [
  53939. _vm._v(
  53940. _vm._s(
  53941. _vm.chatUnreadTotal > 99
  53942. ? "99+"
  53943. : _vm.chatUnreadTotal
  53944. )
  53945. )
  53946. ])
  53947. : _vm._e()
  53948. ],
  53949. 1
  53950. ),
  53951. _vm._v(" "),
  53952. _c(
  53953. "Dropdown",
  53954. {
  53955. staticClass: "right-info",
  53956. attrs: { trigger: "click", transfer: "" },
  53957. on: { "on-click": _vm.setLanguage }
  53958. },
  53959. [
  53960. _c(
  53961. "div",
  53962. [
  53963. _c("Icon", {
  53964. staticClass: "right-mticon",
  53965. attrs: { type: "md-globe", size: "24" }
  53966. }),
  53967. _vm._v(" "),
  53968. _c("Icon", { attrs: { type: "md-arrow-dropdown" } })
  53969. ],
  53970. 1
  53971. ),
  53972. _vm._v(" "),
  53973. _c(
  53974. "Dropdown-menu",
  53975. { attrs: { slot: "list" }, slot: "list" },
  53976. [
  53977. _c(
  53978. "Dropdown-item",
  53979. {
  53980. attrs: {
  53981. name: "zh",
  53982. selected: _vm.getLanguage() === "zh"
  53983. }
  53984. },
  53985. [_vm._v("中文")]
  53986. ),
  53987. _vm._v(" "),
  53988. _c(
  53989. "Dropdown-item",
  53990. {
  53991. attrs: {
  53992. name: "en",
  53993. selected: _vm.getLanguage() === "en"
  53994. }
  53995. },
  53996. [_vm._v("English")]
  53997. )
  53998. ],
  53999. 1
  54000. )
  54001. ],
  54002. 1
  54003. )
  54004. ],
  54005. 1
  54006. )
  54007. ])
  54008. : _vm._e(),
  54009. _vm._v(" "),
  54010. _c(
  54011. "WDrawer",
  54012. {
  54013. attrs: { maxWidth: "640", title: _vm.$L("系统设置") },
  54014. model: {
  54015. value: _vm.systemDrawerShow,
  54016. callback: function($$v) {
  54017. _vm.systemDrawerShow = $$v
  54018. },
  54019. expression: "systemDrawerShow"
  54020. }
  54021. },
  54022. [
  54023. _c(
  54024. "Form",
  54025. {
  54026. ref: "formSystem",
  54027. attrs: { model: _vm.formSystem, "label-width": 150 },
  54028. nativeOn: {
  54029. submit: function($event) {
  54030. $event.preventDefault()
  54031. }
  54032. }
  54033. },
  54034. [
  54035. _c(
  54036. "FormItem",
  54037. { attrs: { label: _vm.$L("首页Logo") } },
  54038. [
  54039. _c("ImgUpload", {
  54040. attrs: { num: 1 },
  54041. model: {
  54042. value: _vm.formSystem.logo,
  54043. callback: function($$v) {
  54044. _vm.$set(_vm.formSystem, "logo", $$v)
  54045. },
  54046. expression: "formSystem.logo"
  54047. }
  54048. }),
  54049. _vm._v(" "),
  54050. _c("span", { staticStyle: { color: "#777" } }, [
  54051. _vm._v(_vm._s(_vm.$L("建议尺寸:%", "300x52")))
  54052. ])
  54053. ],
  54054. 1
  54055. ),
  54056. _vm._v(" "),
  54057. _c(
  54058. "FormItem",
  54059. { attrs: { label: _vm.$L("Github/Gitee图标") } },
  54060. [
  54061. _c(
  54062. "RadioGroup",
  54063. {
  54064. model: {
  54065. value: _vm.formSystem.github,
  54066. callback: function($$v) {
  54067. _vm.$set(_vm.formSystem, "github", $$v)
  54068. },
  54069. expression: "formSystem.github"
  54070. }
  54071. },
  54072. [
  54073. _c("Radio", { attrs: { label: "show" } }, [
  54074. _vm._v(_vm._s(_vm.$L("显示")))
  54075. ]),
  54076. _vm._v(" "),
  54077. _c("Radio", { attrs: { label: "hidden" } }, [
  54078. _vm._v(_vm._s(_vm.$L("隐藏")))
  54079. ])
  54080. ],
  54081. 1
  54082. )
  54083. ],
  54084. 1
  54085. ),
  54086. _vm._v(" "),
  54087. _c(
  54088. "FormItem",
  54089. { attrs: { label: _vm.$L("允许注册") } },
  54090. [
  54091. _c(
  54092. "RadioGroup",
  54093. {
  54094. model: {
  54095. value: _vm.formSystem.reg,
  54096. callback: function($$v) {
  54097. _vm.$set(_vm.formSystem, "reg", $$v)
  54098. },
  54099. expression: "formSystem.reg"
  54100. }
  54101. },
  54102. [
  54103. _c("Radio", { attrs: { label: "open" } }, [
  54104. _vm._v(_vm._s(_vm.$L("允许")))
  54105. ]),
  54106. _vm._v(" "),
  54107. _c("Radio", { attrs: { label: "close" } }, [
  54108. _vm._v(_vm._s(_vm.$L("禁止")))
  54109. ])
  54110. ],
  54111. 1
  54112. )
  54113. ],
  54114. 1
  54115. ),
  54116. _vm._v(" "),
  54117. _c(
  54118. "FormItem",
  54119. { attrs: { label: _vm.$L("音视频通话") } },
  54120. [
  54121. _c(
  54122. "RadioGroup",
  54123. {
  54124. model: {
  54125. value: _vm.formSystem.callav,
  54126. callback: function($$v) {
  54127. _vm.$set(_vm.formSystem, "callav", $$v)
  54128. },
  54129. expression: "formSystem.callav"
  54130. }
  54131. },
  54132. [
  54133. _c("Radio", { attrs: { label: "open" } }, [
  54134. _vm._v(_vm._s(_vm.$L("开启")))
  54135. ]),
  54136. _vm._v(" "),
  54137. _c("Radio", { attrs: { label: "close" } }, [
  54138. _vm._v(_vm._s(_vm.$L("关闭")))
  54139. ])
  54140. ],
  54141. 1
  54142. )
  54143. ],
  54144. 1
  54145. ),
  54146. _vm._v(" "),
  54147. _c(
  54148. "FormItem",
  54149. { attrs: { label: _vm.$L("完成自动归档") } },
  54150. [
  54151. _c(
  54152. "RadioGroup",
  54153. {
  54154. attrs: { value: _vm.formSystem.autoArchived },
  54155. on: { "on-change": _vm.formArchived }
  54156. },
  54157. [
  54158. _c("Radio", { attrs: { label: "open" } }, [
  54159. _vm._v(_vm._s(_vm.$L("开启")))
  54160. ]),
  54161. _vm._v(" "),
  54162. _c("Radio", { attrs: { label: "close" } }, [
  54163. _vm._v(_vm._s(_vm.$L("关闭")))
  54164. ])
  54165. ],
  54166. 1
  54167. ),
  54168. _vm._v(" "),
  54169. _vm.formSystem.autoArchived == "open"
  54170. ? _c(
  54171. "Tooltip",
  54172. {
  54173. staticClass: "setting-auto-day",
  54174. attrs: { placement: "right" }
  54175. },
  54176. [
  54177. _c(
  54178. "Input",
  54179. {
  54180. attrs: { type: "number" },
  54181. model: {
  54182. value: _vm.formSystem.archivedDay,
  54183. callback: function($$v) {
  54184. _vm.$set(_vm.formSystem, "archivedDay", $$v)
  54185. },
  54186. expression: "formSystem.archivedDay"
  54187. }
  54188. },
  54189. [
  54190. _c(
  54191. "span",
  54192. { attrs: { slot: "append" }, slot: "append" },
  54193. [_vm._v(_vm._s(_vm.$L("天")))]
  54194. )
  54195. ]
  54196. ),
  54197. _vm._v(" "),
  54198. _c(
  54199. "div",
  54200. { attrs: { slot: "content" }, slot: "content" },
  54201. [
  54202. _vm._v(
  54203. _vm._s(
  54204. _vm.$L(
  54205. "任务完成 % 天后自动归档。",
  54206. _vm.formSystem.archivedDay
  54207. )
  54208. )
  54209. )
  54210. ]
  54211. )
  54212. ],
  54213. 1
  54214. )
  54215. : _vm._e()
  54216. ],
  54217. 1
  54218. ),
  54219. _vm._v(" "),
  54220. _c(
  54221. "FormItem",
  54222. [
  54223. _c(
  54224. "Button",
  54225. {
  54226. attrs: { loading: _vm.loadIng > 0, type: "primary" },
  54227. on: {
  54228. click: function($event) {
  54229. return _vm.handleSubmit("formSystem")
  54230. }
  54231. }
  54232. },
  54233. [_vm._v(_vm._s(_vm.$L("提交")))]
  54234. ),
  54235. _vm._v(" "),
  54236. _c(
  54237. "Button",
  54238. {
  54239. staticStyle: { "margin-left": "8px" },
  54240. attrs: { loading: _vm.loadIng > 0 },
  54241. on: {
  54242. click: function($event) {
  54243. return _vm.handleReset("formSystem")
  54244. }
  54245. }
  54246. },
  54247. [_vm._v(_vm._s(_vm.$L("重置")))]
  54248. )
  54249. ],
  54250. 1
  54251. )
  54252. ],
  54253. 1
  54254. )
  54255. ],
  54256. 1
  54257. ),
  54258. _vm._v(" "),
  54259. _c(
  54260. "WDrawer",
  54261. {
  54262. attrs: { maxWidth: "1000" },
  54263. model: {
  54264. value: _vm.userDrawerShow,
  54265. callback: function($$v) {
  54266. _vm.userDrawerShow = $$v
  54267. },
  54268. expression: "userDrawerShow"
  54269. }
  54270. },
  54271. [
  54272. _c(
  54273. "Tabs",
  54274. {
  54275. model: {
  54276. value: _vm.userDrawerTab,
  54277. callback: function($$v) {
  54278. _vm.userDrawerTab = $$v
  54279. },
  54280. expression: "userDrawerTab"
  54281. }
  54282. },
  54283. [
  54284. _c(
  54285. "TabPane",
  54286. { attrs: { label: _vm.$L("个人资料"), name: "personal" } },
  54287. [
  54288. _c(
  54289. "Form",
  54290. {
  54291. ref: "formDatum",
  54292. attrs: {
  54293. model: _vm.formDatum,
  54294. rules: _vm.ruleDatum,
  54295. "label-width": 80
  54296. },
  54297. nativeOn: {
  54298. submit: function($event) {
  54299. $event.preventDefault()
  54300. }
  54301. }
  54302. },
  54303. [
  54304. _c(
  54305. "FormItem",
  54306. { attrs: { label: _vm.$L("头像"), prop: "userimg" } },
  54307. [
  54308. _c("ImgUpload", {
  54309. attrs: { num: 1 },
  54310. model: {
  54311. value: _vm.formDatum.userimg,
  54312. callback: function($$v) {
  54313. _vm.$set(_vm.formDatum, "userimg", $$v)
  54314. },
  54315. expression: "formDatum.userimg"
  54316. }
  54317. }),
  54318. _vm._v(" "),
  54319. _c("span", { staticStyle: { color: "#777" } }, [
  54320. _vm._v(_vm._s(_vm.$L("建议尺寸:%", "200x200")))
  54321. ])
  54322. ],
  54323. 1
  54324. ),
  54325. _vm._v(" "),
  54326. _c(
  54327. "FormItem",
  54328. { attrs: { label: _vm.$L("账号") } },
  54329. [
  54330. _c("Input", {
  54331. attrs: { disabled: true },
  54332. model: {
  54333. value: _vm.usrInfo.username,
  54334. callback: function($$v) {
  54335. _vm.$set(_vm.usrInfo, "username", $$v)
  54336. },
  54337. expression: "usrInfo.username"
  54338. }
  54339. })
  54340. ],
  54341. 1
  54342. ),
  54343. _vm._v(" "),
  54344. _c(
  54345. "FormItem",
  54346. { attrs: { label: _vm.$L("昵称"), prop: "nickname" } },
  54347. [
  54348. _c("Input", {
  54349. model: {
  54350. value: _vm.formDatum.nickname,
  54351. callback: function($$v) {
  54352. _vm.$set(_vm.formDatum, "nickname", $$v)
  54353. },
  54354. expression: "formDatum.nickname"
  54355. }
  54356. })
  54357. ],
  54358. 1
  54359. ),
  54360. _vm._v(" "),
  54361. _c(
  54362. "FormItem",
  54363. {
  54364. attrs: {
  54365. label: _vm.$L("职位/职称"),
  54366. prop: "profession"
  54367. }
  54368. },
  54369. [
  54370. _c("Input", {
  54371. model: {
  54372. value: _vm.formDatum.profession,
  54373. callback: function($$v) {
  54374. _vm.$set(_vm.formDatum, "profession", $$v)
  54375. },
  54376. expression: "formDatum.profession"
  54377. }
  54378. })
  54379. ],
  54380. 1
  54381. ),
  54382. _vm._v(" "),
  54383. _c(
  54384. "FormItem",
  54385. [
  54386. _c(
  54387. "Button",
  54388. {
  54389. attrs: {
  54390. loading: _vm.loadIng > 0,
  54391. type: "primary"
  54392. },
  54393. on: {
  54394. click: function($event) {
  54395. return _vm.handleSubmit("formDatum")
  54396. }
  54397. }
  54398. },
  54399. [_vm._v(_vm._s(_vm.$L("提交")))]
  54400. ),
  54401. _vm._v(" "),
  54402. _c(
  54403. "Button",
  54404. {
  54405. staticStyle: { "margin-left": "8px" },
  54406. attrs: { loading: _vm.loadIng > 0 },
  54407. on: {
  54408. click: function($event) {
  54409. return _vm.handleReset("formDatum")
  54410. }
  54411. }
  54412. },
  54413. [_vm._v(_vm._s(_vm.$L("重置")))]
  54414. )
  54415. ],
  54416. 1
  54417. )
  54418. ],
  54419. 1
  54420. )
  54421. ],
  54422. 1
  54423. ),
  54424. _vm._v(" "),
  54425. _c(
  54426. "TabPane",
  54427. { attrs: { label: _vm.$L("偏好设置"), name: "setting" } },
  54428. [
  54429. _c(
  54430. "Form",
  54431. {
  54432. ref: "formSetting",
  54433. attrs: { model: _vm.formSetting, "label-width": 100 },
  54434. nativeOn: {
  54435. submit: function($event) {
  54436. $event.preventDefault()
  54437. }
  54438. }
  54439. },
  54440. [
  54441. _c(
  54442. "FormItem",
  54443. { attrs: { label: _vm.$L("系统皮肤"), prop: "bgid" } },
  54444. [
  54445. _c(
  54446. "ul",
  54447. { staticClass: "setting-bg" },
  54448. _vm._l(
  54449. [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
  54450. function(i) {
  54451. return _c("li", {
  54452. key: i,
  54453. class: { active: _vm.formSetting.bgid == i },
  54454. style:
  54455. "background-image:" + _vm.getBgUrl(i, true),
  54456. on: {
  54457. click: function($event) {
  54458. _vm.formSetting.bgid = i
  54459. }
  54460. }
  54461. })
  54462. }
  54463. ),
  54464. 0
  54465. )
  54466. ]
  54467. ),
  54468. _vm._v(" "),
  54469. _c(
  54470. "FormItem",
  54471. [
  54472. _c(
  54473. "Button",
  54474. {
  54475. attrs: {
  54476. loading: _vm.loadIng > 0,
  54477. type: "primary"
  54478. },
  54479. on: {
  54480. click: function($event) {
  54481. return _vm.handleSubmit("formSetting")
  54482. }
  54483. }
  54484. },
  54485. [_vm._v(_vm._s(_vm.$L("提交")))]
  54486. ),
  54487. _vm._v(" "),
  54488. _c(
  54489. "Button",
  54490. {
  54491. staticStyle: { "margin-left": "8px" },
  54492. attrs: { loading: _vm.loadIng > 0 },
  54493. on: {
  54494. click: function($event) {
  54495. return _vm.handleReset("formSetting")
  54496. }
  54497. }
  54498. },
  54499. [_vm._v(_vm._s(_vm.$L("重置")))]
  54500. )
  54501. ],
  54502. 1
  54503. )
  54504. ],
  54505. 1
  54506. )
  54507. ],
  54508. 1
  54509. ),
  54510. _vm._v(" "),
  54511. _c(
  54512. "TabPane",
  54513. { attrs: { label: _vm.$L("账号密码"), name: "account" } },
  54514. [
  54515. _vm.usrInfo.changepass
  54516. ? _c(
  54517. "Alert",
  54518. { attrs: { type: "warning", showIcon: "" } },
  54519. [_vm._v(_vm._s(_vm.$L("请先修改登录密码!")))]
  54520. )
  54521. : _vm._e(),
  54522. _vm._v(" "),
  54523. _c(
  54524. "Form",
  54525. {
  54526. ref: "formPass",
  54527. attrs: {
  54528. model: _vm.formPass,
  54529. rules: _vm.rulePass,
  54530. "label-width": 100
  54531. },
  54532. nativeOn: {
  54533. submit: function($event) {
  54534. $event.preventDefault()
  54535. }
  54536. }
  54537. },
  54538. [
  54539. _c(
  54540. "FormItem",
  54541. { attrs: { label: _vm.$L("旧密码"), prop: "oldpass" } },
  54542. [
  54543. _c("Input", {
  54544. attrs: { type: "password" },
  54545. model: {
  54546. value: _vm.formPass.oldpass,
  54547. callback: function($$v) {
  54548. _vm.$set(_vm.formPass, "oldpass", $$v)
  54549. },
  54550. expression: "formPass.oldpass"
  54551. }
  54552. })
  54553. ],
  54554. 1
  54555. ),
  54556. _vm._v(" "),
  54557. _c(
  54558. "FormItem",
  54559. { attrs: { label: _vm.$L("新密码"), prop: "newpass" } },
  54560. [
  54561. _c("Input", {
  54562. attrs: { type: "password" },
  54563. model: {
  54564. value: _vm.formPass.newpass,
  54565. callback: function($$v) {
  54566. _vm.$set(_vm.formPass, "newpass", $$v)
  54567. },
  54568. expression: "formPass.newpass"
  54569. }
  54570. })
  54571. ],
  54572. 1
  54573. ),
  54574. _vm._v(" "),
  54575. _c(
  54576. "FormItem",
  54577. {
  54578. attrs: {
  54579. label: _vm.$L("确认新密码"),
  54580. prop: "checkpass"
  54581. }
  54582. },
  54583. [
  54584. _c("Input", {
  54585. attrs: { type: "password" },
  54586. model: {
  54587. value: _vm.formPass.checkpass,
  54588. callback: function($$v) {
  54589. _vm.$set(_vm.formPass, "checkpass", $$v)
  54590. },
  54591. expression: "formPass.checkpass"
  54592. }
  54593. })
  54594. ],
  54595. 1
  54596. ),
  54597. _vm._v(" "),
  54598. _c(
  54599. "FormItem",
  54600. [
  54601. _c(
  54602. "Button",
  54603. {
  54604. attrs: {
  54605. loading: _vm.loadIng > 0,
  54606. type: "primary"
  54607. },
  54608. on: {
  54609. click: function($event) {
  54610. return _vm.handleSubmit("formPass")
  54611. }
  54612. }
  54613. },
  54614. [_vm._v(_vm._s(_vm.$L("提交")))]
  54615. ),
  54616. _vm._v(" "),
  54617. _c(
  54618. "Button",
  54619. {
  54620. staticStyle: { "margin-left": "8px" },
  54621. attrs: { loading: _vm.loadIng > 0 },
  54622. on: {
  54623. click: function($event) {
  54624. return _vm.handleReset("formPass")
  54625. }
  54626. }
  54627. },
  54628. [_vm._v(_vm._s(_vm.$L("重置")))]
  54629. )
  54630. ],
  54631. 1
  54632. )
  54633. ],
  54634. 1
  54635. )
  54636. ],
  54637. 1
  54638. ),
  54639. _vm._v(" "),
  54640. _c(
  54641. "TabPane",
  54642. {
  54643. attrs: { label: _vm.$L("我创建的任务"), name: "createtask" }
  54644. },
  54645. [
  54646. _c("header-create", {
  54647. attrs: {
  54648. canload:
  54649. _vm.userDrawerShow && _vm.userDrawerTab == "createtask"
  54650. }
  54651. })
  54652. ],
  54653. 1
  54654. ),
  54655. _vm._v(" "),
  54656. _c(
  54657. "TabPane",
  54658. {
  54659. attrs: { label: _vm.$L("我归档的任务"), name: "archivedtask" }
  54660. },
  54661. [
  54662. _c("header-archived", {
  54663. attrs: {
  54664. canload:
  54665. _vm.userDrawerShow &&
  54666. _vm.userDrawerTab == "archivedtask"
  54667. }
  54668. })
  54669. ],
  54670. 1
  54671. )
  54672. ],
  54673. 1
  54674. )
  54675. ],
  54676. 1
  54677. ),
  54678. _vm._v(" "),
  54679. _c(
  54680. "WDrawer",
  54681. {
  54682. staticClass: "w-header-chat-draver",
  54683. attrs: { closable: false, maxWidth: "1080" },
  54684. model: {
  54685. value: _vm.chatDrawerShow,
  54686. callback: function($$v) {
  54687. _vm.chatDrawerShow = $$v
  54688. },
  54689. expression: "chatDrawerShow"
  54690. }
  54691. },
  54692. [
  54693. _c("chat-index", {
  54694. attrs: { openWindow: _vm.chatDrawerShow },
  54695. on: {
  54696. "on-open-notice": function($event) {
  54697. _vm.chatDrawerShow = true
  54698. }
  54699. },
  54700. model: {
  54701. value: _vm.chatUnreadTotal,
  54702. callback: function($$v) {
  54703. _vm.chatUnreadTotal = $$v
  54704. },
  54705. expression: "chatUnreadTotal"
  54706. }
  54707. }),
  54708. _vm._v(" "),
  54709. _c(
  54710. "div",
  54711. {
  54712. staticClass: "w-header-chat-close",
  54713. on: {
  54714. click: function($event) {
  54715. _vm.chatDrawerShow = false
  54716. }
  54717. }
  54718. },
  54719. [_c("Icon", { attrs: { type: "ios-close" } })],
  54720. 1
  54721. )
  54722. ],
  54723. 1
  54724. )
  54725. ],
  54726. 1
  54727. )
  54728. }
  54729. var staticRenderFns = []
  54730. render._withStripped = true
  54731. module.exports = { render: render, staticRenderFns: staticRenderFns }
  54732. if (false) {
  54733. module.hot.accept()
  54734. if (module.hot.data) {
  54735. require("vue-hot-reload-api") .rerender("data-v-2df6db1f", module.exports)
  54736. }
  54737. }
  54738. /***/ }),
  54739. /* 136 */
  54740. /***/ (function(module, exports, __webpack_require__) {
  54741. var render = function() {
  54742. var _vm = this
  54743. var _h = _vm.$createElement
  54744. var _c = _vm._self._c || _h
  54745. return _c(
  54746. "div",
  54747. { attrs: { id: "app" } },
  54748. [
  54749. _c("w-header"),
  54750. _vm._v(" "),
  54751. _c(
  54752. "transition",
  54753. { attrs: { name: _vm.transitionName } },
  54754. [
  54755. _c(
  54756. "keep-alive",
  54757. [_c("router-view", { staticClass: "child-view" })],
  54758. 1
  54759. )
  54760. ],
  54761. 1
  54762. ),
  54763. _vm._v(" "),
  54764. _c("w-spinner")
  54765. ],
  54766. 1
  54767. )
  54768. }
  54769. var staticRenderFns = []
  54770. render._withStripped = true
  54771. module.exports = { render: render, staticRenderFns: staticRenderFns }
  54772. if (false) {
  54773. module.hot.accept()
  54774. if (module.hot.data) {
  54775. require("vue-hot-reload-api") .rerender("data-v-0fbb5d46", module.exports)
  54776. }
  54777. }
  54778. /***/ }),
  54779. /* 137 */
  54780. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54781. "use strict";
  54782. /* harmony default export */ __webpack_exports__["a"] = ([{
  54783. path: '/',
  54784. name: 'index',
  54785. component: function component(resolve) {
  54786. return __webpack_require__.e/* require */(8).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(288)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54787. }
  54788. }, {
  54789. path: '/ding',
  54790. name: 'ding',
  54791. component: function component(resolve) {
  54792. return __webpack_require__.e/* require */(1).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(289)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54793. }
  54794. }, {
  54795. path: '/todo',
  54796. name: 'todo',
  54797. meta: { slide: false, tabActive: 'todo' },
  54798. component: function component(resolve) {
  54799. return __webpack_require__.e/* require */(3).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(290)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54800. }
  54801. }, {
  54802. path: '/project',
  54803. name: 'project',
  54804. meta: { slide: false, tabActive: 'project' },
  54805. component: function component(resolve) {
  54806. return __webpack_require__.e/* require */(0/* duplicate */).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(57)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54807. }
  54808. }, {
  54809. path: '/project/pid/:pid',
  54810. name: 'project-pid',
  54811. meta: { slide: false, tabActive: 'project' },
  54812. component: function component(resolve) {
  54813. return __webpack_require__.e/* require */(0/* duplicate */).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(57)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54814. }
  54815. }, {
  54816. path: '/project/panel/:projectid',
  54817. name: 'project-panel',
  54818. meta: { slide: false, tabActive: 'project' },
  54819. component: function component(resolve) {
  54820. return __webpack_require__.e/* require */(2).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(291)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54821. }
  54822. }, {
  54823. path: '/docs',
  54824. name: 'docs',
  54825. meta: { slide: false, tabActive: 'docs' },
  54826. component: function component(resolve) {
  54827. return __webpack_require__.e/* require */(6).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(292)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54828. }
  54829. }, {
  54830. path: '/docs/edit/:sid',
  54831. name: 'docs-edit',
  54832. meta: { slide: false },
  54833. component: function component(resolve) {
  54834. return __webpack_require__.e/* require */(5).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(293)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54835. }
  54836. }, {
  54837. path: '/docs/view/:sid',
  54838. name: 'docs-view',
  54839. meta: { slide: false },
  54840. component: function component(resolve) {
  54841. return __webpack_require__.e/* require */(4).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(294)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54842. }
  54843. }, {
  54844. path: '/team',
  54845. name: 'team',
  54846. meta: { slide: false, tabActive: 'team' },
  54847. component: function component(resolve) {
  54848. return __webpack_require__.e/* require */(7).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(295)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54849. }
  54850. }, {
  54851. path: '*',
  54852. name: '404',
  54853. component: function component(resolve) {
  54854. return __webpack_require__.e/* require */(9).then(function() { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(296)]; ((resolve).apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}.bind(this)).catch(__webpack_require__.oe);
  54855. }
  54856. }]);
  54857. /***/ }),
  54858. /* 138 */
  54859. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  54860. "use strict";
  54861. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  54862. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MultiDrag", function() { return MultiDragPlugin; });
  54863. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Sortable", function() { return Sortable; });
  54864. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Swap", function() { return SwapPlugin; });
  54865. /**!
  54866. * Sortable 1.10.2
  54867. * @author RubaXa <trash@rubaxa.org>
  54868. * @author owenm <owen23355@gmail.com>
  54869. * @license MIT
  54870. */
  54871. function _typeof(obj) {
  54872. if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
  54873. _typeof = function (obj) {
  54874. return typeof obj;
  54875. };
  54876. } else {
  54877. _typeof = function (obj) {
  54878. return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  54879. };
  54880. }
  54881. return _typeof(obj);
  54882. }
  54883. function _defineProperty(obj, key, value) {
  54884. if (key in obj) {
  54885. Object.defineProperty(obj, key, {
  54886. value: value,
  54887. enumerable: true,
  54888. configurable: true,
  54889. writable: true
  54890. });
  54891. } else {
  54892. obj[key] = value;
  54893. }
  54894. return obj;
  54895. }
  54896. function _extends() {
  54897. _extends = Object.assign || function (target) {
  54898. for (var i = 1; i < arguments.length; i++) {
  54899. var source = arguments[i];
  54900. for (var key in source) {
  54901. if (Object.prototype.hasOwnProperty.call(source, key)) {
  54902. target[key] = source[key];
  54903. }
  54904. }
  54905. }
  54906. return target;
  54907. };
  54908. return _extends.apply(this, arguments);
  54909. }
  54910. function _objectSpread(target) {
  54911. for (var i = 1; i < arguments.length; i++) {
  54912. var source = arguments[i] != null ? arguments[i] : {};
  54913. var ownKeys = Object.keys(source);
  54914. if (typeof Object.getOwnPropertySymbols === 'function') {
  54915. ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
  54916. return Object.getOwnPropertyDescriptor(source, sym).enumerable;
  54917. }));
  54918. }
  54919. ownKeys.forEach(function (key) {
  54920. _defineProperty(target, key, source[key]);
  54921. });
  54922. }
  54923. return target;
  54924. }
  54925. function _objectWithoutPropertiesLoose(source, excluded) {
  54926. if (source == null) return {};
  54927. var target = {};
  54928. var sourceKeys = Object.keys(source);
  54929. var key, i;
  54930. for (i = 0; i < sourceKeys.length; i++) {
  54931. key = sourceKeys[i];
  54932. if (excluded.indexOf(key) >= 0) continue;
  54933. target[key] = source[key];
  54934. }
  54935. return target;
  54936. }
  54937. function _objectWithoutProperties(source, excluded) {
  54938. if (source == null) return {};
  54939. var target = _objectWithoutPropertiesLoose(source, excluded);
  54940. var key, i;
  54941. if (Object.getOwnPropertySymbols) {
  54942. var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
  54943. for (i = 0; i < sourceSymbolKeys.length; i++) {
  54944. key = sourceSymbolKeys[i];
  54945. if (excluded.indexOf(key) >= 0) continue;
  54946. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
  54947. target[key] = source[key];
  54948. }
  54949. }
  54950. return target;
  54951. }
  54952. function _toConsumableArray(arr) {
  54953. return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
  54954. }
  54955. function _arrayWithoutHoles(arr) {
  54956. if (Array.isArray(arr)) {
  54957. for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  54958. return arr2;
  54959. }
  54960. }
  54961. function _iterableToArray(iter) {
  54962. if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
  54963. }
  54964. function _nonIterableSpread() {
  54965. throw new TypeError("Invalid attempt to spread non-iterable instance");
  54966. }
  54967. var version = "1.10.2";
  54968. function userAgent(pattern) {
  54969. if (typeof window !== 'undefined' && window.navigator) {
  54970. return !!
  54971. /*@__PURE__*/
  54972. navigator.userAgent.match(pattern);
  54973. }
  54974. }
  54975. var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
  54976. var Edge = userAgent(/Edge/i);
  54977. var FireFox = userAgent(/firefox/i);
  54978. var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
  54979. var IOS = userAgent(/iP(ad|od|hone)/i);
  54980. var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
  54981. var captureMode = {
  54982. capture: false,
  54983. passive: false
  54984. };
  54985. function on(el, event, fn) {
  54986. el.addEventListener(event, fn, !IE11OrLess && captureMode);
  54987. }
  54988. function off(el, event, fn) {
  54989. el.removeEventListener(event, fn, !IE11OrLess && captureMode);
  54990. }
  54991. function matches(
  54992. /**HTMLElement*/
  54993. el,
  54994. /**String*/
  54995. selector) {
  54996. if (!selector) return;
  54997. selector[0] === '>' && (selector = selector.substring(1));
  54998. if (el) {
  54999. try {
  55000. if (el.matches) {
  55001. return el.matches(selector);
  55002. } else if (el.msMatchesSelector) {
  55003. return el.msMatchesSelector(selector);
  55004. } else if (el.webkitMatchesSelector) {
  55005. return el.webkitMatchesSelector(selector);
  55006. }
  55007. } catch (_) {
  55008. return false;
  55009. }
  55010. }
  55011. return false;
  55012. }
  55013. function getParentOrHost(el) {
  55014. return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
  55015. }
  55016. function closest(
  55017. /**HTMLElement*/
  55018. el,
  55019. /**String*/
  55020. selector,
  55021. /**HTMLElement*/
  55022. ctx, includeCTX) {
  55023. if (el) {
  55024. ctx = ctx || document;
  55025. do {
  55026. if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
  55027. return el;
  55028. }
  55029. if (el === ctx) break;
  55030. /* jshint boss:true */
  55031. } while (el = getParentOrHost(el));
  55032. }
  55033. return null;
  55034. }
  55035. var R_SPACE = /\s+/g;
  55036. function toggleClass(el, name, state) {
  55037. if (el && name) {
  55038. if (el.classList) {
  55039. el.classList[state ? 'add' : 'remove'](name);
  55040. } else {
  55041. var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
  55042. el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
  55043. }
  55044. }
  55045. }
  55046. function css(el, prop, val) {
  55047. var style = el && el.style;
  55048. if (style) {
  55049. if (val === void 0) {
  55050. if (document.defaultView && document.defaultView.getComputedStyle) {
  55051. val = document.defaultView.getComputedStyle(el, '');
  55052. } else if (el.currentStyle) {
  55053. val = el.currentStyle;
  55054. }
  55055. return prop === void 0 ? val : val[prop];
  55056. } else {
  55057. if (!(prop in style) && prop.indexOf('webkit') === -1) {
  55058. prop = '-webkit-' + prop;
  55059. }
  55060. style[prop] = val + (typeof val === 'string' ? '' : 'px');
  55061. }
  55062. }
  55063. }
  55064. function matrix(el, selfOnly) {
  55065. var appliedTransforms = '';
  55066. if (typeof el === 'string') {
  55067. appliedTransforms = el;
  55068. } else {
  55069. do {
  55070. var transform = css(el, 'transform');
  55071. if (transform && transform !== 'none') {
  55072. appliedTransforms = transform + ' ' + appliedTransforms;
  55073. }
  55074. /* jshint boss:true */
  55075. } while (!selfOnly && (el = el.parentNode));
  55076. }
  55077. var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  55078. /*jshint -W056 */
  55079. return matrixFn && new matrixFn(appliedTransforms);
  55080. }
  55081. function find(ctx, tagName, iterator) {
  55082. if (ctx) {
  55083. var list = ctx.getElementsByTagName(tagName),
  55084. i = 0,
  55085. n = list.length;
  55086. if (iterator) {
  55087. for (; i < n; i++) {
  55088. iterator(list[i], i);
  55089. }
  55090. }
  55091. return list;
  55092. }
  55093. return [];
  55094. }
  55095. function getWindowScrollingElement() {
  55096. var scrollingElement = document.scrollingElement;
  55097. if (scrollingElement) {
  55098. return scrollingElement;
  55099. } else {
  55100. return document.documentElement;
  55101. }
  55102. }
  55103. /**
  55104. * Returns the "bounding client rect" of given element
  55105. * @param {HTMLElement} el The element whose boundingClientRect is wanted
  55106. * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
  55107. * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
  55108. * @param {[Boolean]} undoScale Whether the container's scale() should be undone
  55109. * @param {[HTMLElement]} container The parent the element will be placed in
  55110. * @return {Object} The boundingClientRect of el, with specified adjustments
  55111. */
  55112. function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
  55113. if (!el.getBoundingClientRect && el !== window) return;
  55114. var elRect, top, left, bottom, right, height, width;
  55115. if (el !== window && el !== getWindowScrollingElement()) {
  55116. elRect = el.getBoundingClientRect();
  55117. top = elRect.top;
  55118. left = elRect.left;
  55119. bottom = elRect.bottom;
  55120. right = elRect.right;
  55121. height = elRect.height;
  55122. width = elRect.width;
  55123. } else {
  55124. top = 0;
  55125. left = 0;
  55126. bottom = window.innerHeight;
  55127. right = window.innerWidth;
  55128. height = window.innerHeight;
  55129. width = window.innerWidth;
  55130. }
  55131. if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
  55132. // Adjust for translate()
  55133. container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
  55134. // Not needed on <= IE11
  55135. if (!IE11OrLess) {
  55136. do {
  55137. if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
  55138. var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container
  55139. top -= containerRect.top + parseInt(css(container, 'border-top-width'));
  55140. left -= containerRect.left + parseInt(css(container, 'border-left-width'));
  55141. bottom = top + elRect.height;
  55142. right = left + elRect.width;
  55143. break;
  55144. }
  55145. /* jshint boss:true */
  55146. } while (container = container.parentNode);
  55147. }
  55148. }
  55149. if (undoScale && el !== window) {
  55150. // Adjust for scale()
  55151. var elMatrix = matrix(container || el),
  55152. scaleX = elMatrix && elMatrix.a,
  55153. scaleY = elMatrix && elMatrix.d;
  55154. if (elMatrix) {
  55155. top /= scaleY;
  55156. left /= scaleX;
  55157. width /= scaleX;
  55158. height /= scaleY;
  55159. bottom = top + height;
  55160. right = left + width;
  55161. }
  55162. }
  55163. return {
  55164. top: top,
  55165. left: left,
  55166. bottom: bottom,
  55167. right: right,
  55168. width: width,
  55169. height: height
  55170. };
  55171. }
  55172. /**
  55173. * Checks if a side of an element is scrolled past a side of its parents
  55174. * @param {HTMLElement} el The element who's side being scrolled out of view is in question
  55175. * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
  55176. * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
  55177. * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
  55178. */
  55179. function isScrolledPast(el, elSide, parentSide) {
  55180. var parent = getParentAutoScrollElement(el, true),
  55181. elSideVal = getRect(el)[elSide];
  55182. /* jshint boss:true */
  55183. while (parent) {
  55184. var parentSideVal = getRect(parent)[parentSide],
  55185. visible = void 0;
  55186. if (parentSide === 'top' || parentSide === 'left') {
  55187. visible = elSideVal >= parentSideVal;
  55188. } else {
  55189. visible = elSideVal <= parentSideVal;
  55190. }
  55191. if (!visible) return parent;
  55192. if (parent === getWindowScrollingElement()) break;
  55193. parent = getParentAutoScrollElement(parent, false);
  55194. }
  55195. return false;
  55196. }
  55197. /**
  55198. * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
  55199. * and non-draggable elements
  55200. * @param {HTMLElement} el The parent element
  55201. * @param {Number} childNum The index of the child
  55202. * @param {Object} options Parent Sortable's options
  55203. * @return {HTMLElement} The child at index childNum, or null if not found
  55204. */
  55205. function getChild(el, childNum, options) {
  55206. var currentChild = 0,
  55207. i = 0,
  55208. children = el.children;
  55209. while (i < children.length) {
  55210. if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {
  55211. if (currentChild === childNum) {
  55212. return children[i];
  55213. }
  55214. currentChild++;
  55215. }
  55216. i++;
  55217. }
  55218. return null;
  55219. }
  55220. /**
  55221. * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
  55222. * @param {HTMLElement} el Parent element
  55223. * @param {selector} selector Any other elements that should be ignored
  55224. * @return {HTMLElement} The last child, ignoring ghostEl
  55225. */
  55226. function lastChild(el, selector) {
  55227. var last = el.lastElementChild;
  55228. while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
  55229. last = last.previousElementSibling;
  55230. }
  55231. return last || null;
  55232. }
  55233. /**
  55234. * Returns the index of an element within its parent for a selected set of
  55235. * elements
  55236. * @param {HTMLElement} el
  55237. * @param {selector} selector
  55238. * @return {number}
  55239. */
  55240. function index(el, selector) {
  55241. var index = 0;
  55242. if (!el || !el.parentNode) {
  55243. return -1;
  55244. }
  55245. /* jshint boss:true */
  55246. while (el = el.previousElementSibling) {
  55247. if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
  55248. index++;
  55249. }
  55250. }
  55251. return index;
  55252. }
  55253. /**
  55254. * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
  55255. * The value is returned in real pixels.
  55256. * @param {HTMLElement} el
  55257. * @return {Array} Offsets in the format of [left, top]
  55258. */
  55259. function getRelativeScrollOffset(el) {
  55260. var offsetLeft = 0,
  55261. offsetTop = 0,
  55262. winScroller = getWindowScrollingElement();
  55263. if (el) {
  55264. do {
  55265. var elMatrix = matrix(el),
  55266. scaleX = elMatrix.a,
  55267. scaleY = elMatrix.d;
  55268. offsetLeft += el.scrollLeft * scaleX;
  55269. offsetTop += el.scrollTop * scaleY;
  55270. } while (el !== winScroller && (el = el.parentNode));
  55271. }
  55272. return [offsetLeft, offsetTop];
  55273. }
  55274. /**
  55275. * Returns the index of the object within the given array
  55276. * @param {Array} arr Array that may or may not hold the object
  55277. * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
  55278. * @return {Number} The index of the object in the array, or -1
  55279. */
  55280. function indexOfObject(arr, obj) {
  55281. for (var i in arr) {
  55282. if (!arr.hasOwnProperty(i)) continue;
  55283. for (var key in obj) {
  55284. if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
  55285. }
  55286. }
  55287. return -1;
  55288. }
  55289. function getParentAutoScrollElement(el, includeSelf) {
  55290. // skip to window
  55291. if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
  55292. var elem = el;
  55293. var gotSelf = false;
  55294. do {
  55295. // we don't need to get elem css if it isn't even overflowing in the first place (performance)
  55296. if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
  55297. var elemCSS = css(elem);
  55298. if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
  55299. if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
  55300. if (gotSelf || includeSelf) return elem;
  55301. gotSelf = true;
  55302. }
  55303. }
  55304. /* jshint boss:true */
  55305. } while (elem = elem.parentNode);
  55306. return getWindowScrollingElement();
  55307. }
  55308. function extend(dst, src) {
  55309. if (dst && src) {
  55310. for (var key in src) {
  55311. if (src.hasOwnProperty(key)) {
  55312. dst[key] = src[key];
  55313. }
  55314. }
  55315. }
  55316. return dst;
  55317. }
  55318. function isRectEqual(rect1, rect2) {
  55319. return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
  55320. }
  55321. var _throttleTimeout;
  55322. function throttle(callback, ms) {
  55323. return function () {
  55324. if (!_throttleTimeout) {
  55325. var args = arguments,
  55326. _this = this;
  55327. if (args.length === 1) {
  55328. callback.call(_this, args[0]);
  55329. } else {
  55330. callback.apply(_this, args);
  55331. }
  55332. _throttleTimeout = setTimeout(function () {
  55333. _throttleTimeout = void 0;
  55334. }, ms);
  55335. }
  55336. };
  55337. }
  55338. function cancelThrottle() {
  55339. clearTimeout(_throttleTimeout);
  55340. _throttleTimeout = void 0;
  55341. }
  55342. function scrollBy(el, x, y) {
  55343. el.scrollLeft += x;
  55344. el.scrollTop += y;
  55345. }
  55346. function clone(el) {
  55347. var Polymer = window.Polymer;
  55348. var $ = window.jQuery || window.Zepto;
  55349. if (Polymer && Polymer.dom) {
  55350. return Polymer.dom(el).cloneNode(true);
  55351. } else if ($) {
  55352. return $(el).clone(true)[0];
  55353. } else {
  55354. return el.cloneNode(true);
  55355. }
  55356. }
  55357. function setRect(el, rect) {
  55358. css(el, 'position', 'absolute');
  55359. css(el, 'top', rect.top);
  55360. css(el, 'left', rect.left);
  55361. css(el, 'width', rect.width);
  55362. css(el, 'height', rect.height);
  55363. }
  55364. function unsetRect(el) {
  55365. css(el, 'position', '');
  55366. css(el, 'top', '');
  55367. css(el, 'left', '');
  55368. css(el, 'width', '');
  55369. css(el, 'height', '');
  55370. }
  55371. var expando = 'Sortable' + new Date().getTime();
  55372. function AnimationStateManager() {
  55373. var animationStates = [],
  55374. animationCallbackId;
  55375. return {
  55376. captureAnimationState: function captureAnimationState() {
  55377. animationStates = [];
  55378. if (!this.options.animation) return;
  55379. var children = [].slice.call(this.el.children);
  55380. children.forEach(function (child) {
  55381. if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
  55382. animationStates.push({
  55383. target: child,
  55384. rect: getRect(child)
  55385. });
  55386. var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation
  55387. if (child.thisAnimationDuration) {
  55388. var childMatrix = matrix(child, true);
  55389. if (childMatrix) {
  55390. fromRect.top -= childMatrix.f;
  55391. fromRect.left -= childMatrix.e;
  55392. }
  55393. }
  55394. child.fromRect = fromRect;
  55395. });
  55396. },
  55397. addAnimationState: function addAnimationState(state) {
  55398. animationStates.push(state);
  55399. },
  55400. removeAnimationState: function removeAnimationState(target) {
  55401. animationStates.splice(indexOfObject(animationStates, {
  55402. target: target
  55403. }), 1);
  55404. },
  55405. animateAll: function animateAll(callback) {
  55406. var _this = this;
  55407. if (!this.options.animation) {
  55408. clearTimeout(animationCallbackId);
  55409. if (typeof callback === 'function') callback();
  55410. return;
  55411. }
  55412. var animating = false,
  55413. animationTime = 0;
  55414. animationStates.forEach(function (state) {
  55415. var time = 0,
  55416. target = state.target,
  55417. fromRect = target.fromRect,
  55418. toRect = getRect(target),
  55419. prevFromRect = target.prevFromRect,
  55420. prevToRect = target.prevToRect,
  55421. animatingRect = state.rect,
  55422. targetMatrix = matrix(target, true);
  55423. if (targetMatrix) {
  55424. // Compensate for current animation
  55425. toRect.top -= targetMatrix.f;
  55426. toRect.left -= targetMatrix.e;
  55427. }
  55428. target.toRect = toRect;
  55429. if (target.thisAnimationDuration) {
  55430. // Could also check if animatingRect is between fromRect and toRect
  55431. if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect
  55432. (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
  55433. // If returning to same place as started from animation and on same axis
  55434. time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
  55435. }
  55436. } // if fromRect != toRect: animate
  55437. if (!isRectEqual(toRect, fromRect)) {
  55438. target.prevFromRect = fromRect;
  55439. target.prevToRect = toRect;
  55440. if (!time) {
  55441. time = _this.options.animation;
  55442. }
  55443. _this.animate(target, animatingRect, toRect, time);
  55444. }
  55445. if (time) {
  55446. animating = true;
  55447. animationTime = Math.max(animationTime, time);
  55448. clearTimeout(target.animationResetTimer);
  55449. target.animationResetTimer = setTimeout(function () {
  55450. target.animationTime = 0;
  55451. target.prevFromRect = null;
  55452. target.fromRect = null;
  55453. target.prevToRect = null;
  55454. target.thisAnimationDuration = null;
  55455. }, time);
  55456. target.thisAnimationDuration = time;
  55457. }
  55458. });
  55459. clearTimeout(animationCallbackId);
  55460. if (!animating) {
  55461. if (typeof callback === 'function') callback();
  55462. } else {
  55463. animationCallbackId = setTimeout(function () {
  55464. if (typeof callback === 'function') callback();
  55465. }, animationTime);
  55466. }
  55467. animationStates = [];
  55468. },
  55469. animate: function animate(target, currentRect, toRect, duration) {
  55470. if (duration) {
  55471. css(target, 'transition', '');
  55472. css(target, 'transform', '');
  55473. var elMatrix = matrix(this.el),
  55474. scaleX = elMatrix && elMatrix.a,
  55475. scaleY = elMatrix && elMatrix.d,
  55476. translateX = (currentRect.left - toRect.left) / (scaleX || 1),
  55477. translateY = (currentRect.top - toRect.top) / (scaleY || 1);
  55478. target.animatingX = !!translateX;
  55479. target.animatingY = !!translateY;
  55480. css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
  55481. repaint(target); // repaint
  55482. css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
  55483. css(target, 'transform', 'translate3d(0,0,0)');
  55484. typeof target.animated === 'number' && clearTimeout(target.animated);
  55485. target.animated = setTimeout(function () {
  55486. css(target, 'transition', '');
  55487. css(target, 'transform', '');
  55488. target.animated = false;
  55489. target.animatingX = false;
  55490. target.animatingY = false;
  55491. }, duration);
  55492. }
  55493. }
  55494. };
  55495. }
  55496. function repaint(target) {
  55497. return target.offsetWidth;
  55498. }
  55499. function calculateRealTime(animatingRect, fromRect, toRect, options) {
  55500. return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
  55501. }
  55502. var plugins = [];
  55503. var defaults = {
  55504. initializeByDefault: true
  55505. };
  55506. var PluginManager = {
  55507. mount: function mount(plugin) {
  55508. // Set default static properties
  55509. for (var option in defaults) {
  55510. if (defaults.hasOwnProperty(option) && !(option in plugin)) {
  55511. plugin[option] = defaults[option];
  55512. }
  55513. }
  55514. plugins.push(plugin);
  55515. },
  55516. pluginEvent: function pluginEvent(eventName, sortable, evt) {
  55517. var _this = this;
  55518. this.eventCanceled = false;
  55519. evt.cancel = function () {
  55520. _this.eventCanceled = true;
  55521. };
  55522. var eventNameGlobal = eventName + 'Global';
  55523. plugins.forEach(function (plugin) {
  55524. if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable
  55525. if (sortable[plugin.pluginName][eventNameGlobal]) {
  55526. sortable[plugin.pluginName][eventNameGlobal](_objectSpread({
  55527. sortable: sortable
  55528. }, evt));
  55529. } // Only fire plugin event if plugin is enabled in this sortable,
  55530. // and plugin has event defined
  55531. if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
  55532. sortable[plugin.pluginName][eventName](_objectSpread({
  55533. sortable: sortable
  55534. }, evt));
  55535. }
  55536. });
  55537. },
  55538. initializePlugins: function initializePlugins(sortable, el, defaults, options) {
  55539. plugins.forEach(function (plugin) {
  55540. var pluginName = plugin.pluginName;
  55541. if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
  55542. var initialized = new plugin(sortable, el, sortable.options);
  55543. initialized.sortable = sortable;
  55544. initialized.options = sortable.options;
  55545. sortable[pluginName] = initialized; // Add default options from plugin
  55546. _extends(defaults, initialized.defaults);
  55547. });
  55548. for (var option in sortable.options) {
  55549. if (!sortable.options.hasOwnProperty(option)) continue;
  55550. var modified = this.modifyOption(sortable, option, sortable.options[option]);
  55551. if (typeof modified !== 'undefined') {
  55552. sortable.options[option] = modified;
  55553. }
  55554. }
  55555. },
  55556. getEventProperties: function getEventProperties(name, sortable) {
  55557. var eventProperties = {};
  55558. plugins.forEach(function (plugin) {
  55559. if (typeof plugin.eventProperties !== 'function') return;
  55560. _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
  55561. });
  55562. return eventProperties;
  55563. },
  55564. modifyOption: function modifyOption(sortable, name, value) {
  55565. var modifiedValue;
  55566. plugins.forEach(function (plugin) {
  55567. // Plugin must exist on the Sortable
  55568. if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
  55569. if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
  55570. modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
  55571. }
  55572. });
  55573. return modifiedValue;
  55574. }
  55575. };
  55576. function dispatchEvent(_ref) {
  55577. var sortable = _ref.sortable,
  55578. rootEl = _ref.rootEl,
  55579. name = _ref.name,
  55580. targetEl = _ref.targetEl,
  55581. cloneEl = _ref.cloneEl,
  55582. toEl = _ref.toEl,
  55583. fromEl = _ref.fromEl,
  55584. oldIndex = _ref.oldIndex,
  55585. newIndex = _ref.newIndex,
  55586. oldDraggableIndex = _ref.oldDraggableIndex,
  55587. newDraggableIndex = _ref.newDraggableIndex,
  55588. originalEvent = _ref.originalEvent,
  55589. putSortable = _ref.putSortable,
  55590. extraEventProperties = _ref.extraEventProperties;
  55591. sortable = sortable || rootEl && rootEl[expando];
  55592. if (!sortable) return;
  55593. var evt,
  55594. options = sortable.options,
  55595. onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature
  55596. if (window.CustomEvent && !IE11OrLess && !Edge) {
  55597. evt = new CustomEvent(name, {
  55598. bubbles: true,
  55599. cancelable: true
  55600. });
  55601. } else {
  55602. evt = document.createEvent('Event');
  55603. evt.initEvent(name, true, true);
  55604. }
  55605. evt.to = toEl || rootEl;
  55606. evt.from = fromEl || rootEl;
  55607. evt.item = targetEl || rootEl;
  55608. evt.clone = cloneEl;
  55609. evt.oldIndex = oldIndex;
  55610. evt.newIndex = newIndex;
  55611. evt.oldDraggableIndex = oldDraggableIndex;
  55612. evt.newDraggableIndex = newDraggableIndex;
  55613. evt.originalEvent = originalEvent;
  55614. evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
  55615. var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable));
  55616. for (var option in allEventProperties) {
  55617. evt[option] = allEventProperties[option];
  55618. }
  55619. if (rootEl) {
  55620. rootEl.dispatchEvent(evt);
  55621. }
  55622. if (options[onName]) {
  55623. options[onName].call(sortable, evt);
  55624. }
  55625. }
  55626. var pluginEvent = function pluginEvent(eventName, sortable) {
  55627. var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
  55628. originalEvent = _ref.evt,
  55629. data = _objectWithoutProperties(_ref, ["evt"]);
  55630. PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({
  55631. dragEl: dragEl,
  55632. parentEl: parentEl,
  55633. ghostEl: ghostEl,
  55634. rootEl: rootEl,
  55635. nextEl: nextEl,
  55636. lastDownEl: lastDownEl,
  55637. cloneEl: cloneEl,
  55638. cloneHidden: cloneHidden,
  55639. dragStarted: moved,
  55640. putSortable: putSortable,
  55641. activeSortable: Sortable.active,
  55642. originalEvent: originalEvent,
  55643. oldIndex: oldIndex,
  55644. oldDraggableIndex: oldDraggableIndex,
  55645. newIndex: newIndex,
  55646. newDraggableIndex: newDraggableIndex,
  55647. hideGhostForTarget: _hideGhostForTarget,
  55648. unhideGhostForTarget: _unhideGhostForTarget,
  55649. cloneNowHidden: function cloneNowHidden() {
  55650. cloneHidden = true;
  55651. },
  55652. cloneNowShown: function cloneNowShown() {
  55653. cloneHidden = false;
  55654. },
  55655. dispatchSortableEvent: function dispatchSortableEvent(name) {
  55656. _dispatchEvent({
  55657. sortable: sortable,
  55658. name: name,
  55659. originalEvent: originalEvent
  55660. });
  55661. }
  55662. }, data));
  55663. };
  55664. function _dispatchEvent(info) {
  55665. dispatchEvent(_objectSpread({
  55666. putSortable: putSortable,
  55667. cloneEl: cloneEl,
  55668. targetEl: dragEl,
  55669. rootEl: rootEl,
  55670. oldIndex: oldIndex,
  55671. oldDraggableIndex: oldDraggableIndex,
  55672. newIndex: newIndex,
  55673. newDraggableIndex: newDraggableIndex
  55674. }, info));
  55675. }
  55676. var dragEl,
  55677. parentEl,
  55678. ghostEl,
  55679. rootEl,
  55680. nextEl,
  55681. lastDownEl,
  55682. cloneEl,
  55683. cloneHidden,
  55684. oldIndex,
  55685. newIndex,
  55686. oldDraggableIndex,
  55687. newDraggableIndex,
  55688. activeGroup,
  55689. putSortable,
  55690. awaitingDragStarted = false,
  55691. ignoreNextClick = false,
  55692. sortables = [],
  55693. tapEvt,
  55694. touchEvt,
  55695. lastDx,
  55696. lastDy,
  55697. tapDistanceLeft,
  55698. tapDistanceTop,
  55699. moved,
  55700. lastTarget,
  55701. lastDirection,
  55702. pastFirstInvertThresh = false,
  55703. isCircumstantialInvert = false,
  55704. targetMoveDistance,
  55705. // For positioning ghost absolutely
  55706. ghostRelativeParent,
  55707. ghostRelativeParentInitialScroll = [],
  55708. // (left, top)
  55709. _silent = false,
  55710. savedInputChecked = [];
  55711. /** @const */
  55712. var documentExists = typeof document !== 'undefined',
  55713. PositionGhostAbsolutely = IOS,
  55714. CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
  55715. // This will not pass for IE9, because IE9 DnD only works on anchors
  55716. supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
  55717. supportCssPointerEvents = function () {
  55718. if (!documentExists) return; // false when <= IE11
  55719. if (IE11OrLess) {
  55720. return false;
  55721. }
  55722. var el = document.createElement('x');
  55723. el.style.cssText = 'pointer-events:auto';
  55724. return el.style.pointerEvents === 'auto';
  55725. }(),
  55726. _detectDirection = function _detectDirection(el, options) {
  55727. var elCSS = css(el),
  55728. elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
  55729. child1 = getChild(el, 0, options),
  55730. child2 = getChild(el, 1, options),
  55731. firstChildCSS = child1 && css(child1),
  55732. secondChildCSS = child2 && css(child2),
  55733. firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
  55734. secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
  55735. if (elCSS.display === 'flex') {
  55736. return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
  55737. }
  55738. if (elCSS.display === 'grid') {
  55739. return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
  55740. }
  55741. if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
  55742. var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
  55743. return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
  55744. }
  55745. return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
  55746. },
  55747. _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
  55748. var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
  55749. dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
  55750. dragElOppLength = vertical ? dragRect.width : dragRect.height,
  55751. targetS1Opp = vertical ? targetRect.left : targetRect.top,
  55752. targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
  55753. targetOppLength = vertical ? targetRect.width : targetRect.height;
  55754. return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
  55755. },
  55756. /**
  55757. * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
  55758. * @param {Number} x X position
  55759. * @param {Number} y Y position
  55760. * @return {HTMLElement} Element of the first found nearest Sortable
  55761. */
  55762. _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
  55763. var ret;
  55764. sortables.some(function (sortable) {
  55765. if (lastChild(sortable)) return;
  55766. var rect = getRect(sortable),
  55767. threshold = sortable[expando].options.emptyInsertThreshold,
  55768. insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
  55769. insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
  55770. if (threshold && insideHorizontally && insideVertically) {
  55771. return ret = sortable;
  55772. }
  55773. });
  55774. return ret;
  55775. },
  55776. _prepareGroup = function _prepareGroup(options) {
  55777. function toFn(value, pull) {
  55778. return function (to, from, dragEl, evt) {
  55779. var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
  55780. if (value == null && (pull || sameGroup)) {
  55781. // Default pull value
  55782. // Default pull and put value if same group
  55783. return true;
  55784. } else if (value == null || value === false) {
  55785. return false;
  55786. } else if (pull && value === 'clone') {
  55787. return value;
  55788. } else if (typeof value === 'function') {
  55789. return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
  55790. } else {
  55791. var otherGroup = (pull ? to : from).options.group.name;
  55792. return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
  55793. }
  55794. };
  55795. }
  55796. var group = {};
  55797. var originalGroup = options.group;
  55798. if (!originalGroup || _typeof(originalGroup) != 'object') {
  55799. originalGroup = {
  55800. name: originalGroup
  55801. };
  55802. }
  55803. group.name = originalGroup.name;
  55804. group.checkPull = toFn(originalGroup.pull, true);
  55805. group.checkPut = toFn(originalGroup.put);
  55806. group.revertClone = originalGroup.revertClone;
  55807. options.group = group;
  55808. },
  55809. _hideGhostForTarget = function _hideGhostForTarget() {
  55810. if (!supportCssPointerEvents && ghostEl) {
  55811. css(ghostEl, 'display', 'none');
  55812. }
  55813. },
  55814. _unhideGhostForTarget = function _unhideGhostForTarget() {
  55815. if (!supportCssPointerEvents && ghostEl) {
  55816. css(ghostEl, 'display', '');
  55817. }
  55818. }; // #1184 fix - Prevent click event on fallback if dragged but item not changed position
  55819. if (documentExists) {
  55820. document.addEventListener('click', function (evt) {
  55821. if (ignoreNextClick) {
  55822. evt.preventDefault();
  55823. evt.stopPropagation && evt.stopPropagation();
  55824. evt.stopImmediatePropagation && evt.stopImmediatePropagation();
  55825. ignoreNextClick = false;
  55826. return false;
  55827. }
  55828. }, true);
  55829. }
  55830. var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
  55831. if (dragEl) {
  55832. evt = evt.touches ? evt.touches[0] : evt;
  55833. var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
  55834. if (nearest) {
  55835. // Create imitation event
  55836. var event = {};
  55837. for (var i in evt) {
  55838. if (evt.hasOwnProperty(i)) {
  55839. event[i] = evt[i];
  55840. }
  55841. }
  55842. event.target = event.rootEl = nearest;
  55843. event.preventDefault = void 0;
  55844. event.stopPropagation = void 0;
  55845. nearest[expando]._onDragOver(event);
  55846. }
  55847. }
  55848. };
  55849. var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
  55850. if (dragEl) {
  55851. dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
  55852. }
  55853. };
  55854. /**
  55855. * @class Sortable
  55856. * @param {HTMLElement} el
  55857. * @param {Object} [options]
  55858. */
  55859. function Sortable(el, options) {
  55860. if (!(el && el.nodeType && el.nodeType === 1)) {
  55861. throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
  55862. }
  55863. this.el = el; // root element
  55864. this.options = options = _extends({}, options); // Export instance
  55865. el[expando] = this;
  55866. var defaults = {
  55867. group: null,
  55868. sort: true,
  55869. disabled: false,
  55870. store: null,
  55871. handle: null,
  55872. draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
  55873. swapThreshold: 1,
  55874. // percentage; 0 <= x <= 1
  55875. invertSwap: false,
  55876. // invert always
  55877. invertedSwapThreshold: null,
  55878. // will be set to same as swapThreshold if default
  55879. removeCloneOnHide: true,
  55880. direction: function direction() {
  55881. return _detectDirection(el, this.options);
  55882. },
  55883. ghostClass: 'sortable-ghost',
  55884. chosenClass: 'sortable-chosen',
  55885. dragClass: 'sortable-drag',
  55886. ignore: 'a, img',
  55887. filter: null,
  55888. preventOnFilter: true,
  55889. animation: 0,
  55890. easing: null,
  55891. setData: function setData(dataTransfer, dragEl) {
  55892. dataTransfer.setData('Text', dragEl.textContent);
  55893. },
  55894. dropBubble: false,
  55895. dragoverBubble: false,
  55896. dataIdAttr: 'data-id',
  55897. delay: 0,
  55898. delayOnTouchOnly: false,
  55899. touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
  55900. forceFallback: false,
  55901. fallbackClass: 'sortable-fallback',
  55902. fallbackOnBody: false,
  55903. fallbackTolerance: 0,
  55904. fallbackOffset: {
  55905. x: 0,
  55906. y: 0
  55907. },
  55908. supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window,
  55909. emptyInsertThreshold: 5
  55910. };
  55911. PluginManager.initializePlugins(this, el, defaults); // Set default options
  55912. for (var name in defaults) {
  55913. !(name in options) && (options[name] = defaults[name]);
  55914. }
  55915. _prepareGroup(options); // Bind all private methods
  55916. for (var fn in this) {
  55917. if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
  55918. this[fn] = this[fn].bind(this);
  55919. }
  55920. } // Setup drag mode
  55921. this.nativeDraggable = options.forceFallback ? false : supportDraggable;
  55922. if (this.nativeDraggable) {
  55923. // Touch start threshold cannot be greater than the native dragstart threshold
  55924. this.options.touchStartThreshold = 1;
  55925. } // Bind events
  55926. if (options.supportPointer) {
  55927. on(el, 'pointerdown', this._onTapStart);
  55928. } else {
  55929. on(el, 'mousedown', this._onTapStart);
  55930. on(el, 'touchstart', this._onTapStart);
  55931. }
  55932. if (this.nativeDraggable) {
  55933. on(el, 'dragover', this);
  55934. on(el, 'dragenter', this);
  55935. }
  55936. sortables.push(this.el); // Restore sorting
  55937. options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager
  55938. _extends(this, AnimationStateManager());
  55939. }
  55940. Sortable.prototype =
  55941. /** @lends Sortable.prototype */
  55942. {
  55943. constructor: Sortable,
  55944. _isOutsideThisEl: function _isOutsideThisEl(target) {
  55945. if (!this.el.contains(target) && target !== this.el) {
  55946. lastTarget = null;
  55947. }
  55948. },
  55949. _getDirection: function _getDirection(evt, target) {
  55950. return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
  55951. },
  55952. _onTapStart: function _onTapStart(
  55953. /** Event|TouchEvent */
  55954. evt) {
  55955. if (!evt.cancelable) return;
  55956. var _this = this,
  55957. el = this.el,
  55958. options = this.options,
  55959. preventOnFilter = options.preventOnFilter,
  55960. type = evt.type,
  55961. touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
  55962. target = (touch || evt).target,
  55963. originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
  55964. filter = options.filter;
  55965. _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
  55966. if (dragEl) {
  55967. return;
  55968. }
  55969. if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
  55970. return; // only left button and enabled
  55971. } // cancel dnd if original target is content editable
  55972. if (originalTarget.isContentEditable) {
  55973. return;
  55974. }
  55975. target = closest(target, options.draggable, el, false);
  55976. if (target && target.animated) {
  55977. return;
  55978. }
  55979. if (lastDownEl === target) {
  55980. // Ignoring duplicate `down`
  55981. return;
  55982. } // Get the index of the dragged element within its parent
  55983. oldIndex = index(target);
  55984. oldDraggableIndex = index(target, options.draggable); // Check filter
  55985. if (typeof filter === 'function') {
  55986. if (filter.call(this, evt, target, this)) {
  55987. _dispatchEvent({
  55988. sortable: _this,
  55989. rootEl: originalTarget,
  55990. name: 'filter',
  55991. targetEl: target,
  55992. toEl: el,
  55993. fromEl: el
  55994. });
  55995. pluginEvent('filter', _this, {
  55996. evt: evt
  55997. });
  55998. preventOnFilter && evt.cancelable && evt.preventDefault();
  55999. return; // cancel dnd
  56000. }
  56001. } else if (filter) {
  56002. filter = filter.split(',').some(function (criteria) {
  56003. criteria = closest(originalTarget, criteria.trim(), el, false);
  56004. if (criteria) {
  56005. _dispatchEvent({
  56006. sortable: _this,
  56007. rootEl: criteria,
  56008. name: 'filter',
  56009. targetEl: target,
  56010. fromEl: el,
  56011. toEl: el
  56012. });
  56013. pluginEvent('filter', _this, {
  56014. evt: evt
  56015. });
  56016. return true;
  56017. }
  56018. });
  56019. if (filter) {
  56020. preventOnFilter && evt.cancelable && evt.preventDefault();
  56021. return; // cancel dnd
  56022. }
  56023. }
  56024. if (options.handle && !closest(originalTarget, options.handle, el, false)) {
  56025. return;
  56026. } // Prepare `dragstart`
  56027. this._prepareDragStart(evt, touch, target);
  56028. },
  56029. _prepareDragStart: function _prepareDragStart(
  56030. /** Event */
  56031. evt,
  56032. /** Touch */
  56033. touch,
  56034. /** HTMLElement */
  56035. target) {
  56036. var _this = this,
  56037. el = _this.el,
  56038. options = _this.options,
  56039. ownerDocument = el.ownerDocument,
  56040. dragStartFn;
  56041. if (target && !dragEl && target.parentNode === el) {
  56042. var dragRect = getRect(target);
  56043. rootEl = el;
  56044. dragEl = target;
  56045. parentEl = dragEl.parentNode;
  56046. nextEl = dragEl.nextSibling;
  56047. lastDownEl = target;
  56048. activeGroup = options.group;
  56049. Sortable.dragged = dragEl;
  56050. tapEvt = {
  56051. target: dragEl,
  56052. clientX: (touch || evt).clientX,
  56053. clientY: (touch || evt).clientY
  56054. };
  56055. tapDistanceLeft = tapEvt.clientX - dragRect.left;
  56056. tapDistanceTop = tapEvt.clientY - dragRect.top;
  56057. this._lastX = (touch || evt).clientX;
  56058. this._lastY = (touch || evt).clientY;
  56059. dragEl.style['will-change'] = 'all';
  56060. dragStartFn = function dragStartFn() {
  56061. pluginEvent('delayEnded', _this, {
  56062. evt: evt
  56063. });
  56064. if (Sortable.eventCanceled) {
  56065. _this._onDrop();
  56066. return;
  56067. } // Delayed drag has been triggered
  56068. // we can re-enable the events: touchmove/mousemove
  56069. _this._disableDelayedDragEvents();
  56070. if (!FireFox && _this.nativeDraggable) {
  56071. dragEl.draggable = true;
  56072. } // Bind the events: dragstart/dragend
  56073. _this._triggerDragStart(evt, touch); // Drag start event
  56074. _dispatchEvent({
  56075. sortable: _this,
  56076. name: 'choose',
  56077. originalEvent: evt
  56078. }); // Chosen item
  56079. toggleClass(dragEl, options.chosenClass, true);
  56080. }; // Disable "draggable"
  56081. options.ignore.split(',').forEach(function (criteria) {
  56082. find(dragEl, criteria.trim(), _disableDraggable);
  56083. });
  56084. on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
  56085. on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
  56086. on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
  56087. on(ownerDocument, 'mouseup', _this._onDrop);
  56088. on(ownerDocument, 'touchend', _this._onDrop);
  56089. on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)
  56090. if (FireFox && this.nativeDraggable) {
  56091. this.options.touchStartThreshold = 4;
  56092. dragEl.draggable = true;
  56093. }
  56094. pluginEvent('delayStart', this, {
  56095. evt: evt
  56096. }); // Delay is impossible for native DnD in Edge or IE
  56097. if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
  56098. if (Sortable.eventCanceled) {
  56099. this._onDrop();
  56100. return;
  56101. } // If the user moves the pointer or let go the click or touch
  56102. // before the delay has been reached:
  56103. // disable the delayed drag
  56104. on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
  56105. on(ownerDocument, 'touchend', _this._disableDelayedDrag);
  56106. on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
  56107. on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
  56108. on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
  56109. options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
  56110. _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
  56111. } else {
  56112. dragStartFn();
  56113. }
  56114. }
  56115. },
  56116. _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(
  56117. /** TouchEvent|PointerEvent **/
  56118. e) {
  56119. var touch = e.touches ? e.touches[0] : e;
  56120. if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
  56121. this._disableDelayedDrag();
  56122. }
  56123. },
  56124. _disableDelayedDrag: function _disableDelayedDrag() {
  56125. dragEl && _disableDraggable(dragEl);
  56126. clearTimeout(this._dragStartTimer);
  56127. this._disableDelayedDragEvents();
  56128. },
  56129. _disableDelayedDragEvents: function _disableDelayedDragEvents() {
  56130. var ownerDocument = this.el.ownerDocument;
  56131. off(ownerDocument, 'mouseup', this._disableDelayedDrag);
  56132. off(ownerDocument, 'touchend', this._disableDelayedDrag);
  56133. off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
  56134. off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
  56135. off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
  56136. off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
  56137. },
  56138. _triggerDragStart: function _triggerDragStart(
  56139. /** Event */
  56140. evt,
  56141. /** Touch */
  56142. touch) {
  56143. touch = touch || evt.pointerType == 'touch' && evt;
  56144. if (!this.nativeDraggable || touch) {
  56145. if (this.options.supportPointer) {
  56146. on(document, 'pointermove', this._onTouchMove);
  56147. } else if (touch) {
  56148. on(document, 'touchmove', this._onTouchMove);
  56149. } else {
  56150. on(document, 'mousemove', this._onTouchMove);
  56151. }
  56152. } else {
  56153. on(dragEl, 'dragend', this);
  56154. on(rootEl, 'dragstart', this._onDragStart);
  56155. }
  56156. try {
  56157. if (document.selection) {
  56158. // Timeout neccessary for IE9
  56159. _nextTick(function () {
  56160. document.selection.empty();
  56161. });
  56162. } else {
  56163. window.getSelection().removeAllRanges();
  56164. }
  56165. } catch (err) {}
  56166. },
  56167. _dragStarted: function _dragStarted(fallback, evt) {
  56168. awaitingDragStarted = false;
  56169. if (rootEl && dragEl) {
  56170. pluginEvent('dragStarted', this, {
  56171. evt: evt
  56172. });
  56173. if (this.nativeDraggable) {
  56174. on(document, 'dragover', _checkOutsideTargetEl);
  56175. }
  56176. var options = this.options; // Apply effect
  56177. !fallback && toggleClass(dragEl, options.dragClass, false);
  56178. toggleClass(dragEl, options.ghostClass, true);
  56179. Sortable.active = this;
  56180. fallback && this._appendGhost(); // Drag start event
  56181. _dispatchEvent({
  56182. sortable: this,
  56183. name: 'start',
  56184. originalEvent: evt
  56185. });
  56186. } else {
  56187. this._nulling();
  56188. }
  56189. },
  56190. _emulateDragOver: function _emulateDragOver() {
  56191. if (touchEvt) {
  56192. this._lastX = touchEvt.clientX;
  56193. this._lastY = touchEvt.clientY;
  56194. _hideGhostForTarget();
  56195. var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
  56196. var parent = target;
  56197. while (target && target.shadowRoot) {
  56198. target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
  56199. if (target === parent) break;
  56200. parent = target;
  56201. }
  56202. dragEl.parentNode[expando]._isOutsideThisEl(target);
  56203. if (parent) {
  56204. do {
  56205. if (parent[expando]) {
  56206. var inserted = void 0;
  56207. inserted = parent[expando]._onDragOver({
  56208. clientX: touchEvt.clientX,
  56209. clientY: touchEvt.clientY,
  56210. target: target,
  56211. rootEl: parent
  56212. });
  56213. if (inserted && !this.options.dragoverBubble) {
  56214. break;
  56215. }
  56216. }
  56217. target = parent; // store last element
  56218. }
  56219. /* jshint boss:true */
  56220. while (parent = parent.parentNode);
  56221. }
  56222. _unhideGhostForTarget();
  56223. }
  56224. },
  56225. _onTouchMove: function _onTouchMove(
  56226. /**TouchEvent*/
  56227. evt) {
  56228. if (tapEvt) {
  56229. var options = this.options,
  56230. fallbackTolerance = options.fallbackTolerance,
  56231. fallbackOffset = options.fallbackOffset,
  56232. touch = evt.touches ? evt.touches[0] : evt,
  56233. ghostMatrix = ghostEl && matrix(ghostEl, true),
  56234. scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
  56235. scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
  56236. relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
  56237. dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
  56238. dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging
  56239. if (!Sortable.active && !awaitingDragStarted) {
  56240. if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
  56241. return;
  56242. }
  56243. this._onDragStart(evt, true);
  56244. }
  56245. if (ghostEl) {
  56246. if (ghostMatrix) {
  56247. ghostMatrix.e += dx - (lastDx || 0);
  56248. ghostMatrix.f += dy - (lastDy || 0);
  56249. } else {
  56250. ghostMatrix = {
  56251. a: 1,
  56252. b: 0,
  56253. c: 0,
  56254. d: 1,
  56255. e: dx,
  56256. f: dy
  56257. };
  56258. }
  56259. var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
  56260. css(ghostEl, 'webkitTransform', cssMatrix);
  56261. css(ghostEl, 'mozTransform', cssMatrix);
  56262. css(ghostEl, 'msTransform', cssMatrix);
  56263. css(ghostEl, 'transform', cssMatrix);
  56264. lastDx = dx;
  56265. lastDy = dy;
  56266. touchEvt = touch;
  56267. }
  56268. evt.cancelable && evt.preventDefault();
  56269. }
  56270. },
  56271. _appendGhost: function _appendGhost() {
  56272. // Bug if using scale(): https://stackoverflow.com/questions/2637058
  56273. // Not being adjusted for
  56274. if (!ghostEl) {
  56275. var container = this.options.fallbackOnBody ? document.body : rootEl,
  56276. rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
  56277. options = this.options; // Position absolutely
  56278. if (PositionGhostAbsolutely) {
  56279. // Get relatively positioned parent
  56280. ghostRelativeParent = container;
  56281. while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
  56282. ghostRelativeParent = ghostRelativeParent.parentNode;
  56283. }
  56284. if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
  56285. if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
  56286. rect.top += ghostRelativeParent.scrollTop;
  56287. rect.left += ghostRelativeParent.scrollLeft;
  56288. } else {
  56289. ghostRelativeParent = getWindowScrollingElement();
  56290. }
  56291. ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
  56292. }
  56293. ghostEl = dragEl.cloneNode(true);
  56294. toggleClass(ghostEl, options.ghostClass, false);
  56295. toggleClass(ghostEl, options.fallbackClass, true);
  56296. toggleClass(ghostEl, options.dragClass, true);
  56297. css(ghostEl, 'transition', '');
  56298. css(ghostEl, 'transform', '');
  56299. css(ghostEl, 'box-sizing', 'border-box');
  56300. css(ghostEl, 'margin', 0);
  56301. css(ghostEl, 'top', rect.top);
  56302. css(ghostEl, 'left', rect.left);
  56303. css(ghostEl, 'width', rect.width);
  56304. css(ghostEl, 'height', rect.height);
  56305. css(ghostEl, 'opacity', '0.8');
  56306. css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
  56307. css(ghostEl, 'zIndex', '100000');
  56308. css(ghostEl, 'pointerEvents', 'none');
  56309. Sortable.ghost = ghostEl;
  56310. container.appendChild(ghostEl); // Set transform-origin
  56311. css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
  56312. }
  56313. },
  56314. _onDragStart: function _onDragStart(
  56315. /**Event*/
  56316. evt,
  56317. /**boolean*/
  56318. fallback) {
  56319. var _this = this;
  56320. var dataTransfer = evt.dataTransfer;
  56321. var options = _this.options;
  56322. pluginEvent('dragStart', this, {
  56323. evt: evt
  56324. });
  56325. if (Sortable.eventCanceled) {
  56326. this._onDrop();
  56327. return;
  56328. }
  56329. pluginEvent('setupClone', this);
  56330. if (!Sortable.eventCanceled) {
  56331. cloneEl = clone(dragEl);
  56332. cloneEl.draggable = false;
  56333. cloneEl.style['will-change'] = '';
  56334. this._hideClone();
  56335. toggleClass(cloneEl, this.options.chosenClass, false);
  56336. Sortable.clone = cloneEl;
  56337. } // #1143: IFrame support workaround
  56338. _this.cloneId = _nextTick(function () {
  56339. pluginEvent('clone', _this);
  56340. if (Sortable.eventCanceled) return;
  56341. if (!_this.options.removeCloneOnHide) {
  56342. rootEl.insertBefore(cloneEl, dragEl);
  56343. }
  56344. _this._hideClone();
  56345. _dispatchEvent({
  56346. sortable: _this,
  56347. name: 'clone'
  56348. });
  56349. });
  56350. !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events
  56351. if (fallback) {
  56352. ignoreNextClick = true;
  56353. _this._loopId = setInterval(_this._emulateDragOver, 50);
  56354. } else {
  56355. // Undo what was set in _prepareDragStart before drag started
  56356. off(document, 'mouseup', _this._onDrop);
  56357. off(document, 'touchend', _this._onDrop);
  56358. off(document, 'touchcancel', _this._onDrop);
  56359. if (dataTransfer) {
  56360. dataTransfer.effectAllowed = 'move';
  56361. options.setData && options.setData.call(_this, dataTransfer, dragEl);
  56362. }
  56363. on(document, 'drop', _this); // #1276 fix:
  56364. css(dragEl, 'transform', 'translateZ(0)');
  56365. }
  56366. awaitingDragStarted = true;
  56367. _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
  56368. on(document, 'selectstart', _this);
  56369. moved = true;
  56370. if (Safari) {
  56371. css(document.body, 'user-select', 'none');
  56372. }
  56373. },
  56374. // Returns true - if no further action is needed (either inserted or another condition)
  56375. _onDragOver: function _onDragOver(
  56376. /**Event*/
  56377. evt) {
  56378. var el = this.el,
  56379. target = evt.target,
  56380. dragRect,
  56381. targetRect,
  56382. revert,
  56383. options = this.options,
  56384. group = options.group,
  56385. activeSortable = Sortable.active,
  56386. isOwner = activeGroup === group,
  56387. canSort = options.sort,
  56388. fromSortable = putSortable || activeSortable,
  56389. vertical,
  56390. _this = this,
  56391. completedFired = false;
  56392. if (_silent) return;
  56393. function dragOverEvent(name, extra) {
  56394. pluginEvent(name, _this, _objectSpread({
  56395. evt: evt,
  56396. isOwner: isOwner,
  56397. axis: vertical ? 'vertical' : 'horizontal',
  56398. revert: revert,
  56399. dragRect: dragRect,
  56400. targetRect: targetRect,
  56401. canSort: canSort,
  56402. fromSortable: fromSortable,
  56403. target: target,
  56404. completed: completed,
  56405. onMove: function onMove(target, after) {
  56406. return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
  56407. },
  56408. changed: changed
  56409. }, extra));
  56410. } // Capture animation state
  56411. function capture() {
  56412. dragOverEvent('dragOverAnimationCapture');
  56413. _this.captureAnimationState();
  56414. if (_this !== fromSortable) {
  56415. fromSortable.captureAnimationState();
  56416. }
  56417. } // Return invocation when dragEl is inserted (or completed)
  56418. function completed(insertion) {
  56419. dragOverEvent('dragOverCompleted', {
  56420. insertion: insertion
  56421. });
  56422. if (insertion) {
  56423. // Clones must be hidden before folding animation to capture dragRectAbsolute properly
  56424. if (isOwner) {
  56425. activeSortable._hideClone();
  56426. } else {
  56427. activeSortable._showClone(_this);
  56428. }
  56429. if (_this !== fromSortable) {
  56430. // Set ghost class to new sortable's ghost class
  56431. toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
  56432. toggleClass(dragEl, options.ghostClass, true);
  56433. }
  56434. if (putSortable !== _this && _this !== Sortable.active) {
  56435. putSortable = _this;
  56436. } else if (_this === Sortable.active && putSortable) {
  56437. putSortable = null;
  56438. } // Animation
  56439. if (fromSortable === _this) {
  56440. _this._ignoreWhileAnimating = target;
  56441. }
  56442. _this.animateAll(function () {
  56443. dragOverEvent('dragOverAnimationComplete');
  56444. _this._ignoreWhileAnimating = null;
  56445. });
  56446. if (_this !== fromSortable) {
  56447. fromSortable.animateAll();
  56448. fromSortable._ignoreWhileAnimating = null;
  56449. }
  56450. } // Null lastTarget if it is not inside a previously swapped element
  56451. if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
  56452. lastTarget = null;
  56453. } // no bubbling and not fallback
  56454. if (!options.dragoverBubble && !evt.rootEl && target !== document) {
  56455. dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted
  56456. !insertion && nearestEmptyInsertDetectEvent(evt);
  56457. }
  56458. !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
  56459. return completedFired = true;
  56460. } // Call when dragEl has been inserted
  56461. function changed() {
  56462. newIndex = index(dragEl);
  56463. newDraggableIndex = index(dragEl, options.draggable);
  56464. _dispatchEvent({
  56465. sortable: _this,
  56466. name: 'change',
  56467. toEl: el,
  56468. newIndex: newIndex,
  56469. newDraggableIndex: newDraggableIndex,
  56470. originalEvent: evt
  56471. });
  56472. }
  56473. if (evt.preventDefault !== void 0) {
  56474. evt.cancelable && evt.preventDefault();
  56475. }
  56476. target = closest(target, options.draggable, el, true);
  56477. dragOverEvent('dragOver');
  56478. if (Sortable.eventCanceled) return completedFired;
  56479. if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
  56480. return completed(false);
  56481. }
  56482. ignoreNextClick = false;
  56483. if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list
  56484. : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
  56485. vertical = this._getDirection(evt, target) === 'vertical';
  56486. dragRect = getRect(dragEl);
  56487. dragOverEvent('dragOverValid');
  56488. if (Sortable.eventCanceled) return completedFired;
  56489. if (revert) {
  56490. parentEl = rootEl; // actualization
  56491. capture();
  56492. this._hideClone();
  56493. dragOverEvent('revert');
  56494. if (!Sortable.eventCanceled) {
  56495. if (nextEl) {
  56496. rootEl.insertBefore(dragEl, nextEl);
  56497. } else {
  56498. rootEl.appendChild(dragEl);
  56499. }
  56500. }
  56501. return completed(true);
  56502. }
  56503. var elLastChild = lastChild(el, options.draggable);
  56504. if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
  56505. // If already at end of list: Do not insert
  56506. if (elLastChild === dragEl) {
  56507. return completed(false);
  56508. } // assign target only if condition is true
  56509. if (elLastChild && el === evt.target) {
  56510. target = elLastChild;
  56511. }
  56512. if (target) {
  56513. targetRect = getRect(target);
  56514. }
  56515. if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
  56516. capture();
  56517. el.appendChild(dragEl);
  56518. parentEl = el; // actualization
  56519. changed();
  56520. return completed(true);
  56521. }
  56522. } else if (target.parentNode === el) {
  56523. targetRect = getRect(target);
  56524. var direction = 0,
  56525. targetBeforeFirstSwap,
  56526. differentLevel = dragEl.parentNode !== el,
  56527. differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
  56528. side1 = vertical ? 'top' : 'left',
  56529. scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
  56530. scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
  56531. if (lastTarget !== target) {
  56532. targetBeforeFirstSwap = targetRect[side1];
  56533. pastFirstInvertThresh = false;
  56534. isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
  56535. }
  56536. direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
  56537. var sibling;
  56538. if (direction !== 0) {
  56539. // Check if target is beside dragEl in respective direction (ignoring hidden elements)
  56540. var dragIndex = index(dragEl);
  56541. do {
  56542. dragIndex -= direction;
  56543. sibling = parentEl.children[dragIndex];
  56544. } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
  56545. } // If dragEl is already beside target: Do not insert
  56546. if (direction === 0 || sibling === target) {
  56547. return completed(false);
  56548. }
  56549. lastTarget = target;
  56550. lastDirection = direction;
  56551. var nextSibling = target.nextElementSibling,
  56552. after = false;
  56553. after = direction === 1;
  56554. var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
  56555. if (moveVector !== false) {
  56556. if (moveVector === 1 || moveVector === -1) {
  56557. after = moveVector === 1;
  56558. }
  56559. _silent = true;
  56560. setTimeout(_unsilent, 30);
  56561. capture();
  56562. if (after && !nextSibling) {
  56563. el.appendChild(dragEl);
  56564. } else {
  56565. target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
  56566. } // Undo chrome's scroll adjustment (has no effect on other browsers)
  56567. if (scrolledPastTop) {
  56568. scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
  56569. }
  56570. parentEl = dragEl.parentNode; // actualization
  56571. // must be done before animation
  56572. if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
  56573. targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
  56574. }
  56575. changed();
  56576. return completed(true);
  56577. }
  56578. }
  56579. if (el.contains(dragEl)) {
  56580. return completed(false);
  56581. }
  56582. }
  56583. return false;
  56584. },
  56585. _ignoreWhileAnimating: null,
  56586. _offMoveEvents: function _offMoveEvents() {
  56587. off(document, 'mousemove', this._onTouchMove);
  56588. off(document, 'touchmove', this._onTouchMove);
  56589. off(document, 'pointermove', this._onTouchMove);
  56590. off(document, 'dragover', nearestEmptyInsertDetectEvent);
  56591. off(document, 'mousemove', nearestEmptyInsertDetectEvent);
  56592. off(document, 'touchmove', nearestEmptyInsertDetectEvent);
  56593. },
  56594. _offUpEvents: function _offUpEvents() {
  56595. var ownerDocument = this.el.ownerDocument;
  56596. off(ownerDocument, 'mouseup', this._onDrop);
  56597. off(ownerDocument, 'touchend', this._onDrop);
  56598. off(ownerDocument, 'pointerup', this._onDrop);
  56599. off(ownerDocument, 'touchcancel', this._onDrop);
  56600. off(document, 'selectstart', this);
  56601. },
  56602. _onDrop: function _onDrop(
  56603. /**Event*/
  56604. evt) {
  56605. var el = this.el,
  56606. options = this.options; // Get the index of the dragged element within its parent
  56607. newIndex = index(dragEl);
  56608. newDraggableIndex = index(dragEl, options.draggable);
  56609. pluginEvent('drop', this, {
  56610. evt: evt
  56611. });
  56612. parentEl = dragEl && dragEl.parentNode; // Get again after plugin event
  56613. newIndex = index(dragEl);
  56614. newDraggableIndex = index(dragEl, options.draggable);
  56615. if (Sortable.eventCanceled) {
  56616. this._nulling();
  56617. return;
  56618. }
  56619. awaitingDragStarted = false;
  56620. isCircumstantialInvert = false;
  56621. pastFirstInvertThresh = false;
  56622. clearInterval(this._loopId);
  56623. clearTimeout(this._dragStartTimer);
  56624. _cancelNextTick(this.cloneId);
  56625. _cancelNextTick(this._dragStartId); // Unbind events
  56626. if (this.nativeDraggable) {
  56627. off(document, 'drop', this);
  56628. off(el, 'dragstart', this._onDragStart);
  56629. }
  56630. this._offMoveEvents();
  56631. this._offUpEvents();
  56632. if (Safari) {
  56633. css(document.body, 'user-select', '');
  56634. }
  56635. css(dragEl, 'transform', '');
  56636. if (evt) {
  56637. if (moved) {
  56638. evt.cancelable && evt.preventDefault();
  56639. !options.dropBubble && evt.stopPropagation();
  56640. }
  56641. ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
  56642. if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
  56643. // Remove clone(s)
  56644. cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
  56645. }
  56646. if (dragEl) {
  56647. if (this.nativeDraggable) {
  56648. off(dragEl, 'dragend', this);
  56649. }
  56650. _disableDraggable(dragEl);
  56651. dragEl.style['will-change'] = ''; // Remove classes
  56652. // ghostClass is added in dragStarted
  56653. if (moved && !awaitingDragStarted) {
  56654. toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
  56655. }
  56656. toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event
  56657. _dispatchEvent({
  56658. sortable: this,
  56659. name: 'unchoose',
  56660. toEl: parentEl,
  56661. newIndex: null,
  56662. newDraggableIndex: null,
  56663. originalEvent: evt
  56664. });
  56665. if (rootEl !== parentEl) {
  56666. if (newIndex >= 0) {
  56667. // Add event
  56668. _dispatchEvent({
  56669. rootEl: parentEl,
  56670. name: 'add',
  56671. toEl: parentEl,
  56672. fromEl: rootEl,
  56673. originalEvent: evt
  56674. }); // Remove event
  56675. _dispatchEvent({
  56676. sortable: this,
  56677. name: 'remove',
  56678. toEl: parentEl,
  56679. originalEvent: evt
  56680. }); // drag from one list and drop into another
  56681. _dispatchEvent({
  56682. rootEl: parentEl,
  56683. name: 'sort',
  56684. toEl: parentEl,
  56685. fromEl: rootEl,
  56686. originalEvent: evt
  56687. });
  56688. _dispatchEvent({
  56689. sortable: this,
  56690. name: 'sort',
  56691. toEl: parentEl,
  56692. originalEvent: evt
  56693. });
  56694. }
  56695. putSortable && putSortable.save();
  56696. } else {
  56697. if (newIndex !== oldIndex) {
  56698. if (newIndex >= 0) {
  56699. // drag & drop within the same list
  56700. _dispatchEvent({
  56701. sortable: this,
  56702. name: 'update',
  56703. toEl: parentEl,
  56704. originalEvent: evt
  56705. });
  56706. _dispatchEvent({
  56707. sortable: this,
  56708. name: 'sort',
  56709. toEl: parentEl,
  56710. originalEvent: evt
  56711. });
  56712. }
  56713. }
  56714. }
  56715. if (Sortable.active) {
  56716. /* jshint eqnull:true */
  56717. if (newIndex == null || newIndex === -1) {
  56718. newIndex = oldIndex;
  56719. newDraggableIndex = oldDraggableIndex;
  56720. }
  56721. _dispatchEvent({
  56722. sortable: this,
  56723. name: 'end',
  56724. toEl: parentEl,
  56725. originalEvent: evt
  56726. }); // Save sorting
  56727. this.save();
  56728. }
  56729. }
  56730. }
  56731. this._nulling();
  56732. },
  56733. _nulling: function _nulling() {
  56734. pluginEvent('nulling', this);
  56735. rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
  56736. savedInputChecked.forEach(function (el) {
  56737. el.checked = true;
  56738. });
  56739. savedInputChecked.length = lastDx = lastDy = 0;
  56740. },
  56741. handleEvent: function handleEvent(
  56742. /**Event*/
  56743. evt) {
  56744. switch (evt.type) {
  56745. case 'drop':
  56746. case 'dragend':
  56747. this._onDrop(evt);
  56748. break;
  56749. case 'dragenter':
  56750. case 'dragover':
  56751. if (dragEl) {
  56752. this._onDragOver(evt);
  56753. _globalDragOver(evt);
  56754. }
  56755. break;
  56756. case 'selectstart':
  56757. evt.preventDefault();
  56758. break;
  56759. }
  56760. },
  56761. /**
  56762. * Serializes the item into an array of string.
  56763. * @returns {String[]}
  56764. */
  56765. toArray: function toArray() {
  56766. var order = [],
  56767. el,
  56768. children = this.el.children,
  56769. i = 0,
  56770. n = children.length,
  56771. options = this.options;
  56772. for (; i < n; i++) {
  56773. el = children[i];
  56774. if (closest(el, options.draggable, this.el, false)) {
  56775. order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
  56776. }
  56777. }
  56778. return order;
  56779. },
  56780. /**
  56781. * Sorts the elements according to the array.
  56782. * @param {String[]} order order of the items
  56783. */
  56784. sort: function sort(order) {
  56785. var items = {},
  56786. rootEl = this.el;
  56787. this.toArray().forEach(function (id, i) {
  56788. var el = rootEl.children[i];
  56789. if (closest(el, this.options.draggable, rootEl, false)) {
  56790. items[id] = el;
  56791. }
  56792. }, this);
  56793. order.forEach(function (id) {
  56794. if (items[id]) {
  56795. rootEl.removeChild(items[id]);
  56796. rootEl.appendChild(items[id]);
  56797. }
  56798. });
  56799. },
  56800. /**
  56801. * Save the current sorting
  56802. */
  56803. save: function save() {
  56804. var store = this.options.store;
  56805. store && store.set && store.set(this);
  56806. },
  56807. /**
  56808. * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
  56809. * @param {HTMLElement} el
  56810. * @param {String} [selector] default: `options.draggable`
  56811. * @returns {HTMLElement|null}
  56812. */
  56813. closest: function closest$1(el, selector) {
  56814. return closest(el, selector || this.options.draggable, this.el, false);
  56815. },
  56816. /**
  56817. * Set/get option
  56818. * @param {string} name
  56819. * @param {*} [value]
  56820. * @returns {*}
  56821. */
  56822. option: function option(name, value) {
  56823. var options = this.options;
  56824. if (value === void 0) {
  56825. return options[name];
  56826. } else {
  56827. var modifiedValue = PluginManager.modifyOption(this, name, value);
  56828. if (typeof modifiedValue !== 'undefined') {
  56829. options[name] = modifiedValue;
  56830. } else {
  56831. options[name] = value;
  56832. }
  56833. if (name === 'group') {
  56834. _prepareGroup(options);
  56835. }
  56836. }
  56837. },
  56838. /**
  56839. * Destroy
  56840. */
  56841. destroy: function destroy() {
  56842. pluginEvent('destroy', this);
  56843. var el = this.el;
  56844. el[expando] = null;
  56845. off(el, 'mousedown', this._onTapStart);
  56846. off(el, 'touchstart', this._onTapStart);
  56847. off(el, 'pointerdown', this._onTapStart);
  56848. if (this.nativeDraggable) {
  56849. off(el, 'dragover', this);
  56850. off(el, 'dragenter', this);
  56851. } // Remove draggable attributes
  56852. Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
  56853. el.removeAttribute('draggable');
  56854. });
  56855. this._onDrop();
  56856. this._disableDelayedDragEvents();
  56857. sortables.splice(sortables.indexOf(this.el), 1);
  56858. this.el = el = null;
  56859. },
  56860. _hideClone: function _hideClone() {
  56861. if (!cloneHidden) {
  56862. pluginEvent('hideClone', this);
  56863. if (Sortable.eventCanceled) return;
  56864. css(cloneEl, 'display', 'none');
  56865. if (this.options.removeCloneOnHide && cloneEl.parentNode) {
  56866. cloneEl.parentNode.removeChild(cloneEl);
  56867. }
  56868. cloneHidden = true;
  56869. }
  56870. },
  56871. _showClone: function _showClone(putSortable) {
  56872. if (putSortable.lastPutMode !== 'clone') {
  56873. this._hideClone();
  56874. return;
  56875. }
  56876. if (cloneHidden) {
  56877. pluginEvent('showClone', this);
  56878. if (Sortable.eventCanceled) return; // show clone at dragEl or original position
  56879. if (rootEl.contains(dragEl) && !this.options.group.revertClone) {
  56880. rootEl.insertBefore(cloneEl, dragEl);
  56881. } else if (nextEl) {
  56882. rootEl.insertBefore(cloneEl, nextEl);
  56883. } else {
  56884. rootEl.appendChild(cloneEl);
  56885. }
  56886. if (this.options.group.revertClone) {
  56887. this.animate(dragEl, cloneEl);
  56888. }
  56889. css(cloneEl, 'display', '');
  56890. cloneHidden = false;
  56891. }
  56892. }
  56893. };
  56894. function _globalDragOver(
  56895. /**Event*/
  56896. evt) {
  56897. if (evt.dataTransfer) {
  56898. evt.dataTransfer.dropEffect = 'move';
  56899. }
  56900. evt.cancelable && evt.preventDefault();
  56901. }
  56902. function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
  56903. var evt,
  56904. sortable = fromEl[expando],
  56905. onMoveFn = sortable.options.onMove,
  56906. retVal; // Support for new CustomEvent feature
  56907. if (window.CustomEvent && !IE11OrLess && !Edge) {
  56908. evt = new CustomEvent('move', {
  56909. bubbles: true,
  56910. cancelable: true
  56911. });
  56912. } else {
  56913. evt = document.createEvent('Event');
  56914. evt.initEvent('move', true, true);
  56915. }
  56916. evt.to = toEl;
  56917. evt.from = fromEl;
  56918. evt.dragged = dragEl;
  56919. evt.draggedRect = dragRect;
  56920. evt.related = targetEl || toEl;
  56921. evt.relatedRect = targetRect || getRect(toEl);
  56922. evt.willInsertAfter = willInsertAfter;
  56923. evt.originalEvent = originalEvent;
  56924. fromEl.dispatchEvent(evt);
  56925. if (onMoveFn) {
  56926. retVal = onMoveFn.call(sortable, evt, originalEvent);
  56927. }
  56928. return retVal;
  56929. }
  56930. function _disableDraggable(el) {
  56931. el.draggable = false;
  56932. }
  56933. function _unsilent() {
  56934. _silent = false;
  56935. }
  56936. function _ghostIsLast(evt, vertical, sortable) {
  56937. var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
  56938. var spacer = 10;
  56939. return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
  56940. }
  56941. function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
  56942. var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
  56943. targetLength = vertical ? targetRect.height : targetRect.width,
  56944. targetS1 = vertical ? targetRect.top : targetRect.left,
  56945. targetS2 = vertical ? targetRect.bottom : targetRect.right,
  56946. invert = false;
  56947. if (!invertSwap) {
  56948. // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
  56949. if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
  56950. // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
  56951. // check if past first invert threshold on side opposite of lastDirection
  56952. if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
  56953. // past first invert threshold, do not restrict inverted threshold to dragEl shadow
  56954. pastFirstInvertThresh = true;
  56955. }
  56956. if (!pastFirstInvertThresh) {
  56957. // dragEl shadow (target move distance shadow)
  56958. if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
  56959. : mouseOnAxis > targetS2 - targetMoveDistance) {
  56960. return -lastDirection;
  56961. }
  56962. } else {
  56963. invert = true;
  56964. }
  56965. } else {
  56966. // Regular
  56967. if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
  56968. return _getInsertDirection(target);
  56969. }
  56970. }
  56971. }
  56972. invert = invert || invertSwap;
  56973. if (invert) {
  56974. // Invert of regular
  56975. if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
  56976. return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
  56977. }
  56978. }
  56979. return 0;
  56980. }
  56981. /**
  56982. * Gets the direction dragEl must be swapped relative to target in order to make it
  56983. * seem that dragEl has been "inserted" into that element's position
  56984. * @param {HTMLElement} target The target whose position dragEl is being inserted at
  56985. * @return {Number} Direction dragEl must be swapped
  56986. */
  56987. function _getInsertDirection(target) {
  56988. if (index(dragEl) < index(target)) {
  56989. return 1;
  56990. } else {
  56991. return -1;
  56992. }
  56993. }
  56994. /**
  56995. * Generate id
  56996. * @param {HTMLElement} el
  56997. * @returns {String}
  56998. * @private
  56999. */
  57000. function _generateId(el) {
  57001. var str = el.tagName + el.className + el.src + el.href + el.textContent,
  57002. i = str.length,
  57003. sum = 0;
  57004. while (i--) {
  57005. sum += str.charCodeAt(i);
  57006. }
  57007. return sum.toString(36);
  57008. }
  57009. function _saveInputCheckedState(root) {
  57010. savedInputChecked.length = 0;
  57011. var inputs = root.getElementsByTagName('input');
  57012. var idx = inputs.length;
  57013. while (idx--) {
  57014. var el = inputs[idx];
  57015. el.checked && savedInputChecked.push(el);
  57016. }
  57017. }
  57018. function _nextTick(fn) {
  57019. return setTimeout(fn, 0);
  57020. }
  57021. function _cancelNextTick(id) {
  57022. return clearTimeout(id);
  57023. } // Fixed #973:
  57024. if (documentExists) {
  57025. on(document, 'touchmove', function (evt) {
  57026. if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
  57027. evt.preventDefault();
  57028. }
  57029. });
  57030. } // Export utils
  57031. Sortable.utils = {
  57032. on: on,
  57033. off: off,
  57034. css: css,
  57035. find: find,
  57036. is: function is(el, selector) {
  57037. return !!closest(el, selector, el, false);
  57038. },
  57039. extend: extend,
  57040. throttle: throttle,
  57041. closest: closest,
  57042. toggleClass: toggleClass,
  57043. clone: clone,
  57044. index: index,
  57045. nextTick: _nextTick,
  57046. cancelNextTick: _cancelNextTick,
  57047. detectDirection: _detectDirection,
  57048. getChild: getChild
  57049. };
  57050. /**
  57051. * Get the Sortable instance of an element
  57052. * @param {HTMLElement} element The element
  57053. * @return {Sortable|undefined} The instance of Sortable
  57054. */
  57055. Sortable.get = function (element) {
  57056. return element[expando];
  57057. };
  57058. /**
  57059. * Mount a plugin to Sortable
  57060. * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
  57061. */
  57062. Sortable.mount = function () {
  57063. for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
  57064. plugins[_key] = arguments[_key];
  57065. }
  57066. if (plugins[0].constructor === Array) plugins = plugins[0];
  57067. plugins.forEach(function (plugin) {
  57068. if (!plugin.prototype || !plugin.prototype.constructor) {
  57069. throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
  57070. }
  57071. if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);
  57072. PluginManager.mount(plugin);
  57073. });
  57074. };
  57075. /**
  57076. * Create sortable instance
  57077. * @param {HTMLElement} el
  57078. * @param {Object} [options]
  57079. */
  57080. Sortable.create = function (el, options) {
  57081. return new Sortable(el, options);
  57082. }; // Export
  57083. Sortable.version = version;
  57084. var autoScrolls = [],
  57085. scrollEl,
  57086. scrollRootEl,
  57087. scrolling = false,
  57088. lastAutoScrollX,
  57089. lastAutoScrollY,
  57090. touchEvt$1,
  57091. pointerElemChangedInterval;
  57092. function AutoScrollPlugin() {
  57093. function AutoScroll() {
  57094. this.defaults = {
  57095. scroll: true,
  57096. scrollSensitivity: 30,
  57097. scrollSpeed: 10,
  57098. bubbleScroll: true
  57099. }; // Bind all private methods
  57100. for (var fn in this) {
  57101. if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
  57102. this[fn] = this[fn].bind(this);
  57103. }
  57104. }
  57105. }
  57106. AutoScroll.prototype = {
  57107. dragStarted: function dragStarted(_ref) {
  57108. var originalEvent = _ref.originalEvent;
  57109. if (this.sortable.nativeDraggable) {
  57110. on(document, 'dragover', this._handleAutoScroll);
  57111. } else {
  57112. if (this.options.supportPointer) {
  57113. on(document, 'pointermove', this._handleFallbackAutoScroll);
  57114. } else if (originalEvent.touches) {
  57115. on(document, 'touchmove', this._handleFallbackAutoScroll);
  57116. } else {
  57117. on(document, 'mousemove', this._handleFallbackAutoScroll);
  57118. }
  57119. }
  57120. },
  57121. dragOverCompleted: function dragOverCompleted(_ref2) {
  57122. var originalEvent = _ref2.originalEvent;
  57123. // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
  57124. if (!this.options.dragOverBubble && !originalEvent.rootEl) {
  57125. this._handleAutoScroll(originalEvent);
  57126. }
  57127. },
  57128. drop: function drop() {
  57129. if (this.sortable.nativeDraggable) {
  57130. off(document, 'dragover', this._handleAutoScroll);
  57131. } else {
  57132. off(document, 'pointermove', this._handleFallbackAutoScroll);
  57133. off(document, 'touchmove', this._handleFallbackAutoScroll);
  57134. off(document, 'mousemove', this._handleFallbackAutoScroll);
  57135. }
  57136. clearPointerElemChangedInterval();
  57137. clearAutoScrolls();
  57138. cancelThrottle();
  57139. },
  57140. nulling: function nulling() {
  57141. touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
  57142. autoScrolls.length = 0;
  57143. },
  57144. _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
  57145. this._handleAutoScroll(evt, true);
  57146. },
  57147. _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
  57148. var _this = this;
  57149. var x = (evt.touches ? evt.touches[0] : evt).clientX,
  57150. y = (evt.touches ? evt.touches[0] : evt).clientY,
  57151. elem = document.elementFromPoint(x, y);
  57152. touchEvt$1 = evt; // IE does not seem to have native autoscroll,
  57153. // Edge's autoscroll seems too conditional,
  57154. // MACOS Safari does not have autoscroll,
  57155. // Firefox and Chrome are good
  57156. if (fallback || Edge || IE11OrLess || Safari) {
  57157. autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change
  57158. var ogElemScroller = getParentAutoScrollElement(elem, true);
  57159. if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
  57160. pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour
  57161. pointerElemChangedInterval = setInterval(function () {
  57162. var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
  57163. if (newElem !== ogElemScroller) {
  57164. ogElemScroller = newElem;
  57165. clearAutoScrolls();
  57166. }
  57167. autoScroll(evt, _this.options, newElem, fallback);
  57168. }, 10);
  57169. lastAutoScrollX = x;
  57170. lastAutoScrollY = y;
  57171. }
  57172. } else {
  57173. // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
  57174. if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
  57175. clearAutoScrolls();
  57176. return;
  57177. }
  57178. autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
  57179. }
  57180. }
  57181. };
  57182. return _extends(AutoScroll, {
  57183. pluginName: 'scroll',
  57184. initializeByDefault: true
  57185. });
  57186. }
  57187. function clearAutoScrolls() {
  57188. autoScrolls.forEach(function (autoScroll) {
  57189. clearInterval(autoScroll.pid);
  57190. });
  57191. autoScrolls = [];
  57192. }
  57193. function clearPointerElemChangedInterval() {
  57194. clearInterval(pointerElemChangedInterval);
  57195. }
  57196. var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
  57197. // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
  57198. if (!options.scroll) return;
  57199. var x = (evt.touches ? evt.touches[0] : evt).clientX,
  57200. y = (evt.touches ? evt.touches[0] : evt).clientY,
  57201. sens = options.scrollSensitivity,
  57202. speed = options.scrollSpeed,
  57203. winScroller = getWindowScrollingElement();
  57204. var scrollThisInstance = false,
  57205. scrollCustomFn; // New scroll root, set scrollEl
  57206. if (scrollRootEl !== rootEl) {
  57207. scrollRootEl = rootEl;
  57208. clearAutoScrolls();
  57209. scrollEl = options.scroll;
  57210. scrollCustomFn = options.scrollFn;
  57211. if (scrollEl === true) {
  57212. scrollEl = getParentAutoScrollElement(rootEl, true);
  57213. }
  57214. }
  57215. var layersOut = 0;
  57216. var currentParent = scrollEl;
  57217. do {
  57218. var el = currentParent,
  57219. rect = getRect(el),
  57220. top = rect.top,
  57221. bottom = rect.bottom,
  57222. left = rect.left,
  57223. right = rect.right,
  57224. width = rect.width,
  57225. height = rect.height,
  57226. canScrollX = void 0,
  57227. canScrollY = void 0,
  57228. scrollWidth = el.scrollWidth,
  57229. scrollHeight = el.scrollHeight,
  57230. elCSS = css(el),
  57231. scrollPosX = el.scrollLeft,
  57232. scrollPosY = el.scrollTop;
  57233. if (el === winScroller) {
  57234. canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
  57235. canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
  57236. } else {
  57237. canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
  57238. canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
  57239. }
  57240. var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
  57241. var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
  57242. if (!autoScrolls[layersOut]) {
  57243. for (var i = 0; i <= layersOut; i++) {
  57244. if (!autoScrolls[i]) {
  57245. autoScrolls[i] = {};
  57246. }
  57247. }
  57248. }
  57249. if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
  57250. autoScrolls[layersOut].el = el;
  57251. autoScrolls[layersOut].vx = vx;
  57252. autoScrolls[layersOut].vy = vy;
  57253. clearInterval(autoScrolls[layersOut].pid);
  57254. if (vx != 0 || vy != 0) {
  57255. scrollThisInstance = true;
  57256. /* jshint loopfunc:true */
  57257. autoScrolls[layersOut].pid = setInterval(function () {
  57258. // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
  57259. if (isFallback && this.layer === 0) {
  57260. Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
  57261. }
  57262. var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
  57263. var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
  57264. if (typeof scrollCustomFn === 'function') {
  57265. if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
  57266. return;
  57267. }
  57268. }
  57269. scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
  57270. }.bind({
  57271. layer: layersOut
  57272. }), 24);
  57273. }
  57274. }
  57275. layersOut++;
  57276. } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
  57277. scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
  57278. }, 30);
  57279. var drop = function drop(_ref) {
  57280. var originalEvent = _ref.originalEvent,
  57281. putSortable = _ref.putSortable,
  57282. dragEl = _ref.dragEl,
  57283. activeSortable = _ref.activeSortable,
  57284. dispatchSortableEvent = _ref.dispatchSortableEvent,
  57285. hideGhostForTarget = _ref.hideGhostForTarget,
  57286. unhideGhostForTarget = _ref.unhideGhostForTarget;
  57287. if (!originalEvent) return;
  57288. var toSortable = putSortable || activeSortable;
  57289. hideGhostForTarget();
  57290. var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
  57291. var target = document.elementFromPoint(touch.clientX, touch.clientY);
  57292. unhideGhostForTarget();
  57293. if (toSortable && !toSortable.el.contains(target)) {
  57294. dispatchSortableEvent('spill');
  57295. this.onSpill({
  57296. dragEl: dragEl,
  57297. putSortable: putSortable
  57298. });
  57299. }
  57300. };
  57301. function Revert() {}
  57302. Revert.prototype = {
  57303. startIndex: null,
  57304. dragStart: function dragStart(_ref2) {
  57305. var oldDraggableIndex = _ref2.oldDraggableIndex;
  57306. this.startIndex = oldDraggableIndex;
  57307. },
  57308. onSpill: function onSpill(_ref3) {
  57309. var dragEl = _ref3.dragEl,
  57310. putSortable = _ref3.putSortable;
  57311. this.sortable.captureAnimationState();
  57312. if (putSortable) {
  57313. putSortable.captureAnimationState();
  57314. }
  57315. var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
  57316. if (nextSibling) {
  57317. this.sortable.el.insertBefore(dragEl, nextSibling);
  57318. } else {
  57319. this.sortable.el.appendChild(dragEl);
  57320. }
  57321. this.sortable.animateAll();
  57322. if (putSortable) {
  57323. putSortable.animateAll();
  57324. }
  57325. },
  57326. drop: drop
  57327. };
  57328. _extends(Revert, {
  57329. pluginName: 'revertOnSpill'
  57330. });
  57331. function Remove() {}
  57332. Remove.prototype = {
  57333. onSpill: function onSpill(_ref4) {
  57334. var dragEl = _ref4.dragEl,
  57335. putSortable = _ref4.putSortable;
  57336. var parentSortable = putSortable || this.sortable;
  57337. parentSortable.captureAnimationState();
  57338. dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
  57339. parentSortable.animateAll();
  57340. },
  57341. drop: drop
  57342. };
  57343. _extends(Remove, {
  57344. pluginName: 'removeOnSpill'
  57345. });
  57346. var lastSwapEl;
  57347. function SwapPlugin() {
  57348. function Swap() {
  57349. this.defaults = {
  57350. swapClass: 'sortable-swap-highlight'
  57351. };
  57352. }
  57353. Swap.prototype = {
  57354. dragStart: function dragStart(_ref) {
  57355. var dragEl = _ref.dragEl;
  57356. lastSwapEl = dragEl;
  57357. },
  57358. dragOverValid: function dragOverValid(_ref2) {
  57359. var completed = _ref2.completed,
  57360. target = _ref2.target,
  57361. onMove = _ref2.onMove,
  57362. activeSortable = _ref2.activeSortable,
  57363. changed = _ref2.changed,
  57364. cancel = _ref2.cancel;
  57365. if (!activeSortable.options.swap) return;
  57366. var el = this.sortable.el,
  57367. options = this.options;
  57368. if (target && target !== el) {
  57369. var prevSwapEl = lastSwapEl;
  57370. if (onMove(target) !== false) {
  57371. toggleClass(target, options.swapClass, true);
  57372. lastSwapEl = target;
  57373. } else {
  57374. lastSwapEl = null;
  57375. }
  57376. if (prevSwapEl && prevSwapEl !== lastSwapEl) {
  57377. toggleClass(prevSwapEl, options.swapClass, false);
  57378. }
  57379. }
  57380. changed();
  57381. completed(true);
  57382. cancel();
  57383. },
  57384. drop: function drop(_ref3) {
  57385. var activeSortable = _ref3.activeSortable,
  57386. putSortable = _ref3.putSortable,
  57387. dragEl = _ref3.dragEl;
  57388. var toSortable = putSortable || this.sortable;
  57389. var options = this.options;
  57390. lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);
  57391. if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {
  57392. if (dragEl !== lastSwapEl) {
  57393. toSortable.captureAnimationState();
  57394. if (toSortable !== activeSortable) activeSortable.captureAnimationState();
  57395. swapNodes(dragEl, lastSwapEl);
  57396. toSortable.animateAll();
  57397. if (toSortable !== activeSortable) activeSortable.animateAll();
  57398. }
  57399. }
  57400. },
  57401. nulling: function nulling() {
  57402. lastSwapEl = null;
  57403. }
  57404. };
  57405. return _extends(Swap, {
  57406. pluginName: 'swap',
  57407. eventProperties: function eventProperties() {
  57408. return {
  57409. swapItem: lastSwapEl
  57410. };
  57411. }
  57412. });
  57413. }
  57414. function swapNodes(n1, n2) {
  57415. var p1 = n1.parentNode,
  57416. p2 = n2.parentNode,
  57417. i1,
  57418. i2;
  57419. if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
  57420. i1 = index(n1);
  57421. i2 = index(n2);
  57422. if (p1.isEqualNode(p2) && i1 < i2) {
  57423. i2++;
  57424. }
  57425. p1.insertBefore(n2, p1.children[i1]);
  57426. p2.insertBefore(n1, p2.children[i2]);
  57427. }
  57428. var multiDragElements = [],
  57429. multiDragClones = [],
  57430. lastMultiDragSelect,
  57431. // for selection with modifier key down (SHIFT)
  57432. multiDragSortable,
  57433. initialFolding = false,
  57434. // Initial multi-drag fold when drag started
  57435. folding = false,
  57436. // Folding any other time
  57437. dragStarted = false,
  57438. dragEl$1,
  57439. clonesFromRect,
  57440. clonesHidden;
  57441. function MultiDragPlugin() {
  57442. function MultiDrag(sortable) {
  57443. // Bind all private methods
  57444. for (var fn in this) {
  57445. if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
  57446. this[fn] = this[fn].bind(this);
  57447. }
  57448. }
  57449. if (sortable.options.supportPointer) {
  57450. on(document, 'pointerup', this._deselectMultiDrag);
  57451. } else {
  57452. on(document, 'mouseup', this._deselectMultiDrag);
  57453. on(document, 'touchend', this._deselectMultiDrag);
  57454. }
  57455. on(document, 'keydown', this._checkKeyDown);
  57456. on(document, 'keyup', this._checkKeyUp);
  57457. this.defaults = {
  57458. selectedClass: 'sortable-selected',
  57459. multiDragKey: null,
  57460. setData: function setData(dataTransfer, dragEl) {
  57461. var data = '';
  57462. if (multiDragElements.length && multiDragSortable === sortable) {
  57463. multiDragElements.forEach(function (multiDragElement, i) {
  57464. data += (!i ? '' : ', ') + multiDragElement.textContent;
  57465. });
  57466. } else {
  57467. data = dragEl.textContent;
  57468. }
  57469. dataTransfer.setData('Text', data);
  57470. }
  57471. };
  57472. }
  57473. MultiDrag.prototype = {
  57474. multiDragKeyDown: false,
  57475. isMultiDrag: false,
  57476. delayStartGlobal: function delayStartGlobal(_ref) {
  57477. var dragged = _ref.dragEl;
  57478. dragEl$1 = dragged;
  57479. },
  57480. delayEnded: function delayEnded() {
  57481. this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);
  57482. },
  57483. setupClone: function setupClone(_ref2) {
  57484. var sortable = _ref2.sortable,
  57485. cancel = _ref2.cancel;
  57486. if (!this.isMultiDrag) return;
  57487. for (var i = 0; i < multiDragElements.length; i++) {
  57488. multiDragClones.push(clone(multiDragElements[i]));
  57489. multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;
  57490. multiDragClones[i].draggable = false;
  57491. multiDragClones[i].style['will-change'] = '';
  57492. toggleClass(multiDragClones[i], this.options.selectedClass, false);
  57493. multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);
  57494. }
  57495. sortable._hideClone();
  57496. cancel();
  57497. },
  57498. clone: function clone(_ref3) {
  57499. var sortable = _ref3.sortable,
  57500. rootEl = _ref3.rootEl,
  57501. dispatchSortableEvent = _ref3.dispatchSortableEvent,
  57502. cancel = _ref3.cancel;
  57503. if (!this.isMultiDrag) return;
  57504. if (!this.options.removeCloneOnHide) {
  57505. if (multiDragElements.length && multiDragSortable === sortable) {
  57506. insertMultiDragClones(true, rootEl);
  57507. dispatchSortableEvent('clone');
  57508. cancel();
  57509. }
  57510. }
  57511. },
  57512. showClone: function showClone(_ref4) {
  57513. var cloneNowShown = _ref4.cloneNowShown,
  57514. rootEl = _ref4.rootEl,
  57515. cancel = _ref4.cancel;
  57516. if (!this.isMultiDrag) return;
  57517. insertMultiDragClones(false, rootEl);
  57518. multiDragClones.forEach(function (clone) {
  57519. css(clone, 'display', '');
  57520. });
  57521. cloneNowShown();
  57522. clonesHidden = false;
  57523. cancel();
  57524. },
  57525. hideClone: function hideClone(_ref5) {
  57526. var _this = this;
  57527. var sortable = _ref5.sortable,
  57528. cloneNowHidden = _ref5.cloneNowHidden,
  57529. cancel = _ref5.cancel;
  57530. if (!this.isMultiDrag) return;
  57531. multiDragClones.forEach(function (clone) {
  57532. css(clone, 'display', 'none');
  57533. if (_this.options.removeCloneOnHide && clone.parentNode) {
  57534. clone.parentNode.removeChild(clone);
  57535. }
  57536. });
  57537. cloneNowHidden();
  57538. clonesHidden = true;
  57539. cancel();
  57540. },
  57541. dragStartGlobal: function dragStartGlobal(_ref6) {
  57542. var sortable = _ref6.sortable;
  57543. if (!this.isMultiDrag && multiDragSortable) {
  57544. multiDragSortable.multiDrag._deselectMultiDrag();
  57545. }
  57546. multiDragElements.forEach(function (multiDragElement) {
  57547. multiDragElement.sortableIndex = index(multiDragElement);
  57548. }); // Sort multi-drag elements
  57549. multiDragElements = multiDragElements.sort(function (a, b) {
  57550. return a.sortableIndex - b.sortableIndex;
  57551. });
  57552. dragStarted = true;
  57553. },
  57554. dragStarted: function dragStarted(_ref7) {
  57555. var _this2 = this;
  57556. var sortable = _ref7.sortable;
  57557. if (!this.isMultiDrag) return;
  57558. if (this.options.sort) {
  57559. // Capture rects,
  57560. // hide multi drag elements (by positioning them absolute),
  57561. // set multi drag elements rects to dragRect,
  57562. // show multi drag elements,
  57563. // animate to rects,
  57564. // unset rects & remove from DOM
  57565. sortable.captureAnimationState();
  57566. if (this.options.animation) {
  57567. multiDragElements.forEach(function (multiDragElement) {
  57568. if (multiDragElement === dragEl$1) return;
  57569. css(multiDragElement, 'position', 'absolute');
  57570. });
  57571. var dragRect = getRect(dragEl$1, false, true, true);
  57572. multiDragElements.forEach(function (multiDragElement) {
  57573. if (multiDragElement === dragEl$1) return;
  57574. setRect(multiDragElement, dragRect);
  57575. });
  57576. folding = true;
  57577. initialFolding = true;
  57578. }
  57579. }
  57580. sortable.animateAll(function () {
  57581. folding = false;
  57582. initialFolding = false;
  57583. if (_this2.options.animation) {
  57584. multiDragElements.forEach(function (multiDragElement) {
  57585. unsetRect(multiDragElement);
  57586. });
  57587. } // Remove all auxiliary multidrag items from el, if sorting enabled
  57588. if (_this2.options.sort) {
  57589. removeMultiDragElements();
  57590. }
  57591. });
  57592. },
  57593. dragOver: function dragOver(_ref8) {
  57594. var target = _ref8.target,
  57595. completed = _ref8.completed,
  57596. cancel = _ref8.cancel;
  57597. if (folding && ~multiDragElements.indexOf(target)) {
  57598. completed(false);
  57599. cancel();
  57600. }
  57601. },
  57602. revert: function revert(_ref9) {
  57603. var fromSortable = _ref9.fromSortable,
  57604. rootEl = _ref9.rootEl,
  57605. sortable = _ref9.sortable,
  57606. dragRect = _ref9.dragRect;
  57607. if (multiDragElements.length > 1) {
  57608. // Setup unfold animation
  57609. multiDragElements.forEach(function (multiDragElement) {
  57610. sortable.addAnimationState({
  57611. target: multiDragElement,
  57612. rect: folding ? getRect(multiDragElement) : dragRect
  57613. });
  57614. unsetRect(multiDragElement);
  57615. multiDragElement.fromRect = dragRect;
  57616. fromSortable.removeAnimationState(multiDragElement);
  57617. });
  57618. folding = false;
  57619. insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);
  57620. }
  57621. },
  57622. dragOverCompleted: function dragOverCompleted(_ref10) {
  57623. var sortable = _ref10.sortable,
  57624. isOwner = _ref10.isOwner,
  57625. insertion = _ref10.insertion,
  57626. activeSortable = _ref10.activeSortable,
  57627. parentEl = _ref10.parentEl,
  57628. putSortable = _ref10.putSortable;
  57629. var options = this.options;
  57630. if (insertion) {
  57631. // Clones must be hidden before folding animation to capture dragRectAbsolute properly
  57632. if (isOwner) {
  57633. activeSortable._hideClone();
  57634. }
  57635. initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location
  57636. if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {
  57637. // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible
  57638. var dragRectAbsolute = getRect(dragEl$1, false, true, true);
  57639. multiDragElements.forEach(function (multiDragElement) {
  57640. if (multiDragElement === dragEl$1) return;
  57641. setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted
  57642. // while folding, and so that we can capture them again because old sortable will no longer be fromSortable
  57643. parentEl.appendChild(multiDragElement);
  57644. });
  57645. folding = true;
  57646. } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out
  57647. if (!isOwner) {
  57648. // Only remove if not folding (folding will remove them anyways)
  57649. if (!folding) {
  57650. removeMultiDragElements();
  57651. }
  57652. if (multiDragElements.length > 1) {
  57653. var clonesHiddenBefore = clonesHidden;
  57654. activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden
  57655. if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {
  57656. multiDragClones.forEach(function (clone) {
  57657. activeSortable.addAnimationState({
  57658. target: clone,
  57659. rect: clonesFromRect
  57660. });
  57661. clone.fromRect = clonesFromRect;
  57662. clone.thisAnimationDuration = null;
  57663. });
  57664. }
  57665. } else {
  57666. activeSortable._showClone(sortable);
  57667. }
  57668. }
  57669. }
  57670. },
  57671. dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {
  57672. var dragRect = _ref11.dragRect,
  57673. isOwner = _ref11.isOwner,
  57674. activeSortable = _ref11.activeSortable;
  57675. multiDragElements.forEach(function (multiDragElement) {
  57676. multiDragElement.thisAnimationDuration = null;
  57677. });
  57678. if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {
  57679. clonesFromRect = _extends({}, dragRect);
  57680. var dragMatrix = matrix(dragEl$1, true);
  57681. clonesFromRect.top -= dragMatrix.f;
  57682. clonesFromRect.left -= dragMatrix.e;
  57683. }
  57684. },
  57685. dragOverAnimationComplete: function dragOverAnimationComplete() {
  57686. if (folding) {
  57687. folding = false;
  57688. removeMultiDragElements();
  57689. }
  57690. },
  57691. drop: function drop(_ref12) {
  57692. var evt = _ref12.originalEvent,
  57693. rootEl = _ref12.rootEl,
  57694. parentEl = _ref12.parentEl,
  57695. sortable = _ref12.sortable,
  57696. dispatchSortableEvent = _ref12.dispatchSortableEvent,
  57697. oldIndex = _ref12.oldIndex,
  57698. putSortable = _ref12.putSortable;
  57699. var toSortable = putSortable || this.sortable;
  57700. if (!evt) return;
  57701. var options = this.options,
  57702. children = parentEl.children; // Multi-drag selection
  57703. if (!dragStarted) {
  57704. if (options.multiDragKey && !this.multiDragKeyDown) {
  57705. this._deselectMultiDrag();
  57706. }
  57707. toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));
  57708. if (!~multiDragElements.indexOf(dragEl$1)) {
  57709. multiDragElements.push(dragEl$1);
  57710. dispatchEvent({
  57711. sortable: sortable,
  57712. rootEl: rootEl,
  57713. name: 'select',
  57714. targetEl: dragEl$1,
  57715. originalEvt: evt
  57716. }); // Modifier activated, select from last to dragEl
  57717. if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {
  57718. var lastIndex = index(lastMultiDragSelect),
  57719. currentIndex = index(dragEl$1);
  57720. if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
  57721. // Must include lastMultiDragSelect (select it), in case modified selection from no selection
  57722. // (but previous selection existed)
  57723. var n, i;
  57724. if (currentIndex > lastIndex) {
  57725. i = lastIndex;
  57726. n = currentIndex;
  57727. } else {
  57728. i = currentIndex;
  57729. n = lastIndex + 1;
  57730. }
  57731. for (; i < n; i++) {
  57732. if (~multiDragElements.indexOf(children[i])) continue;
  57733. toggleClass(children[i], options.selectedClass, true);
  57734. multiDragElements.push(children[i]);
  57735. dispatchEvent({
  57736. sortable: sortable,
  57737. rootEl: rootEl,
  57738. name: 'select',
  57739. targetEl: children[i],
  57740. originalEvt: evt
  57741. });
  57742. }
  57743. }
  57744. } else {
  57745. lastMultiDragSelect = dragEl$1;
  57746. }
  57747. multiDragSortable = toSortable;
  57748. } else {
  57749. multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);
  57750. lastMultiDragSelect = null;
  57751. dispatchEvent({
  57752. sortable: sortable,
  57753. rootEl: rootEl,
  57754. name: 'deselect',
  57755. targetEl: dragEl$1,
  57756. originalEvt: evt
  57757. });
  57758. }
  57759. } // Multi-drag drop
  57760. if (dragStarted && this.isMultiDrag) {
  57761. // Do not "unfold" after around dragEl if reverted
  57762. if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
  57763. var dragRect = getRect(dragEl$1),
  57764. multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');
  57765. if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;
  57766. toSortable.captureAnimationState();
  57767. if (!initialFolding) {
  57768. if (options.animation) {
  57769. dragEl$1.fromRect = dragRect;
  57770. multiDragElements.forEach(function (multiDragElement) {
  57771. multiDragElement.thisAnimationDuration = null;
  57772. if (multiDragElement !== dragEl$1) {
  57773. var rect = folding ? getRect(multiDragElement) : dragRect;
  57774. multiDragElement.fromRect = rect; // Prepare unfold animation
  57775. toSortable.addAnimationState({
  57776. target: multiDragElement,
  57777. rect: rect
  57778. });
  57779. }
  57780. });
  57781. } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert
  57782. // properly they must all be removed
  57783. removeMultiDragElements();
  57784. multiDragElements.forEach(function (multiDragElement) {
  57785. if (children[multiDragIndex]) {
  57786. parentEl.insertBefore(multiDragElement, children[multiDragIndex]);
  57787. } else {
  57788. parentEl.appendChild(multiDragElement);
  57789. }
  57790. multiDragIndex++;
  57791. }); // If initial folding is done, the elements may have changed position because they are now
  57792. // unfolding around dragEl, even though dragEl may not have his index changed, so update event
  57793. // must be fired here as Sortable will not.
  57794. if (oldIndex === index(dragEl$1)) {
  57795. var update = false;
  57796. multiDragElements.forEach(function (multiDragElement) {
  57797. if (multiDragElement.sortableIndex !== index(multiDragElement)) {
  57798. update = true;
  57799. return;
  57800. }
  57801. });
  57802. if (update) {
  57803. dispatchSortableEvent('update');
  57804. }
  57805. }
  57806. } // Must be done after capturing individual rects (scroll bar)
  57807. multiDragElements.forEach(function (multiDragElement) {
  57808. unsetRect(multiDragElement);
  57809. });
  57810. toSortable.animateAll();
  57811. }
  57812. multiDragSortable = toSortable;
  57813. } // Remove clones if necessary
  57814. if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
  57815. multiDragClones.forEach(function (clone) {
  57816. clone.parentNode && clone.parentNode.removeChild(clone);
  57817. });
  57818. }
  57819. },
  57820. nullingGlobal: function nullingGlobal() {
  57821. this.isMultiDrag = dragStarted = false;
  57822. multiDragClones.length = 0;
  57823. },
  57824. destroyGlobal: function destroyGlobal() {
  57825. this._deselectMultiDrag();
  57826. off(document, 'pointerup', this._deselectMultiDrag);
  57827. off(document, 'mouseup', this._deselectMultiDrag);
  57828. off(document, 'touchend', this._deselectMultiDrag);
  57829. off(document, 'keydown', this._checkKeyDown);
  57830. off(document, 'keyup', this._checkKeyUp);
  57831. },
  57832. _deselectMultiDrag: function _deselectMultiDrag(evt) {
  57833. if (typeof dragStarted !== "undefined" && dragStarted) return; // Only deselect if selection is in this sortable
  57834. if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable
  57835. if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click
  57836. if (evt && evt.button !== 0) return;
  57837. while (multiDragElements.length) {
  57838. var el = multiDragElements[0];
  57839. toggleClass(el, this.options.selectedClass, false);
  57840. multiDragElements.shift();
  57841. dispatchEvent({
  57842. sortable: this.sortable,
  57843. rootEl: this.sortable.el,
  57844. name: 'deselect',
  57845. targetEl: el,
  57846. originalEvt: evt
  57847. });
  57848. }
  57849. },
  57850. _checkKeyDown: function _checkKeyDown(evt) {
  57851. if (evt.key === this.options.multiDragKey) {
  57852. this.multiDragKeyDown = true;
  57853. }
  57854. },
  57855. _checkKeyUp: function _checkKeyUp(evt) {
  57856. if (evt.key === this.options.multiDragKey) {
  57857. this.multiDragKeyDown = false;
  57858. }
  57859. }
  57860. };
  57861. return _extends(MultiDrag, {
  57862. // Static methods & properties
  57863. pluginName: 'multiDrag',
  57864. utils: {
  57865. /**
  57866. * Selects the provided multi-drag item
  57867. * @param {HTMLElement} el The element to be selected
  57868. */
  57869. select: function select(el) {
  57870. var sortable = el.parentNode[expando];
  57871. if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;
  57872. if (multiDragSortable && multiDragSortable !== sortable) {
  57873. multiDragSortable.multiDrag._deselectMultiDrag();
  57874. multiDragSortable = sortable;
  57875. }
  57876. toggleClass(el, sortable.options.selectedClass, true);
  57877. multiDragElements.push(el);
  57878. },
  57879. /**
  57880. * Deselects the provided multi-drag item
  57881. * @param {HTMLElement} el The element to be deselected
  57882. */
  57883. deselect: function deselect(el) {
  57884. var sortable = el.parentNode[expando],
  57885. index = multiDragElements.indexOf(el);
  57886. if (!sortable || !sortable.options.multiDrag || !~index) return;
  57887. toggleClass(el, sortable.options.selectedClass, false);
  57888. multiDragElements.splice(index, 1);
  57889. }
  57890. },
  57891. eventProperties: function eventProperties() {
  57892. var _this3 = this;
  57893. var oldIndicies = [],
  57894. newIndicies = [];
  57895. multiDragElements.forEach(function (multiDragElement) {
  57896. oldIndicies.push({
  57897. multiDragElement: multiDragElement,
  57898. index: multiDragElement.sortableIndex
  57899. }); // multiDragElements will already be sorted if folding
  57900. var newIndex;
  57901. if (folding && multiDragElement !== dragEl$1) {
  57902. newIndex = -1;
  57903. } else if (folding) {
  57904. newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');
  57905. } else {
  57906. newIndex = index(multiDragElement);
  57907. }
  57908. newIndicies.push({
  57909. multiDragElement: multiDragElement,
  57910. index: newIndex
  57911. });
  57912. });
  57913. return {
  57914. items: _toConsumableArray(multiDragElements),
  57915. clones: [].concat(multiDragClones),
  57916. oldIndicies: oldIndicies,
  57917. newIndicies: newIndicies
  57918. };
  57919. },
  57920. optionListeners: {
  57921. multiDragKey: function multiDragKey(key) {
  57922. key = key.toLowerCase();
  57923. if (key === 'ctrl') {
  57924. key = 'Control';
  57925. } else if (key.length > 1) {
  57926. key = key.charAt(0).toUpperCase() + key.substr(1);
  57927. }
  57928. return key;
  57929. }
  57930. }
  57931. });
  57932. }
  57933. function insertMultiDragElements(clonesInserted, rootEl) {
  57934. multiDragElements.forEach(function (multiDragElement, i) {
  57935. var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];
  57936. if (target) {
  57937. rootEl.insertBefore(multiDragElement, target);
  57938. } else {
  57939. rootEl.appendChild(multiDragElement);
  57940. }
  57941. });
  57942. }
  57943. /**
  57944. * Insert multi-drag clones
  57945. * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
  57946. * @param {HTMLElement} rootEl
  57947. */
  57948. function insertMultiDragClones(elementsInserted, rootEl) {
  57949. multiDragClones.forEach(function (clone, i) {
  57950. var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];
  57951. if (target) {
  57952. rootEl.insertBefore(clone, target);
  57953. } else {
  57954. rootEl.appendChild(clone);
  57955. }
  57956. });
  57957. }
  57958. function removeMultiDragElements() {
  57959. multiDragElements.forEach(function (multiDragElement) {
  57960. if (multiDragElement === dragEl$1) return;
  57961. multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);
  57962. });
  57963. }
  57964. Sortable.mount(new AutoScrollPlugin());
  57965. Sortable.mount(Remove, Revert);
  57966. /* harmony default export */ __webpack_exports__["default"] = (Sortable);
  57967. /***/ }),
  57968. /* 139 */
  57969. /***/ (function(module, exports, __webpack_require__) {
  57970. // style-loader: Adds some css to the DOM by adding a <style> tag
  57971. // load the styles
  57972. var content = __webpack_require__(140);
  57973. if(typeof content === 'string') content = [[module.i, content, '']];
  57974. if(content.locals) module.exports = content.locals;
  57975. // add the styles to the DOM
  57976. var update = __webpack_require__(1)("f2cb592e", content, false, {});
  57977. // Hot Module Replacement
  57978. if(false) {
  57979. // When the styles change, update the <style> tags
  57980. if(!content.locals) {
  57981. module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0c50b298\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./files.vue", function() {
  57982. var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-0c50b298\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./files.vue");
  57983. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  57984. update(newContent);
  57985. });
  57986. }
  57987. // When the module is disposed, remove the <style> tags
  57988. module.hot.dispose(function() { update(); });
  57989. }
  57990. /***/ }),
  57991. /* 140 */
  57992. /***/ (function(module, exports, __webpack_require__) {
  57993. exports = module.exports = __webpack_require__(0)(false);
  57994. // imports
  57995. // module
  57996. exports.push([module.i, "\n.project-task-file[data-v-0c50b298] {\n margin: 0 12px;\n}\n.project-task-file .tableFill[data-v-0c50b298] {\n margin: 12px 0 20px;\n}\n", ""]);
  57997. // exports
  57998. /***/ }),
  57999. /* 141 */
  58000. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58001. "use strict";
  58002. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  58003. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  58004. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  58005. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_clipboard2__ = __webpack_require__(142);
  58006. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vue_clipboard2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vue_clipboard2__);
  58007. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer__ = __webpack_require__(7);
  58008. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer__);
  58009. //
  58010. //
  58011. //
  58012. //
  58013. //
  58014. //
  58015. //
  58016. //
  58017. //
  58018. //
  58019. //
  58020. //
  58021. //
  58022. //
  58023. //
  58024. //
  58025. //
  58026. //
  58027. //
  58028. //
  58029. //
  58030. //
  58031. //
  58032. //
  58033. //
  58034. //
  58035. //
  58036. //
  58037. //
  58038. //
  58039. //
  58040. //
  58041. //
  58042. //
  58043. //
  58044. //
  58045. //
  58046. //
  58047. //
  58048. //
  58049. //
  58050. //
  58051. //
  58052. //
  58053. //
  58054. //
  58055. //
  58056. //
  58057. //
  58058. //
  58059. //
  58060. //
  58061. //
  58062. //
  58063. //
  58064. //
  58065. //
  58066. //
  58067. //
  58068. //
  58069. __WEBPACK_IMPORTED_MODULE_0_vue___default.a.use(__WEBPACK_IMPORTED_MODULE_1_vue_clipboard2___default.a);
  58070. /* harmony default export */ __webpack_exports__["default"] = ({
  58071. name: 'ProjectTaskFiles',
  58072. components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_2__DrawerTabsContainer___default.a },
  58073. props: {
  58074. projectid: {
  58075. default: 0
  58076. },
  58077. taskid: {
  58078. default: 0
  58079. },
  58080. canload: {
  58081. type: Boolean,
  58082. default: true
  58083. },
  58084. simple: {
  58085. type: Boolean,
  58086. default: false
  58087. }
  58088. },
  58089. data: function data() {
  58090. return {
  58091. keys: {},
  58092. sorts: { key: '', order: '' },
  58093. loadYet: false,
  58094. loadIng: 0,
  58095. columns: [],
  58096. lists: [],
  58097. listPage: 1,
  58098. listTotal: 0,
  58099. lastPage: 0,
  58100. noDataText: "",
  58101. uploadFormat: ['jpg', 'jpeg', 'png', 'gif', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'esp', 'pdf', 'rar', 'zip', 'gz', 'ai', 'avi', 'bmp', 'cdr', 'eps', 'mov', 'mp3', 'mp4', 'pr', 'psd', 'svg', 'tif'],
  58102. actionUrl: $A.apiUrl('project/files/upload'),
  58103. params: {
  58104. token: $A.getToken(),
  58105. taskid: this.taskid,
  58106. projectid: this.projectid
  58107. },
  58108. uploadList: [],
  58109. maxSize: 204800
  58110. };
  58111. },
  58112. mounted: function mounted() {
  58113. if (this.canload) {
  58114. this.loadYet = true;
  58115. this.getLists(true);
  58116. }
  58117. this.uploadList = this.$refs.upload.fileList;
  58118. },
  58119. watch: {
  58120. projectid: function projectid(val) {
  58121. if (this.loadYet) {
  58122. this.getLists(true);
  58123. }
  58124. this.$set(this.params, 'projectid', val);
  58125. },
  58126. taskid: function taskid(val) {
  58127. if (this.loadYet) {
  58128. this.getLists(true);
  58129. }
  58130. this.$set(this.params, 'taskid', val);
  58131. },
  58132. canload: function canload(val) {
  58133. if (val && !this.loadYet) {
  58134. this.loadYet = true;
  58135. this.getLists(true);
  58136. }
  58137. },
  58138. uploadList: function uploadList(files) {
  58139. var _this = this;
  58140. files.forEach(function (file) {
  58141. if (typeof file.username === "undefined") {
  58142. file.username = _this.usrName;
  58143. file.indate = Math.round(new Date().getTime() / 1000);
  58144. _this.lists.unshift(file);
  58145. _this.$emit('change', 'up');
  58146. }
  58147. });
  58148. }
  58149. },
  58150. methods: {
  58151. initLanguage: function initLanguage() {
  58152. var _this2 = this;
  58153. this.noDataText = this.$L("数据加载中.....");
  58154. var columns = [];
  58155. columns.push({
  58156. "title": "",
  58157. "width": 60,
  58158. render: function render(h, params) {
  58159. if (!params.row.thumb) {
  58160. return h('WLoading', {
  58161. style: {
  58162. width: "24px",
  58163. height: "24px",
  58164. verticalAlign: "middle"
  58165. }
  58166. });
  58167. }
  58168. var imgRender = h('img', {
  58169. style: {
  58170. width: "28px",
  58171. height: "28px",
  58172. display: "table"
  58173. },
  58174. attrs: {
  58175. src: params.row.thumb
  58176. }
  58177. });
  58178. if (['jpg', 'jpeg', 'png', 'gif'].indexOf(params.row.ext) !== -1) {
  58179. return h('Tooltip', {
  58180. props: {
  58181. transfer: true,
  58182. delay: 600,
  58183. maxWidth: 600
  58184. }
  58185. }, [imgRender, h('div', { slot: 'content' }, [h('img', {
  58186. style: {
  58187. maxWidth: "360px",
  58188. maxHeight: "360px",
  58189. display: "table",
  58190. margin: "3px 0"
  58191. },
  58192. attrs: {
  58193. src: params.row.path
  58194. }
  58195. })])]);
  58196. } else {
  58197. return imgRender;
  58198. }
  58199. }
  58200. });
  58201. columns.push({
  58202. "title": this.$L("文件名"),
  58203. "key": 'name',
  58204. "minWidth": 100,
  58205. "tooltip": true,
  58206. "sortable": true,
  58207. render: function render(h, params) {
  58208. var arr = [h('span', params.row.name)];
  58209. if (params.row.showProgress === true) {
  58210. arr.push(h('Progress', {
  58211. style: {
  58212. display: 'block',
  58213. marginTop: '-3px'
  58214. },
  58215. props: {
  58216. percent: parseFloat($A.runNum(params.row.percentage || 100, 2))
  58217. }
  58218. }));
  58219. }
  58220. return h('div', arr);
  58221. }
  58222. });
  58223. columns.push({
  58224. "title": this.$L("大小"),
  58225. "key": 'size',
  58226. "minWidth": 90,
  58227. "maxWidth": 120,
  58228. "align": "right",
  58229. "sortable": true,
  58230. render: function render(h, params) {
  58231. return h('span', $A.bytesToSize(params.row.size));
  58232. }
  58233. });
  58234. if (!this.simple) {
  58235. columns.push({
  58236. "title": this.$L("下载次数"),
  58237. "key": 'download',
  58238. "align": "center",
  58239. "sortable": true,
  58240. "width": 100
  58241. });
  58242. columns.push({
  58243. "title": this.$L("上传者"),
  58244. "key": 'username',
  58245. "minWidth": 90,
  58246. "maxWidth": 130,
  58247. "sortable": true,
  58248. render: function render(h, params) {
  58249. return h('UserView', {
  58250. props: {
  58251. username: params.row.username
  58252. }
  58253. });
  58254. }
  58255. });
  58256. columns.push({
  58257. "title": this.$L("上传时间"),
  58258. "key": 'indate',
  58259. "width": 160,
  58260. "sortable": true,
  58261. render: function render(h, params) {
  58262. return h('span', $A.formatDate("Y-m-d H:i:s", params.row.indate));
  58263. }
  58264. });
  58265. }
  58266. columns.push({
  58267. "title": " ",
  58268. "key": 'action',
  58269. "align": 'right',
  58270. "width": 120,
  58271. render: function render(h, params) {
  58272. if (!params.row.id) {
  58273. return null;
  58274. }
  58275. return h('div', [h('Tooltip', {
  58276. props: { content: _this2.$L('下载'), transfer: true, delay: 600 },
  58277. style: { position: 'relative' }
  58278. }, [h('Icon', {
  58279. props: { type: 'md-arrow-down', size: 16 },
  58280. style: { margin: '0 3px', cursor: 'pointer' }
  58281. }), h('a', {
  58282. style: { position: 'absolute', top: '0', left: '0', right: '0', bottom: '0', 'zIndex': 1 },
  58283. attrs: { href: $A.apiUrl('project/files/download?fileid=' + params.row.id), target: '_blank' },
  58284. on: {
  58285. click: function click() {
  58286. if (params.row.yetdown) {
  58287. return;
  58288. }
  58289. params.row.yetdown = 1;
  58290. _this2.$set(params.row, 'download', params.row.download + 1);
  58291. }
  58292. }
  58293. })]), h('Tooltip', {
  58294. props: { content: _this2.$L('重命名'), transfer: true, delay: 600 }
  58295. }, [h('Icon', {
  58296. props: { type: 'md-create', size: 16 },
  58297. style: { margin: '0 3px', cursor: 'pointer' },
  58298. on: {
  58299. click: function click() {
  58300. _this2.renameFile(params.row);
  58301. }
  58302. }
  58303. })]), h('Tooltip', {
  58304. props: { content: _this2.$L('复制链接'), transfer: true, delay: 600 }
  58305. }, [h('Icon', {
  58306. props: { type: 'md-link', size: 16 },
  58307. style: { margin: '0 3px', cursor: 'pointer', transform: 'rotate(-45deg)' },
  58308. on: {
  58309. click: function click() {
  58310. _this2.$copyText($A.apiUrl('project/files/download?fileid=' + params.row.id)).then(function () {
  58311. _this2.$Message.success(_this2.$L('复制成功!'));
  58312. }, function () {
  58313. _this2.$Message.error(_this2.$L('复制失败!'));
  58314. });
  58315. }
  58316. }
  58317. })]), h('Tooltip', {
  58318. props: { content: _this2.$L('删除'), transfer: true, delay: 600 }
  58319. }, [h('Icon', {
  58320. props: { type: 'md-trash', size: 16 },
  58321. style: { margin: '0 3px', cursor: 'pointer' },
  58322. on: {
  58323. click: function click() {
  58324. _this2.deleteFile(params.row);
  58325. }
  58326. }
  58327. })])]);
  58328. }
  58329. });
  58330. this.columns = columns;
  58331. },
  58332. sreachTab: function sreachTab(clear) {
  58333. if (clear === true) {
  58334. this.keys = {};
  58335. }
  58336. this.getLists(true);
  58337. },
  58338. sortChange: function sortChange(info) {
  58339. this.sorts = { key: info.key, order: info.order };
  58340. this.getLists(true);
  58341. },
  58342. setPage: function setPage(page) {
  58343. this.listPage = page;
  58344. this.getLists();
  58345. },
  58346. setPageSize: function setPageSize(size) {
  58347. if (Math.max($A.runNum(this.listPageSize), 10) != size) {
  58348. this.listPageSize = size;
  58349. this.getLists();
  58350. }
  58351. },
  58352. getLists: function getLists(resetLoad) {
  58353. var _this3 = this;
  58354. if (resetLoad === true) {
  58355. this.listPage = 1;
  58356. }
  58357. if (this.projectid == 0 && this.taskid == 0) {
  58358. this.lists = [];
  58359. this.listTotal = 0;
  58360. this.noDataText = this.$L("没有相关的文件");
  58361. return;
  58362. }
  58363. this.loadIng++;
  58364. var whereData = $A.cloneData(this.keys);
  58365. whereData.page = Math.max(this.listPage, 1);
  58366. whereData.pagesize = Math.max($A.runNum(this.listPageSize), 10);
  58367. whereData.projectid = this.projectid;
  58368. whereData.taskid = this.taskid;
  58369. whereData.sorts = this.sorts;
  58370. this.noDataText = this.$L("数据加载中.....");
  58371. $A.apiAjax({
  58372. url: 'project/files/lists',
  58373. data: whereData,
  58374. complete: function complete() {
  58375. _this3.loadIng--;
  58376. },
  58377. error: function error() {
  58378. _this3.noDataText = _this3.$L("数据加载失败!");
  58379. },
  58380. success: function success(res) {
  58381. if (res.ret === 1) {
  58382. _this3.lists = res.data.lists;
  58383. _this3.listTotal = res.data.total;
  58384. _this3.lastPage = res.data.lastPage;
  58385. _this3.noDataText = _this3.$L("没有相关的文件");
  58386. } else {
  58387. _this3.lists = [];
  58388. _this3.listTotal = 0;
  58389. _this3.lastPage = 0;
  58390. _this3.noDataText = res.msg;
  58391. }
  58392. }
  58393. });
  58394. },
  58395. renameFile: function renameFile(item) {
  58396. var _this4 = this;
  58397. this.renameValue = "";
  58398. this.$Modal.confirm({
  58399. render: function render(h) {
  58400. return h('div', [h('div', {
  58401. style: {
  58402. fontSize: '16px',
  58403. fontWeight: '500',
  58404. marginBottom: '20px'
  58405. }
  58406. }, _this4.$L('重命名文件名')), h('Input', {
  58407. props: {
  58408. value: _this4.renameValue,
  58409. autofocus: true,
  58410. placeholder: item.name || _this4.$L('请输入新的文件名称')
  58411. },
  58412. on: {
  58413. input: function input(val) {
  58414. _this4.renameValue = val;
  58415. }
  58416. }
  58417. })]);
  58418. },
  58419. loading: true,
  58420. onOk: function onOk() {
  58421. if (_this4.renameValue) {
  58422. var oldName = item.name;
  58423. var newName = _this4.renameValue;
  58424. if (!$A.rightExists(newName, '.' + item.ext)) {
  58425. newName += '.' + item.ext;
  58426. }
  58427. _this4.$set(item, 'name', newName);
  58428. $A.apiAjax({
  58429. url: 'project/files/rename',
  58430. data: {
  58431. fileid: item.id,
  58432. name: newName
  58433. },
  58434. error: function error() {
  58435. _this4.$Modal.remove();
  58436. _this4.$set(item, 'name', oldName);
  58437. alert(_this4.$L('网络繁忙,请稍后再试!'));
  58438. },
  58439. success: function success(res) {
  58440. _this4.$Modal.remove();
  58441. if (res.ret === 1) {
  58442. _this4.$set(item, 'name', res.data.name);
  58443. } else {
  58444. _this4.$Modal.error({ title: _this4.$L('温馨提示'), content: res.msg });
  58445. _this4.$set(item, 'name', oldName);
  58446. }
  58447. }
  58448. });
  58449. } else {
  58450. _this4.$Modal.remove();
  58451. }
  58452. }
  58453. });
  58454. },
  58455. deleteFile: function deleteFile(item) {
  58456. var _this5 = this;
  58457. this.$Modal.confirm({
  58458. title: this.$L('删除文件'),
  58459. content: this.$L('你确定要删除此文件吗?'),
  58460. loading: true,
  58461. onOk: function onOk() {
  58462. $A.apiAjax({
  58463. url: 'project/files/delete',
  58464. data: {
  58465. fileid: item.id
  58466. },
  58467. error: function error() {
  58468. _this5.$Modal.remove();
  58469. alert(_this5.$L('网络繁忙,请稍后再试!'));
  58470. },
  58471. success: function success(res) {
  58472. _this5.$Modal.remove();
  58473. _this5.lists.some(function (temp, index) {
  58474. if (temp.id == item.id) {
  58475. _this5.lists.splice(index, 1);
  58476. return true;
  58477. }
  58478. });
  58479. setTimeout(function () {
  58480. if (res.ret === 1) {
  58481. _this5.$Message.success(res.msg);
  58482. _this5.$emit('change', 'delete');
  58483. } else {
  58484. _this5.$Modal.error({ title: _this5.$L('温馨提示'), content: res.msg });
  58485. }
  58486. }, 350);
  58487. }
  58488. });
  58489. }
  58490. });
  58491. },
  58492. uploadHandleClick: function uploadHandleClick() {
  58493. this.$refs.upload.handleClick();
  58494. },
  58495. handleError: function handleError(error, html, file) {
  58496. var _this6 = this;
  58497. //上传失败
  58498. this.$Modal.warning({
  58499. title: this.$L('上传失败'),
  58500. content: this.$L('文件 % 上传失败,%', file.name, error)
  58501. });
  58502. this.$refs.upload.fileList.pop();
  58503. this.lists.some(function (item, index) {
  58504. if (item.uid == file.uid) {
  58505. _this6.lists.splice(index, 1);
  58506. return true;
  58507. }
  58508. });
  58509. this.$emit('change', 'error');
  58510. },
  58511. handleSuccess: function handleSuccess(res, file) {
  58512. var _this7 = this;
  58513. //上传完成
  58514. if (res.ret === 1) {
  58515. for (var key in res.data) {
  58516. if (res.data.hasOwnProperty(key)) {
  58517. file[key] = res.data[key];
  58518. }
  58519. }
  58520. this.$emit('change', 'add');
  58521. } else {
  58522. this.$Modal.warning({
  58523. title: this.$L('上传失败'),
  58524. content: this.$L('文件 % 上传失败,%', file.name, res.msg)
  58525. });
  58526. this.$refs.upload.fileList.pop();
  58527. this.lists.some(function (item, index) {
  58528. if (item.id == res.id) {
  58529. _this7.lists.splice(index, 1);
  58530. return true;
  58531. }
  58532. });
  58533. this.$emit('change', 'error');
  58534. }
  58535. this.uploadList = this.$refs.upload.fileList;
  58536. },
  58537. handleFormatError: function handleFormatError(file) {
  58538. //上传类型错误
  58539. this.$Modal.warning({
  58540. title: this.$L('文件格式不正确'),
  58541. content: this.$L('文件 % 格式不正确,仅支持上传:%', file.name, this.uploadFormat.join(','))
  58542. });
  58543. },
  58544. handleMaxSize: function handleMaxSize(file) {
  58545. //上传大小错误
  58546. this.$Modal.warning({
  58547. title: this.$L('超出文件大小限制'),
  58548. content: this.$L('文件 % 太大,不能超过%。', file.name, $A.bytesToSize(this.maxSize * 1024))
  58549. });
  58550. },
  58551. handleBeforeUpload: function handleBeforeUpload() {
  58552. //上传前判断
  58553. this.params = {
  58554. token: $A.getToken(),
  58555. taskid: this.taskid,
  58556. projectid: this.projectid
  58557. };
  58558. return true;
  58559. },
  58560. upload: function upload(file) {
  58561. //手动传file
  58562. if (this.handleBeforeUpload()) {
  58563. this.$refs.upload.upload(file);
  58564. }
  58565. }
  58566. }
  58567. });
  58568. /***/ }),
  58569. /* 142 */
  58570. /***/ (function(module, exports, __webpack_require__) {
  58571. var Clipboard = __webpack_require__(143) // FIXME: workaround for browserify
  58572. var VueClipboardConfig = {
  58573. autoSetContainer: false,
  58574. appendToBody: true // This fixes IE, see #50
  58575. }
  58576. var VueClipboard = {
  58577. install: function (Vue) {
  58578. var globalPrototype = Vue.version.slice(0, 2) === '3.' ? Vue.config.globalProperties : Vue.prototype
  58579. globalPrototype.$clipboardConfig = VueClipboardConfig
  58580. globalPrototype.$copyText = function (text, container) {
  58581. return new Promise(function (resolve, reject) {
  58582. var fakeElement = document.createElement('button')
  58583. var clipboard = new Clipboard(fakeElement, {
  58584. text: function () { return text },
  58585. action: function () { return 'copy' },
  58586. container: typeof container === 'object' ? container : document.body
  58587. })
  58588. clipboard.on('success', function (e) {
  58589. clipboard.destroy()
  58590. resolve(e)
  58591. })
  58592. clipboard.on('error', function (e) {
  58593. clipboard.destroy()
  58594. reject(e)
  58595. })
  58596. if (VueClipboardConfig.appendToBody) document.body.appendChild(fakeElement)
  58597. fakeElement.click()
  58598. if (VueClipboardConfig.appendToBody) document.body.removeChild(fakeElement)
  58599. })
  58600. }
  58601. Vue.directive('clipboard', {
  58602. bind: function (el, binding, vnode) {
  58603. if (binding.arg === 'success') {
  58604. el._vClipboard_success = binding.value
  58605. } else if (binding.arg === 'error') {
  58606. el._vClipboard_error = binding.value
  58607. } else {
  58608. var clipboard = new Clipboard(el, {
  58609. text: function () { return binding.value },
  58610. action: function () { return binding.arg === 'cut' ? 'cut' : 'copy' },
  58611. container: VueClipboardConfig.autoSetContainer ? el : undefined
  58612. })
  58613. clipboard.on('success', function (e) {
  58614. var callback = el._vClipboard_success
  58615. callback && callback(e)
  58616. })
  58617. clipboard.on('error', function (e) {
  58618. var callback = el._vClipboard_error
  58619. callback && callback(e)
  58620. })
  58621. el._vClipboard = clipboard
  58622. }
  58623. },
  58624. update: function (el, binding) {
  58625. if (binding.arg === 'success') {
  58626. el._vClipboard_success = binding.value
  58627. } else if (binding.arg === 'error') {
  58628. el._vClipboard_error = binding.value
  58629. } else {
  58630. el._vClipboard.text = function () { return binding.value }
  58631. el._vClipboard.action = function () { return binding.arg === 'cut' ? 'cut' : 'copy' }
  58632. }
  58633. },
  58634. unbind: function (el, binding) {
  58635. // FIXME: investigate why $element._vClipboard was missing
  58636. if (!el._vClipboard) return
  58637. if (binding.arg === 'success') {
  58638. delete el._vClipboard_success
  58639. } else if (binding.arg === 'error') {
  58640. delete el._vClipboard_error
  58641. } else {
  58642. el._vClipboard.destroy()
  58643. delete el._vClipboard
  58644. }
  58645. }
  58646. })
  58647. },
  58648. config: VueClipboardConfig
  58649. }
  58650. if (true) {
  58651. module.exports = VueClipboard
  58652. } else if (typeof define === 'function' && define.amd) {
  58653. define([], function () {
  58654. return VueClipboard
  58655. })
  58656. }
  58657. /***/ }),
  58658. /* 143 */
  58659. /***/ (function(module, exports, __webpack_require__) {
  58660. /*!
  58661. * clipboard.js v2.0.10
  58662. * https://clipboardjs.com/
  58663. *
  58664. * Licensed MIT © Zeno Rocha
  58665. */
  58666. !function(t,e){ true?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return n={686:function(t,e,n){"use strict";n.d(e,{default:function(){return o}});var e=n(279),i=n.n(e),e=n(370),u=n.n(e),e=n(817),c=n.n(e);function a(t){try{return document.execCommand(t)}catch(t){return}}var f=function(t){t=c()(t);return a("cut"),t};var l=function(t){var e,n,o,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof t?(e=t,n="rtl"===document.documentElement.getAttribute("dir"),(o=document.createElement("textarea")).style.fontSize="12pt",o.style.border="0",o.style.padding="0",o.style.margin="0",o.style.position="absolute",o.style[n?"right":"left"]="-9999px",n=window.pageYOffset||document.documentElement.scrollTop,o.style.top="".concat(n,"px"),o.setAttribute("readonly",""),o.value=e,o=o,r.container.appendChild(o),i=c()(o),a("copy"),o.remove()):(i=c()(t),a("copy")),i};function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var s=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=t.action,n=void 0===e?"copy":e,o=t.container,e=t.target,t=t.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==e){if(!e||"object"!==r(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return t?l(t,{container:o}):e?"cut"===n?f(e):l(e,{container:o}):void 0};function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(n){var o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}();return function(){var t,e=m(n);return t=o?(t=m(this).constructor,Reflect.construct(e,arguments,t)):e.apply(this,arguments),e=this,!(t=t)||"object"!==p(t)&&"function"!=typeof t?function(t){if(void 0!==t)return t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}(e):t}}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v(t,e){t="data-clipboard-".concat(t);if(e.hasAttribute(t))return e.getAttribute(t)}var o=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(r,i());var t,e,n,o=h(r);function r(t,e){var n;return function(t){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this),(n=o.call(this)).resolveOptions(e),n.listenClick(t),n}return t=r,n=[{key:"copy",value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{container:document.body};return l(t,e)}},{key:"cut",value:function(t){return f(t)}},{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof t?[t]:t,e=!!document.queryCommandSupported;return t.forEach(function(t){e=e&&!!document.queryCommandSupported(t)}),e}}],(e=[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===p(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=u()(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget,n=this.action(e)||"copy",t=s({action:n,container:this.container,target:this.target(e),text:this.text(e)});this.emit(t?"success":"error",{action:n,text:t,trigger:e,clearSelection:function(){e&&e.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(t){return v("action",t)}},{key:"defaultTarget",value:function(t){t=v("target",t);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(t){return v("text",t)}},{key:"destroy",value:function(){this.listener.destroy()}}])&&d(t.prototype,e),n&&d(t,n),r}()},828:function(t){var e;"undefined"==typeof Element||Element.prototype.matches||((e=Element.prototype).matches=e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector),t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}},438:function(t,e,n){var u=n(828);function i(t,e,n,o,r){var i=function(e,n,t,o){return function(t){t.delegateTarget=u(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,i,r),{destroy:function(){t.removeEventListener(n,i,r)}}}t.exports=function(t,e,n,o,r){return"function"==typeof t.addEventListener?i.apply(null,arguments):"function"==typeof n?i.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return i(t,e,n,o,r)}))}},879:function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},370:function(t,e,n){var f=n(879),l=n(438);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return c=e,a=n,(u=t).addEventListener(c,a),{destroy:function(){u.removeEventListener(c,a)}};if(f.nodeList(t))return o=t,r=e,i=n,Array.prototype.forEach.call(o,function(t){t.addEventListener(r,i)}),{destroy:function(){Array.prototype.forEach.call(o,function(t){t.removeEventListener(r,i)})}};if(f.string(t))return t=t,e=e,n=n,l(document.body,t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,r,i,u,c,a}},817:function(t){t.exports=function(t){var e,n="SELECT"===t.nodeName?(t.focus(),t.value):"INPUT"===t.nodeName||"TEXTAREA"===t.nodeName?((e=t.hasAttribute("readonly"))||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),e||t.removeAttribute("readonly"),t.value):(t.hasAttribute("contenteditable")&&t.focus(),n=window.getSelection(),(e=document.createRange()).selectNodeContents(t),n.removeAllRanges(),n.addRange(e),n.toString());return n}},279:function(t){function e(){}e.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function r(){o.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,r=n.length;o<r;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],r=[];if(o&&e)for(var i=0,u=o.length;i<u;i++)o[i].fn!==e&&o[i].fn._!==e&&r.push(o[i]);return r.length?n[t]=r:delete n[t],this}},t.exports=e,t.exports.TinyEmitter=e}},r={},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o(686).default;function o(t){if(r[t])return r[t].exports;var e=r[t]={exports:{}};return n[t](e,e.exports,o),e.exports}var n,r});
  58667. /***/ }),
  58668. /* 144 */
  58669. /***/ (function(module, exports, __webpack_require__) {
  58670. var render = function() {
  58671. var _vm = this
  58672. var _h = _vm.$createElement
  58673. var _c = _vm._self._c || _h
  58674. return _c("drawer-tabs-container", [
  58675. _c(
  58676. "div",
  58677. { staticClass: "project-task-file" },
  58678. [
  58679. !_vm.simple
  58680. ? _c("Row", { staticClass: "sreachBox" }, [
  58681. _c("div", { staticClass: "item" }, [
  58682. _c(
  58683. "div",
  58684. { staticClass: "item-2" },
  58685. [
  58686. _c("sreachTitle", { attrs: { val: _vm.keys.name } }, [
  58687. _vm._v(_vm._s(_vm.$L("文件名")))
  58688. ]),
  58689. _vm._v(" "),
  58690. _c("Input", {
  58691. attrs: { placeholder: _vm.$L("关键词") },
  58692. model: {
  58693. value: _vm.keys.name,
  58694. callback: function($$v) {
  58695. _vm.$set(_vm.keys, "name", $$v)
  58696. },
  58697. expression: "keys.name"
  58698. }
  58699. })
  58700. ],
  58701. 1
  58702. ),
  58703. _vm._v(" "),
  58704. _c(
  58705. "div",
  58706. { staticClass: "item-2" },
  58707. [
  58708. _c("sreachTitle", { attrs: { val: _vm.keys.username } }, [
  58709. _vm._v(_vm._s(_vm.$L("上传者")))
  58710. ]),
  58711. _vm._v(" "),
  58712. _c("Input", {
  58713. attrs: { placeholder: _vm.$L("用户名") },
  58714. model: {
  58715. value: _vm.keys.username,
  58716. callback: function($$v) {
  58717. _vm.$set(_vm.keys, "username", $$v)
  58718. },
  58719. expression: "keys.username"
  58720. }
  58721. })
  58722. ],
  58723. 1
  58724. )
  58725. ]),
  58726. _vm._v(" "),
  58727. _c(
  58728. "div",
  58729. { staticClass: "item item-button" },
  58730. [
  58731. _vm.$A.objImplode(_vm.keys) != ""
  58732. ? _c(
  58733. "Button",
  58734. {
  58735. attrs: { type: "text" },
  58736. on: {
  58737. click: function($event) {
  58738. return _vm.sreachTab(true)
  58739. }
  58740. }
  58741. },
  58742. [_vm._v(_vm._s(_vm.$L("取消筛选")))]
  58743. )
  58744. : _vm._e(),
  58745. _vm._v(" "),
  58746. _c(
  58747. "Button",
  58748. {
  58749. attrs: {
  58750. type: "primary",
  58751. icon: "md-search",
  58752. loading: _vm.loadIng > 0
  58753. },
  58754. on: { click: _vm.sreachTab }
  58755. },
  58756. [_vm._v(_vm._s(_vm.$L("搜索")))]
  58757. )
  58758. ],
  58759. 1
  58760. )
  58761. ])
  58762. : _vm._e(),
  58763. _vm._v(" "),
  58764. _c(
  58765. "Row",
  58766. {
  58767. staticClass: "butBox",
  58768. style:
  58769. "float:left;margin-top:-32px;" +
  58770. (_vm.simple ? "display:none" : "")
  58771. },
  58772. [
  58773. _c(
  58774. "Upload",
  58775. {
  58776. ref: "upload",
  58777. attrs: {
  58778. name: "files",
  58779. action: _vm.actionUrl,
  58780. data: _vm.params,
  58781. multiple: "",
  58782. format: _vm.uploadFormat,
  58783. "show-upload-list": false,
  58784. "max-size": _vm.maxSize,
  58785. "on-success": _vm.handleSuccess,
  58786. "on-error": _vm.handleError,
  58787. "on-format-error": _vm.handleFormatError,
  58788. "on-exceeded-size": _vm.handleMaxSize,
  58789. "before-upload": _vm.handleBeforeUpload
  58790. }
  58791. },
  58792. [
  58793. _c(
  58794. "Button",
  58795. {
  58796. attrs: {
  58797. loading: _vm.loadIng > 0,
  58798. type: "primary",
  58799. icon: "ios-cloud-upload-outline"
  58800. },
  58801. on: { click: function($event) {} }
  58802. },
  58803. [_vm._v(_vm._s(_vm.$L("上传文件")))]
  58804. )
  58805. ],
  58806. 1
  58807. )
  58808. ],
  58809. 1
  58810. ),
  58811. _vm._v(" "),
  58812. _c("Table", {
  58813. ref: "tableRef",
  58814. staticClass: "tableFill",
  58815. attrs: {
  58816. size: !_vm.simple ? "default" : "small",
  58817. columns: _vm.columns,
  58818. data: _vm.lists,
  58819. loading: _vm.loadIng > 0,
  58820. "no-data-text": _vm.noDataText,
  58821. stripe: ""
  58822. },
  58823. on: { "on-sort-change": _vm.sortChange }
  58824. }),
  58825. _vm._v(" "),
  58826. _vm.lastPage > 1 || !_vm.simple
  58827. ? _c("Page", {
  58828. staticClass: "pageBox",
  58829. attrs: {
  58830. simple: _vm.simple || _vm.windowMax768,
  58831. total: _vm.listTotal,
  58832. current: _vm.listPage,
  58833. disabled: _vm.loadIng > 0,
  58834. "page-size-opts": [10, 20, 30, 50, 100],
  58835. placement: "top",
  58836. "show-elevator": "",
  58837. "show-sizer": "",
  58838. "show-total": "",
  58839. transfer: ""
  58840. },
  58841. on: {
  58842. "on-change": _vm.setPage,
  58843. "on-page-size-change": _vm.setPageSize
  58844. }
  58845. })
  58846. : _vm._e()
  58847. ],
  58848. 1
  58849. )
  58850. ])
  58851. }
  58852. var staticRenderFns = []
  58853. render._withStripped = true
  58854. module.exports = { render: render, staticRenderFns: staticRenderFns }
  58855. if (false) {
  58856. module.hot.accept()
  58857. if (module.hot.data) {
  58858. require("vue-hot-reload-api") .rerender("data-v-0c50b298", module.exports)
  58859. }
  58860. }
  58861. /***/ }),
  58862. /* 145 */
  58863. /***/ (function(module, exports, __webpack_require__) {
  58864. // style-loader: Adds some css to the DOM by adding a <style> tag
  58865. // load the styles
  58866. var content = __webpack_require__(146);
  58867. if(typeof content === 'string') content = [[module.i, content, '']];
  58868. if(content.locals) module.exports = content.locals;
  58869. // add the styles to the DOM
  58870. var update = __webpack_require__(1)("2afd1fe1", content, false, {});
  58871. // Hot Module Replacement
  58872. if(false) {
  58873. // When the styles change, update the <style> tags
  58874. if(!content.locals) {
  58875. module.hot.accept("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2951ea9e\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./logs.vue", function() {
  58876. var newContent = require("!!../../../../../../../node_modules/css-loader/index.js!../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-2951ea9e\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./logs.vue");
  58877. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  58878. update(newContent);
  58879. });
  58880. }
  58881. // When the module is disposed, remove the <style> tags
  58882. module.hot.dispose(function() { update(); });
  58883. }
  58884. /***/ }),
  58885. /* 146 */
  58886. /***/ (function(module, exports, __webpack_require__) {
  58887. exports = module.exports = __webpack_require__(0)(false);
  58888. // imports
  58889. // module
  58890. exports.push([module.i, "\n.project-task-logs[data-v-2951ea9e] {\n margin: 0 12px;\n}\n.project-task-logs .logs-activity[data-v-2951ea9e] {\n position: relative;\n word-break: break-all;\n padding: 12px 12px;\n}\n.project-task-logs .logs-activity.istaskid > li[data-v-2951ea9e] {\n padding-top: 0;\n}\n.project-task-logs .logs-activity > li[data-v-2951ea9e] {\n padding-top: 22px;\n}\n.project-task-logs .logs-activity > li.logs-loading[data-v-2951ea9e] {\n margin: 4px 0;\n width: 18px;\n height: 18px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.project-task-logs .logs-activity > li.logs-more[data-v-2951ea9e] {\n cursor: pointer;\n}\n.project-task-logs .logs-activity > li.logs-more[data-v-2951ea9e]:hover {\n color: #048be0;\n}\n.project-task-logs .logs-activity > li.logs-none[data-v-2951ea9e] {\n cursor: pointer;\n color: #666666;\n line-height: 26px;\n}\n.project-task-logs .logs-activity > li[data-v-2951ea9e]:first-child {\n padding-top: 0;\n}\n.project-task-logs .logs-activity > li:last-child .logs-section[data-v-2951ea9e] {\n margin-bottom: -8px;\n}\n.project-task-logs .logs-activity > li .logs-date[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.36);\n padding-bottom: 14px;\n}\n.project-task-logs .logs-activity > li .logs-section .ivu-timeline-item[data-v-2951ea9e] {\n padding-bottom: 2px;\n}\n.project-task-logs .logs-activity > li .logs-dot[data-v-2951ea9e] {\n width: 18px;\n height: 18px;\n margin-left: 10px;\n}\n.project-task-logs .logs-activity > li .logs-dot .avatar[data-v-2951ea9e] {\n width: 18px;\n height: 18px;\n font-size: 12px;\n line-height: 18px;\n border-radius: 14px;\n overflow: hidden;\n}\n.project-task-logs .logs-activity > li .log-summary > span[data-v-2951ea9e],\n .project-task-logs .logs-activity > li .log-summary > a[data-v-2951ea9e] {\n padding-right: 6px;\n word-wrap: break-word;\n word-break: break-word;\n}\n.project-task-logs .logs-activity > li .log-summary .log-creator[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.85);\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-secondary[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.54);\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-link[data-v-2951ea9e] {\n color: #048be0;\n cursor: pointer;\n}\n.project-task-logs .logs-activity > li .log-summary .log-text-info[data-v-2951ea9e] {\n color: rgba(0, 0, 0, 0.36);\n}\n", ""]);
  58891. // exports
  58892. /***/ }),
  58893. /* 147 */
  58894. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  58895. "use strict";
  58896. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  58897. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__ = __webpack_require__(7);
  58898. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer__);
  58899. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  58900. //
  58901. //
  58902. //
  58903. //
  58904. //
  58905. //
  58906. //
  58907. //
  58908. //
  58909. //
  58910. //
  58911. //
  58912. //
  58913. //
  58914. //
  58915. //
  58916. //
  58917. //
  58918. //
  58919. //
  58920. //
  58921. //
  58922. //
  58923. //
  58924. //
  58925. //
  58926. //
  58927. //
  58928. //
  58929. //
  58930. //
  58931. //
  58932. //
  58933. //
  58934. //
  58935. //
  58936. //
  58937. //
  58938. //
  58939. //
  58940. //
  58941. //
  58942. //
  58943. //
  58944. //
  58945. //
  58946. //
  58947. //
  58948. //
  58949. //
  58950. //
  58951. //
  58952. //
  58953. //
  58954. //
  58955. //
  58956. //
  58957. //
  58958. //
  58959. //
  58960. //
  58961. //
  58962. //
  58963. //
  58964. //
  58965. //
  58966. //
  58967. //
  58968. //
  58969. //
  58970. //
  58971. //
  58972. //
  58973. //
  58974. //
  58975. //
  58976. //
  58977. //
  58978. //
  58979. //
  58980. //
  58981. //
  58982. //
  58983. //
  58984. //
  58985. //
  58986. //
  58987. //
  58988. //
  58989. //
  58990. //
  58991. //
  58992. //
  58993. //
  58994. //
  58995. //
  58996. //
  58997. //
  58998. //
  58999. //
  59000. //
  59001. //
  59002. //
  59003. //
  59004. //
  59005. //
  59006. //
  59007. //
  59008. //
  59009. //
  59010. //
  59011. //
  59012. //
  59013. //
  59014. //
  59015. //
  59016. //
  59017. /* harmony default export */ __webpack_exports__["default"] = ({
  59018. name: 'ProjectTaskLogs',
  59019. components: { DrawerTabsContainer: __WEBPACK_IMPORTED_MODULE_0__DrawerTabsContainer___default.a },
  59020. props: {
  59021. projectid: {
  59022. default: 0
  59023. },
  59024. taskid: {
  59025. default: 0
  59026. },
  59027. pagesize: {
  59028. default: 100
  59029. },
  59030. logtype: {
  59031. default: '全部'
  59032. },
  59033. canload: {
  59034. type: Boolean,
  59035. default: true
  59036. }
  59037. },
  59038. data: function data() {
  59039. return {
  59040. loadYet: false,
  59041. loadIng: 0,
  59042. lists: {},
  59043. listPage: 1,
  59044. hasMorePages: false,
  59045. totalNum: -1
  59046. };
  59047. },
  59048. mounted: function mounted() {
  59049. if (this.canload) {
  59050. this.loadYet = true;
  59051. this.getLists(true);
  59052. }
  59053. },
  59054. watch: {
  59055. projectid: function projectid() {
  59056. if (this.loadYet) {
  59057. this.lists = {};
  59058. this.getLists(true);
  59059. }
  59060. },
  59061. taskid: function taskid() {
  59062. if (this.loadYet) {
  59063. this.lists = {};
  59064. this.getLists(true);
  59065. }
  59066. },
  59067. logtype: function logtype() {
  59068. if (this.loadYet) {
  59069. this.lists = {};
  59070. this.getLists(true);
  59071. }
  59072. },
  59073. canload: function canload(val) {
  59074. if (val && !this.loadYet) {
  59075. this.loadYet = true;
  59076. this.getLists(true);
  59077. }
  59078. }
  59079. },
  59080. methods: {
  59081. logDate: function logDate(items) {
  59082. var md = $A.formatDate("m-d");
  59083. return md == items.ymd ? items.ymd + ' ' + this.$L('今天') : items.key;
  59084. },
  59085. getLists: function getLists(resetLoad, noLoading) {
  59086. var _this = this;
  59087. if (resetLoad === true) {
  59088. this.listPage = 1;
  59089. }
  59090. if (noLoading !== true) {
  59091. this.loadIng++;
  59092. }
  59093. $A.apiAjax({
  59094. url: 'project/log/lists',
  59095. data: {
  59096. projectid: this.projectid,
  59097. taskid: this.taskid,
  59098. type: this.logtype,
  59099. page: Math.max(this.listPage, 1),
  59100. pagesize: this.pagesize
  59101. },
  59102. complete: function complete() {
  59103. if (noLoading !== true) {
  59104. _this.loadIng--;
  59105. }
  59106. },
  59107. success: function success(res) {
  59108. if (res.ret === 1) {
  59109. var timeData = void 0,
  59110. key = void 0;
  59111. if (resetLoad === true) {
  59112. _this.lists = {};
  59113. }
  59114. _this.$nextTick(function () {
  59115. res.data.lists.forEach(function (item) {
  59116. timeData = item.timeData;
  59117. key = timeData.ymd + " " + timeData.week;
  59118. if (_typeof(_this.lists[key]) !== "object") {
  59119. _this.$set(_this.lists, key, {
  59120. key: key,
  59121. ymd: timeData.ymd,
  59122. lists: []
  59123. });
  59124. }
  59125. _this.lists[key].lists.push(item);
  59126. });
  59127. _this.hasMorePages = res.data.hasMorePages;
  59128. _this.totalNum = res.data.total;
  59129. });
  59130. } else {
  59131. _this.lists = {};
  59132. _this.hasMorePages = false;
  59133. _this.totalNum = 0;
  59134. }
  59135. }
  59136. });
  59137. },
  59138. getMore: function getMore() {
  59139. if (!this.hasMorePages) {
  59140. return;
  59141. }
  59142. this.hasMorePages = false;
  59143. this.listPage++;
  59144. this.getLists();
  59145. },
  59146. openChat: function openChat(username) {
  59147. if (typeof window.onChatOpenUserName === "function") {
  59148. window.onChatOpenUserName(username);
  59149. }
  59150. },
  59151. fileDownUrl: function fileDownUrl(id) {
  59152. return $A.apiUrl('project/files/download?fileid=' + id);
  59153. }
  59154. }
  59155. });
  59156. /***/ }),
  59157. /* 148 */
  59158. /***/ (function(module, exports, __webpack_require__) {
  59159. var render = function() {
  59160. var _vm = this
  59161. var _h = _vm.$createElement
  59162. var _c = _vm._self._c || _h
  59163. return _c("drawer-tabs-container", [
  59164. _c("div", { staticClass: "project-task-logs" }, [
  59165. _c(
  59166. "ul",
  59167. {
  59168. staticClass: "logs-activity",
  59169. class: "" + (_vm.taskid > 0 ? "istaskid" : "")
  59170. },
  59171. [
  59172. _vm._l(_vm.lists, function(items) {
  59173. return _c("li", [
  59174. _c("div", { staticClass: "logs-date" }, [
  59175. _vm._v(_vm._s(_vm.logDate(items)))
  59176. ]),
  59177. _vm._v(" "),
  59178. _c(
  59179. "div",
  59180. { staticClass: "logs-section" },
  59181. [
  59182. _c(
  59183. "Timeline",
  59184. _vm._l(items.lists, function(item, index) {
  59185. return _c("TimelineItem", { key: index }, [
  59186. _c(
  59187. "div",
  59188. {
  59189. staticClass: "logs-dot",
  59190. attrs: { slot: "dot" },
  59191. slot: "dot"
  59192. },
  59193. [
  59194. _c("UserImg", {
  59195. staticClass: "avatar",
  59196. attrs: { info: item }
  59197. })
  59198. ],
  59199. 1
  59200. ),
  59201. _vm._v(" "),
  59202. _c("div", { staticClass: "log-summary" }, [
  59203. _c(
  59204. "span",
  59205. {
  59206. staticClass: "log-creator",
  59207. on: {
  59208. click: function($event) {
  59209. return _vm.openChat(item.username)
  59210. }
  59211. }
  59212. },
  59213. [
  59214. _c("UserView", {
  59215. attrs: { username: item.username }
  59216. })
  59217. ],
  59218. 1
  59219. ),
  59220. _vm._v(" "),
  59221. _c("span", { staticClass: "log-text-secondary" }, [
  59222. _vm._v(_vm._s(item.detail))
  59223. ]),
  59224. _vm._v(" "),
  59225. item.other.type == "task" && _vm.taskid == 0
  59226. ? _c(
  59227. "span",
  59228. {
  59229. staticClass: "log-text-link",
  59230. on: {
  59231. click: function($event) {
  59232. return _vm.taskDetail(item.other.id)
  59233. }
  59234. }
  59235. },
  59236. [_vm._v(_vm._s(item.other.title))]
  59237. )
  59238. : _vm._e(),
  59239. _vm._v(" "),
  59240. item.other.type == "username"
  59241. ? _c(
  59242. "span",
  59243. {
  59244. staticClass: "log-text-link",
  59245. on: {
  59246. click: function($event) {
  59247. return _vm.openChat(item.other.username)
  59248. }
  59249. }
  59250. },
  59251. [
  59252. _c("UserView", {
  59253. attrs: { username: item.other.username }
  59254. })
  59255. ],
  59256. 1
  59257. )
  59258. : _vm._e(),
  59259. _vm._v(" "),
  59260. item.other.type == "file"
  59261. ? _c(
  59262. "a",
  59263. {
  59264. staticClass: "log-text-link",
  59265. attrs: {
  59266. target: "_blank",
  59267. href: _vm.fileDownUrl(item.other.id)
  59268. }
  59269. },
  59270. [_vm._v(_vm._s(item.other.name))]
  59271. )
  59272. : _vm._e(),
  59273. _vm._v(" "),
  59274. _c("span", { staticClass: "log-text-info" }, [
  59275. _vm._v(
  59276. _vm._s(item.timeData.ymd) +
  59277. " " +
  59278. _vm._s(item.timeData.segment) +
  59279. " " +
  59280. _vm._s(item.timeData.hi)
  59281. )
  59282. ])
  59283. ])
  59284. ])
  59285. }),
  59286. 1
  59287. )
  59288. ],
  59289. 1
  59290. )
  59291. ])
  59292. }),
  59293. _vm._v(" "),
  59294. _vm.loadIng > 0
  59295. ? _c("li", { staticClass: "logs-loading" }, [_c("w-loading")], 1)
  59296. : _vm.hasMorePages
  59297. ? _c(
  59298. "li",
  59299. { staticClass: "logs-more", on: { click: _vm.getMore } },
  59300. [_vm._v(_vm._s(_vm.$L("加载更多")))]
  59301. )
  59302. : _vm.totalNum == 0
  59303. ? _c(
  59304. "li",
  59305. {
  59306. staticClass: "logs-none",
  59307. on: {
  59308. click: function($event) {
  59309. return _vm.getLists(true)
  59310. }
  59311. }
  59312. },
  59313. [_vm._v(_vm._s(_vm.$L("没有相关内容")))]
  59314. )
  59315. : _vm._e()
  59316. ],
  59317. 2
  59318. )
  59319. ])
  59320. ])
  59321. }
  59322. var staticRenderFns = []
  59323. render._withStripped = true
  59324. module.exports = { render: render, staticRenderFns: staticRenderFns }
  59325. if (false) {
  59326. module.hot.accept()
  59327. if (module.hot.data) {
  59328. require("vue-hot-reload-api") .rerender("data-v-2951ea9e", module.exports)
  59329. }
  59330. }
  59331. /***/ }),
  59332. /* 149 */
  59333. /***/ (function(module, exports, __webpack_require__) {
  59334. var Symbol = __webpack_require__(18);
  59335. /** Used for built-in method references. */
  59336. var objectProto = Object.prototype;
  59337. /** Used to check objects for own properties. */
  59338. var hasOwnProperty = objectProto.hasOwnProperty;
  59339. /**
  59340. * Used to resolve the
  59341. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  59342. * of values.
  59343. */
  59344. var nativeObjectToString = objectProto.toString;
  59345. /** Built-in value references. */
  59346. var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  59347. /**
  59348. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  59349. *
  59350. * @private
  59351. * @param {*} value The value to query.
  59352. * @returns {string} Returns the raw `toStringTag`.
  59353. */
  59354. function getRawTag(value) {
  59355. var isOwn = hasOwnProperty.call(value, symToStringTag),
  59356. tag = value[symToStringTag];
  59357. try {
  59358. value[symToStringTag] = undefined;
  59359. var unmasked = true;
  59360. } catch (e) {}
  59361. var result = nativeObjectToString.call(value);
  59362. if (unmasked) {
  59363. if (isOwn) {
  59364. value[symToStringTag] = tag;
  59365. } else {
  59366. delete value[symToStringTag];
  59367. }
  59368. }
  59369. return result;
  59370. }
  59371. module.exports = getRawTag;
  59372. /***/ }),
  59373. /* 150 */
  59374. /***/ (function(module, exports) {
  59375. /** Used for built-in method references. */
  59376. var objectProto = Object.prototype;
  59377. /**
  59378. * Used to resolve the
  59379. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  59380. * of values.
  59381. */
  59382. var nativeObjectToString = objectProto.toString;
  59383. /**
  59384. * Converts `value` to a string using `Object.prototype.toString`.
  59385. *
  59386. * @private
  59387. * @param {*} value The value to convert.
  59388. * @returns {string} Returns the converted string.
  59389. */
  59390. function objectToString(value) {
  59391. return nativeObjectToString.call(value);
  59392. }
  59393. module.exports = objectToString;
  59394. /***/ }),
  59395. /* 151 */
  59396. /***/ (function(module, exports, __webpack_require__) {
  59397. var Hash = __webpack_require__(152),
  59398. ListCache = __webpack_require__(12),
  59399. Map = __webpack_require__(23);
  59400. /**
  59401. * Removes all key-value entries from the map.
  59402. *
  59403. * @private
  59404. * @name clear
  59405. * @memberOf MapCache
  59406. */
  59407. function mapCacheClear() {
  59408. this.size = 0;
  59409. this.__data__ = {
  59410. 'hash': new Hash,
  59411. 'map': new (Map || ListCache),
  59412. 'string': new Hash
  59413. };
  59414. }
  59415. module.exports = mapCacheClear;
  59416. /***/ }),
  59417. /* 152 */
  59418. /***/ (function(module, exports, __webpack_require__) {
  59419. var hashClear = __webpack_require__(153),
  59420. hashDelete = __webpack_require__(158),
  59421. hashGet = __webpack_require__(159),
  59422. hashHas = __webpack_require__(160),
  59423. hashSet = __webpack_require__(161);
  59424. /**
  59425. * Creates a hash object.
  59426. *
  59427. * @private
  59428. * @constructor
  59429. * @param {Array} [entries] The key-value pairs to cache.
  59430. */
  59431. function Hash(entries) {
  59432. var index = -1,
  59433. length = entries == null ? 0 : entries.length;
  59434. this.clear();
  59435. while (++index < length) {
  59436. var entry = entries[index];
  59437. this.set(entry[0], entry[1]);
  59438. }
  59439. }
  59440. // Add methods to `Hash`.
  59441. Hash.prototype.clear = hashClear;
  59442. Hash.prototype['delete'] = hashDelete;
  59443. Hash.prototype.get = hashGet;
  59444. Hash.prototype.has = hashHas;
  59445. Hash.prototype.set = hashSet;
  59446. module.exports = Hash;
  59447. /***/ }),
  59448. /* 153 */
  59449. /***/ (function(module, exports, __webpack_require__) {
  59450. var nativeCreate = __webpack_require__(11);
  59451. /**
  59452. * Removes all key-value entries from the hash.
  59453. *
  59454. * @private
  59455. * @name clear
  59456. * @memberOf Hash
  59457. */
  59458. function hashClear() {
  59459. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  59460. this.size = 0;
  59461. }
  59462. module.exports = hashClear;
  59463. /***/ }),
  59464. /* 154 */
  59465. /***/ (function(module, exports, __webpack_require__) {
  59466. var isFunction = __webpack_require__(38),
  59467. isMasked = __webpack_require__(155),
  59468. isObject = __webpack_require__(9),
  59469. toSource = __webpack_require__(39);
  59470. /**
  59471. * Used to match `RegExp`
  59472. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  59473. */
  59474. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  59475. /** Used to detect host constructors (Safari). */
  59476. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  59477. /** Used for built-in method references. */
  59478. var funcProto = Function.prototype,
  59479. objectProto = Object.prototype;
  59480. /** Used to resolve the decompiled source of functions. */
  59481. var funcToString = funcProto.toString;
  59482. /** Used to check objects for own properties. */
  59483. var hasOwnProperty = objectProto.hasOwnProperty;
  59484. /** Used to detect if a method is native. */
  59485. var reIsNative = RegExp('^' +
  59486. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  59487. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  59488. );
  59489. /**
  59490. * The base implementation of `_.isNative` without bad shim checks.
  59491. *
  59492. * @private
  59493. * @param {*} value The value to check.
  59494. * @returns {boolean} Returns `true` if `value` is a native function,
  59495. * else `false`.
  59496. */
  59497. function baseIsNative(value) {
  59498. if (!isObject(value) || isMasked(value)) {
  59499. return false;
  59500. }
  59501. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  59502. return pattern.test(toSource(value));
  59503. }
  59504. module.exports = baseIsNative;
  59505. /***/ }),
  59506. /* 155 */
  59507. /***/ (function(module, exports, __webpack_require__) {
  59508. var coreJsData = __webpack_require__(156);
  59509. /** Used to detect methods masquerading as native. */
  59510. var maskSrcKey = (function() {
  59511. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  59512. return uid ? ('Symbol(src)_1.' + uid) : '';
  59513. }());
  59514. /**
  59515. * Checks if `func` has its source masked.
  59516. *
  59517. * @private
  59518. * @param {Function} func The function to check.
  59519. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  59520. */
  59521. function isMasked(func) {
  59522. return !!maskSrcKey && (maskSrcKey in func);
  59523. }
  59524. module.exports = isMasked;
  59525. /***/ }),
  59526. /* 156 */
  59527. /***/ (function(module, exports, __webpack_require__) {
  59528. var root = __webpack_require__(3);
  59529. /** Used to detect overreaching core-js shims. */
  59530. var coreJsData = root['__core-js_shared__'];
  59531. module.exports = coreJsData;
  59532. /***/ }),
  59533. /* 157 */
  59534. /***/ (function(module, exports) {
  59535. /**
  59536. * Gets the value at `key` of `object`.
  59537. *
  59538. * @private
  59539. * @param {Object} [object] The object to query.
  59540. * @param {string} key The key of the property to get.
  59541. * @returns {*} Returns the property value.
  59542. */
  59543. function getValue(object, key) {
  59544. return object == null ? undefined : object[key];
  59545. }
  59546. module.exports = getValue;
  59547. /***/ }),
  59548. /* 158 */
  59549. /***/ (function(module, exports) {
  59550. /**
  59551. * Removes `key` and its value from the hash.
  59552. *
  59553. * @private
  59554. * @name delete
  59555. * @memberOf Hash
  59556. * @param {Object} hash The hash to modify.
  59557. * @param {string} key The key of the value to remove.
  59558. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  59559. */
  59560. function hashDelete(key) {
  59561. var result = this.has(key) && delete this.__data__[key];
  59562. this.size -= result ? 1 : 0;
  59563. return result;
  59564. }
  59565. module.exports = hashDelete;
  59566. /***/ }),
  59567. /* 159 */
  59568. /***/ (function(module, exports, __webpack_require__) {
  59569. var nativeCreate = __webpack_require__(11);
  59570. /** Used to stand-in for `undefined` hash values. */
  59571. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  59572. /** Used for built-in method references. */
  59573. var objectProto = Object.prototype;
  59574. /** Used to check objects for own properties. */
  59575. var hasOwnProperty = objectProto.hasOwnProperty;
  59576. /**
  59577. * Gets the hash value for `key`.
  59578. *
  59579. * @private
  59580. * @name get
  59581. * @memberOf Hash
  59582. * @param {string} key The key of the value to get.
  59583. * @returns {*} Returns the entry value.
  59584. */
  59585. function hashGet(key) {
  59586. var data = this.__data__;
  59587. if (nativeCreate) {
  59588. var result = data[key];
  59589. return result === HASH_UNDEFINED ? undefined : result;
  59590. }
  59591. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  59592. }
  59593. module.exports = hashGet;
  59594. /***/ }),
  59595. /* 160 */
  59596. /***/ (function(module, exports, __webpack_require__) {
  59597. var nativeCreate = __webpack_require__(11);
  59598. /** Used for built-in method references. */
  59599. var objectProto = Object.prototype;
  59600. /** Used to check objects for own properties. */
  59601. var hasOwnProperty = objectProto.hasOwnProperty;
  59602. /**
  59603. * Checks if a hash value for `key` exists.
  59604. *
  59605. * @private
  59606. * @name has
  59607. * @memberOf Hash
  59608. * @param {string} key The key of the entry to check.
  59609. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  59610. */
  59611. function hashHas(key) {
  59612. var data = this.__data__;
  59613. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  59614. }
  59615. module.exports = hashHas;
  59616. /***/ }),
  59617. /* 161 */
  59618. /***/ (function(module, exports, __webpack_require__) {
  59619. var nativeCreate = __webpack_require__(11);
  59620. /** Used to stand-in for `undefined` hash values. */
  59621. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  59622. /**
  59623. * Sets the hash `key` to `value`.
  59624. *
  59625. * @private
  59626. * @name set
  59627. * @memberOf Hash
  59628. * @param {string} key The key of the value to set.
  59629. * @param {*} value The value to set.
  59630. * @returns {Object} Returns the hash instance.
  59631. */
  59632. function hashSet(key, value) {
  59633. var data = this.__data__;
  59634. this.size += this.has(key) ? 0 : 1;
  59635. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  59636. return this;
  59637. }
  59638. module.exports = hashSet;
  59639. /***/ }),
  59640. /* 162 */
  59641. /***/ (function(module, exports) {
  59642. /**
  59643. * Removes all key-value entries from the list cache.
  59644. *
  59645. * @private
  59646. * @name clear
  59647. * @memberOf ListCache
  59648. */
  59649. function listCacheClear() {
  59650. this.__data__ = [];
  59651. this.size = 0;
  59652. }
  59653. module.exports = listCacheClear;
  59654. /***/ }),
  59655. /* 163 */
  59656. /***/ (function(module, exports, __webpack_require__) {
  59657. var assocIndexOf = __webpack_require__(13);
  59658. /** Used for built-in method references. */
  59659. var arrayProto = Array.prototype;
  59660. /** Built-in value references. */
  59661. var splice = arrayProto.splice;
  59662. /**
  59663. * Removes `key` and its value from the list cache.
  59664. *
  59665. * @private
  59666. * @name delete
  59667. * @memberOf ListCache
  59668. * @param {string} key The key of the value to remove.
  59669. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  59670. */
  59671. function listCacheDelete(key) {
  59672. var data = this.__data__,
  59673. index = assocIndexOf(data, key);
  59674. if (index < 0) {
  59675. return false;
  59676. }
  59677. var lastIndex = data.length - 1;
  59678. if (index == lastIndex) {
  59679. data.pop();
  59680. } else {
  59681. splice.call(data, index, 1);
  59682. }
  59683. --this.size;
  59684. return true;
  59685. }
  59686. module.exports = listCacheDelete;
  59687. /***/ }),
  59688. /* 164 */
  59689. /***/ (function(module, exports, __webpack_require__) {
  59690. var assocIndexOf = __webpack_require__(13);
  59691. /**
  59692. * Gets the list cache value for `key`.
  59693. *
  59694. * @private
  59695. * @name get
  59696. * @memberOf ListCache
  59697. * @param {string} key The key of the value to get.
  59698. * @returns {*} Returns the entry value.
  59699. */
  59700. function listCacheGet(key) {
  59701. var data = this.__data__,
  59702. index = assocIndexOf(data, key);
  59703. return index < 0 ? undefined : data[index][1];
  59704. }
  59705. module.exports = listCacheGet;
  59706. /***/ }),
  59707. /* 165 */
  59708. /***/ (function(module, exports, __webpack_require__) {
  59709. var assocIndexOf = __webpack_require__(13);
  59710. /**
  59711. * Checks if a list cache value for `key` exists.
  59712. *
  59713. * @private
  59714. * @name has
  59715. * @memberOf ListCache
  59716. * @param {string} key The key of the entry to check.
  59717. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  59718. */
  59719. function listCacheHas(key) {
  59720. return assocIndexOf(this.__data__, key) > -1;
  59721. }
  59722. module.exports = listCacheHas;
  59723. /***/ }),
  59724. /* 166 */
  59725. /***/ (function(module, exports, __webpack_require__) {
  59726. var assocIndexOf = __webpack_require__(13);
  59727. /**
  59728. * Sets the list cache `key` to `value`.
  59729. *
  59730. * @private
  59731. * @name set
  59732. * @memberOf ListCache
  59733. * @param {string} key The key of the value to set.
  59734. * @param {*} value The value to set.
  59735. * @returns {Object} Returns the list cache instance.
  59736. */
  59737. function listCacheSet(key, value) {
  59738. var data = this.__data__,
  59739. index = assocIndexOf(data, key);
  59740. if (index < 0) {
  59741. ++this.size;
  59742. data.push([key, value]);
  59743. } else {
  59744. data[index][1] = value;
  59745. }
  59746. return this;
  59747. }
  59748. module.exports = listCacheSet;
  59749. /***/ }),
  59750. /* 167 */
  59751. /***/ (function(module, exports, __webpack_require__) {
  59752. var getMapData = __webpack_require__(14);
  59753. /**
  59754. * Removes `key` and its value from the map.
  59755. *
  59756. * @private
  59757. * @name delete
  59758. * @memberOf MapCache
  59759. * @param {string} key The key of the value to remove.
  59760. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  59761. */
  59762. function mapCacheDelete(key) {
  59763. var result = getMapData(this, key)['delete'](key);
  59764. this.size -= result ? 1 : 0;
  59765. return result;
  59766. }
  59767. module.exports = mapCacheDelete;
  59768. /***/ }),
  59769. /* 168 */
  59770. /***/ (function(module, exports) {
  59771. /**
  59772. * Checks if `value` is suitable for use as unique object key.
  59773. *
  59774. * @private
  59775. * @param {*} value The value to check.
  59776. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  59777. */
  59778. function isKeyable(value) {
  59779. var type = typeof value;
  59780. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  59781. ? (value !== '__proto__')
  59782. : (value === null);
  59783. }
  59784. module.exports = isKeyable;
  59785. /***/ }),
  59786. /* 169 */
  59787. /***/ (function(module, exports, __webpack_require__) {
  59788. var getMapData = __webpack_require__(14);
  59789. /**
  59790. * Gets the map value for `key`.
  59791. *
  59792. * @private
  59793. * @name get
  59794. * @memberOf MapCache
  59795. * @param {string} key The key of the value to get.
  59796. * @returns {*} Returns the entry value.
  59797. */
  59798. function mapCacheGet(key) {
  59799. return getMapData(this, key).get(key);
  59800. }
  59801. module.exports = mapCacheGet;
  59802. /***/ }),
  59803. /* 170 */
  59804. /***/ (function(module, exports, __webpack_require__) {
  59805. var getMapData = __webpack_require__(14);
  59806. /**
  59807. * Checks if a map value for `key` exists.
  59808. *
  59809. * @private
  59810. * @name has
  59811. * @memberOf MapCache
  59812. * @param {string} key The key of the entry to check.
  59813. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  59814. */
  59815. function mapCacheHas(key) {
  59816. return getMapData(this, key).has(key);
  59817. }
  59818. module.exports = mapCacheHas;
  59819. /***/ }),
  59820. /* 171 */
  59821. /***/ (function(module, exports, __webpack_require__) {
  59822. var getMapData = __webpack_require__(14);
  59823. /**
  59824. * Sets the map `key` to `value`.
  59825. *
  59826. * @private
  59827. * @name set
  59828. * @memberOf MapCache
  59829. * @param {string} key The key of the value to set.
  59830. * @param {*} value The value to set.
  59831. * @returns {Object} Returns the map cache instance.
  59832. */
  59833. function mapCacheSet(key, value) {
  59834. var data = getMapData(this, key),
  59835. size = data.size;
  59836. data.set(key, value);
  59837. this.size += data.size == size ? 0 : 1;
  59838. return this;
  59839. }
  59840. module.exports = mapCacheSet;
  59841. /***/ }),
  59842. /* 172 */
  59843. /***/ (function(module, exports, __webpack_require__) {
  59844. var ListCache = __webpack_require__(12);
  59845. /**
  59846. * Removes all key-value entries from the stack.
  59847. *
  59848. * @private
  59849. * @name clear
  59850. * @memberOf Stack
  59851. */
  59852. function stackClear() {
  59853. this.__data__ = new ListCache;
  59854. this.size = 0;
  59855. }
  59856. module.exports = stackClear;
  59857. /***/ }),
  59858. /* 173 */
  59859. /***/ (function(module, exports) {
  59860. /**
  59861. * Removes `key` and its value from the stack.
  59862. *
  59863. * @private
  59864. * @name delete
  59865. * @memberOf Stack
  59866. * @param {string} key The key of the value to remove.
  59867. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  59868. */
  59869. function stackDelete(key) {
  59870. var data = this.__data__,
  59871. result = data['delete'](key);
  59872. this.size = data.size;
  59873. return result;
  59874. }
  59875. module.exports = stackDelete;
  59876. /***/ }),
  59877. /* 174 */
  59878. /***/ (function(module, exports) {
  59879. /**
  59880. * Gets the stack value for `key`.
  59881. *
  59882. * @private
  59883. * @name get
  59884. * @memberOf Stack
  59885. * @param {string} key The key of the value to get.
  59886. * @returns {*} Returns the entry value.
  59887. */
  59888. function stackGet(key) {
  59889. return this.__data__.get(key);
  59890. }
  59891. module.exports = stackGet;
  59892. /***/ }),
  59893. /* 175 */
  59894. /***/ (function(module, exports) {
  59895. /**
  59896. * Checks if a stack value for `key` exists.
  59897. *
  59898. * @private
  59899. * @name has
  59900. * @memberOf Stack
  59901. * @param {string} key The key of the entry to check.
  59902. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  59903. */
  59904. function stackHas(key) {
  59905. return this.__data__.has(key);
  59906. }
  59907. module.exports = stackHas;
  59908. /***/ }),
  59909. /* 176 */
  59910. /***/ (function(module, exports, __webpack_require__) {
  59911. var ListCache = __webpack_require__(12),
  59912. Map = __webpack_require__(23),
  59913. MapCache = __webpack_require__(54);
  59914. /** Used as the size to enable large array optimizations. */
  59915. var LARGE_ARRAY_SIZE = 200;
  59916. /**
  59917. * Sets the stack `key` to `value`.
  59918. *
  59919. * @private
  59920. * @name set
  59921. * @memberOf Stack
  59922. * @param {string} key The key of the value to set.
  59923. * @param {*} value The value to set.
  59924. * @returns {Object} Returns the stack cache instance.
  59925. */
  59926. function stackSet(key, value) {
  59927. var data = this.__data__;
  59928. if (data instanceof ListCache) {
  59929. var pairs = data.__data__;
  59930. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  59931. pairs.push([key, value]);
  59932. this.size = ++data.size;
  59933. return this;
  59934. }
  59935. data = this.__data__ = new MapCache(pairs);
  59936. }
  59937. data.set(key, value);
  59938. this.size = data.size;
  59939. return this;
  59940. }
  59941. module.exports = stackSet;
  59942. /***/ }),
  59943. /* 177 */
  59944. /***/ (function(module, exports) {
  59945. /**
  59946. * A specialized version of `_.filter` for arrays without support for
  59947. * iteratee shorthands.
  59948. *
  59949. * @private
  59950. * @param {Array} [array] The array to iterate over.
  59951. * @param {Function} predicate The function invoked per iteration.
  59952. * @returns {Array} Returns the new filtered array.
  59953. */
  59954. function arrayFilter(array, predicate) {
  59955. var index = -1,
  59956. length = array == null ? 0 : array.length,
  59957. resIndex = 0,
  59958. result = [];
  59959. while (++index < length) {
  59960. var value = array[index];
  59961. if (predicate(value, index, array)) {
  59962. result[resIndex++] = value;
  59963. }
  59964. }
  59965. return result;
  59966. }
  59967. module.exports = arrayFilter;
  59968. /***/ }),
  59969. /* 178 */
  59970. /***/ (function(module, exports) {
  59971. /**
  59972. * The base implementation of `_.times` without support for iteratee shorthands
  59973. * or max array length checks.
  59974. *
  59975. * @private
  59976. * @param {number} n The number of times to invoke `iteratee`.
  59977. * @param {Function} iteratee The function invoked per iteration.
  59978. * @returns {Array} Returns the array of results.
  59979. */
  59980. function baseTimes(n, iteratee) {
  59981. var index = -1,
  59982. result = Array(n);
  59983. while (++index < n) {
  59984. result[index] = iteratee(index);
  59985. }
  59986. return result;
  59987. }
  59988. module.exports = baseTimes;
  59989. /***/ }),
  59990. /* 179 */
  59991. /***/ (function(module, exports, __webpack_require__) {
  59992. var baseGetTag = __webpack_require__(10),
  59993. isObjectLike = __webpack_require__(8);
  59994. /** `Object#toString` result references. */
  59995. var argsTag = '[object Arguments]';
  59996. /**
  59997. * The base implementation of `_.isArguments`.
  59998. *
  59999. * @private
  60000. * @param {*} value The value to check.
  60001. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  60002. */
  60003. function baseIsArguments(value) {
  60004. return isObjectLike(value) && baseGetTag(value) == argsTag;
  60005. }
  60006. module.exports = baseIsArguments;
  60007. /***/ }),
  60008. /* 180 */
  60009. /***/ (function(module, exports) {
  60010. /**
  60011. * This method returns `false`.
  60012. *
  60013. * @static
  60014. * @memberOf _
  60015. * @since 4.13.0
  60016. * @category Util
  60017. * @returns {boolean} Returns `false`.
  60018. * @example
  60019. *
  60020. * _.times(2, _.stubFalse);
  60021. * // => [false, false]
  60022. */
  60023. function stubFalse() {
  60024. return false;
  60025. }
  60026. module.exports = stubFalse;
  60027. /***/ }),
  60028. /* 181 */
  60029. /***/ (function(module, exports, __webpack_require__) {
  60030. var baseGetTag = __webpack_require__(10),
  60031. isLength = __webpack_require__(35),
  60032. isObjectLike = __webpack_require__(8);
  60033. /** `Object#toString` result references. */
  60034. var argsTag = '[object Arguments]',
  60035. arrayTag = '[object Array]',
  60036. boolTag = '[object Boolean]',
  60037. dateTag = '[object Date]',
  60038. errorTag = '[object Error]',
  60039. funcTag = '[object Function]',
  60040. mapTag = '[object Map]',
  60041. numberTag = '[object Number]',
  60042. objectTag = '[object Object]',
  60043. regexpTag = '[object RegExp]',
  60044. setTag = '[object Set]',
  60045. stringTag = '[object String]',
  60046. weakMapTag = '[object WeakMap]';
  60047. var arrayBufferTag = '[object ArrayBuffer]',
  60048. dataViewTag = '[object DataView]',
  60049. float32Tag = '[object Float32Array]',
  60050. float64Tag = '[object Float64Array]',
  60051. int8Tag = '[object Int8Array]',
  60052. int16Tag = '[object Int16Array]',
  60053. int32Tag = '[object Int32Array]',
  60054. uint8Tag = '[object Uint8Array]',
  60055. uint8ClampedTag = '[object Uint8ClampedArray]',
  60056. uint16Tag = '[object Uint16Array]',
  60057. uint32Tag = '[object Uint32Array]';
  60058. /** Used to identify `toStringTag` values of typed arrays. */
  60059. var typedArrayTags = {};
  60060. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  60061. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  60062. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  60063. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  60064. typedArrayTags[uint32Tag] = true;
  60065. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  60066. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  60067. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  60068. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  60069. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  60070. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  60071. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  60072. typedArrayTags[weakMapTag] = false;
  60073. /**
  60074. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  60075. *
  60076. * @private
  60077. * @param {*} value The value to check.
  60078. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  60079. */
  60080. function baseIsTypedArray(value) {
  60081. return isObjectLike(value) &&
  60082. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  60083. }
  60084. module.exports = baseIsTypedArray;
  60085. /***/ }),
  60086. /* 182 */
  60087. /***/ (function(module, exports, __webpack_require__) {
  60088. var isPrototype = __webpack_require__(27),
  60089. nativeKeys = __webpack_require__(183);
  60090. /** Used for built-in method references. */
  60091. var objectProto = Object.prototype;
  60092. /** Used to check objects for own properties. */
  60093. var hasOwnProperty = objectProto.hasOwnProperty;
  60094. /**
  60095. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  60096. *
  60097. * @private
  60098. * @param {Object} object The object to query.
  60099. * @returns {Array} Returns the array of property names.
  60100. */
  60101. function baseKeys(object) {
  60102. if (!isPrototype(object)) {
  60103. return nativeKeys(object);
  60104. }
  60105. var result = [];
  60106. for (var key in Object(object)) {
  60107. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  60108. result.push(key);
  60109. }
  60110. }
  60111. return result;
  60112. }
  60113. module.exports = baseKeys;
  60114. /***/ }),
  60115. /* 183 */
  60116. /***/ (function(module, exports, __webpack_require__) {
  60117. var overArg = __webpack_require__(44);
  60118. /* Built-in method references for those with the same name as other `lodash` methods. */
  60119. var nativeKeys = overArg(Object.keys, Object);
  60120. module.exports = nativeKeys;
  60121. /***/ }),
  60122. /* 184 */
  60123. /***/ (function(module, exports, __webpack_require__) {
  60124. var getNative = __webpack_require__(5),
  60125. root = __webpack_require__(3);
  60126. /* Built-in method references that are verified to be native. */
  60127. var DataView = getNative(root, 'DataView');
  60128. module.exports = DataView;
  60129. /***/ }),
  60130. /* 185 */
  60131. /***/ (function(module, exports, __webpack_require__) {
  60132. var getNative = __webpack_require__(5),
  60133. root = __webpack_require__(3);
  60134. /* Built-in method references that are verified to be native. */
  60135. var Promise = getNative(root, 'Promise');
  60136. module.exports = Promise;
  60137. /***/ }),
  60138. /* 186 */
  60139. /***/ (function(module, exports, __webpack_require__) {
  60140. var getNative = __webpack_require__(5),
  60141. root = __webpack_require__(3);
  60142. /* Built-in method references that are verified to be native. */
  60143. var Set = getNative(root, 'Set');
  60144. module.exports = Set;
  60145. /***/ }),
  60146. /* 187 */
  60147. /***/ (function(module, exports, __webpack_require__) {
  60148. var getNative = __webpack_require__(5),
  60149. root = __webpack_require__(3);
  60150. /* Built-in method references that are verified to be native. */
  60151. var WeakMap = getNative(root, 'WeakMap');
  60152. module.exports = WeakMap;
  60153. /***/ }),
  60154. /* 188 */
  60155. /***/ (function(module, exports) {
  60156. /**
  60157. * When source maps are enabled, `style-loader` uses a link element with a data-uri to
  60158. * embed the css on the page. This breaks all relative urls because now they are relative to a
  60159. * bundle instead of the current page.
  60160. *
  60161. * One solution is to only use full urls, but that may be impossible.
  60162. *
  60163. * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
  60164. *
  60165. * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
  60166. *
  60167. */
  60168. module.exports = function (css) {
  60169. // get current location
  60170. var location = typeof window !== "undefined" && window.location;
  60171. if (!location) {
  60172. throw new Error("fixUrls requires window.location");
  60173. }
  60174. // blank or null?
  60175. if (!css || typeof css !== "string") {
  60176. return css;
  60177. }
  60178. var baseUrl = location.protocol + "//" + location.host;
  60179. var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  60180. // convert each url(...)
  60181. /*
  60182. This regular expression is just a way to recursively match brackets within
  60183. a string.
  60184. /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
  60185. ( = Start a capturing group
  60186. (?: = Start a non-capturing group
  60187. [^)(] = Match anything that isn't a parentheses
  60188. | = OR
  60189. \( = Match a start parentheses
  60190. (?: = Start another non-capturing groups
  60191. [^)(]+ = Match anything that isn't a parentheses
  60192. | = OR
  60193. \( = Match a start parentheses
  60194. [^)(]* = Match anything that isn't a parentheses
  60195. \) = Match a end parentheses
  60196. ) = End Group
  60197. *\) = Match anything and then a close parens
  60198. ) = Close non-capturing group
  60199. * = Match anything
  60200. ) = Close capturing group
  60201. \) = Match a close parens
  60202. /gi = Get all matches, not the first. Be case insensitive.
  60203. */
  60204. var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  60205. // strip quotes (if they exist)
  60206. var unquotedOrigUrl = origUrl
  60207. .trim()
  60208. .replace(/^"(.*)"$/, function(o, $1){ return $1; })
  60209. .replace(/^'(.*)'$/, function(o, $1){ return $1; });
  60210. // already a full url? no change
  60211. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) {
  60212. return fullMatch;
  60213. }
  60214. // convert the url to a full url
  60215. var newUrl;
  60216. if (unquotedOrigUrl.indexOf("//") === 0) {
  60217. //TODO: should we add protocol?
  60218. newUrl = unquotedOrigUrl;
  60219. } else if (unquotedOrigUrl.indexOf("/") === 0) {
  60220. // path should be relative to the base url
  60221. newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
  60222. } else {
  60223. // path should be relative to current directory
  60224. newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
  60225. }
  60226. // send back the fixed url(...)
  60227. return "url(" + JSON.stringify(newUrl) + ")";
  60228. });
  60229. // send back the fixed css
  60230. return fixedCss;
  60231. };
  60232. /***/ }),
  60233. /* 189 */
  60234. /***/ (function(module, exports, __webpack_require__) {
  60235. // style-loader: Adds some css to the DOM by adding a <style> tag
  60236. // load the styles
  60237. var content = __webpack_require__(190);
  60238. if(typeof content === 'string') content = [[module.i, content, '']];
  60239. if(content.locals) module.exports = content.locals;
  60240. // add the styles to the DOM
  60241. var update = __webpack_require__(1)("6a9f6baf", content, false, {});
  60242. // Hot Module Replacement
  60243. if(false) {
  60244. // When the styles change, update the <style> tags
  60245. if(!content.locals) {
  60246. module.hot.accept("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1fd3fc13\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./content.vue", function() {
  60247. var newContent = require("!!../../../../../../node_modules/css-loader/index.js!../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-1fd3fc13\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./content.vue");
  60248. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  60249. update(newContent);
  60250. });
  60251. }
  60252. // When the module is disposed, remove the <style> tags
  60253. module.hot.dispose(function() { update(); });
  60254. }
  60255. /***/ }),
  60256. /* 190 */
  60257. /***/ (function(module, exports, __webpack_require__) {
  60258. exports = module.exports = __webpack_require__(0)(false);
  60259. // imports
  60260. // module
  60261. exports.push([module.i, "\n.report-content[data-v-1fd3fc13] {\n background: 0 0;\n border: 0;\n float: none;\n margin: 6px 0;\n max-width: none;\n outline: 0;\n padding: 0;\n position: static;\n width: 100%;\n}\n", ""]);
  60262. // exports
  60263. /***/ }),
  60264. /* 191 */
  60265. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60266. "use strict";
  60267. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  60268. //
  60269. //
  60270. //
  60271. //
  60272. //
  60273. //
  60274. //
  60275. //
  60276. //
  60277. //
  60278. //
  60279. //
  60280. //
  60281. //
  60282. //
  60283. //
  60284. //
  60285. /**
  60286. * 预览内容
  60287. */
  60288. /* harmony default export */ __webpack_exports__["default"] = ({
  60289. name: 'ReportContent',
  60290. props: {
  60291. content: {
  60292. default: ''
  60293. }
  60294. },
  60295. data: function data() {
  60296. return {
  60297. contentHeight: 50
  60298. };
  60299. },
  60300. mounted: function mounted() {
  60301. this.setContent(this.content);
  60302. },
  60303. watch: {
  60304. content: function content(val) {
  60305. this.setContent(val);
  60306. }
  60307. },
  60308. methods: {
  60309. setContent: function setContent(val) {
  60310. var _this = this;
  60311. if (!this.$el.contentWindow) {
  60312. return;
  60313. }
  60314. var $d = this.$el.contentWindow.document;
  60315. $A("body", $d).html('<link type="text/css" rel="stylesheet" href="' + window.location.origin + '/js/build/skins/ui/oxide/content.min.css"><style>html,body{padding:0;margin:0}</style><div id="content">' + val + '</div>');
  60316. this.$nextTick(function () {
  60317. _this.contentHeight = $d.getElementById("content").scrollHeight;
  60318. });
  60319. }
  60320. }
  60321. });
  60322. /***/ }),
  60323. /* 192 */
  60324. /***/ (function(module, exports, __webpack_require__) {
  60325. var render = function() {
  60326. var _vm = this
  60327. var _h = _vm.$createElement
  60328. var _c = _vm._self._c || _h
  60329. return _c("iframe", {
  60330. staticClass: "report-content",
  60331. style: { height: _vm.contentHeight + "px" }
  60332. })
  60333. }
  60334. var staticRenderFns = []
  60335. render._withStripped = true
  60336. module.exports = { render: render, staticRenderFns: staticRenderFns }
  60337. if (false) {
  60338. module.hot.accept()
  60339. if (module.hot.data) {
  60340. require("vue-hot-reload-api") .rerender("data-v-1fd3fc13", module.exports)
  60341. }
  60342. }
  60343. /***/ }),
  60344. /* 193 */
  60345. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  60346. "use strict";
  60347. /*!
  60348. * vue-router v3.5.3
  60349. * (c) 2021 Evan You
  60350. * @license MIT
  60351. */
  60352. /* */
  60353. function assert (condition, message) {
  60354. if (!condition) {
  60355. throw new Error(("[vue-router] " + message))
  60356. }
  60357. }
  60358. function warn (condition, message) {
  60359. if (!condition) {
  60360. typeof console !== 'undefined' && console.warn(("[vue-router] " + message));
  60361. }
  60362. }
  60363. function extend (a, b) {
  60364. for (var key in b) {
  60365. a[key] = b[key];
  60366. }
  60367. return a
  60368. }
  60369. /* */
  60370. var encodeReserveRE = /[!'()*]/g;
  60371. var encodeReserveReplacer = function (c) { return '%' + c.charCodeAt(0).toString(16); };
  60372. var commaRE = /%2C/g;
  60373. // fixed encodeURIComponent which is more conformant to RFC3986:
  60374. // - escapes [!'()*]
  60375. // - preserve commas
  60376. var encode = function (str) { return encodeURIComponent(str)
  60377. .replace(encodeReserveRE, encodeReserveReplacer)
  60378. .replace(commaRE, ','); };
  60379. function decode (str) {
  60380. try {
  60381. return decodeURIComponent(str)
  60382. } catch (err) {
  60383. if (true) {
  60384. warn(false, ("Error decoding \"" + str + "\". Leaving it intact."));
  60385. }
  60386. }
  60387. return str
  60388. }
  60389. function resolveQuery (
  60390. query,
  60391. extraQuery,
  60392. _parseQuery
  60393. ) {
  60394. if ( extraQuery === void 0 ) extraQuery = {};
  60395. var parse = _parseQuery || parseQuery;
  60396. var parsedQuery;
  60397. try {
  60398. parsedQuery = parse(query || '');
  60399. } catch (e) {
  60400. "development" !== 'production' && warn(false, e.message);
  60401. parsedQuery = {};
  60402. }
  60403. for (var key in extraQuery) {
  60404. var value = extraQuery[key];
  60405. parsedQuery[key] = Array.isArray(value)
  60406. ? value.map(castQueryParamValue)
  60407. : castQueryParamValue(value);
  60408. }
  60409. return parsedQuery
  60410. }
  60411. var castQueryParamValue = function (value) { return (value == null || typeof value === 'object' ? value : String(value)); };
  60412. function parseQuery (query) {
  60413. var res = {};
  60414. query = query.trim().replace(/^(\?|#|&)/, '');
  60415. if (!query) {
  60416. return res
  60417. }
  60418. query.split('&').forEach(function (param) {
  60419. var parts = param.replace(/\+/g, ' ').split('=');
  60420. var key = decode(parts.shift());
  60421. var val = parts.length > 0 ? decode(parts.join('=')) : null;
  60422. if (res[key] === undefined) {
  60423. res[key] = val;
  60424. } else if (Array.isArray(res[key])) {
  60425. res[key].push(val);
  60426. } else {
  60427. res[key] = [res[key], val];
  60428. }
  60429. });
  60430. return res
  60431. }
  60432. function stringifyQuery (obj) {
  60433. var res = obj
  60434. ? Object.keys(obj)
  60435. .map(function (key) {
  60436. var val = obj[key];
  60437. if (val === undefined) {
  60438. return ''
  60439. }
  60440. if (val === null) {
  60441. return encode(key)
  60442. }
  60443. if (Array.isArray(val)) {
  60444. var result = [];
  60445. val.forEach(function (val2) {
  60446. if (val2 === undefined) {
  60447. return
  60448. }
  60449. if (val2 === null) {
  60450. result.push(encode(key));
  60451. } else {
  60452. result.push(encode(key) + '=' + encode(val2));
  60453. }
  60454. });
  60455. return result.join('&')
  60456. }
  60457. return encode(key) + '=' + encode(val)
  60458. })
  60459. .filter(function (x) { return x.length > 0; })
  60460. .join('&')
  60461. : null;
  60462. return res ? ("?" + res) : ''
  60463. }
  60464. /* */
  60465. var trailingSlashRE = /\/?$/;
  60466. function createRoute (
  60467. record,
  60468. location,
  60469. redirectedFrom,
  60470. router
  60471. ) {
  60472. var stringifyQuery = router && router.options.stringifyQuery;
  60473. var query = location.query || {};
  60474. try {
  60475. query = clone(query);
  60476. } catch (e) {}
  60477. var route = {
  60478. name: location.name || (record && record.name),
  60479. meta: (record && record.meta) || {},
  60480. path: location.path || '/',
  60481. hash: location.hash || '',
  60482. query: query,
  60483. params: location.params || {},
  60484. fullPath: getFullPath(location, stringifyQuery),
  60485. matched: record ? formatMatch(record) : []
  60486. };
  60487. if (redirectedFrom) {
  60488. route.redirectedFrom = getFullPath(redirectedFrom, stringifyQuery);
  60489. }
  60490. return Object.freeze(route)
  60491. }
  60492. function clone (value) {
  60493. if (Array.isArray(value)) {
  60494. return value.map(clone)
  60495. } else if (value && typeof value === 'object') {
  60496. var res = {};
  60497. for (var key in value) {
  60498. res[key] = clone(value[key]);
  60499. }
  60500. return res
  60501. } else {
  60502. return value
  60503. }
  60504. }
  60505. // the starting route that represents the initial state
  60506. var START = createRoute(null, {
  60507. path: '/'
  60508. });
  60509. function formatMatch (record) {
  60510. var res = [];
  60511. while (record) {
  60512. res.unshift(record);
  60513. record = record.parent;
  60514. }
  60515. return res
  60516. }
  60517. function getFullPath (
  60518. ref,
  60519. _stringifyQuery
  60520. ) {
  60521. var path = ref.path;
  60522. var query = ref.query; if ( query === void 0 ) query = {};
  60523. var hash = ref.hash; if ( hash === void 0 ) hash = '';
  60524. var stringify = _stringifyQuery || stringifyQuery;
  60525. return (path || '/') + stringify(query) + hash
  60526. }
  60527. function isSameRoute (a, b, onlyPath) {
  60528. if (b === START) {
  60529. return a === b
  60530. } else if (!b) {
  60531. return false
  60532. } else if (a.path && b.path) {
  60533. return a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && (onlyPath ||
  60534. a.hash === b.hash &&
  60535. isObjectEqual(a.query, b.query))
  60536. } else if (a.name && b.name) {
  60537. return (
  60538. a.name === b.name &&
  60539. (onlyPath || (
  60540. a.hash === b.hash &&
  60541. isObjectEqual(a.query, b.query) &&
  60542. isObjectEqual(a.params, b.params))
  60543. )
  60544. )
  60545. } else {
  60546. return false
  60547. }
  60548. }
  60549. function isObjectEqual (a, b) {
  60550. if ( a === void 0 ) a = {};
  60551. if ( b === void 0 ) b = {};
  60552. // handle null value #1566
  60553. if (!a || !b) { return a === b }
  60554. var aKeys = Object.keys(a).sort();
  60555. var bKeys = Object.keys(b).sort();
  60556. if (aKeys.length !== bKeys.length) {
  60557. return false
  60558. }
  60559. return aKeys.every(function (key, i) {
  60560. var aVal = a[key];
  60561. var bKey = bKeys[i];
  60562. if (bKey !== key) { return false }
  60563. var bVal = b[key];
  60564. // query values can be null and undefined
  60565. if (aVal == null || bVal == null) { return aVal === bVal }
  60566. // check nested equality
  60567. if (typeof aVal === 'object' && typeof bVal === 'object') {
  60568. return isObjectEqual(aVal, bVal)
  60569. }
  60570. return String(aVal) === String(bVal)
  60571. })
  60572. }
  60573. function isIncludedRoute (current, target) {
  60574. return (
  60575. current.path.replace(trailingSlashRE, '/').indexOf(
  60576. target.path.replace(trailingSlashRE, '/')
  60577. ) === 0 &&
  60578. (!target.hash || current.hash === target.hash) &&
  60579. queryIncludes(current.query, target.query)
  60580. )
  60581. }
  60582. function queryIncludes (current, target) {
  60583. for (var key in target) {
  60584. if (!(key in current)) {
  60585. return false
  60586. }
  60587. }
  60588. return true
  60589. }
  60590. function handleRouteEntered (route) {
  60591. for (var i = 0; i < route.matched.length; i++) {
  60592. var record = route.matched[i];
  60593. for (var name in record.instances) {
  60594. var instance = record.instances[name];
  60595. var cbs = record.enteredCbs[name];
  60596. if (!instance || !cbs) { continue }
  60597. delete record.enteredCbs[name];
  60598. for (var i$1 = 0; i$1 < cbs.length; i$1++) {
  60599. if (!instance._isBeingDestroyed) { cbs[i$1](instance); }
  60600. }
  60601. }
  60602. }
  60603. }
  60604. var View = {
  60605. name: 'RouterView',
  60606. functional: true,
  60607. props: {
  60608. name: {
  60609. type: String,
  60610. default: 'default'
  60611. }
  60612. },
  60613. render: function render (_, ref) {
  60614. var props = ref.props;
  60615. var children = ref.children;
  60616. var parent = ref.parent;
  60617. var data = ref.data;
  60618. // used by devtools to display a router-view badge
  60619. data.routerView = true;
  60620. // directly use parent context's createElement() function
  60621. // so that components rendered by router-view can resolve named slots
  60622. var h = parent.$createElement;
  60623. var name = props.name;
  60624. var route = parent.$route;
  60625. var cache = parent._routerViewCache || (parent._routerViewCache = {});
  60626. // determine current view depth, also check to see if the tree
  60627. // has been toggled inactive but kept-alive.
  60628. var depth = 0;
  60629. var inactive = false;
  60630. while (parent && parent._routerRoot !== parent) {
  60631. var vnodeData = parent.$vnode ? parent.$vnode.data : {};
  60632. if (vnodeData.routerView) {
  60633. depth++;
  60634. }
  60635. if (vnodeData.keepAlive && parent._directInactive && parent._inactive) {
  60636. inactive = true;
  60637. }
  60638. parent = parent.$parent;
  60639. }
  60640. data.routerViewDepth = depth;
  60641. // render previous view if the tree is inactive and kept-alive
  60642. if (inactive) {
  60643. var cachedData = cache[name];
  60644. var cachedComponent = cachedData && cachedData.component;
  60645. if (cachedComponent) {
  60646. // #2301
  60647. // pass props
  60648. if (cachedData.configProps) {
  60649. fillPropsinData(cachedComponent, data, cachedData.route, cachedData.configProps);
  60650. }
  60651. return h(cachedComponent, data, children)
  60652. } else {
  60653. // render previous empty view
  60654. return h()
  60655. }
  60656. }
  60657. var matched = route.matched[depth];
  60658. var component = matched && matched.components[name];
  60659. // render empty node if no matched route or no config component
  60660. if (!matched || !component) {
  60661. cache[name] = null;
  60662. return h()
  60663. }
  60664. // cache component
  60665. cache[name] = { component: component };
  60666. // attach instance registration hook
  60667. // this will be called in the instance's injected lifecycle hooks
  60668. data.registerRouteInstance = function (vm, val) {
  60669. // val could be undefined for unregistration
  60670. var current = matched.instances[name];
  60671. if (
  60672. (val && current !== vm) ||
  60673. (!val && current === vm)
  60674. ) {
  60675. matched.instances[name] = val;
  60676. }
  60677. }
  60678. // also register instance in prepatch hook
  60679. // in case the same component instance is reused across different routes
  60680. ;(data.hook || (data.hook = {})).prepatch = function (_, vnode) {
  60681. matched.instances[name] = vnode.componentInstance;
  60682. };
  60683. // register instance in init hook
  60684. // in case kept-alive component be actived when routes changed
  60685. data.hook.init = function (vnode) {
  60686. if (vnode.data.keepAlive &&
  60687. vnode.componentInstance &&
  60688. vnode.componentInstance !== matched.instances[name]
  60689. ) {
  60690. matched.instances[name] = vnode.componentInstance;
  60691. }
  60692. // if the route transition has already been confirmed then we weren't
  60693. // able to call the cbs during confirmation as the component was not
  60694. // registered yet, so we call it here.
  60695. handleRouteEntered(route);
  60696. };
  60697. var configProps = matched.props && matched.props[name];
  60698. // save route and configProps in cache
  60699. if (configProps) {
  60700. extend(cache[name], {
  60701. route: route,
  60702. configProps: configProps
  60703. });
  60704. fillPropsinData(component, data, route, configProps);
  60705. }
  60706. return h(component, data, children)
  60707. }
  60708. };
  60709. function fillPropsinData (component, data, route, configProps) {
  60710. // resolve props
  60711. var propsToPass = data.props = resolveProps(route, configProps);
  60712. if (propsToPass) {
  60713. // clone to prevent mutation
  60714. propsToPass = data.props = extend({}, propsToPass);
  60715. // pass non-declared props as attrs
  60716. var attrs = data.attrs = data.attrs || {};
  60717. for (var key in propsToPass) {
  60718. if (!component.props || !(key in component.props)) {
  60719. attrs[key] = propsToPass[key];
  60720. delete propsToPass[key];
  60721. }
  60722. }
  60723. }
  60724. }
  60725. function resolveProps (route, config) {
  60726. switch (typeof config) {
  60727. case 'undefined':
  60728. return
  60729. case 'object':
  60730. return config
  60731. case 'function':
  60732. return config(route)
  60733. case 'boolean':
  60734. return config ? route.params : undefined
  60735. default:
  60736. if (true) {
  60737. warn(
  60738. false,
  60739. "props in \"" + (route.path) + "\" is a " + (typeof config) + ", " +
  60740. "expecting an object, function or boolean."
  60741. );
  60742. }
  60743. }
  60744. }
  60745. /* */
  60746. function resolvePath (
  60747. relative,
  60748. base,
  60749. append
  60750. ) {
  60751. var firstChar = relative.charAt(0);
  60752. if (firstChar === '/') {
  60753. return relative
  60754. }
  60755. if (firstChar === '?' || firstChar === '#') {
  60756. return base + relative
  60757. }
  60758. var stack = base.split('/');
  60759. // remove trailing segment if:
  60760. // - not appending
  60761. // - appending to trailing slash (last segment is empty)
  60762. if (!append || !stack[stack.length - 1]) {
  60763. stack.pop();
  60764. }
  60765. // resolve relative path
  60766. var segments = relative.replace(/^\//, '').split('/');
  60767. for (var i = 0; i < segments.length; i++) {
  60768. var segment = segments[i];
  60769. if (segment === '..') {
  60770. stack.pop();
  60771. } else if (segment !== '.') {
  60772. stack.push(segment);
  60773. }
  60774. }
  60775. // ensure leading slash
  60776. if (stack[0] !== '') {
  60777. stack.unshift('');
  60778. }
  60779. return stack.join('/')
  60780. }
  60781. function parsePath (path) {
  60782. var hash = '';
  60783. var query = '';
  60784. var hashIndex = path.indexOf('#');
  60785. if (hashIndex >= 0) {
  60786. hash = path.slice(hashIndex);
  60787. path = path.slice(0, hashIndex);
  60788. }
  60789. var queryIndex = path.indexOf('?');
  60790. if (queryIndex >= 0) {
  60791. query = path.slice(queryIndex + 1);
  60792. path = path.slice(0, queryIndex);
  60793. }
  60794. return {
  60795. path: path,
  60796. query: query,
  60797. hash: hash
  60798. }
  60799. }
  60800. function cleanPath (path) {
  60801. return path.replace(/\/+/g, '/')
  60802. }
  60803. var isarray = Array.isArray || function (arr) {
  60804. return Object.prototype.toString.call(arr) == '[object Array]';
  60805. };
  60806. /**
  60807. * Expose `pathToRegexp`.
  60808. */
  60809. var pathToRegexp_1 = pathToRegexp;
  60810. var parse_1 = parse;
  60811. var compile_1 = compile;
  60812. var tokensToFunction_1 = tokensToFunction;
  60813. var tokensToRegExp_1 = tokensToRegExp;
  60814. /**
  60815. * The main path matching regexp utility.
  60816. *
  60817. * @type {RegExp}
  60818. */
  60819. var PATH_REGEXP = new RegExp([
  60820. // Match escaped characters that would otherwise appear in future matches.
  60821. // This allows the user to escape special characters that won't transform.
  60822. '(\\\\.)',
  60823. // Match Express-style parameters and un-named parameters with a prefix
  60824. // and optional suffixes. Matches appear as:
  60825. //
  60826. // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
  60827. // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
  60828. // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
  60829. '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
  60830. ].join('|'), 'g');
  60831. /**
  60832. * Parse a string for the raw tokens.
  60833. *
  60834. * @param {string} str
  60835. * @param {Object=} options
  60836. * @return {!Array}
  60837. */
  60838. function parse (str, options) {
  60839. var tokens = [];
  60840. var key = 0;
  60841. var index = 0;
  60842. var path = '';
  60843. var defaultDelimiter = options && options.delimiter || '/';
  60844. var res;
  60845. while ((res = PATH_REGEXP.exec(str)) != null) {
  60846. var m = res[0];
  60847. var escaped = res[1];
  60848. var offset = res.index;
  60849. path += str.slice(index, offset);
  60850. index = offset + m.length;
  60851. // Ignore already escaped sequences.
  60852. if (escaped) {
  60853. path += escaped[1];
  60854. continue
  60855. }
  60856. var next = str[index];
  60857. var prefix = res[2];
  60858. var name = res[3];
  60859. var capture = res[4];
  60860. var group = res[5];
  60861. var modifier = res[6];
  60862. var asterisk = res[7];
  60863. // Push the current path onto the tokens.
  60864. if (path) {
  60865. tokens.push(path);
  60866. path = '';
  60867. }
  60868. var partial = prefix != null && next != null && next !== prefix;
  60869. var repeat = modifier === '+' || modifier === '*';
  60870. var optional = modifier === '?' || modifier === '*';
  60871. var delimiter = res[2] || defaultDelimiter;
  60872. var pattern = capture || group;
  60873. tokens.push({
  60874. name: name || key++,
  60875. prefix: prefix || '',
  60876. delimiter: delimiter,
  60877. optional: optional,
  60878. repeat: repeat,
  60879. partial: partial,
  60880. asterisk: !!asterisk,
  60881. pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
  60882. });
  60883. }
  60884. // Match any characters still remaining.
  60885. if (index < str.length) {
  60886. path += str.substr(index);
  60887. }
  60888. // If the path exists, push it onto the end.
  60889. if (path) {
  60890. tokens.push(path);
  60891. }
  60892. return tokens
  60893. }
  60894. /**
  60895. * Compile a string to a template function for the path.
  60896. *
  60897. * @param {string} str
  60898. * @param {Object=} options
  60899. * @return {!function(Object=, Object=)}
  60900. */
  60901. function compile (str, options) {
  60902. return tokensToFunction(parse(str, options), options)
  60903. }
  60904. /**
  60905. * Prettier encoding of URI path segments.
  60906. *
  60907. * @param {string}
  60908. * @return {string}
  60909. */
  60910. function encodeURIComponentPretty (str) {
  60911. return encodeURI(str).replace(/[\/?#]/g, function (c) {
  60912. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  60913. })
  60914. }
  60915. /**
  60916. * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
  60917. *
  60918. * @param {string}
  60919. * @return {string}
  60920. */
  60921. function encodeAsterisk (str) {
  60922. return encodeURI(str).replace(/[?#]/g, function (c) {
  60923. return '%' + c.charCodeAt(0).toString(16).toUpperCase()
  60924. })
  60925. }
  60926. /**
  60927. * Expose a method for transforming tokens into the path function.
  60928. */
  60929. function tokensToFunction (tokens, options) {
  60930. // Compile all the tokens into regexps.
  60931. var matches = new Array(tokens.length);
  60932. // Compile all the patterns before compilation.
  60933. for (var i = 0; i < tokens.length; i++) {
  60934. if (typeof tokens[i] === 'object') {
  60935. matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
  60936. }
  60937. }
  60938. return function (obj, opts) {
  60939. var path = '';
  60940. var data = obj || {};
  60941. var options = opts || {};
  60942. var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
  60943. for (var i = 0; i < tokens.length; i++) {
  60944. var token = tokens[i];
  60945. if (typeof token === 'string') {
  60946. path += token;
  60947. continue
  60948. }
  60949. var value = data[token.name];
  60950. var segment;
  60951. if (value == null) {
  60952. if (token.optional) {
  60953. // Prepend partial segment prefixes.
  60954. if (token.partial) {
  60955. path += token.prefix;
  60956. }
  60957. continue
  60958. } else {
  60959. throw new TypeError('Expected "' + token.name + '" to be defined')
  60960. }
  60961. }
  60962. if (isarray(value)) {
  60963. if (!token.repeat) {
  60964. throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
  60965. }
  60966. if (value.length === 0) {
  60967. if (token.optional) {
  60968. continue
  60969. } else {
  60970. throw new TypeError('Expected "' + token.name + '" to not be empty')
  60971. }
  60972. }
  60973. for (var j = 0; j < value.length; j++) {
  60974. segment = encode(value[j]);
  60975. if (!matches[i].test(segment)) {
  60976. throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
  60977. }
  60978. path += (j === 0 ? token.prefix : token.delimiter) + segment;
  60979. }
  60980. continue
  60981. }
  60982. segment = token.asterisk ? encodeAsterisk(value) : encode(value);
  60983. if (!matches[i].test(segment)) {
  60984. throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
  60985. }
  60986. path += token.prefix + segment;
  60987. }
  60988. return path
  60989. }
  60990. }
  60991. /**
  60992. * Escape a regular expression string.
  60993. *
  60994. * @param {string} str
  60995. * @return {string}
  60996. */
  60997. function escapeString (str) {
  60998. return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
  60999. }
  61000. /**
  61001. * Escape the capturing group by escaping special characters and meaning.
  61002. *
  61003. * @param {string} group
  61004. * @return {string}
  61005. */
  61006. function escapeGroup (group) {
  61007. return group.replace(/([=!:$\/()])/g, '\\$1')
  61008. }
  61009. /**
  61010. * Attach the keys as a property of the regexp.
  61011. *
  61012. * @param {!RegExp} re
  61013. * @param {Array} keys
  61014. * @return {!RegExp}
  61015. */
  61016. function attachKeys (re, keys) {
  61017. re.keys = keys;
  61018. return re
  61019. }
  61020. /**
  61021. * Get the flags for a regexp from the options.
  61022. *
  61023. * @param {Object} options
  61024. * @return {string}
  61025. */
  61026. function flags (options) {
  61027. return options && options.sensitive ? '' : 'i'
  61028. }
  61029. /**
  61030. * Pull out keys from a regexp.
  61031. *
  61032. * @param {!RegExp} path
  61033. * @param {!Array} keys
  61034. * @return {!RegExp}
  61035. */
  61036. function regexpToRegexp (path, keys) {
  61037. // Use a negative lookahead to match only capturing groups.
  61038. var groups = path.source.match(/\((?!\?)/g);
  61039. if (groups) {
  61040. for (var i = 0; i < groups.length; i++) {
  61041. keys.push({
  61042. name: i,
  61043. prefix: null,
  61044. delimiter: null,
  61045. optional: false,
  61046. repeat: false,
  61047. partial: false,
  61048. asterisk: false,
  61049. pattern: null
  61050. });
  61051. }
  61052. }
  61053. return attachKeys(path, keys)
  61054. }
  61055. /**
  61056. * Transform an array into a regexp.
  61057. *
  61058. * @param {!Array} path
  61059. * @param {Array} keys
  61060. * @param {!Object} options
  61061. * @return {!RegExp}
  61062. */
  61063. function arrayToRegexp (path, keys, options) {
  61064. var parts = [];
  61065. for (var i = 0; i < path.length; i++) {
  61066. parts.push(pathToRegexp(path[i], keys, options).source);
  61067. }
  61068. var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
  61069. return attachKeys(regexp, keys)
  61070. }
  61071. /**
  61072. * Create a path regexp from string input.
  61073. *
  61074. * @param {string} path
  61075. * @param {!Array} keys
  61076. * @param {!Object} options
  61077. * @return {!RegExp}
  61078. */
  61079. function stringToRegexp (path, keys, options) {
  61080. return tokensToRegExp(parse(path, options), keys, options)
  61081. }
  61082. /**
  61083. * Expose a function for taking tokens and returning a RegExp.
  61084. *
  61085. * @param {!Array} tokens
  61086. * @param {(Array|Object)=} keys
  61087. * @param {Object=} options
  61088. * @return {!RegExp}
  61089. */
  61090. function tokensToRegExp (tokens, keys, options) {
  61091. if (!isarray(keys)) {
  61092. options = /** @type {!Object} */ (keys || options);
  61093. keys = [];
  61094. }
  61095. options = options || {};
  61096. var strict = options.strict;
  61097. var end = options.end !== false;
  61098. var route = '';
  61099. // Iterate over the tokens and create our regexp string.
  61100. for (var i = 0; i < tokens.length; i++) {
  61101. var token = tokens[i];
  61102. if (typeof token === 'string') {
  61103. route += escapeString(token);
  61104. } else {
  61105. var prefix = escapeString(token.prefix);
  61106. var capture = '(?:' + token.pattern + ')';
  61107. keys.push(token);
  61108. if (token.repeat) {
  61109. capture += '(?:' + prefix + capture + ')*';
  61110. }
  61111. if (token.optional) {
  61112. if (!token.partial) {
  61113. capture = '(?:' + prefix + '(' + capture + '))?';
  61114. } else {
  61115. capture = prefix + '(' + capture + ')?';
  61116. }
  61117. } else {
  61118. capture = prefix + '(' + capture + ')';
  61119. }
  61120. route += capture;
  61121. }
  61122. }
  61123. var delimiter = escapeString(options.delimiter || '/');
  61124. var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
  61125. // In non-strict mode we allow a slash at the end of match. If the path to
  61126. // match already ends with a slash, we remove it for consistency. The slash
  61127. // is valid at the end of a path match, not in the middle. This is important
  61128. // in non-ending mode, where "/test/" shouldn't match "/test//route".
  61129. if (!strict) {
  61130. route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
  61131. }
  61132. if (end) {
  61133. route += '$';
  61134. } else {
  61135. // In non-ending mode, we need the capturing groups to match as much as
  61136. // possible by using a positive lookahead to the end or next path segment.
  61137. route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
  61138. }
  61139. return attachKeys(new RegExp('^' + route, flags(options)), keys)
  61140. }
  61141. /**
  61142. * Normalize the given path string, returning a regular expression.
  61143. *
  61144. * An empty array can be passed in for the keys, which will hold the
  61145. * placeholder key descriptions. For example, using `/user/:id`, `keys` will
  61146. * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
  61147. *
  61148. * @param {(string|RegExp|Array)} path
  61149. * @param {(Array|Object)=} keys
  61150. * @param {Object=} options
  61151. * @return {!RegExp}
  61152. */
  61153. function pathToRegexp (path, keys, options) {
  61154. if (!isarray(keys)) {
  61155. options = /** @type {!Object} */ (keys || options);
  61156. keys = [];
  61157. }
  61158. options = options || {};
  61159. if (path instanceof RegExp) {
  61160. return regexpToRegexp(path, /** @type {!Array} */ (keys))
  61161. }
  61162. if (isarray(path)) {
  61163. return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
  61164. }
  61165. return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
  61166. }
  61167. pathToRegexp_1.parse = parse_1;
  61168. pathToRegexp_1.compile = compile_1;
  61169. pathToRegexp_1.tokensToFunction = tokensToFunction_1;
  61170. pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
  61171. /* */
  61172. // $flow-disable-line
  61173. var regexpCompileCache = Object.create(null);
  61174. function fillParams (
  61175. path,
  61176. params,
  61177. routeMsg
  61178. ) {
  61179. params = params || {};
  61180. try {
  61181. var filler =
  61182. regexpCompileCache[path] ||
  61183. (regexpCompileCache[path] = pathToRegexp_1.compile(path));
  61184. // Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
  61185. // and fix #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string
  61186. if (typeof params.pathMatch === 'string') { params[0] = params.pathMatch; }
  61187. return filler(params, { pretty: true })
  61188. } catch (e) {
  61189. if (true) {
  61190. // Fix #3072 no warn if `pathMatch` is string
  61191. warn(typeof params.pathMatch === 'string', ("missing param for " + routeMsg + ": " + (e.message)));
  61192. }
  61193. return ''
  61194. } finally {
  61195. // delete the 0 if it was added
  61196. delete params[0];
  61197. }
  61198. }
  61199. /* */
  61200. function normalizeLocation (
  61201. raw,
  61202. current,
  61203. append,
  61204. router
  61205. ) {
  61206. var next = typeof raw === 'string' ? { path: raw } : raw;
  61207. // named target
  61208. if (next._normalized) {
  61209. return next
  61210. } else if (next.name) {
  61211. next = extend({}, raw);
  61212. var params = next.params;
  61213. if (params && typeof params === 'object') {
  61214. next.params = extend({}, params);
  61215. }
  61216. return next
  61217. }
  61218. // relative params
  61219. if (!next.path && next.params && current) {
  61220. next = extend({}, next);
  61221. next._normalized = true;
  61222. var params$1 = extend(extend({}, current.params), next.params);
  61223. if (current.name) {
  61224. next.name = current.name;
  61225. next.params = params$1;
  61226. } else if (current.matched.length) {
  61227. var rawPath = current.matched[current.matched.length - 1].path;
  61228. next.path = fillParams(rawPath, params$1, ("path " + (current.path)));
  61229. } else if (true) {
  61230. warn(false, "relative params navigation requires a current route.");
  61231. }
  61232. return next
  61233. }
  61234. var parsedPath = parsePath(next.path || '');
  61235. var basePath = (current && current.path) || '/';
  61236. var path = parsedPath.path
  61237. ? resolvePath(parsedPath.path, basePath, append || next.append)
  61238. : basePath;
  61239. var query = resolveQuery(
  61240. parsedPath.query,
  61241. next.query,
  61242. router && router.options.parseQuery
  61243. );
  61244. var hash = next.hash || parsedPath.hash;
  61245. if (hash && hash.charAt(0) !== '#') {
  61246. hash = "#" + hash;
  61247. }
  61248. return {
  61249. _normalized: true,
  61250. path: path,
  61251. query: query,
  61252. hash: hash
  61253. }
  61254. }
  61255. /* */
  61256. // work around weird flow bug
  61257. var toTypes = [String, Object];
  61258. var eventTypes = [String, Array];
  61259. var noop = function () {};
  61260. var warnedCustomSlot;
  61261. var warnedTagProp;
  61262. var warnedEventProp;
  61263. var Link = {
  61264. name: 'RouterLink',
  61265. props: {
  61266. to: {
  61267. type: toTypes,
  61268. required: true
  61269. },
  61270. tag: {
  61271. type: String,
  61272. default: 'a'
  61273. },
  61274. custom: Boolean,
  61275. exact: Boolean,
  61276. exactPath: Boolean,
  61277. append: Boolean,
  61278. replace: Boolean,
  61279. activeClass: String,
  61280. exactActiveClass: String,
  61281. ariaCurrentValue: {
  61282. type: String,
  61283. default: 'page'
  61284. },
  61285. event: {
  61286. type: eventTypes,
  61287. default: 'click'
  61288. }
  61289. },
  61290. render: function render (h) {
  61291. var this$1 = this;
  61292. var router = this.$router;
  61293. var current = this.$route;
  61294. var ref = router.resolve(
  61295. this.to,
  61296. current,
  61297. this.append
  61298. );
  61299. var location = ref.location;
  61300. var route = ref.route;
  61301. var href = ref.href;
  61302. var classes = {};
  61303. var globalActiveClass = router.options.linkActiveClass;
  61304. var globalExactActiveClass = router.options.linkExactActiveClass;
  61305. // Support global empty active class
  61306. var activeClassFallback =
  61307. globalActiveClass == null ? 'router-link-active' : globalActiveClass;
  61308. var exactActiveClassFallback =
  61309. globalExactActiveClass == null
  61310. ? 'router-link-exact-active'
  61311. : globalExactActiveClass;
  61312. var activeClass =
  61313. this.activeClass == null ? activeClassFallback : this.activeClass;
  61314. var exactActiveClass =
  61315. this.exactActiveClass == null
  61316. ? exactActiveClassFallback
  61317. : this.exactActiveClass;
  61318. var compareTarget = route.redirectedFrom
  61319. ? createRoute(null, normalizeLocation(route.redirectedFrom), null, router)
  61320. : route;
  61321. classes[exactActiveClass] = isSameRoute(current, compareTarget, this.exactPath);
  61322. classes[activeClass] = this.exact || this.exactPath
  61323. ? classes[exactActiveClass]
  61324. : isIncludedRoute(current, compareTarget);
  61325. var ariaCurrentValue = classes[exactActiveClass] ? this.ariaCurrentValue : null;
  61326. var handler = function (e) {
  61327. if (guardEvent(e)) {
  61328. if (this$1.replace) {
  61329. router.replace(location, noop);
  61330. } else {
  61331. router.push(location, noop);
  61332. }
  61333. }
  61334. };
  61335. var on = { click: guardEvent };
  61336. if (Array.isArray(this.event)) {
  61337. this.event.forEach(function (e) {
  61338. on[e] = handler;
  61339. });
  61340. } else {
  61341. on[this.event] = handler;
  61342. }
  61343. var data = { class: classes };
  61344. var scopedSlot =
  61345. !this.$scopedSlots.$hasNormal &&
  61346. this.$scopedSlots.default &&
  61347. this.$scopedSlots.default({
  61348. href: href,
  61349. route: route,
  61350. navigate: handler,
  61351. isActive: classes[activeClass],
  61352. isExactActive: classes[exactActiveClass]
  61353. });
  61354. if (scopedSlot) {
  61355. if ("development" !== 'production' && !this.custom) {
  61356. !warnedCustomSlot && warn(false, 'In Vue Router 4, the v-slot API will by default wrap its content with an <a> element. Use the custom prop to remove this warning:\n<router-link v-slot="{ navigate, href }" custom></router-link>\n');
  61357. warnedCustomSlot = true;
  61358. }
  61359. if (scopedSlot.length === 1) {
  61360. return scopedSlot[0]
  61361. } else if (scopedSlot.length > 1 || !scopedSlot.length) {
  61362. if (true) {
  61363. warn(
  61364. false,
  61365. ("<router-link> with to=\"" + (this.to) + "\" is trying to use a scoped slot but it didn't provide exactly one child. Wrapping the content with a span element.")
  61366. );
  61367. }
  61368. return scopedSlot.length === 0 ? h() : h('span', {}, scopedSlot)
  61369. }
  61370. }
  61371. if (true) {
  61372. if ('tag' in this.$options.propsData && !warnedTagProp) {
  61373. warn(
  61374. false,
  61375. "<router-link>'s tag prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link."
  61376. );
  61377. warnedTagProp = true;
  61378. }
  61379. if ('event' in this.$options.propsData && !warnedEventProp) {
  61380. warn(
  61381. false,
  61382. "<router-link>'s event prop is deprecated and has been removed in Vue Router 4. Use the v-slot API to remove this warning: https://next.router.vuejs.org/guide/migration/#removal-of-event-and-tag-props-in-router-link."
  61383. );
  61384. warnedEventProp = true;
  61385. }
  61386. }
  61387. if (this.tag === 'a') {
  61388. data.on = on;
  61389. data.attrs = { href: href, 'aria-current': ariaCurrentValue };
  61390. } else {
  61391. // find the first <a> child and apply listener and href
  61392. var a = findAnchor(this.$slots.default);
  61393. if (a) {
  61394. // in case the <a> is a static node
  61395. a.isStatic = false;
  61396. var aData = (a.data = extend({}, a.data));
  61397. aData.on = aData.on || {};
  61398. // transform existing events in both objects into arrays so we can push later
  61399. for (var event in aData.on) {
  61400. var handler$1 = aData.on[event];
  61401. if (event in on) {
  61402. aData.on[event] = Array.isArray(handler$1) ? handler$1 : [handler$1];
  61403. }
  61404. }
  61405. // append new listeners for router-link
  61406. for (var event$1 in on) {
  61407. if (event$1 in aData.on) {
  61408. // on[event] is always a function
  61409. aData.on[event$1].push(on[event$1]);
  61410. } else {
  61411. aData.on[event$1] = handler;
  61412. }
  61413. }
  61414. var aAttrs = (a.data.attrs = extend({}, a.data.attrs));
  61415. aAttrs.href = href;
  61416. aAttrs['aria-current'] = ariaCurrentValue;
  61417. } else {
  61418. // doesn't have <a> child, apply listener to self
  61419. data.on = on;
  61420. }
  61421. }
  61422. return h(this.tag, data, this.$slots.default)
  61423. }
  61424. };
  61425. function guardEvent (e) {
  61426. // don't redirect with control keys
  61427. if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) { return }
  61428. // don't redirect when preventDefault called
  61429. if (e.defaultPrevented) { return }
  61430. // don't redirect on right click
  61431. if (e.button !== undefined && e.button !== 0) { return }
  61432. // don't redirect if `target="_blank"`
  61433. if (e.currentTarget && e.currentTarget.getAttribute) {
  61434. var target = e.currentTarget.getAttribute('target');
  61435. if (/\b_blank\b/i.test(target)) { return }
  61436. }
  61437. // this may be a Weex event which doesn't have this method
  61438. if (e.preventDefault) {
  61439. e.preventDefault();
  61440. }
  61441. return true
  61442. }
  61443. function findAnchor (children) {
  61444. if (children) {
  61445. var child;
  61446. for (var i = 0; i < children.length; i++) {
  61447. child = children[i];
  61448. if (child.tag === 'a') {
  61449. return child
  61450. }
  61451. if (child.children && (child = findAnchor(child.children))) {
  61452. return child
  61453. }
  61454. }
  61455. }
  61456. }
  61457. var _Vue;
  61458. function install (Vue) {
  61459. if (install.installed && _Vue === Vue) { return }
  61460. install.installed = true;
  61461. _Vue = Vue;
  61462. var isDef = function (v) { return v !== undefined; };
  61463. var registerInstance = function (vm, callVal) {
  61464. var i = vm.$options._parentVnode;
  61465. if (isDef(i) && isDef(i = i.data) && isDef(i = i.registerRouteInstance)) {
  61466. i(vm, callVal);
  61467. }
  61468. };
  61469. Vue.mixin({
  61470. beforeCreate: function beforeCreate () {
  61471. if (isDef(this.$options.router)) {
  61472. this._routerRoot = this;
  61473. this._router = this.$options.router;
  61474. this._router.init(this);
  61475. Vue.util.defineReactive(this, '_route', this._router.history.current);
  61476. } else {
  61477. this._routerRoot = (this.$parent && this.$parent._routerRoot) || this;
  61478. }
  61479. registerInstance(this, this);
  61480. },
  61481. destroyed: function destroyed () {
  61482. registerInstance(this);
  61483. }
  61484. });
  61485. Object.defineProperty(Vue.prototype, '$router', {
  61486. get: function get () { return this._routerRoot._router }
  61487. });
  61488. Object.defineProperty(Vue.prototype, '$route', {
  61489. get: function get () { return this._routerRoot._route }
  61490. });
  61491. Vue.component('RouterView', View);
  61492. Vue.component('RouterLink', Link);
  61493. var strats = Vue.config.optionMergeStrategies;
  61494. // use the same hook merging strategy for route hooks
  61495. strats.beforeRouteEnter = strats.beforeRouteLeave = strats.beforeRouteUpdate = strats.created;
  61496. }
  61497. /* */
  61498. var inBrowser = typeof window !== 'undefined';
  61499. /* */
  61500. function createRouteMap (
  61501. routes,
  61502. oldPathList,
  61503. oldPathMap,
  61504. oldNameMap,
  61505. parentRoute
  61506. ) {
  61507. // the path list is used to control path matching priority
  61508. var pathList = oldPathList || [];
  61509. // $flow-disable-line
  61510. var pathMap = oldPathMap || Object.create(null);
  61511. // $flow-disable-line
  61512. var nameMap = oldNameMap || Object.create(null);
  61513. routes.forEach(function (route) {
  61514. addRouteRecord(pathList, pathMap, nameMap, route, parentRoute);
  61515. });
  61516. // ensure wildcard routes are always at the end
  61517. for (var i = 0, l = pathList.length; i < l; i++) {
  61518. if (pathList[i] === '*') {
  61519. pathList.push(pathList.splice(i, 1)[0]);
  61520. l--;
  61521. i--;
  61522. }
  61523. }
  61524. if (true) {
  61525. // warn if routes do not include leading slashes
  61526. var found = pathList
  61527. // check for missing leading slash
  61528. .filter(function (path) { return path && path.charAt(0) !== '*' && path.charAt(0) !== '/'; });
  61529. if (found.length > 0) {
  61530. var pathNames = found.map(function (path) { return ("- " + path); }).join('\n');
  61531. warn(false, ("Non-nested routes must include a leading slash character. Fix the following routes: \n" + pathNames));
  61532. }
  61533. }
  61534. return {
  61535. pathList: pathList,
  61536. pathMap: pathMap,
  61537. nameMap: nameMap
  61538. }
  61539. }
  61540. function addRouteRecord (
  61541. pathList,
  61542. pathMap,
  61543. nameMap,
  61544. route,
  61545. parent,
  61546. matchAs
  61547. ) {
  61548. var path = route.path;
  61549. var name = route.name;
  61550. if (true) {
  61551. assert(path != null, "\"path\" is required in a route configuration.");
  61552. assert(
  61553. typeof route.component !== 'string',
  61554. "route config \"component\" for path: " + (String(
  61555. path || name
  61556. )) + " cannot be a " + "string id. Use an actual component instead."
  61557. );
  61558. warn(
  61559. // eslint-disable-next-line no-control-regex
  61560. !/[^\u0000-\u007F]+/.test(path),
  61561. "Route with path \"" + path + "\" contains unencoded characters, make sure " +
  61562. "your path is correctly encoded before passing it to the router. Use " +
  61563. "encodeURI to encode static segments of your path."
  61564. );
  61565. }
  61566. var pathToRegexpOptions =
  61567. route.pathToRegexpOptions || {};
  61568. var normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict);
  61569. if (typeof route.caseSensitive === 'boolean') {
  61570. pathToRegexpOptions.sensitive = route.caseSensitive;
  61571. }
  61572. var record = {
  61573. path: normalizedPath,
  61574. regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
  61575. components: route.components || { default: route.component },
  61576. alias: route.alias
  61577. ? typeof route.alias === 'string'
  61578. ? [route.alias]
  61579. : route.alias
  61580. : [],
  61581. instances: {},
  61582. enteredCbs: {},
  61583. name: name,
  61584. parent: parent,
  61585. matchAs: matchAs,
  61586. redirect: route.redirect,
  61587. beforeEnter: route.beforeEnter,
  61588. meta: route.meta || {},
  61589. props:
  61590. route.props == null
  61591. ? {}
  61592. : route.components
  61593. ? route.props
  61594. : { default: route.props }
  61595. };
  61596. if (route.children) {
  61597. // Warn if route is named, does not redirect and has a default child route.
  61598. // If users navigate to this route by name, the default child will
  61599. // not be rendered (GH Issue #629)
  61600. if (true) {
  61601. if (
  61602. route.name &&
  61603. !route.redirect &&
  61604. route.children.some(function (child) { return /^\/?$/.test(child.path); })
  61605. ) {
  61606. warn(
  61607. false,
  61608. "Named Route '" + (route.name) + "' has a default child route. " +
  61609. "When navigating to this named route (:to=\"{name: '" + (route.name) + "'\"), " +
  61610. "the default child route will not be rendered. Remove the name from " +
  61611. "this route and use the name of the default child route for named " +
  61612. "links instead."
  61613. );
  61614. }
  61615. }
  61616. route.children.forEach(function (child) {
  61617. var childMatchAs = matchAs
  61618. ? cleanPath((matchAs + "/" + (child.path)))
  61619. : undefined;
  61620. addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs);
  61621. });
  61622. }
  61623. if (!pathMap[record.path]) {
  61624. pathList.push(record.path);
  61625. pathMap[record.path] = record;
  61626. }
  61627. if (route.alias !== undefined) {
  61628. var aliases = Array.isArray(route.alias) ? route.alias : [route.alias];
  61629. for (var i = 0; i < aliases.length; ++i) {
  61630. var alias = aliases[i];
  61631. if ("development" !== 'production' && alias === path) {
  61632. warn(
  61633. false,
  61634. ("Found an alias with the same value as the path: \"" + path + "\". You have to remove that alias. It will be ignored in development.")
  61635. );
  61636. // skip in dev to make it work
  61637. continue
  61638. }
  61639. var aliasRoute = {
  61640. path: alias,
  61641. children: route.children
  61642. };
  61643. addRouteRecord(
  61644. pathList,
  61645. pathMap,
  61646. nameMap,
  61647. aliasRoute,
  61648. parent,
  61649. record.path || '/' // matchAs
  61650. );
  61651. }
  61652. }
  61653. if (name) {
  61654. if (!nameMap[name]) {
  61655. nameMap[name] = record;
  61656. } else if ("development" !== 'production' && !matchAs) {
  61657. warn(
  61658. false,
  61659. "Duplicate named routes definition: " +
  61660. "{ name: \"" + name + "\", path: \"" + (record.path) + "\" }"
  61661. );
  61662. }
  61663. }
  61664. }
  61665. function compileRouteRegex (
  61666. path,
  61667. pathToRegexpOptions
  61668. ) {
  61669. var regex = pathToRegexp_1(path, [], pathToRegexpOptions);
  61670. if (true) {
  61671. var keys = Object.create(null);
  61672. regex.keys.forEach(function (key) {
  61673. warn(
  61674. !keys[key.name],
  61675. ("Duplicate param keys in route with path: \"" + path + "\"")
  61676. );
  61677. keys[key.name] = true;
  61678. });
  61679. }
  61680. return regex
  61681. }
  61682. function normalizePath (
  61683. path,
  61684. parent,
  61685. strict
  61686. ) {
  61687. if (!strict) { path = path.replace(/\/$/, ''); }
  61688. if (path[0] === '/') { return path }
  61689. if (parent == null) { return path }
  61690. return cleanPath(((parent.path) + "/" + path))
  61691. }
  61692. /* */
  61693. function createMatcher (
  61694. routes,
  61695. router
  61696. ) {
  61697. var ref = createRouteMap(routes);
  61698. var pathList = ref.pathList;
  61699. var pathMap = ref.pathMap;
  61700. var nameMap = ref.nameMap;
  61701. function addRoutes (routes) {
  61702. createRouteMap(routes, pathList, pathMap, nameMap);
  61703. }
  61704. function addRoute (parentOrRoute, route) {
  61705. var parent = (typeof parentOrRoute !== 'object') ? nameMap[parentOrRoute] : undefined;
  61706. // $flow-disable-line
  61707. createRouteMap([route || parentOrRoute], pathList, pathMap, nameMap, parent);
  61708. // add aliases of parent
  61709. if (parent && parent.alias.length) {
  61710. createRouteMap(
  61711. // $flow-disable-line route is defined if parent is
  61712. parent.alias.map(function (alias) { return ({ path: alias, children: [route] }); }),
  61713. pathList,
  61714. pathMap,
  61715. nameMap,
  61716. parent
  61717. );
  61718. }
  61719. }
  61720. function getRoutes () {
  61721. return pathList.map(function (path) { return pathMap[path]; })
  61722. }
  61723. function match (
  61724. raw,
  61725. currentRoute,
  61726. redirectedFrom
  61727. ) {
  61728. var location = normalizeLocation(raw, currentRoute, false, router);
  61729. var name = location.name;
  61730. if (name) {
  61731. var record = nameMap[name];
  61732. if (true) {
  61733. warn(record, ("Route with name '" + name + "' does not exist"));
  61734. }
  61735. if (!record) { return _createRoute(null, location) }
  61736. var paramNames = record.regex.keys
  61737. .filter(function (key) { return !key.optional; })
  61738. .map(function (key) { return key.name; });
  61739. if (typeof location.params !== 'object') {
  61740. location.params = {};
  61741. }
  61742. if (currentRoute && typeof currentRoute.params === 'object') {
  61743. for (var key in currentRoute.params) {
  61744. if (!(key in location.params) && paramNames.indexOf(key) > -1) {
  61745. location.params[key] = currentRoute.params[key];
  61746. }
  61747. }
  61748. }
  61749. location.path = fillParams(record.path, location.params, ("named route \"" + name + "\""));
  61750. return _createRoute(record, location, redirectedFrom)
  61751. } else if (location.path) {
  61752. location.params = {};
  61753. for (var i = 0; i < pathList.length; i++) {
  61754. var path = pathList[i];
  61755. var record$1 = pathMap[path];
  61756. if (matchRoute(record$1.regex, location.path, location.params)) {
  61757. return _createRoute(record$1, location, redirectedFrom)
  61758. }
  61759. }
  61760. }
  61761. // no match
  61762. return _createRoute(null, location)
  61763. }
  61764. function redirect (
  61765. record,
  61766. location
  61767. ) {
  61768. var originalRedirect = record.redirect;
  61769. var redirect = typeof originalRedirect === 'function'
  61770. ? originalRedirect(createRoute(record, location, null, router))
  61771. : originalRedirect;
  61772. if (typeof redirect === 'string') {
  61773. redirect = { path: redirect };
  61774. }
  61775. if (!redirect || typeof redirect !== 'object') {
  61776. if (true) {
  61777. warn(
  61778. false, ("invalid redirect option: " + (JSON.stringify(redirect)))
  61779. );
  61780. }
  61781. return _createRoute(null, location)
  61782. }
  61783. var re = redirect;
  61784. var name = re.name;
  61785. var path = re.path;
  61786. var query = location.query;
  61787. var hash = location.hash;
  61788. var params = location.params;
  61789. query = re.hasOwnProperty('query') ? re.query : query;
  61790. hash = re.hasOwnProperty('hash') ? re.hash : hash;
  61791. params = re.hasOwnProperty('params') ? re.params : params;
  61792. if (name) {
  61793. // resolved named direct
  61794. var targetRecord = nameMap[name];
  61795. if (true) {
  61796. assert(targetRecord, ("redirect failed: named route \"" + name + "\" not found."));
  61797. }
  61798. return match({
  61799. _normalized: true,
  61800. name: name,
  61801. query: query,
  61802. hash: hash,
  61803. params: params
  61804. }, undefined, location)
  61805. } else if (path) {
  61806. // 1. resolve relative redirect
  61807. var rawPath = resolveRecordPath(path, record);
  61808. // 2. resolve params
  61809. var resolvedPath = fillParams(rawPath, params, ("redirect route with path \"" + rawPath + "\""));
  61810. // 3. rematch with existing query and hash
  61811. return match({
  61812. _normalized: true,
  61813. path: resolvedPath,
  61814. query: query,
  61815. hash: hash
  61816. }, undefined, location)
  61817. } else {
  61818. if (true) {
  61819. warn(false, ("invalid redirect option: " + (JSON.stringify(redirect))));
  61820. }
  61821. return _createRoute(null, location)
  61822. }
  61823. }
  61824. function alias (
  61825. record,
  61826. location,
  61827. matchAs
  61828. ) {
  61829. var aliasedPath = fillParams(matchAs, location.params, ("aliased route with path \"" + matchAs + "\""));
  61830. var aliasedMatch = match({
  61831. _normalized: true,
  61832. path: aliasedPath
  61833. });
  61834. if (aliasedMatch) {
  61835. var matched = aliasedMatch.matched;
  61836. var aliasedRecord = matched[matched.length - 1];
  61837. location.params = aliasedMatch.params;
  61838. return _createRoute(aliasedRecord, location)
  61839. }
  61840. return _createRoute(null, location)
  61841. }
  61842. function _createRoute (
  61843. record,
  61844. location,
  61845. redirectedFrom
  61846. ) {
  61847. if (record && record.redirect) {
  61848. return redirect(record, redirectedFrom || location)
  61849. }
  61850. if (record && record.matchAs) {
  61851. return alias(record, location, record.matchAs)
  61852. }
  61853. return createRoute(record, location, redirectedFrom, router)
  61854. }
  61855. return {
  61856. match: match,
  61857. addRoute: addRoute,
  61858. getRoutes: getRoutes,
  61859. addRoutes: addRoutes
  61860. }
  61861. }
  61862. function matchRoute (
  61863. regex,
  61864. path,
  61865. params
  61866. ) {
  61867. var m = path.match(regex);
  61868. if (!m) {
  61869. return false
  61870. } else if (!params) {
  61871. return true
  61872. }
  61873. for (var i = 1, len = m.length; i < len; ++i) {
  61874. var key = regex.keys[i - 1];
  61875. if (key) {
  61876. // Fix #1994: using * with props: true generates a param named 0
  61877. params[key.name || 'pathMatch'] = typeof m[i] === 'string' ? decode(m[i]) : m[i];
  61878. }
  61879. }
  61880. return true
  61881. }
  61882. function resolveRecordPath (path, record) {
  61883. return resolvePath(path, record.parent ? record.parent.path : '/', true)
  61884. }
  61885. /* */
  61886. // use User Timing api (if present) for more accurate key precision
  61887. var Time =
  61888. inBrowser && window.performance && window.performance.now
  61889. ? window.performance
  61890. : Date;
  61891. function genStateKey () {
  61892. return Time.now().toFixed(3)
  61893. }
  61894. var _key = genStateKey();
  61895. function getStateKey () {
  61896. return _key
  61897. }
  61898. function setStateKey (key) {
  61899. return (_key = key)
  61900. }
  61901. /* */
  61902. var positionStore = Object.create(null);
  61903. function setupScroll () {
  61904. // Prevent browser scroll behavior on History popstate
  61905. if ('scrollRestoration' in window.history) {
  61906. window.history.scrollRestoration = 'manual';
  61907. }
  61908. // Fix for #1585 for Firefox
  61909. // Fix for #2195 Add optional third attribute to workaround a bug in safari https://bugs.webkit.org/show_bug.cgi?id=182678
  61910. // Fix for #2774 Support for apps loaded from Windows file shares not mapped to network drives: replaced location.origin with
  61911. // window.location.protocol + '//' + window.location.host
  61912. // location.host contains the port and location.hostname doesn't
  61913. var protocolAndPath = window.location.protocol + '//' + window.location.host;
  61914. var absolutePath = window.location.href.replace(protocolAndPath, '');
  61915. // preserve existing history state as it could be overriden by the user
  61916. var stateCopy = extend({}, window.history.state);
  61917. stateCopy.key = getStateKey();
  61918. window.history.replaceState(stateCopy, '', absolutePath);
  61919. window.addEventListener('popstate', handlePopState);
  61920. return function () {
  61921. window.removeEventListener('popstate', handlePopState);
  61922. }
  61923. }
  61924. function handleScroll (
  61925. router,
  61926. to,
  61927. from,
  61928. isPop
  61929. ) {
  61930. if (!router.app) {
  61931. return
  61932. }
  61933. var behavior = router.options.scrollBehavior;
  61934. if (!behavior) {
  61935. return
  61936. }
  61937. if (true) {
  61938. assert(typeof behavior === 'function', "scrollBehavior must be a function");
  61939. }
  61940. // wait until re-render finishes before scrolling
  61941. router.app.$nextTick(function () {
  61942. var position = getScrollPosition();
  61943. var shouldScroll = behavior.call(
  61944. router,
  61945. to,
  61946. from,
  61947. isPop ? position : null
  61948. );
  61949. if (!shouldScroll) {
  61950. return
  61951. }
  61952. if (typeof shouldScroll.then === 'function') {
  61953. shouldScroll
  61954. .then(function (shouldScroll) {
  61955. scrollToPosition((shouldScroll), position);
  61956. })
  61957. .catch(function (err) {
  61958. if (true) {
  61959. assert(false, err.toString());
  61960. }
  61961. });
  61962. } else {
  61963. scrollToPosition(shouldScroll, position);
  61964. }
  61965. });
  61966. }
  61967. function saveScrollPosition () {
  61968. var key = getStateKey();
  61969. if (key) {
  61970. positionStore[key] = {
  61971. x: window.pageXOffset,
  61972. y: window.pageYOffset
  61973. };
  61974. }
  61975. }
  61976. function handlePopState (e) {
  61977. saveScrollPosition();
  61978. if (e.state && e.state.key) {
  61979. setStateKey(e.state.key);
  61980. }
  61981. }
  61982. function getScrollPosition () {
  61983. var key = getStateKey();
  61984. if (key) {
  61985. return positionStore[key]
  61986. }
  61987. }
  61988. function getElementPosition (el, offset) {
  61989. var docEl = document.documentElement;
  61990. var docRect = docEl.getBoundingClientRect();
  61991. var elRect = el.getBoundingClientRect();
  61992. return {
  61993. x: elRect.left - docRect.left - offset.x,
  61994. y: elRect.top - docRect.top - offset.y
  61995. }
  61996. }
  61997. function isValidPosition (obj) {
  61998. return isNumber(obj.x) || isNumber(obj.y)
  61999. }
  62000. function normalizePosition (obj) {
  62001. return {
  62002. x: isNumber(obj.x) ? obj.x : window.pageXOffset,
  62003. y: isNumber(obj.y) ? obj.y : window.pageYOffset
  62004. }
  62005. }
  62006. function normalizeOffset (obj) {
  62007. return {
  62008. x: isNumber(obj.x) ? obj.x : 0,
  62009. y: isNumber(obj.y) ? obj.y : 0
  62010. }
  62011. }
  62012. function isNumber (v) {
  62013. return typeof v === 'number'
  62014. }
  62015. var hashStartsWithNumberRE = /^#\d/;
  62016. function scrollToPosition (shouldScroll, position) {
  62017. var isObject = typeof shouldScroll === 'object';
  62018. if (isObject && typeof shouldScroll.selector === 'string') {
  62019. // getElementById would still fail if the selector contains a more complicated query like #main[data-attr]
  62020. // but at the same time, it doesn't make much sense to select an element with an id and an extra selector
  62021. var el = hashStartsWithNumberRE.test(shouldScroll.selector) // $flow-disable-line
  62022. ? document.getElementById(shouldScroll.selector.slice(1)) // $flow-disable-line
  62023. : document.querySelector(shouldScroll.selector);
  62024. if (el) {
  62025. var offset =
  62026. shouldScroll.offset && typeof shouldScroll.offset === 'object'
  62027. ? shouldScroll.offset
  62028. : {};
  62029. offset = normalizeOffset(offset);
  62030. position = getElementPosition(el, offset);
  62031. } else if (isValidPosition(shouldScroll)) {
  62032. position = normalizePosition(shouldScroll);
  62033. }
  62034. } else if (isObject && isValidPosition(shouldScroll)) {
  62035. position = normalizePosition(shouldScroll);
  62036. }
  62037. if (position) {
  62038. // $flow-disable-line
  62039. if ('scrollBehavior' in document.documentElement.style) {
  62040. window.scrollTo({
  62041. left: position.x,
  62042. top: position.y,
  62043. // $flow-disable-line
  62044. behavior: shouldScroll.behavior
  62045. });
  62046. } else {
  62047. window.scrollTo(position.x, position.y);
  62048. }
  62049. }
  62050. }
  62051. /* */
  62052. var supportsPushState =
  62053. inBrowser &&
  62054. (function () {
  62055. var ua = window.navigator.userAgent;
  62056. if (
  62057. (ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) &&
  62058. ua.indexOf('Mobile Safari') !== -1 &&
  62059. ua.indexOf('Chrome') === -1 &&
  62060. ua.indexOf('Windows Phone') === -1
  62061. ) {
  62062. return false
  62063. }
  62064. return window.history && typeof window.history.pushState === 'function'
  62065. })();
  62066. function pushState (url, replace) {
  62067. saveScrollPosition();
  62068. // try...catch the pushState call to get around Safari
  62069. // DOM Exception 18 where it limits to 100 pushState calls
  62070. var history = window.history;
  62071. try {
  62072. if (replace) {
  62073. // preserve existing history state as it could be overriden by the user
  62074. var stateCopy = extend({}, history.state);
  62075. stateCopy.key = getStateKey();
  62076. history.replaceState(stateCopy, '', url);
  62077. } else {
  62078. history.pushState({ key: setStateKey(genStateKey()) }, '', url);
  62079. }
  62080. } catch (e) {
  62081. window.location[replace ? 'replace' : 'assign'](url);
  62082. }
  62083. }
  62084. function replaceState (url) {
  62085. pushState(url, true);
  62086. }
  62087. /* */
  62088. function runQueue (queue, fn, cb) {
  62089. var step = function (index) {
  62090. if (index >= queue.length) {
  62091. cb();
  62092. } else {
  62093. if (queue[index]) {
  62094. fn(queue[index], function () {
  62095. step(index + 1);
  62096. });
  62097. } else {
  62098. step(index + 1);
  62099. }
  62100. }
  62101. };
  62102. step(0);
  62103. }
  62104. // When changing thing, also edit router.d.ts
  62105. var NavigationFailureType = {
  62106. redirected: 2,
  62107. aborted: 4,
  62108. cancelled: 8,
  62109. duplicated: 16
  62110. };
  62111. function createNavigationRedirectedError (from, to) {
  62112. return createRouterError(
  62113. from,
  62114. to,
  62115. NavigationFailureType.redirected,
  62116. ("Redirected when going from \"" + (from.fullPath) + "\" to \"" + (stringifyRoute(
  62117. to
  62118. )) + "\" via a navigation guard.")
  62119. )
  62120. }
  62121. function createNavigationDuplicatedError (from, to) {
  62122. var error = createRouterError(
  62123. from,
  62124. to,
  62125. NavigationFailureType.duplicated,
  62126. ("Avoided redundant navigation to current location: \"" + (from.fullPath) + "\".")
  62127. );
  62128. // backwards compatible with the first introduction of Errors
  62129. error.name = 'NavigationDuplicated';
  62130. return error
  62131. }
  62132. function createNavigationCancelledError (from, to) {
  62133. return createRouterError(
  62134. from,
  62135. to,
  62136. NavigationFailureType.cancelled,
  62137. ("Navigation cancelled from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" with a new navigation.")
  62138. )
  62139. }
  62140. function createNavigationAbortedError (from, to) {
  62141. return createRouterError(
  62142. from,
  62143. to,
  62144. NavigationFailureType.aborted,
  62145. ("Navigation aborted from \"" + (from.fullPath) + "\" to \"" + (to.fullPath) + "\" via a navigation guard.")
  62146. )
  62147. }
  62148. function createRouterError (from, to, type, message) {
  62149. var error = new Error(message);
  62150. error._isRouter = true;
  62151. error.from = from;
  62152. error.to = to;
  62153. error.type = type;
  62154. return error
  62155. }
  62156. var propertiesToLog = ['params', 'query', 'hash'];
  62157. function stringifyRoute (to) {
  62158. if (typeof to === 'string') { return to }
  62159. if ('path' in to) { return to.path }
  62160. var location = {};
  62161. propertiesToLog.forEach(function (key) {
  62162. if (key in to) { location[key] = to[key]; }
  62163. });
  62164. return JSON.stringify(location, null, 2)
  62165. }
  62166. function isError (err) {
  62167. return Object.prototype.toString.call(err).indexOf('Error') > -1
  62168. }
  62169. function isNavigationFailure (err, errorType) {
  62170. return (
  62171. isError(err) &&
  62172. err._isRouter &&
  62173. (errorType == null || err.type === errorType)
  62174. )
  62175. }
  62176. /* */
  62177. function resolveAsyncComponents (matched) {
  62178. return function (to, from, next) {
  62179. var hasAsync = false;
  62180. var pending = 0;
  62181. var error = null;
  62182. flatMapComponents(matched, function (def, _, match, key) {
  62183. // if it's a function and doesn't have cid attached,
  62184. // assume it's an async component resolve function.
  62185. // we are not using Vue's default async resolving mechanism because
  62186. // we want to halt the navigation until the incoming component has been
  62187. // resolved.
  62188. if (typeof def === 'function' && def.cid === undefined) {
  62189. hasAsync = true;
  62190. pending++;
  62191. var resolve = once(function (resolvedDef) {
  62192. if (isESModule(resolvedDef)) {
  62193. resolvedDef = resolvedDef.default;
  62194. }
  62195. // save resolved on async factory in case it's used elsewhere
  62196. def.resolved = typeof resolvedDef === 'function'
  62197. ? resolvedDef
  62198. : _Vue.extend(resolvedDef);
  62199. match.components[key] = resolvedDef;
  62200. pending--;
  62201. if (pending <= 0) {
  62202. next();
  62203. }
  62204. });
  62205. var reject = once(function (reason) {
  62206. var msg = "Failed to resolve async component " + key + ": " + reason;
  62207. "development" !== 'production' && warn(false, msg);
  62208. if (!error) {
  62209. error = isError(reason)
  62210. ? reason
  62211. : new Error(msg);
  62212. next(error);
  62213. }
  62214. });
  62215. var res;
  62216. try {
  62217. res = def(resolve, reject);
  62218. } catch (e) {
  62219. reject(e);
  62220. }
  62221. if (res) {
  62222. if (typeof res.then === 'function') {
  62223. res.then(resolve, reject);
  62224. } else {
  62225. // new syntax in Vue 2.3
  62226. var comp = res.component;
  62227. if (comp && typeof comp.then === 'function') {
  62228. comp.then(resolve, reject);
  62229. }
  62230. }
  62231. }
  62232. }
  62233. });
  62234. if (!hasAsync) { next(); }
  62235. }
  62236. }
  62237. function flatMapComponents (
  62238. matched,
  62239. fn
  62240. ) {
  62241. return flatten(matched.map(function (m) {
  62242. return Object.keys(m.components).map(function (key) { return fn(
  62243. m.components[key],
  62244. m.instances[key],
  62245. m, key
  62246. ); })
  62247. }))
  62248. }
  62249. function flatten (arr) {
  62250. return Array.prototype.concat.apply([], arr)
  62251. }
  62252. var hasSymbol =
  62253. typeof Symbol === 'function' &&
  62254. typeof Symbol.toStringTag === 'symbol';
  62255. function isESModule (obj) {
  62256. return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module')
  62257. }
  62258. // in Webpack 2, require.ensure now also returns a Promise
  62259. // so the resolve/reject functions may get called an extra time
  62260. // if the user uses an arrow function shorthand that happens to
  62261. // return that Promise.
  62262. function once (fn) {
  62263. var called = false;
  62264. return function () {
  62265. var args = [], len = arguments.length;
  62266. while ( len-- ) args[ len ] = arguments[ len ];
  62267. if (called) { return }
  62268. called = true;
  62269. return fn.apply(this, args)
  62270. }
  62271. }
  62272. /* */
  62273. var History = function History (router, base) {
  62274. this.router = router;
  62275. this.base = normalizeBase(base);
  62276. // start with a route object that stands for "nowhere"
  62277. this.current = START;
  62278. this.pending = null;
  62279. this.ready = false;
  62280. this.readyCbs = [];
  62281. this.readyErrorCbs = [];
  62282. this.errorCbs = [];
  62283. this.listeners = [];
  62284. };
  62285. History.prototype.listen = function listen (cb) {
  62286. this.cb = cb;
  62287. };
  62288. History.prototype.onReady = function onReady (cb, errorCb) {
  62289. if (this.ready) {
  62290. cb();
  62291. } else {
  62292. this.readyCbs.push(cb);
  62293. if (errorCb) {
  62294. this.readyErrorCbs.push(errorCb);
  62295. }
  62296. }
  62297. };
  62298. History.prototype.onError = function onError (errorCb) {
  62299. this.errorCbs.push(errorCb);
  62300. };
  62301. History.prototype.transitionTo = function transitionTo (
  62302. location,
  62303. onComplete,
  62304. onAbort
  62305. ) {
  62306. var this$1 = this;
  62307. var route;
  62308. // catch redirect option https://github.com/vuejs/vue-router/issues/3201
  62309. try {
  62310. route = this.router.match(location, this.current);
  62311. } catch (e) {
  62312. this.errorCbs.forEach(function (cb) {
  62313. cb(e);
  62314. });
  62315. // Exception should still be thrown
  62316. throw e
  62317. }
  62318. var prev = this.current;
  62319. this.confirmTransition(
  62320. route,
  62321. function () {
  62322. this$1.updateRoute(route);
  62323. onComplete && onComplete(route);
  62324. this$1.ensureURL();
  62325. this$1.router.afterHooks.forEach(function (hook) {
  62326. hook && hook(route, prev);
  62327. });
  62328. // fire ready cbs once
  62329. if (!this$1.ready) {
  62330. this$1.ready = true;
  62331. this$1.readyCbs.forEach(function (cb) {
  62332. cb(route);
  62333. });
  62334. }
  62335. },
  62336. function (err) {
  62337. if (onAbort) {
  62338. onAbort(err);
  62339. }
  62340. if (err && !this$1.ready) {
  62341. // Initial redirection should not mark the history as ready yet
  62342. // because it's triggered by the redirection instead
  62343. // https://github.com/vuejs/vue-router/issues/3225
  62344. // https://github.com/vuejs/vue-router/issues/3331
  62345. if (!isNavigationFailure(err, NavigationFailureType.redirected) || prev !== START) {
  62346. this$1.ready = true;
  62347. this$1.readyErrorCbs.forEach(function (cb) {
  62348. cb(err);
  62349. });
  62350. }
  62351. }
  62352. }
  62353. );
  62354. };
  62355. History.prototype.confirmTransition = function confirmTransition (route, onComplete, onAbort) {
  62356. var this$1 = this;
  62357. var current = this.current;
  62358. this.pending = route;
  62359. var abort = function (err) {
  62360. // changed after adding errors with
  62361. // https://github.com/vuejs/vue-router/pull/3047 before that change,
  62362. // redirect and aborted navigation would produce an err == null
  62363. if (!isNavigationFailure(err) && isError(err)) {
  62364. if (this$1.errorCbs.length) {
  62365. this$1.errorCbs.forEach(function (cb) {
  62366. cb(err);
  62367. });
  62368. } else {
  62369. if (true) {
  62370. warn(false, 'uncaught error during route navigation:');
  62371. }
  62372. console.error(err);
  62373. }
  62374. }
  62375. onAbort && onAbort(err);
  62376. };
  62377. var lastRouteIndex = route.matched.length - 1;
  62378. var lastCurrentIndex = current.matched.length - 1;
  62379. if (
  62380. isSameRoute(route, current) &&
  62381. // in the case the route map has been dynamically appended to
  62382. lastRouteIndex === lastCurrentIndex &&
  62383. route.matched[lastRouteIndex] === current.matched[lastCurrentIndex]
  62384. ) {
  62385. this.ensureURL();
  62386. if (route.hash) {
  62387. handleScroll(this.router, current, route, false);
  62388. }
  62389. return abort(createNavigationDuplicatedError(current, route))
  62390. }
  62391. var ref = resolveQueue(
  62392. this.current.matched,
  62393. route.matched
  62394. );
  62395. var updated = ref.updated;
  62396. var deactivated = ref.deactivated;
  62397. var activated = ref.activated;
  62398. var queue = [].concat(
  62399. // in-component leave guards
  62400. extractLeaveGuards(deactivated),
  62401. // global before hooks
  62402. this.router.beforeHooks,
  62403. // in-component update hooks
  62404. extractUpdateHooks(updated),
  62405. // in-config enter guards
  62406. activated.map(function (m) { return m.beforeEnter; }),
  62407. // async components
  62408. resolveAsyncComponents(activated)
  62409. );
  62410. var iterator = function (hook, next) {
  62411. if (this$1.pending !== route) {
  62412. return abort(createNavigationCancelledError(current, route))
  62413. }
  62414. try {
  62415. hook(route, current, function (to) {
  62416. if (to === false) {
  62417. // next(false) -> abort navigation, ensure current URL
  62418. this$1.ensureURL(true);
  62419. abort(createNavigationAbortedError(current, route));
  62420. } else if (isError(to)) {
  62421. this$1.ensureURL(true);
  62422. abort(to);
  62423. } else if (
  62424. typeof to === 'string' ||
  62425. (typeof to === 'object' &&
  62426. (typeof to.path === 'string' || typeof to.name === 'string'))
  62427. ) {
  62428. // next('/') or next({ path: '/' }) -> redirect
  62429. abort(createNavigationRedirectedError(current, route));
  62430. if (typeof to === 'object' && to.replace) {
  62431. this$1.replace(to);
  62432. } else {
  62433. this$1.push(to);
  62434. }
  62435. } else {
  62436. // confirm transition and pass on the value
  62437. next(to);
  62438. }
  62439. });
  62440. } catch (e) {
  62441. abort(e);
  62442. }
  62443. };
  62444. runQueue(queue, iterator, function () {
  62445. // wait until async components are resolved before
  62446. // extracting in-component enter guards
  62447. var enterGuards = extractEnterGuards(activated);
  62448. var queue = enterGuards.concat(this$1.router.resolveHooks);
  62449. runQueue(queue, iterator, function () {
  62450. if (this$1.pending !== route) {
  62451. return abort(createNavigationCancelledError(current, route))
  62452. }
  62453. this$1.pending = null;
  62454. onComplete(route);
  62455. if (this$1.router.app) {
  62456. this$1.router.app.$nextTick(function () {
  62457. handleRouteEntered(route);
  62458. });
  62459. }
  62460. });
  62461. });
  62462. };
  62463. History.prototype.updateRoute = function updateRoute (route) {
  62464. this.current = route;
  62465. this.cb && this.cb(route);
  62466. };
  62467. History.prototype.setupListeners = function setupListeners () {
  62468. // Default implementation is empty
  62469. };
  62470. History.prototype.teardown = function teardown () {
  62471. // clean up event listeners
  62472. // https://github.com/vuejs/vue-router/issues/2341
  62473. this.listeners.forEach(function (cleanupListener) {
  62474. cleanupListener();
  62475. });
  62476. this.listeners = [];
  62477. // reset current history route
  62478. // https://github.com/vuejs/vue-router/issues/3294
  62479. this.current = START;
  62480. this.pending = null;
  62481. };
  62482. function normalizeBase (base) {
  62483. if (!base) {
  62484. if (inBrowser) {
  62485. // respect <base> tag
  62486. var baseEl = document.querySelector('base');
  62487. base = (baseEl && baseEl.getAttribute('href')) || '/';
  62488. // strip full URL origin
  62489. base = base.replace(/^https?:\/\/[^\/]+/, '');
  62490. } else {
  62491. base = '/';
  62492. }
  62493. }
  62494. // make sure there's the starting slash
  62495. if (base.charAt(0) !== '/') {
  62496. base = '/' + base;
  62497. }
  62498. // remove trailing slash
  62499. return base.replace(/\/$/, '')
  62500. }
  62501. function resolveQueue (
  62502. current,
  62503. next
  62504. ) {
  62505. var i;
  62506. var max = Math.max(current.length, next.length);
  62507. for (i = 0; i < max; i++) {
  62508. if (current[i] !== next[i]) {
  62509. break
  62510. }
  62511. }
  62512. return {
  62513. updated: next.slice(0, i),
  62514. activated: next.slice(i),
  62515. deactivated: current.slice(i)
  62516. }
  62517. }
  62518. function extractGuards (
  62519. records,
  62520. name,
  62521. bind,
  62522. reverse
  62523. ) {
  62524. var guards = flatMapComponents(records, function (def, instance, match, key) {
  62525. var guard = extractGuard(def, name);
  62526. if (guard) {
  62527. return Array.isArray(guard)
  62528. ? guard.map(function (guard) { return bind(guard, instance, match, key); })
  62529. : bind(guard, instance, match, key)
  62530. }
  62531. });
  62532. return flatten(reverse ? guards.reverse() : guards)
  62533. }
  62534. function extractGuard (
  62535. def,
  62536. key
  62537. ) {
  62538. if (typeof def !== 'function') {
  62539. // extend now so that global mixins are applied.
  62540. def = _Vue.extend(def);
  62541. }
  62542. return def.options[key]
  62543. }
  62544. function extractLeaveGuards (deactivated) {
  62545. return extractGuards(deactivated, 'beforeRouteLeave', bindGuard, true)
  62546. }
  62547. function extractUpdateHooks (updated) {
  62548. return extractGuards(updated, 'beforeRouteUpdate', bindGuard)
  62549. }
  62550. function bindGuard (guard, instance) {
  62551. if (instance) {
  62552. return function boundRouteGuard () {
  62553. return guard.apply(instance, arguments)
  62554. }
  62555. }
  62556. }
  62557. function extractEnterGuards (
  62558. activated
  62559. ) {
  62560. return extractGuards(
  62561. activated,
  62562. 'beforeRouteEnter',
  62563. function (guard, _, match, key) {
  62564. return bindEnterGuard(guard, match, key)
  62565. }
  62566. )
  62567. }
  62568. function bindEnterGuard (
  62569. guard,
  62570. match,
  62571. key
  62572. ) {
  62573. return function routeEnterGuard (to, from, next) {
  62574. return guard(to, from, function (cb) {
  62575. if (typeof cb === 'function') {
  62576. if (!match.enteredCbs[key]) {
  62577. match.enteredCbs[key] = [];
  62578. }
  62579. match.enteredCbs[key].push(cb);
  62580. }
  62581. next(cb);
  62582. })
  62583. }
  62584. }
  62585. /* */
  62586. var HTML5History = /*@__PURE__*/(function (History) {
  62587. function HTML5History (router, base) {
  62588. History.call(this, router, base);
  62589. this._startLocation = getLocation(this.base);
  62590. }
  62591. if ( History ) HTML5History.__proto__ = History;
  62592. HTML5History.prototype = Object.create( History && History.prototype );
  62593. HTML5History.prototype.constructor = HTML5History;
  62594. HTML5History.prototype.setupListeners = function setupListeners () {
  62595. var this$1 = this;
  62596. if (this.listeners.length > 0) {
  62597. return
  62598. }
  62599. var router = this.router;
  62600. var expectScroll = router.options.scrollBehavior;
  62601. var supportsScroll = supportsPushState && expectScroll;
  62602. if (supportsScroll) {
  62603. this.listeners.push(setupScroll());
  62604. }
  62605. var handleRoutingEvent = function () {
  62606. var current = this$1.current;
  62607. // Avoiding first `popstate` event dispatched in some browsers but first
  62608. // history route not updated since async guard at the same time.
  62609. var location = getLocation(this$1.base);
  62610. if (this$1.current === START && location === this$1._startLocation) {
  62611. return
  62612. }
  62613. this$1.transitionTo(location, function (route) {
  62614. if (supportsScroll) {
  62615. handleScroll(router, route, current, true);
  62616. }
  62617. });
  62618. };
  62619. window.addEventListener('popstate', handleRoutingEvent);
  62620. this.listeners.push(function () {
  62621. window.removeEventListener('popstate', handleRoutingEvent);
  62622. });
  62623. };
  62624. HTML5History.prototype.go = function go (n) {
  62625. window.history.go(n);
  62626. };
  62627. HTML5History.prototype.push = function push (location, onComplete, onAbort) {
  62628. var this$1 = this;
  62629. var ref = this;
  62630. var fromRoute = ref.current;
  62631. this.transitionTo(location, function (route) {
  62632. pushState(cleanPath(this$1.base + route.fullPath));
  62633. handleScroll(this$1.router, route, fromRoute, false);
  62634. onComplete && onComplete(route);
  62635. }, onAbort);
  62636. };
  62637. HTML5History.prototype.replace = function replace (location, onComplete, onAbort) {
  62638. var this$1 = this;
  62639. var ref = this;
  62640. var fromRoute = ref.current;
  62641. this.transitionTo(location, function (route) {
  62642. replaceState(cleanPath(this$1.base + route.fullPath));
  62643. handleScroll(this$1.router, route, fromRoute, false);
  62644. onComplete && onComplete(route);
  62645. }, onAbort);
  62646. };
  62647. HTML5History.prototype.ensureURL = function ensureURL (push) {
  62648. if (getLocation(this.base) !== this.current.fullPath) {
  62649. var current = cleanPath(this.base + this.current.fullPath);
  62650. push ? pushState(current) : replaceState(current);
  62651. }
  62652. };
  62653. HTML5History.prototype.getCurrentLocation = function getCurrentLocation () {
  62654. return getLocation(this.base)
  62655. };
  62656. return HTML5History;
  62657. }(History));
  62658. function getLocation (base) {
  62659. var path = window.location.pathname;
  62660. var pathLowerCase = path.toLowerCase();
  62661. var baseLowerCase = base.toLowerCase();
  62662. // base="/a" shouldn't turn path="/app" into "/a/pp"
  62663. // https://github.com/vuejs/vue-router/issues/3555
  62664. // so we ensure the trailing slash in the base
  62665. if (base && ((pathLowerCase === baseLowerCase) ||
  62666. (pathLowerCase.indexOf(cleanPath(baseLowerCase + '/')) === 0))) {
  62667. path = path.slice(base.length);
  62668. }
  62669. return (path || '/') + window.location.search + window.location.hash
  62670. }
  62671. /* */
  62672. var HashHistory = /*@__PURE__*/(function (History) {
  62673. function HashHistory (router, base, fallback) {
  62674. History.call(this, router, base);
  62675. // check history fallback deeplinking
  62676. if (fallback && checkFallback(this.base)) {
  62677. return
  62678. }
  62679. ensureSlash();
  62680. }
  62681. if ( History ) HashHistory.__proto__ = History;
  62682. HashHistory.prototype = Object.create( History && History.prototype );
  62683. HashHistory.prototype.constructor = HashHistory;
  62684. // this is delayed until the app mounts
  62685. // to avoid the hashchange listener being fired too early
  62686. HashHistory.prototype.setupListeners = function setupListeners () {
  62687. var this$1 = this;
  62688. if (this.listeners.length > 0) {
  62689. return
  62690. }
  62691. var router = this.router;
  62692. var expectScroll = router.options.scrollBehavior;
  62693. var supportsScroll = supportsPushState && expectScroll;
  62694. if (supportsScroll) {
  62695. this.listeners.push(setupScroll());
  62696. }
  62697. var handleRoutingEvent = function () {
  62698. var current = this$1.current;
  62699. if (!ensureSlash()) {
  62700. return
  62701. }
  62702. this$1.transitionTo(getHash(), function (route) {
  62703. if (supportsScroll) {
  62704. handleScroll(this$1.router, route, current, true);
  62705. }
  62706. if (!supportsPushState) {
  62707. replaceHash(route.fullPath);
  62708. }
  62709. });
  62710. };
  62711. var eventType = supportsPushState ? 'popstate' : 'hashchange';
  62712. window.addEventListener(
  62713. eventType,
  62714. handleRoutingEvent
  62715. );
  62716. this.listeners.push(function () {
  62717. window.removeEventListener(eventType, handleRoutingEvent);
  62718. });
  62719. };
  62720. HashHistory.prototype.push = function push (location, onComplete, onAbort) {
  62721. var this$1 = this;
  62722. var ref = this;
  62723. var fromRoute = ref.current;
  62724. this.transitionTo(
  62725. location,
  62726. function (route) {
  62727. pushHash(route.fullPath);
  62728. handleScroll(this$1.router, route, fromRoute, false);
  62729. onComplete && onComplete(route);
  62730. },
  62731. onAbort
  62732. );
  62733. };
  62734. HashHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  62735. var this$1 = this;
  62736. var ref = this;
  62737. var fromRoute = ref.current;
  62738. this.transitionTo(
  62739. location,
  62740. function (route) {
  62741. replaceHash(route.fullPath);
  62742. handleScroll(this$1.router, route, fromRoute, false);
  62743. onComplete && onComplete(route);
  62744. },
  62745. onAbort
  62746. );
  62747. };
  62748. HashHistory.prototype.go = function go (n) {
  62749. window.history.go(n);
  62750. };
  62751. HashHistory.prototype.ensureURL = function ensureURL (push) {
  62752. var current = this.current.fullPath;
  62753. if (getHash() !== current) {
  62754. push ? pushHash(current) : replaceHash(current);
  62755. }
  62756. };
  62757. HashHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  62758. return getHash()
  62759. };
  62760. return HashHistory;
  62761. }(History));
  62762. function checkFallback (base) {
  62763. var location = getLocation(base);
  62764. if (!/^\/#/.test(location)) {
  62765. window.location.replace(cleanPath(base + '/#' + location));
  62766. return true
  62767. }
  62768. }
  62769. function ensureSlash () {
  62770. var path = getHash();
  62771. if (path.charAt(0) === '/') {
  62772. return true
  62773. }
  62774. replaceHash('/' + path);
  62775. return false
  62776. }
  62777. function getHash () {
  62778. // We can't use window.location.hash here because it's not
  62779. // consistent across browsers - Firefox will pre-decode it!
  62780. var href = window.location.href;
  62781. var index = href.indexOf('#');
  62782. // empty path
  62783. if (index < 0) { return '' }
  62784. href = href.slice(index + 1);
  62785. return href
  62786. }
  62787. function getUrl (path) {
  62788. var href = window.location.href;
  62789. var i = href.indexOf('#');
  62790. var base = i >= 0 ? href.slice(0, i) : href;
  62791. return (base + "#" + path)
  62792. }
  62793. function pushHash (path) {
  62794. if (supportsPushState) {
  62795. pushState(getUrl(path));
  62796. } else {
  62797. window.location.hash = path;
  62798. }
  62799. }
  62800. function replaceHash (path) {
  62801. if (supportsPushState) {
  62802. replaceState(getUrl(path));
  62803. } else {
  62804. window.location.replace(getUrl(path));
  62805. }
  62806. }
  62807. /* */
  62808. var AbstractHistory = /*@__PURE__*/(function (History) {
  62809. function AbstractHistory (router, base) {
  62810. History.call(this, router, base);
  62811. this.stack = [];
  62812. this.index = -1;
  62813. }
  62814. if ( History ) AbstractHistory.__proto__ = History;
  62815. AbstractHistory.prototype = Object.create( History && History.prototype );
  62816. AbstractHistory.prototype.constructor = AbstractHistory;
  62817. AbstractHistory.prototype.push = function push (location, onComplete, onAbort) {
  62818. var this$1 = this;
  62819. this.transitionTo(
  62820. location,
  62821. function (route) {
  62822. this$1.stack = this$1.stack.slice(0, this$1.index + 1).concat(route);
  62823. this$1.index++;
  62824. onComplete && onComplete(route);
  62825. },
  62826. onAbort
  62827. );
  62828. };
  62829. AbstractHistory.prototype.replace = function replace (location, onComplete, onAbort) {
  62830. var this$1 = this;
  62831. this.transitionTo(
  62832. location,
  62833. function (route) {
  62834. this$1.stack = this$1.stack.slice(0, this$1.index).concat(route);
  62835. onComplete && onComplete(route);
  62836. },
  62837. onAbort
  62838. );
  62839. };
  62840. AbstractHistory.prototype.go = function go (n) {
  62841. var this$1 = this;
  62842. var targetIndex = this.index + n;
  62843. if (targetIndex < 0 || targetIndex >= this.stack.length) {
  62844. return
  62845. }
  62846. var route = this.stack[targetIndex];
  62847. this.confirmTransition(
  62848. route,
  62849. function () {
  62850. var prev = this$1.current;
  62851. this$1.index = targetIndex;
  62852. this$1.updateRoute(route);
  62853. this$1.router.afterHooks.forEach(function (hook) {
  62854. hook && hook(route, prev);
  62855. });
  62856. },
  62857. function (err) {
  62858. if (isNavigationFailure(err, NavigationFailureType.duplicated)) {
  62859. this$1.index = targetIndex;
  62860. }
  62861. }
  62862. );
  62863. };
  62864. AbstractHistory.prototype.getCurrentLocation = function getCurrentLocation () {
  62865. var current = this.stack[this.stack.length - 1];
  62866. return current ? current.fullPath : '/'
  62867. };
  62868. AbstractHistory.prototype.ensureURL = function ensureURL () {
  62869. // noop
  62870. };
  62871. return AbstractHistory;
  62872. }(History));
  62873. /* */
  62874. var VueRouter = function VueRouter (options) {
  62875. if ( options === void 0 ) options = {};
  62876. if (true) {
  62877. warn(this instanceof VueRouter, "Router must be called with the new operator.");
  62878. }
  62879. this.app = null;
  62880. this.apps = [];
  62881. this.options = options;
  62882. this.beforeHooks = [];
  62883. this.resolveHooks = [];
  62884. this.afterHooks = [];
  62885. this.matcher = createMatcher(options.routes || [], this);
  62886. var mode = options.mode || 'hash';
  62887. this.fallback =
  62888. mode === 'history' && !supportsPushState && options.fallback !== false;
  62889. if (this.fallback) {
  62890. mode = 'hash';
  62891. }
  62892. if (!inBrowser) {
  62893. mode = 'abstract';
  62894. }
  62895. this.mode = mode;
  62896. switch (mode) {
  62897. case 'history':
  62898. this.history = new HTML5History(this, options.base);
  62899. break
  62900. case 'hash':
  62901. this.history = new HashHistory(this, options.base, this.fallback);
  62902. break
  62903. case 'abstract':
  62904. this.history = new AbstractHistory(this, options.base);
  62905. break
  62906. default:
  62907. if (true) {
  62908. assert(false, ("invalid mode: " + mode));
  62909. }
  62910. }
  62911. };
  62912. var prototypeAccessors = { currentRoute: { configurable: true } };
  62913. VueRouter.prototype.match = function match (raw, current, redirectedFrom) {
  62914. return this.matcher.match(raw, current, redirectedFrom)
  62915. };
  62916. prototypeAccessors.currentRoute.get = function () {
  62917. return this.history && this.history.current
  62918. };
  62919. VueRouter.prototype.init = function init (app /* Vue component instance */) {
  62920. var this$1 = this;
  62921. "development" !== 'production' &&
  62922. assert(
  62923. install.installed,
  62924. "not installed. Make sure to call `Vue.use(VueRouter)` " +
  62925. "before creating root instance."
  62926. );
  62927. this.apps.push(app);
  62928. // set up app destroyed handler
  62929. // https://github.com/vuejs/vue-router/issues/2639
  62930. app.$once('hook:destroyed', function () {
  62931. // clean out app from this.apps array once destroyed
  62932. var index = this$1.apps.indexOf(app);
  62933. if (index > -1) { this$1.apps.splice(index, 1); }
  62934. // ensure we still have a main app or null if no apps
  62935. // we do not release the router so it can be reused
  62936. if (this$1.app === app) { this$1.app = this$1.apps[0] || null; }
  62937. if (!this$1.app) { this$1.history.teardown(); }
  62938. });
  62939. // main app previously initialized
  62940. // return as we don't need to set up new history listener
  62941. if (this.app) {
  62942. return
  62943. }
  62944. this.app = app;
  62945. var history = this.history;
  62946. if (history instanceof HTML5History || history instanceof HashHistory) {
  62947. var handleInitialScroll = function (routeOrError) {
  62948. var from = history.current;
  62949. var expectScroll = this$1.options.scrollBehavior;
  62950. var supportsScroll = supportsPushState && expectScroll;
  62951. if (supportsScroll && 'fullPath' in routeOrError) {
  62952. handleScroll(this$1, routeOrError, from, false);
  62953. }
  62954. };
  62955. var setupListeners = function (routeOrError) {
  62956. history.setupListeners();
  62957. handleInitialScroll(routeOrError);
  62958. };
  62959. history.transitionTo(
  62960. history.getCurrentLocation(),
  62961. setupListeners,
  62962. setupListeners
  62963. );
  62964. }
  62965. history.listen(function (route) {
  62966. this$1.apps.forEach(function (app) {
  62967. app._route = route;
  62968. });
  62969. });
  62970. };
  62971. VueRouter.prototype.beforeEach = function beforeEach (fn) {
  62972. return registerHook(this.beforeHooks, fn)
  62973. };
  62974. VueRouter.prototype.beforeResolve = function beforeResolve (fn) {
  62975. return registerHook(this.resolveHooks, fn)
  62976. };
  62977. VueRouter.prototype.afterEach = function afterEach (fn) {
  62978. return registerHook(this.afterHooks, fn)
  62979. };
  62980. VueRouter.prototype.onReady = function onReady (cb, errorCb) {
  62981. this.history.onReady(cb, errorCb);
  62982. };
  62983. VueRouter.prototype.onError = function onError (errorCb) {
  62984. this.history.onError(errorCb);
  62985. };
  62986. VueRouter.prototype.push = function push (location, onComplete, onAbort) {
  62987. var this$1 = this;
  62988. // $flow-disable-line
  62989. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  62990. return new Promise(function (resolve, reject) {
  62991. this$1.history.push(location, resolve, reject);
  62992. })
  62993. } else {
  62994. this.history.push(location, onComplete, onAbort);
  62995. }
  62996. };
  62997. VueRouter.prototype.replace = function replace (location, onComplete, onAbort) {
  62998. var this$1 = this;
  62999. // $flow-disable-line
  63000. if (!onComplete && !onAbort && typeof Promise !== 'undefined') {
  63001. return new Promise(function (resolve, reject) {
  63002. this$1.history.replace(location, resolve, reject);
  63003. })
  63004. } else {
  63005. this.history.replace(location, onComplete, onAbort);
  63006. }
  63007. };
  63008. VueRouter.prototype.go = function go (n) {
  63009. this.history.go(n);
  63010. };
  63011. VueRouter.prototype.back = function back () {
  63012. this.go(-1);
  63013. };
  63014. VueRouter.prototype.forward = function forward () {
  63015. this.go(1);
  63016. };
  63017. VueRouter.prototype.getMatchedComponents = function getMatchedComponents (to) {
  63018. var route = to
  63019. ? to.matched
  63020. ? to
  63021. : this.resolve(to).route
  63022. : this.currentRoute;
  63023. if (!route) {
  63024. return []
  63025. }
  63026. return [].concat.apply(
  63027. [],
  63028. route.matched.map(function (m) {
  63029. return Object.keys(m.components).map(function (key) {
  63030. return m.components[key]
  63031. })
  63032. })
  63033. )
  63034. };
  63035. VueRouter.prototype.resolve = function resolve (
  63036. to,
  63037. current,
  63038. append
  63039. ) {
  63040. current = current || this.history.current;
  63041. var location = normalizeLocation(to, current, append, this);
  63042. var route = this.match(location, current);
  63043. var fullPath = route.redirectedFrom || route.fullPath;
  63044. var base = this.history.base;
  63045. var href = createHref(base, fullPath, this.mode);
  63046. return {
  63047. location: location,
  63048. route: route,
  63049. href: href,
  63050. // for backwards compat
  63051. normalizedTo: location,
  63052. resolved: route
  63053. }
  63054. };
  63055. VueRouter.prototype.getRoutes = function getRoutes () {
  63056. return this.matcher.getRoutes()
  63057. };
  63058. VueRouter.prototype.addRoute = function addRoute (parentOrRoute, route) {
  63059. this.matcher.addRoute(parentOrRoute, route);
  63060. if (this.history.current !== START) {
  63061. this.history.transitionTo(this.history.getCurrentLocation());
  63062. }
  63063. };
  63064. VueRouter.prototype.addRoutes = function addRoutes (routes) {
  63065. if (true) {
  63066. warn(false, 'router.addRoutes() is deprecated and has been removed in Vue Router 4. Use router.addRoute() instead.');
  63067. }
  63068. this.matcher.addRoutes(routes);
  63069. if (this.history.current !== START) {
  63070. this.history.transitionTo(this.history.getCurrentLocation());
  63071. }
  63072. };
  63073. Object.defineProperties( VueRouter.prototype, prototypeAccessors );
  63074. function registerHook (list, fn) {
  63075. list.push(fn);
  63076. return function () {
  63077. var i = list.indexOf(fn);
  63078. if (i > -1) { list.splice(i, 1); }
  63079. }
  63080. }
  63081. function createHref (base, fullPath, mode) {
  63082. var path = mode === 'hash' ? '#' + fullPath : fullPath;
  63083. return base ? cleanPath(base + '/' + path) : path
  63084. }
  63085. VueRouter.install = install;
  63086. VueRouter.version = '3.5.3';
  63087. VueRouter.isNavigationFailure = isNavigationFailure;
  63088. VueRouter.NavigationFailureType = NavigationFailureType;
  63089. VueRouter.START_LOCATION = START;
  63090. if (inBrowser && window.Vue) {
  63091. window.Vue.use(VueRouter);
  63092. }
  63093. /* harmony default export */ __webpack_exports__["a"] = (VueRouter);
  63094. /***/ }),
  63095. /* 194 */
  63096. /***/ (function(module, exports, __webpack_require__) {
  63097. (function webpackUniversalModuleDefinition(root, factory) {
  63098. if(true)
  63099. module.exports = factory(__webpack_require__(4));
  63100. else if(typeof define === 'function' && define.amd)
  63101. define("iview", ["vue"], factory);
  63102. else if(typeof exports === 'object')
  63103. exports["iview"] = factory(require("vue"));
  63104. else
  63105. root["iview"] = factory(root["Vue"]);
  63106. })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_16__) {
  63107. return /******/ (function(modules) { // webpackBootstrap
  63108. /******/ // The module cache
  63109. /******/ var installedModules = {};
  63110. /******/
  63111. /******/ // The require function
  63112. /******/ function __webpack_require__(moduleId) {
  63113. /******/
  63114. /******/ // Check if module is in cache
  63115. /******/ if(installedModules[moduleId]) {
  63116. /******/ return installedModules[moduleId].exports;
  63117. /******/ }
  63118. /******/ // Create a new module (and put it into the cache)
  63119. /******/ var module = installedModules[moduleId] = {
  63120. /******/ i: moduleId,
  63121. /******/ l: false,
  63122. /******/ exports: {}
  63123. /******/ };
  63124. /******/
  63125. /******/ // Execute the module function
  63126. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  63127. /******/
  63128. /******/ // Flag the module as loaded
  63129. /******/ module.l = true;
  63130. /******/
  63131. /******/ // Return the exports of the module
  63132. /******/ return module.exports;
  63133. /******/ }
  63134. /******/
  63135. /******/
  63136. /******/ // expose the modules object (__webpack_modules__)
  63137. /******/ __webpack_require__.m = modules;
  63138. /******/
  63139. /******/ // expose the module cache
  63140. /******/ __webpack_require__.c = installedModules;
  63141. /******/
  63142. /******/ // define getter function for harmony exports
  63143. /******/ __webpack_require__.d = function(exports, name, getter) {
  63144. /******/ if(!__webpack_require__.o(exports, name)) {
  63145. /******/ Object.defineProperty(exports, name, {
  63146. /******/ configurable: false,
  63147. /******/ enumerable: true,
  63148. /******/ get: getter
  63149. /******/ });
  63150. /******/ }
  63151. /******/ };
  63152. /******/
  63153. /******/ // getDefaultExport function for compatibility with non-harmony modules
  63154. /******/ __webpack_require__.n = function(module) {
  63155. /******/ var getter = module && module.__esModule ?
  63156. /******/ function getDefault() { return module['default']; } :
  63157. /******/ function getModuleExports() { return module; };
  63158. /******/ __webpack_require__.d(getter, 'a', getter);
  63159. /******/ return getter;
  63160. /******/ };
  63161. /******/
  63162. /******/ // Object.prototype.hasOwnProperty.call
  63163. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  63164. /******/
  63165. /******/ // __webpack_public_path__
  63166. /******/ __webpack_require__.p = "/dist/";
  63167. /******/
  63168. /******/ // Load entry module and return exports
  63169. /******/ return __webpack_require__(__webpack_require__.s = 259);
  63170. /******/ })
  63171. /************************************************************************/
  63172. /******/ ([
  63173. /* 0 */
  63174. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63175. "use strict";
  63176. /* harmony export (immutable) */ __webpack_exports__["a"] = normalizeComponent;
  63177. /* globals __VUE_SSR_CONTEXT__ */
  63178. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  63179. // This module is a runtime utility for cleaner component module output and will
  63180. // be included in the final webpack user bundle.
  63181. function normalizeComponent (
  63182. scriptExports,
  63183. render,
  63184. staticRenderFns,
  63185. functionalTemplate,
  63186. injectStyles,
  63187. scopeId,
  63188. moduleIdentifier, /* server only */
  63189. shadowMode /* vue-cli only */
  63190. ) {
  63191. scriptExports = scriptExports || {}
  63192. // ES6 modules interop
  63193. var type = typeof scriptExports.default
  63194. if (type === 'object' || type === 'function') {
  63195. scriptExports = scriptExports.default
  63196. }
  63197. // Vue.extend constructor export interop
  63198. var options = typeof scriptExports === 'function'
  63199. ? scriptExports.options
  63200. : scriptExports
  63201. // render functions
  63202. if (render) {
  63203. options.render = render
  63204. options.staticRenderFns = staticRenderFns
  63205. options._compiled = true
  63206. }
  63207. // functional template
  63208. if (functionalTemplate) {
  63209. options.functional = true
  63210. }
  63211. // scopedId
  63212. if (scopeId) {
  63213. options._scopeId = scopeId
  63214. }
  63215. var hook
  63216. if (moduleIdentifier) { // server build
  63217. hook = function (context) {
  63218. // 2.3 injection
  63219. context =
  63220. context || // cached call
  63221. (this.$vnode && this.$vnode.ssrContext) || // stateful
  63222. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  63223. // 2.2 with runInNewContext: true
  63224. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  63225. context = __VUE_SSR_CONTEXT__
  63226. }
  63227. // inject component styles
  63228. if (injectStyles) {
  63229. injectStyles.call(this, context)
  63230. }
  63231. // register component module identifier for async chunk inferrence
  63232. if (context && context._registeredComponents) {
  63233. context._registeredComponents.add(moduleIdentifier)
  63234. }
  63235. }
  63236. // used by ssr in case component is cached and beforeCreate
  63237. // never gets called
  63238. options._ssrRegister = hook
  63239. } else if (injectStyles) {
  63240. hook = shadowMode
  63241. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  63242. : injectStyles
  63243. }
  63244. if (hook) {
  63245. if (options.functional) {
  63246. // for template-only hot-reload because in that case the render fn doesn't
  63247. // go through the normalizer
  63248. options._injectStyles = hook
  63249. // register for functioal component in vue file
  63250. var originalRender = options.render
  63251. options.render = function renderWithStyleInjection (h, context) {
  63252. hook.call(context)
  63253. return originalRender(h, context)
  63254. }
  63255. } else {
  63256. // inject component registration as beforeCreate hook
  63257. var existing = options.beforeCreate
  63258. options.beforeCreate = existing
  63259. ? [].concat(existing, hook)
  63260. : [hook]
  63261. }
  63262. }
  63263. return {
  63264. exports: scriptExports,
  63265. options: options
  63266. }
  63267. }
  63268. /***/ }),
  63269. /* 1 */
  63270. /***/ (function(module, exports, __webpack_require__) {
  63271. "use strict";
  63272. exports.__esModule = true;
  63273. exports.default = function (innerThis, boundThis) {
  63274. if (innerThis !== boundThis) {
  63275. throw new TypeError("Cannot instantiate an arrow function");
  63276. }
  63277. };
  63278. /***/ }),
  63279. /* 2 */
  63280. /***/ (function(module, exports, __webpack_require__) {
  63281. "use strict";
  63282. exports.__esModule = true;
  63283. var _defineProperty = __webpack_require__(269);
  63284. var _defineProperty2 = _interopRequireDefault(_defineProperty);
  63285. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63286. exports.default = function (obj, key, value) {
  63287. if (key in obj) {
  63288. (0, _defineProperty2.default)(obj, key, {
  63289. value: value,
  63290. enumerable: true,
  63291. configurable: true,
  63292. writable: true
  63293. });
  63294. } else {
  63295. obj[key] = value;
  63296. }
  63297. return obj;
  63298. };
  63299. /***/ }),
  63300. /* 3 */
  63301. /***/ (function(module, exports, __webpack_require__) {
  63302. "use strict";
  63303. Object.defineProperty(exports, "__esModule", {
  63304. value: true
  63305. });
  63306. exports.sharpMatcherRegx = exports.dimensionMap = exports.findComponentUpward = exports.deepCopy = exports.firstUpperCase = exports.MutationObserver = undefined;
  63307. var _getIterator2 = __webpack_require__(45);
  63308. var _getIterator3 = _interopRequireDefault(_getIterator2);
  63309. var _newArrowCheck2 = __webpack_require__(1);
  63310. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  63311. exports.oneOf = oneOf;
  63312. exports.camelcaseToHyphen = camelcaseToHyphen;
  63313. exports.getScrollBarSize = getScrollBarSize;
  63314. exports.getStyle = getStyle;
  63315. exports.warnProp = warnProp;
  63316. exports.scrollTop = scrollTop;
  63317. exports.findComponentDownward = findComponentDownward;
  63318. exports.findComponentsDownward = findComponentsDownward;
  63319. exports.findComponentsUpward = findComponentsUpward;
  63320. exports.findBrothersComponents = findBrothersComponents;
  63321. exports.hasClass = hasClass;
  63322. exports.addClass = addClass;
  63323. exports.removeClass = removeClass;
  63324. exports.setMatchMedia = setMatchMedia;
  63325. var _vue = __webpack_require__(16);
  63326. var _vue2 = _interopRequireDefault(_vue);
  63327. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63328. var isServer = _vue2.default.prototype.$isServer;
  63329. function oneOf(value, validList) {
  63330. for (var i = 0; i < validList.length; i++) {
  63331. if (value === validList[i]) {
  63332. return true;
  63333. }
  63334. }
  63335. return false;
  63336. }
  63337. function camelcaseToHyphen(str) {
  63338. return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
  63339. }
  63340. var cached = void 0;
  63341. function getScrollBarSize(fresh) {
  63342. if (isServer) return 0;
  63343. if (fresh || cached === undefined) {
  63344. var inner = document.createElement('div');
  63345. inner.style.width = '100%';
  63346. inner.style.height = '200px';
  63347. var outer = document.createElement('div');
  63348. var outerStyle = outer.style;
  63349. outerStyle.position = 'absolute';
  63350. outerStyle.top = 0;
  63351. outerStyle.left = 0;
  63352. outerStyle.pointerEvents = 'none';
  63353. outerStyle.visibility = 'hidden';
  63354. outerStyle.width = '200px';
  63355. outerStyle.height = '150px';
  63356. outerStyle.overflow = 'hidden';
  63357. outer.appendChild(inner);
  63358. document.body.appendChild(outer);
  63359. var widthContained = inner.offsetWidth;
  63360. outer.style.overflow = 'scroll';
  63361. var widthScroll = inner.offsetWidth;
  63362. if (widthContained === widthScroll) {
  63363. widthScroll = outer.clientWidth;
  63364. }
  63365. document.body.removeChild(outer);
  63366. cached = widthContained - widthScroll;
  63367. }
  63368. return cached;
  63369. }
  63370. var MutationObserver = exports.MutationObserver = isServer ? false : window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
  63371. var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
  63372. var MOZ_HACK_REGEXP = /^moz([A-Z])/;
  63373. function camelCase(name) {
  63374. return name.replace(SPECIAL_CHARS_REGEXP, function (_, separator, letter, offset) {
  63375. return offset ? letter.toUpperCase() : letter;
  63376. }).replace(MOZ_HACK_REGEXP, 'Moz$1');
  63377. }
  63378. function getStyle(element, styleName) {
  63379. if (!element || !styleName) return null;
  63380. styleName = camelCase(styleName);
  63381. if (styleName === 'float') {
  63382. styleName = 'cssFloat';
  63383. }
  63384. try {
  63385. var computed = document.defaultView.getComputedStyle(element, '');
  63386. return element.style[styleName] || computed ? computed[styleName] : null;
  63387. } catch (e) {
  63388. return element.style[styleName];
  63389. }
  63390. }
  63391. function firstUpperCase(str) {
  63392. return str.toString()[0].toUpperCase() + str.toString().slice(1);
  63393. }
  63394. exports.firstUpperCase = firstUpperCase;
  63395. function warnProp(component, prop, correctType, wrongType) {
  63396. correctType = firstUpperCase(correctType);
  63397. wrongType = firstUpperCase(wrongType);
  63398. console.error('[iView warn]: Invalid prop: type check failed for prop ' + String(prop) + '. Expected ' + String(correctType) + ', got ' + String(wrongType) + '. (found in component: ' + String(component) + ')');
  63399. }
  63400. function typeOf(obj) {
  63401. var toString = Object.prototype.toString;
  63402. var map = {
  63403. '[object Boolean]': 'boolean',
  63404. '[object Number]': 'number',
  63405. '[object String]': 'string',
  63406. '[object Function]': 'function',
  63407. '[object Array]': 'array',
  63408. '[object Date]': 'date',
  63409. '[object RegExp]': 'regExp',
  63410. '[object Undefined]': 'undefined',
  63411. '[object Null]': 'null',
  63412. '[object Object]': 'object'
  63413. };
  63414. return map[toString.call(obj)];
  63415. }
  63416. function deepCopy(data) {
  63417. var t = typeOf(data);
  63418. var o = void 0;
  63419. if (t === 'array') {
  63420. o = [];
  63421. } else if (t === 'object') {
  63422. o = {};
  63423. } else {
  63424. return data;
  63425. }
  63426. if (t === 'array') {
  63427. for (var i = 0; i < data.length; i++) {
  63428. o.push(deepCopy(data[i]));
  63429. }
  63430. } else if (t === 'object') {
  63431. for (var _i in data) {
  63432. o[_i] = deepCopy(data[_i]);
  63433. }
  63434. }
  63435. return o;
  63436. }
  63437. exports.deepCopy = deepCopy;
  63438. function scrollTop(el) {
  63439. var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  63440. var to = arguments[2];
  63441. var duration = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 500;
  63442. var endCallback = arguments[4];
  63443. if (!window.requestAnimationFrame) {
  63444. window.requestAnimationFrame = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function (callback) {
  63445. return window.setTimeout(callback, 1000 / 60);
  63446. };
  63447. }
  63448. var difference = Math.abs(from - to);
  63449. var step = Math.ceil(difference / duration * 50);
  63450. function scroll(start, end, step) {
  63451. var _this = this;
  63452. if (start === end) {
  63453. endCallback && endCallback();
  63454. return;
  63455. }
  63456. var d = start + step > end ? end : start + step;
  63457. if (start > end) {
  63458. d = start - step < end ? end : start - step;
  63459. }
  63460. if (el === window) {
  63461. window.scrollTo(d, d);
  63462. } else {
  63463. el.scrollTop = d;
  63464. }
  63465. window.requestAnimationFrame(function () {
  63466. (0, _newArrowCheck3.default)(this, _this);
  63467. return scroll(d, end, step);
  63468. }.bind(this));
  63469. }
  63470. scroll(from, to, step);
  63471. }
  63472. function findComponentUpward(context, componentName, componentNames) {
  63473. if (typeof componentName === 'string') {
  63474. componentNames = [componentName];
  63475. } else {
  63476. componentNames = componentName;
  63477. }
  63478. var parent = context.$parent;
  63479. var name = parent.$options.name;
  63480. while (parent && (!name || componentNames.indexOf(name) < 0)) {
  63481. parent = parent.$parent;
  63482. if (parent) name = parent.$options.name;
  63483. }
  63484. return parent;
  63485. }
  63486. exports.findComponentUpward = findComponentUpward;
  63487. function findComponentDownward(context, componentName) {
  63488. var $children = context.$children;
  63489. var children = null;
  63490. if ($children.length) {
  63491. var _iteratorNormalCompletion = true;
  63492. var _didIteratorError = false;
  63493. var _iteratorError = undefined;
  63494. try {
  63495. for (var _iterator = (0, _getIterator3.default)($children), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  63496. var child = _step.value;
  63497. var name = child.$options.name;
  63498. if (name === componentName) {
  63499. children = child;
  63500. break;
  63501. } else {
  63502. children = findComponentDownward(child, componentName);
  63503. if (children) break;
  63504. }
  63505. }
  63506. } catch (err) {
  63507. _didIteratorError = true;
  63508. _iteratorError = err;
  63509. } finally {
  63510. try {
  63511. if (!_iteratorNormalCompletion && _iterator.return) {
  63512. _iterator.return();
  63513. }
  63514. } finally {
  63515. if (_didIteratorError) {
  63516. throw _iteratorError;
  63517. }
  63518. }
  63519. }
  63520. }
  63521. return children;
  63522. }
  63523. function findComponentsDownward(context, componentName) {
  63524. var _this2 = this;
  63525. return context.$children.reduce(function (components, child) {
  63526. (0, _newArrowCheck3.default)(this, _this2);
  63527. if (child.$options.name === componentName) components.push(child);
  63528. var foundChilds = findComponentsDownward(child, componentName);
  63529. return components.concat(foundChilds);
  63530. }.bind(this), []);
  63531. }
  63532. function findComponentsUpward(context, componentName) {
  63533. var parents = [];
  63534. var parent = context.$parent;
  63535. if (parent) {
  63536. if (parent.$options.name === componentName) parents.push(parent);
  63537. return parents.concat(findComponentsUpward(parent, componentName));
  63538. } else {
  63539. return [];
  63540. }
  63541. }
  63542. function findBrothersComponents(context, componentName) {
  63543. var _this3 = this;
  63544. var exceptMe = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  63545. var res = context.$parent.$children.filter(function (item) {
  63546. (0, _newArrowCheck3.default)(this, _this3);
  63547. return item.$options.name === componentName;
  63548. }.bind(this));
  63549. var index = res.findIndex(function (item) {
  63550. (0, _newArrowCheck3.default)(this, _this3);
  63551. return item._uid === context._uid;
  63552. }.bind(this));
  63553. if (exceptMe) res.splice(index, 1);
  63554. return res;
  63555. }
  63556. var trim = function trim(string) {
  63557. return (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
  63558. };
  63559. function hasClass(el, cls) {
  63560. if (!el || !cls) return false;
  63561. if (cls.indexOf(' ') !== -1) throw new Error('className should not contain space.');
  63562. if (el.classList) {
  63563. return el.classList.contains(cls);
  63564. } else {
  63565. return (' ' + el.className + ' ').indexOf(' ' + cls + ' ') > -1;
  63566. }
  63567. }
  63568. function addClass(el, cls) {
  63569. if (!el) return;
  63570. var curClass = el.className;
  63571. var classes = (cls || '').split(' ');
  63572. for (var i = 0, j = classes.length; i < j; i++) {
  63573. var clsName = classes[i];
  63574. if (!clsName) continue;
  63575. if (el.classList) {
  63576. el.classList.add(clsName);
  63577. } else {
  63578. if (!hasClass(el, clsName)) {
  63579. curClass += ' ' + clsName;
  63580. }
  63581. }
  63582. }
  63583. if (!el.classList) {
  63584. el.className = curClass;
  63585. }
  63586. }
  63587. function removeClass(el, cls) {
  63588. if (!el || !cls) return;
  63589. var classes = cls.split(' ');
  63590. var curClass = ' ' + el.className + ' ';
  63591. for (var i = 0, j = classes.length; i < j; i++) {
  63592. var clsName = classes[i];
  63593. if (!clsName) continue;
  63594. if (el.classList) {
  63595. el.classList.remove(clsName);
  63596. } else {
  63597. if (hasClass(el, clsName)) {
  63598. curClass = curClass.replace(' ' + clsName + ' ', ' ');
  63599. }
  63600. }
  63601. }
  63602. if (!el.classList) {
  63603. el.className = trim(curClass);
  63604. }
  63605. }
  63606. var dimensionMap = exports.dimensionMap = {
  63607. xs: '480px',
  63608. sm: '576px',
  63609. md: '768px',
  63610. lg: '992px',
  63611. xl: '1200px',
  63612. xxl: '1600px'
  63613. };
  63614. function setMatchMedia() {
  63615. var _this4 = this;
  63616. if (typeof window !== 'undefined') {
  63617. var matchMediaPolyfill = function (mediaQuery) {
  63618. (0, _newArrowCheck3.default)(this, _this4);
  63619. return {
  63620. media: mediaQuery,
  63621. matches: false,
  63622. on: function on() {},
  63623. off: function off() {}
  63624. };
  63625. }.bind(this);
  63626. window.matchMedia = window.matchMedia || matchMediaPolyfill;
  63627. }
  63628. }
  63629. var sharpMatcherRegx = exports.sharpMatcherRegx = /#([^#]+)$/;
  63630. /***/ }),
  63631. /* 4 */
  63632. /***/ (function(module, exports, __webpack_require__) {
  63633. "use strict";
  63634. Object.defineProperty(exports, "__esModule", {
  63635. value: true
  63636. });
  63637. var _newArrowCheck2 = __webpack_require__(1);
  63638. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  63639. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63640. function _broadcast(componentName, eventName, params) {
  63641. var _this = this;
  63642. this.$children.forEach(function (child) {
  63643. (0, _newArrowCheck3.default)(this, _this);
  63644. var name = child.$options.name;
  63645. if (name === componentName) {
  63646. child.$emit.apply(child, [eventName].concat(params));
  63647. } else {
  63648. _broadcast.apply(child, [componentName, eventName].concat([params]));
  63649. }
  63650. }.bind(this));
  63651. }
  63652. exports.default = {
  63653. methods: {
  63654. dispatch: function dispatch(componentName, eventName, params) {
  63655. var parent = this.$parent || this.$root;
  63656. var name = parent.$options.name;
  63657. while (parent && (!name || name !== componentName)) {
  63658. parent = parent.$parent;
  63659. if (parent) {
  63660. name = parent.$options.name;
  63661. }
  63662. }
  63663. if (parent) {
  63664. parent.$emit.apply(parent, [eventName].concat(params));
  63665. }
  63666. },
  63667. broadcast: function broadcast(componentName, eventName, params) {
  63668. _broadcast.call(this, componentName, eventName, params);
  63669. }
  63670. }
  63671. };
  63672. /***/ }),
  63673. /* 5 */
  63674. /***/ (function(module, exports) {
  63675. var core = module.exports = { version: '2.6.9' };
  63676. if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  63677. /***/ }),
  63678. /* 6 */
  63679. /***/ (function(module, exports, __webpack_require__) {
  63680. "use strict";
  63681. Object.defineProperty(exports, "__esModule", {
  63682. value: true
  63683. });
  63684. var _locale = __webpack_require__(120);
  63685. exports.default = {
  63686. methods: {
  63687. t: function t() {
  63688. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  63689. args[_key] = arguments[_key];
  63690. }
  63691. return _locale.t.apply(this, args);
  63692. }
  63693. }
  63694. };
  63695. /***/ }),
  63696. /* 7 */
  63697. /***/ (function(module, exports, __webpack_require__) {
  63698. var global = __webpack_require__(9);
  63699. var core = __webpack_require__(5);
  63700. var ctx = __webpack_require__(24);
  63701. var hide = __webpack_require__(25);
  63702. var has = __webpack_require__(30);
  63703. var PROTOTYPE = 'prototype';
  63704. var $export = function (type, name, source) {
  63705. var IS_FORCED = type & $export.F;
  63706. var IS_GLOBAL = type & $export.G;
  63707. var IS_STATIC = type & $export.S;
  63708. var IS_PROTO = type & $export.P;
  63709. var IS_BIND = type & $export.B;
  63710. var IS_WRAP = type & $export.W;
  63711. var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  63712. var expProto = exports[PROTOTYPE];
  63713. var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  63714. var key, own, out;
  63715. if (IS_GLOBAL) source = name;
  63716. for (key in source) {
  63717. // contains in native
  63718. own = !IS_FORCED && target && target[key] !== undefined;
  63719. if (own && has(exports, key)) continue;
  63720. // export native or passed
  63721. out = own ? target[key] : source[key];
  63722. // prevent global pollution for namespaces
  63723. exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
  63724. // bind timers to global for call from export context
  63725. : IS_BIND && own ? ctx(out, global)
  63726. // wrap global constructors for prevent change them in library
  63727. : IS_WRAP && target[key] == out ? (function (C) {
  63728. var F = function (a, b, c) {
  63729. if (this instanceof C) {
  63730. switch (arguments.length) {
  63731. case 0: return new C();
  63732. case 1: return new C(a);
  63733. case 2: return new C(a, b);
  63734. } return new C(a, b, c);
  63735. } return C.apply(this, arguments);
  63736. };
  63737. F[PROTOTYPE] = C[PROTOTYPE];
  63738. return F;
  63739. // make static versions for prototype methods
  63740. })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
  63741. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  63742. if (IS_PROTO) {
  63743. (exports.virtual || (exports.virtual = {}))[key] = out;
  63744. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  63745. if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
  63746. }
  63747. }
  63748. };
  63749. // type bitmap
  63750. $export.F = 1; // forced
  63751. $export.G = 2; // global
  63752. $export.S = 4; // static
  63753. $export.P = 8; // proto
  63754. $export.B = 16; // bind
  63755. $export.W = 32; // wrap
  63756. $export.U = 64; // safe
  63757. $export.R = 128; // real proto method for `library`
  63758. module.exports = $export;
  63759. /***/ }),
  63760. /* 8 */
  63761. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  63762. "use strict";
  63763. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  63764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__ = __webpack_require__(101);
  63765. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__);
  63766. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  63767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__ = __webpack_require__(275);
  63768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__);
  63769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  63770. /* script */
  63771. /* template */
  63772. /* template functional */
  63773. var __vue_template_functional__ = false
  63774. /* styles */
  63775. var __vue_styles__ = null
  63776. /* scopeId */
  63777. var __vue_scopeId__ = null
  63778. /* moduleIdentifier (server only) */
  63779. var __vue_module_identifier__ = null
  63780. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  63781. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_icon_vue___default.a,
  63782. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__["render"],
  63783. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8ab195dc_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_icon_vue__["staticRenderFns"],
  63784. __vue_template_functional__,
  63785. __vue_styles__,
  63786. __vue_scopeId__,
  63787. __vue_module_identifier__
  63788. )
  63789. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  63790. /***/ }),
  63791. /* 9 */
  63792. /***/ (function(module, exports) {
  63793. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  63794. var global = module.exports = typeof window != 'undefined' && window.Math == Math
  63795. ? window : typeof self != 'undefined' && self.Math == Math ? self
  63796. // eslint-disable-next-line no-new-func
  63797. : Function('return this')();
  63798. if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  63799. /***/ }),
  63800. /* 10 */
  63801. /***/ (function(module, exports, __webpack_require__) {
  63802. var store = __webpack_require__(67)('wks');
  63803. var uid = __webpack_require__(53);
  63804. var Symbol = __webpack_require__(9).Symbol;
  63805. var USE_SYMBOL = typeof Symbol == 'function';
  63806. var $exports = module.exports = function (name) {
  63807. return store[name] || (store[name] =
  63808. USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
  63809. };
  63810. $exports.store = store;
  63811. /***/ }),
  63812. /* 11 */
  63813. /***/ (function(module, exports, __webpack_require__) {
  63814. "use strict";
  63815. Object.defineProperty(exports, "__esModule", {
  63816. value: true
  63817. });
  63818. exports.default = {
  63819. inject: {
  63820. FormInstance: {
  63821. default: ''
  63822. }
  63823. },
  63824. computed: {
  63825. itemDisabled: function itemDisabled() {
  63826. var state = this.disabled;
  63827. if (!state && this.FormInstance) state = this.FormInstance.disabled;
  63828. return state;
  63829. }
  63830. }
  63831. };
  63832. /***/ }),
  63833. /* 12 */
  63834. /***/ (function(module, exports, __webpack_require__) {
  63835. "use strict";
  63836. Object.defineProperty(exports, "__esModule", {
  63837. value: true
  63838. });
  63839. exports.off = exports.on = undefined;
  63840. var _vue = __webpack_require__(16);
  63841. var _vue2 = _interopRequireDefault(_vue);
  63842. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63843. var isServer = _vue2.default.prototype.$isServer;
  63844. var on = exports.on = function () {
  63845. if (!isServer && document.addEventListener) {
  63846. return function (element, event, handler) {
  63847. var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  63848. if (element && event && handler) {
  63849. element.addEventListener(event, handler, useCapture);
  63850. }
  63851. };
  63852. } else {
  63853. return function (element, event, handler) {
  63854. if (element && event && handler) {
  63855. element.attachEvent('on' + event, handler);
  63856. }
  63857. };
  63858. }
  63859. }();
  63860. var off = exports.off = function () {
  63861. if (!isServer && document.removeEventListener) {
  63862. return function (element, event, handler) {
  63863. var useCapture = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  63864. if (element && event) {
  63865. element.removeEventListener(event, handler, useCapture);
  63866. }
  63867. };
  63868. } else {
  63869. return function (element, event, handler) {
  63870. if (element && event) {
  63871. element.detachEvent('on' + event, handler);
  63872. }
  63873. };
  63874. }
  63875. }();
  63876. /***/ }),
  63877. /* 13 */
  63878. /***/ (function(module, exports, __webpack_require__) {
  63879. // Thank's IE8 for his funny defineProperty
  63880. module.exports = !__webpack_require__(31)(function () {
  63881. return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  63882. });
  63883. /***/ }),
  63884. /* 14 */
  63885. /***/ (function(module, exports, __webpack_require__) {
  63886. var anObject = __webpack_require__(22);
  63887. var IE8_DOM_DEFINE = __webpack_require__(98);
  63888. var toPrimitive = __webpack_require__(70);
  63889. var dP = Object.defineProperty;
  63890. exports.f = __webpack_require__(13) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
  63891. anObject(O);
  63892. P = toPrimitive(P, true);
  63893. anObject(Attributes);
  63894. if (IE8_DOM_DEFINE) try {
  63895. return dP(O, P, Attributes);
  63896. } catch (e) { /* empty */ }
  63897. if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  63898. if ('value' in Attributes) O[P] = Attributes.value;
  63899. return O;
  63900. };
  63901. /***/ }),
  63902. /* 15 */
  63903. /***/ (function(module, exports, __webpack_require__) {
  63904. module.exports = { "default": __webpack_require__(264), __esModule: true };
  63905. /***/ }),
  63906. /* 16 */
  63907. /***/ (function(module, exports) {
  63908. module.exports = __WEBPACK_EXTERNAL_MODULE_16__;
  63909. /***/ }),
  63910. /* 17 */
  63911. /***/ (function(module, exports, __webpack_require__) {
  63912. "use strict";
  63913. exports.__esModule = true;
  63914. var _from = __webpack_require__(111);
  63915. var _from2 = _interopRequireDefault(_from);
  63916. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63917. exports.default = function (arr) {
  63918. if (Array.isArray(arr)) {
  63919. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
  63920. arr2[i] = arr[i];
  63921. }
  63922. return arr2;
  63923. } else {
  63924. return (0, _from2.default)(arr);
  63925. }
  63926. };
  63927. /***/ }),
  63928. /* 18 */
  63929. /***/ (function(module, exports) {
  63930. module.exports = function (it) {
  63931. return typeof it === 'object' ? it !== null : typeof it === 'function';
  63932. };
  63933. /***/ }),
  63934. /* 19 */
  63935. /***/ (function(module, exports, __webpack_require__) {
  63936. "use strict";
  63937. Object.defineProperty(exports, "__esModule", {
  63938. value: true
  63939. });
  63940. var _icon = __webpack_require__(8);
  63941. var _icon2 = _interopRequireDefault(_icon);
  63942. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63943. exports.default = _icon2.default;
  63944. /***/ }),
  63945. /* 20 */
  63946. /***/ (function(module, exports, __webpack_require__) {
  63947. "use strict";
  63948. Object.defineProperty(exports, "__esModule", {
  63949. value: true
  63950. });
  63951. exports.TYPE_VALUE_RESOLVER_MAP = exports.DEFAULT_FORMATS = exports.formatDateLabels = exports.initTimeDate = exports.nextMonth = exports.prevMonth = exports.siblingMonth = exports.getFirstDayOfMonth = exports.getDayCountOfMonth = exports.parseDate = exports.formatDate = exports.isInRange = exports.clearHours = exports.toDate = undefined;
  63952. var _slicedToArray2 = __webpack_require__(26);
  63953. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  63954. var _newArrowCheck2 = __webpack_require__(1);
  63955. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  63956. var _toConsumableArray2 = __webpack_require__(17);
  63957. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  63958. var _date2 = __webpack_require__(407);
  63959. var _date3 = _interopRequireDefault(_date2);
  63960. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  63961. var toDate = exports.toDate = function toDate(date) {
  63962. var _date = new Date(date);
  63963. if (isNaN(_date.getTime()) && typeof date === 'string') {
  63964. _date = date.split('-').map(Number);
  63965. _date[1] += 1;
  63966. _date = new (Function.prototype.bind.apply(Date, [null].concat((0, _toConsumableArray3.default)(_date))))();
  63967. }
  63968. if (isNaN(_date.getTime())) return null;
  63969. return _date;
  63970. };
  63971. var clearHours = exports.clearHours = function clearHours(time) {
  63972. var cloneDate = new Date(time);
  63973. cloneDate.setHours(0, 0, 0, 0);
  63974. return cloneDate.getTime();
  63975. };
  63976. var isInRange = exports.isInRange = function (time, a, b) {
  63977. (0, _newArrowCheck3.default)(undefined, undefined);
  63978. if (!a || !b) return false;
  63979. var _sort = [a, b].sort(),
  63980. _sort2 = (0, _slicedToArray3.default)(_sort, 2),
  63981. start = _sort2[0],
  63982. end = _sort2[1];
  63983. return time >= start && time <= end;
  63984. }.bind(undefined);
  63985. var formatDate = exports.formatDate = function formatDate(date, format) {
  63986. date = toDate(date);
  63987. if (!date) return '';
  63988. return _date3.default.format(date, format || 'yyyy-MM-dd');
  63989. };
  63990. var parseDate = exports.parseDate = function parseDate(string, format) {
  63991. return _date3.default.parse(string, format || 'yyyy-MM-dd');
  63992. };
  63993. var getDayCountOfMonth = exports.getDayCountOfMonth = function getDayCountOfMonth(year, month) {
  63994. return new Date(year, month + 1, 0).getDate();
  63995. };
  63996. var getFirstDayOfMonth = exports.getFirstDayOfMonth = function getFirstDayOfMonth(date) {
  63997. var temp = new Date(date.getTime());
  63998. temp.setDate(1);
  63999. return temp.getDay();
  64000. };
  64001. var siblingMonth = exports.siblingMonth = function siblingMonth(src, diff) {
  64002. var temp = new Date(src);
  64003. var newMonth = temp.getMonth() + diff;
  64004. var newMonthDayCount = getDayCountOfMonth(temp.getFullYear(), newMonth);
  64005. if (newMonthDayCount < temp.getDate()) {
  64006. temp.setDate(newMonthDayCount);
  64007. }
  64008. temp.setMonth(newMonth);
  64009. return temp;
  64010. };
  64011. var prevMonth = exports.prevMonth = function prevMonth(src) {
  64012. return siblingMonth(src, -1);
  64013. };
  64014. var nextMonth = exports.nextMonth = function nextMonth(src) {
  64015. return siblingMonth(src, 1);
  64016. };
  64017. var initTimeDate = exports.initTimeDate = function initTimeDate() {
  64018. var date = new Date();
  64019. date.setHours(0);
  64020. date.setMinutes(0);
  64021. date.setSeconds(0);
  64022. return date;
  64023. };
  64024. var formatDateLabels = exports.formatDateLabels = function () {
  64025. var _this = this;
  64026. var formats = {
  64027. yyyy: function yyyy(date) {
  64028. (0, _newArrowCheck3.default)(this, _this);
  64029. return date.getFullYear();
  64030. }.bind(this),
  64031. m: function m(date) {
  64032. (0, _newArrowCheck3.default)(this, _this);
  64033. return date.getMonth() + 1;
  64034. }.bind(this),
  64035. mm: function mm(date) {
  64036. (0, _newArrowCheck3.default)(this, _this);
  64037. return ('0' + (date.getMonth() + 1)).slice(-2);
  64038. }.bind(this),
  64039. mmm: function mmm(date, locale) {
  64040. (0, _newArrowCheck3.default)(this, _this);
  64041. var monthName = date.toLocaleDateString(locale, {
  64042. month: 'long'
  64043. });
  64044. return monthName.slice(0, 3);
  64045. }.bind(this),
  64046. Mmm: function Mmm(date, locale) {
  64047. (0, _newArrowCheck3.default)(this, _this);
  64048. var monthName = date.toLocaleDateString(locale, {
  64049. month: 'long'
  64050. });
  64051. return (monthName[0].toUpperCase() + monthName.slice(1).toLowerCase()).slice(0, 3);
  64052. }.bind(this),
  64053. mmmm: function mmmm(date, locale) {
  64054. (0, _newArrowCheck3.default)(this, _this);
  64055. return date.toLocaleDateString(locale, {
  64056. month: 'long'
  64057. });
  64058. }.bind(this),
  64059. Mmmm: function Mmmm(date, locale) {
  64060. (0, _newArrowCheck3.default)(this, _this);
  64061. var monthName = date.toLocaleDateString(locale, {
  64062. month: 'long'
  64063. });
  64064. return monthName[0].toUpperCase() + monthName.slice(1).toLowerCase();
  64065. }.bind(this)
  64066. };
  64067. var formatRegex = new RegExp(['yyyy', 'Mmmm', 'mmmm', 'Mmm', 'mmm', 'mm', 'm'].join('|'), 'g');
  64068. return function (locale, format, date) {
  64069. var _this2 = this;
  64070. var componetsRegex = /(\[[^\]]+\])([^\[\]]+)(\[[^\]]+\])/;
  64071. var components = format.match(componetsRegex).slice(1);
  64072. var separator = components[1];
  64073. var labels = [components[0], components[2]].map(function (component) {
  64074. (0, _newArrowCheck3.default)(this, _this2);
  64075. var label = component.replace(/\[[^\]]+\]/, function (str) {
  64076. (0, _newArrowCheck3.default)(this, _this2);
  64077. return str.slice(1, -1).replace(formatRegex, function (match) {
  64078. (0, _newArrowCheck3.default)(this, _this2);
  64079. return formats[match](date, locale);
  64080. }.bind(this));
  64081. }.bind(this));
  64082. return {
  64083. label: label,
  64084. type: component.indexOf('yy') != -1 ? 'year' : 'month'
  64085. };
  64086. }.bind(this));
  64087. return {
  64088. separator: separator,
  64089. labels: labels
  64090. };
  64091. };
  64092. }();
  64093. var DEFAULT_FORMATS = exports.DEFAULT_FORMATS = {
  64094. date: 'yyyy-MM-dd',
  64095. month: 'yyyy-MM',
  64096. year: 'yyyy',
  64097. datetime: 'yyyy-MM-dd HH:mm:ss',
  64098. time: 'HH:mm:ss',
  64099. timerange: 'HH:mm:ss',
  64100. daterange: 'yyyy-MM-dd',
  64101. datetimerange: 'yyyy-MM-dd HH:mm:ss'
  64102. };
  64103. var DATE_FORMATTER = function DATE_FORMATTER(value, format) {
  64104. return formatDate(value, format);
  64105. };
  64106. var DATE_PARSER = function DATE_PARSER(text, format) {
  64107. return parseDate(text, format);
  64108. };
  64109. var RANGE_FORMATTER = function RANGE_FORMATTER(value, format, RANGE_SEPARATOR) {
  64110. if (Array.isArray(value) && value.length === 2) {
  64111. var start = value[0];
  64112. var end = value[1];
  64113. if (start && end) {
  64114. return formatDate(start, format) + RANGE_SEPARATOR + formatDate(end, format);
  64115. }
  64116. } else if (!Array.isArray(value) && value instanceof Date) {
  64117. return formatDate(value, format);
  64118. }
  64119. return '';
  64120. };
  64121. var RANGE_PARSER = function RANGE_PARSER(text, format, RANGE_SEPARATOR) {
  64122. var array = Array.isArray(text) ? text : text.split(RANGE_SEPARATOR);
  64123. if (array.length === 2) {
  64124. var range1 = array[0];
  64125. var range2 = array[1];
  64126. return [range1 instanceof Date ? range1 : parseDate(range1, format), range2 instanceof Date ? range2 : parseDate(range2, format)];
  64127. }
  64128. return [];
  64129. };
  64130. var TYPE_VALUE_RESOLVER_MAP = exports.TYPE_VALUE_RESOLVER_MAP = {
  64131. default: {
  64132. formatter: function formatter(value) {
  64133. if (!value) return '';
  64134. return '' + value;
  64135. },
  64136. parser: function parser(text) {
  64137. if (text === undefined || text === '') return null;
  64138. return text;
  64139. }
  64140. },
  64141. date: {
  64142. formatter: DATE_FORMATTER,
  64143. parser: DATE_PARSER
  64144. },
  64145. datetime: {
  64146. formatter: DATE_FORMATTER,
  64147. parser: DATE_PARSER
  64148. },
  64149. daterange: {
  64150. formatter: RANGE_FORMATTER,
  64151. parser: RANGE_PARSER
  64152. },
  64153. datetimerange: {
  64154. formatter: RANGE_FORMATTER,
  64155. parser: RANGE_PARSER
  64156. },
  64157. timerange: {
  64158. formatter: RANGE_FORMATTER,
  64159. parser: RANGE_PARSER
  64160. },
  64161. time: {
  64162. formatter: DATE_FORMATTER,
  64163. parser: DATE_PARSER
  64164. },
  64165. month: {
  64166. formatter: DATE_FORMATTER,
  64167. parser: DATE_PARSER
  64168. },
  64169. year: {
  64170. formatter: DATE_FORMATTER,
  64171. parser: DATE_PARSER
  64172. },
  64173. multiple: {
  64174. formatter: function formatter(value, format) {
  64175. (0, _newArrowCheck3.default)(undefined, undefined);
  64176. return value.filter(Boolean).map(function (date) {
  64177. (0, _newArrowCheck3.default)(undefined, undefined);
  64178. return formatDate(date, format);
  64179. }.bind(undefined)).join(',');
  64180. }.bind(undefined),
  64181. parser: function parser(value, format) {
  64182. (0, _newArrowCheck3.default)(undefined, undefined);
  64183. var values = typeof value === 'string' ? value.split(',') : value;
  64184. return values.map(function (value) {
  64185. (0, _newArrowCheck3.default)(undefined, undefined);
  64186. if (value instanceof Date) return value;
  64187. if (typeof value === 'string') value = value.trim();else if (typeof value !== 'number' && !value) value = '';
  64188. return parseDate(value, format);
  64189. }.bind(undefined));
  64190. }.bind(undefined)
  64191. },
  64192. number: {
  64193. formatter: function formatter(value) {
  64194. if (!value) return '';
  64195. return '' + value;
  64196. },
  64197. parser: function parser(text) {
  64198. var result = Number(text);
  64199. if (!isNaN(text)) {
  64200. return result;
  64201. } else {
  64202. return null;
  64203. }
  64204. }
  64205. }
  64206. };
  64207. /***/ }),
  64208. /* 21 */
  64209. /***/ (function(module, exports, __webpack_require__) {
  64210. module.exports = { "default": __webpack_require__(260), __esModule: true };
  64211. /***/ }),
  64212. /* 22 */
  64213. /***/ (function(module, exports, __webpack_require__) {
  64214. var isObject = __webpack_require__(18);
  64215. module.exports = function (it) {
  64216. if (!isObject(it)) throw TypeError(it + ' is not an object!');
  64217. return it;
  64218. };
  64219. /***/ }),
  64220. /* 23 */
  64221. /***/ (function(module, exports, __webpack_require__) {
  64222. "use strict";
  64223. Object.defineProperty(exports, "__esModule", {
  64224. value: true
  64225. });
  64226. var _assign = __webpack_require__(15);
  64227. var _assign2 = _interopRequireDefault(_assign);
  64228. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64229. function getTarget(node) {
  64230. if (node === void 0) {
  64231. node = document.body;
  64232. }
  64233. if (node === true) {
  64234. return document.body;
  64235. }
  64236. return node instanceof window.Node ? node : document.querySelector(node);
  64237. }
  64238. var directive = {
  64239. inserted: function inserted(el, _ref, vnode) {
  64240. var value = _ref.value;
  64241. if (el.dataset && el.dataset.transfer !== 'true') return false;
  64242. el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
  64243. var parentNode = el.parentNode;
  64244. if (!parentNode) return;
  64245. var home = document.createComment('');
  64246. var hasMovedOut = false;
  64247. if (value !== false) {
  64248. parentNode.replaceChild(home, el);
  64249. getTarget(value).appendChild(el);
  64250. hasMovedOut = true;
  64251. }
  64252. if (!el.__transferDomData) {
  64253. el.__transferDomData = {
  64254. parentNode: parentNode,
  64255. home: home,
  64256. target: getTarget(value),
  64257. hasMovedOut: hasMovedOut
  64258. };
  64259. }
  64260. },
  64261. componentUpdated: function componentUpdated(el, _ref2) {
  64262. var value = _ref2.value;
  64263. if (el.dataset && el.dataset.transfer !== 'true') return false;
  64264. var ref$1 = el.__transferDomData;
  64265. if (!ref$1) return;
  64266. var parentNode = ref$1.parentNode;
  64267. var home = ref$1.home;
  64268. var hasMovedOut = ref$1.hasMovedOut;
  64269. if (!hasMovedOut && value) {
  64270. parentNode.replaceChild(home, el);
  64271. getTarget(value).appendChild(el);
  64272. el.__transferDomData = (0, _assign2.default)({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
  64273. } else if (hasMovedOut && value === false) {
  64274. parentNode.replaceChild(el, home);
  64275. el.__transferDomData = (0, _assign2.default)({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
  64276. } else if (value) {
  64277. getTarget(value).appendChild(el);
  64278. }
  64279. },
  64280. unbind: function unbind(el) {
  64281. if (el.dataset && el.dataset.transfer !== 'true') return false;
  64282. el.className = el.className.replace('v-transfer-dom', '');
  64283. var ref$1 = el.__transferDomData;
  64284. if (!ref$1) return;
  64285. if (el.__transferDomData.hasMovedOut === true) {
  64286. el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el);
  64287. }
  64288. el.__transferDomData = null;
  64289. }
  64290. };
  64291. exports.default = directive;
  64292. /***/ }),
  64293. /* 24 */
  64294. /***/ (function(module, exports, __webpack_require__) {
  64295. // optional / simple context binding
  64296. var aFunction = __webpack_require__(43);
  64297. module.exports = function (fn, that, length) {
  64298. aFunction(fn);
  64299. if (that === undefined) return fn;
  64300. switch (length) {
  64301. case 1: return function (a) {
  64302. return fn.call(that, a);
  64303. };
  64304. case 2: return function (a, b) {
  64305. return fn.call(that, a, b);
  64306. };
  64307. case 3: return function (a, b, c) {
  64308. return fn.call(that, a, b, c);
  64309. };
  64310. }
  64311. return function (/* ...args */) {
  64312. return fn.apply(that, arguments);
  64313. };
  64314. };
  64315. /***/ }),
  64316. /* 25 */
  64317. /***/ (function(module, exports, __webpack_require__) {
  64318. var dP = __webpack_require__(14);
  64319. var createDesc = __webpack_require__(44);
  64320. module.exports = __webpack_require__(13) ? function (object, key, value) {
  64321. return dP.f(object, key, createDesc(1, value));
  64322. } : function (object, key, value) {
  64323. object[key] = value;
  64324. return object;
  64325. };
  64326. /***/ }),
  64327. /* 26 */
  64328. /***/ (function(module, exports, __webpack_require__) {
  64329. "use strict";
  64330. exports.__esModule = true;
  64331. var _isIterable2 = __webpack_require__(291);
  64332. var _isIterable3 = _interopRequireDefault(_isIterable2);
  64333. var _getIterator2 = __webpack_require__(45);
  64334. var _getIterator3 = _interopRequireDefault(_getIterator2);
  64335. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64336. exports.default = function () {
  64337. function sliceIterator(arr, i) {
  64338. var _arr = [];
  64339. var _n = true;
  64340. var _d = false;
  64341. var _e = undefined;
  64342. try {
  64343. for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {
  64344. _arr.push(_s.value);
  64345. if (i && _arr.length === i) break;
  64346. }
  64347. } catch (err) {
  64348. _d = true;
  64349. _e = err;
  64350. } finally {
  64351. try {
  64352. if (!_n && _i["return"]) _i["return"]();
  64353. } finally {
  64354. if (_d) throw _e;
  64355. }
  64356. }
  64357. return _arr;
  64358. }
  64359. return function (arr, i) {
  64360. if (Array.isArray(arr)) {
  64361. return arr;
  64362. } else if ((0, _isIterable3.default)(Object(arr))) {
  64363. return sliceIterator(arr, i);
  64364. } else {
  64365. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  64366. }
  64367. };
  64368. }();
  64369. /***/ }),
  64370. /* 27 */
  64371. /***/ (function(module, exports, __webpack_require__) {
  64372. "use strict";
  64373. exports.__esModule = true;
  64374. var _iterator = __webpack_require__(301);
  64375. var _iterator2 = _interopRequireDefault(_iterator);
  64376. var _symbol = __webpack_require__(303);
  64377. var _symbol2 = _interopRequireDefault(_symbol);
  64378. var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
  64379. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64380. exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
  64381. return typeof obj === "undefined" ? "undefined" : _typeof(obj);
  64382. } : function (obj) {
  64383. return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
  64384. };
  64385. /***/ }),
  64386. /* 28 */
  64387. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64388. "use strict";
  64389. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  64390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__ = __webpack_require__(131);
  64391. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__);
  64392. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  64393. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__ = __webpack_require__(355);
  64394. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__);
  64395. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  64396. /* script */
  64397. /* template */
  64398. /* template functional */
  64399. var __vue_template_functional__ = false
  64400. /* styles */
  64401. var __vue_styles__ = null
  64402. /* scopeId */
  64403. var __vue_scopeId__ = null
  64404. /* moduleIdentifier (server only) */
  64405. var __vue_module_identifier__ = null
  64406. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  64407. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_vue___default.a,
  64408. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__["render"],
  64409. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9c2aeb5c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_vue__["staticRenderFns"],
  64410. __vue_template_functional__,
  64411. __vue_styles__,
  64412. __vue_scopeId__,
  64413. __vue_module_identifier__
  64414. )
  64415. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  64416. /***/ }),
  64417. /* 29 */
  64418. /***/ (function(module, exports, __webpack_require__) {
  64419. // 7.1.13 ToObject(argument)
  64420. var defined = __webpack_require__(63);
  64421. module.exports = function (it) {
  64422. return Object(defined(it));
  64423. };
  64424. /***/ }),
  64425. /* 30 */
  64426. /***/ (function(module, exports) {
  64427. var hasOwnProperty = {}.hasOwnProperty;
  64428. module.exports = function (it, key) {
  64429. return hasOwnProperty.call(it, key);
  64430. };
  64431. /***/ }),
  64432. /* 31 */
  64433. /***/ (function(module, exports) {
  64434. module.exports = function (exec) {
  64435. try {
  64436. return !!exec();
  64437. } catch (e) {
  64438. return true;
  64439. }
  64440. };
  64441. /***/ }),
  64442. /* 32 */
  64443. /***/ (function(module, exports, __webpack_require__) {
  64444. "use strict";
  64445. exports.__esModule = true;
  64446. var _assign = __webpack_require__(15);
  64447. var _assign2 = _interopRequireDefault(_assign);
  64448. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64449. exports.default = _assign2.default || function (target) {
  64450. for (var i = 1; i < arguments.length; i++) {
  64451. var source = arguments[i];
  64452. for (var key in source) {
  64453. if (Object.prototype.hasOwnProperty.call(source, key)) {
  64454. target[key] = source[key];
  64455. }
  64456. }
  64457. }
  64458. return target;
  64459. };
  64460. /***/ }),
  64461. /* 33 */
  64462. /***/ (function(module, exports, __webpack_require__) {
  64463. // to indexed object, toObject with fallback for non-array-like ES3 strings
  64464. var IObject = __webpack_require__(64);
  64465. var defined = __webpack_require__(63);
  64466. module.exports = function (it) {
  64467. return IObject(defined(it));
  64468. };
  64469. /***/ }),
  64470. /* 34 */
  64471. /***/ (function(module, exports) {
  64472. module.exports = {};
  64473. /***/ }),
  64474. /* 35 */
  64475. /***/ (function(module, exports, __webpack_require__) {
  64476. "use strict";
  64477. var $at = __webpack_require__(280)(true);
  64478. // 21.1.3.27 String.prototype[@@iterator]()
  64479. __webpack_require__(72)(String, 'String', function (iterated) {
  64480. this._t = String(iterated); // target
  64481. this._i = 0; // next index
  64482. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  64483. }, function () {
  64484. var O = this._t;
  64485. var index = this._i;
  64486. var point;
  64487. if (index >= O.length) return { value: undefined, done: true };
  64488. point = $at(O, index);
  64489. this._i += point.length;
  64490. return { value: point, done: false };
  64491. });
  64492. /***/ }),
  64493. /* 36 */
  64494. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64495. "use strict";
  64496. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  64497. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__ = __webpack_require__(115);
  64498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__);
  64499. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  64500. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__ = __webpack_require__(300);
  64501. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__);
  64502. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  64503. /* script */
  64504. /* template */
  64505. /* template functional */
  64506. var __vue_template_functional__ = false
  64507. /* styles */
  64508. var __vue_styles__ = null
  64509. /* scopeId */
  64510. var __vue_scopeId__ = null
  64511. /* moduleIdentifier (server only) */
  64512. var __vue_module_identifier__ = null
  64513. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  64514. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default.a,
  64515. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["render"],
  64516. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6cd7d5ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["staticRenderFns"],
  64517. __vue_template_functional__,
  64518. __vue_styles__,
  64519. __vue_scopeId__,
  64520. __vue_module_identifier__
  64521. )
  64522. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  64523. /***/ }),
  64524. /* 37 */
  64525. /***/ (function(module, exports, __webpack_require__) {
  64526. "use strict";
  64527. Object.defineProperty(exports, "__esModule", {
  64528. value: true
  64529. });
  64530. var transferIndex = 0;
  64531. var lastVisibleIndex = 0;
  64532. function transferIncrease() {
  64533. exports.transferIndex = transferIndex += 1;
  64534. }
  64535. function lastVisibleIncrease() {
  64536. exports.lastVisibleIndex = lastVisibleIndex += 1;
  64537. }
  64538. exports.transferIndex = transferIndex;
  64539. exports.transferIncrease = transferIncrease;
  64540. exports.lastVisibleIndex = lastVisibleIndex;
  64541. exports.lastVisibleIncrease = lastVisibleIncrease;
  64542. /***/ }),
  64543. /* 38 */
  64544. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64545. "use strict";
  64546. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  64547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__ = __webpack_require__(124);
  64548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__);
  64549. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  64550. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__ = __webpack_require__(339);
  64551. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__);
  64552. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  64553. /* script */
  64554. /* template */
  64555. /* template functional */
  64556. var __vue_template_functional__ = false
  64557. /* styles */
  64558. var __vue_styles__ = null
  64559. /* scopeId */
  64560. var __vue_scopeId__ = null
  64561. /* moduleIdentifier (server only) */
  64562. var __vue_module_identifier__ = null
  64563. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  64564. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_vue___default.a,
  64565. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__["render"],
  64566. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2a328bd6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_vue__["staticRenderFns"],
  64567. __vue_template_functional__,
  64568. __vue_styles__,
  64569. __vue_scopeId__,
  64570. __vue_module_identifier__
  64571. )
  64572. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  64573. /***/ }),
  64574. /* 39 */
  64575. /***/ (function(module, exports, __webpack_require__) {
  64576. "use strict";
  64577. Object.defineProperty(exports, "__esModule", {
  64578. value: true
  64579. });
  64580. var _isFinite = __webpack_require__(75);
  64581. var _isFinite2 = _interopRequireDefault(_isFinite);
  64582. exports.changeColor = changeColor;
  64583. exports.clamp = clamp;
  64584. exports.getIncrement = getIncrement;
  64585. exports.getTouches = getTouches;
  64586. exports.toRGBAString = toRGBAString;
  64587. exports.isValidHex = isValidHex;
  64588. exports.simpleCheckForValidColor = simpleCheckForValidColor;
  64589. var _tinycolor = __webpack_require__(149);
  64590. var _tinycolor2 = _interopRequireDefault(_tinycolor);
  64591. var _assist = __webpack_require__(3);
  64592. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64593. function setAlpha(data, alpha) {
  64594. var color = (0, _tinycolor2.default)(data);
  64595. var _a = color._a;
  64596. if (_a === undefined || _a === null) {
  64597. color.setAlpha(alpha || 1);
  64598. }
  64599. return color;
  64600. }
  64601. function getColor(data, colorData) {
  64602. var alpha = colorData && colorData.a;
  64603. if (colorData) {
  64604. if (colorData.hsl) {
  64605. return setAlpha(colorData.hsl, alpha);
  64606. }
  64607. if (colorData.hex && colorData.hex.length > 0) {
  64608. return setAlpha(colorData.hex, alpha);
  64609. }
  64610. }
  64611. return setAlpha(colorData, alpha);
  64612. }
  64613. function changeColor(data, oldHue) {
  64614. var colorData = data === '' ? '#2d8cf0' : data;
  64615. var color = getColor(data, colorData);
  64616. var hsl = color.toHsl();
  64617. var hsv = color.toHsv();
  64618. if (hsl.s === 0) {
  64619. hsl.h = colorData.h || colorData.hsl && colorData.hsl.h || oldHue || 0;
  64620. hsv.h = hsl.h;
  64621. }
  64622. if (hsv.v < 0.0164) {
  64623. hsv.h = colorData.h || colorData.hsv && colorData.hsv.h || 0;
  64624. hsv.s = colorData.s || colorData.hsv && colorData.hsv.s || 0;
  64625. }
  64626. if (hsl.l < 0.01) {
  64627. hsl.h = colorData.h || colorData.hsl && colorData.hsl.h || 0;
  64628. hsl.s = colorData.s || colorData.hsl && colorData.hsl.s || 0;
  64629. }
  64630. return {
  64631. hsl: hsl,
  64632. hex: color.toHexString().toUpperCase(),
  64633. rgba: color.toRgb(),
  64634. hsv: hsv,
  64635. oldHue: colorData.h || oldHue || hsl.h,
  64636. source: colorData.source,
  64637. a: colorData.a || color.getAlpha()
  64638. };
  64639. }
  64640. function clamp(value, min, max) {
  64641. if (value < min) {
  64642. return min;
  64643. }
  64644. if (value > max) {
  64645. return max;
  64646. }
  64647. return value;
  64648. }
  64649. function getIncrement(key, keys, increment) {
  64650. return (0, _assist.oneOf)(key, keys) ? increment : 0;
  64651. }
  64652. function getTouches(e, prop) {
  64653. return e.touches ? e.touches[0][prop] : 0;
  64654. }
  64655. function toRGBAString(rgba) {
  64656. var r = rgba.r,
  64657. g = rgba.g,
  64658. b = rgba.b,
  64659. a = rgba.a;
  64660. return 'rgba(' + String([r, g, b, a].join(',')) + ')';
  64661. }
  64662. function isValidHex(hex) {
  64663. return (0, _tinycolor2.default)(hex).isValid();
  64664. }
  64665. function checkIteratee(data, counts, letter) {
  64666. var checked = counts.checked,
  64667. passed = counts.passed;
  64668. var value = data[letter];
  64669. if (value) {
  64670. checked += 1;
  64671. if ((0, _isFinite2.default)(value)) {
  64672. passed += 1;
  64673. }
  64674. }
  64675. return { checked: checked, passed: passed };
  64676. }
  64677. var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
  64678. function simpleCheckForValidColor(data) {
  64679. var results = keysToCheck.reduce(checkIteratee.bind(null, data), { checked: 0, passed: 0 });
  64680. return results.checked === results.passed ? data : undefined;
  64681. }
  64682. /***/ }),
  64683. /* 40 */
  64684. /***/ (function(module, exports, __webpack_require__) {
  64685. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  64686. var $keys = __webpack_require__(96);
  64687. var enumBugKeys = __webpack_require__(68);
  64688. module.exports = Object.keys || function keys(O) {
  64689. return $keys(O, enumBugKeys);
  64690. };
  64691. /***/ }),
  64692. /* 41 */
  64693. /***/ (function(module, exports) {
  64694. var toString = {}.toString;
  64695. module.exports = function (it) {
  64696. return toString.call(it).slice(8, -1);
  64697. };
  64698. /***/ }),
  64699. /* 42 */
  64700. /***/ (function(module, exports) {
  64701. module.exports = true;
  64702. /***/ }),
  64703. /* 43 */
  64704. /***/ (function(module, exports) {
  64705. module.exports = function (it) {
  64706. if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  64707. return it;
  64708. };
  64709. /***/ }),
  64710. /* 44 */
  64711. /***/ (function(module, exports) {
  64712. module.exports = function (bitmap, value) {
  64713. return {
  64714. enumerable: !(bitmap & 1),
  64715. configurable: !(bitmap & 2),
  64716. writable: !(bitmap & 4),
  64717. value: value
  64718. };
  64719. };
  64720. /***/ }),
  64721. /* 45 */
  64722. /***/ (function(module, exports, __webpack_require__) {
  64723. module.exports = { "default": __webpack_require__(276), __esModule: true };
  64724. /***/ }),
  64725. /* 46 */
  64726. /***/ (function(module, exports, __webpack_require__) {
  64727. __webpack_require__(277);
  64728. var global = __webpack_require__(9);
  64729. var hide = __webpack_require__(25);
  64730. var Iterators = __webpack_require__(34);
  64731. var TO_STRING_TAG = __webpack_require__(10)('toStringTag');
  64732. var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  64733. 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  64734. 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  64735. 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  64736. 'TextTrackList,TouchList').split(',');
  64737. for (var i = 0; i < DOMIterables.length; i++) {
  64738. var NAME = DOMIterables[i];
  64739. var Collection = global[NAME];
  64740. var proto = Collection && Collection.prototype;
  64741. if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  64742. Iterators[NAME] = Iterators.Array;
  64743. }
  64744. /***/ }),
  64745. /* 47 */
  64746. /***/ (function(module, exports, __webpack_require__) {
  64747. var def = __webpack_require__(14).f;
  64748. var has = __webpack_require__(30);
  64749. var TAG = __webpack_require__(10)('toStringTag');
  64750. module.exports = function (it, tag, stat) {
  64751. if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  64752. };
  64753. /***/ }),
  64754. /* 48 */
  64755. /***/ (function(module, exports, __webpack_require__) {
  64756. "use strict";
  64757. Object.defineProperty(exports, "__esModule", {
  64758. value: true
  64759. });
  64760. var _newArrowCheck2 = __webpack_require__(1);
  64761. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  64762. var _typeof2 = __webpack_require__(27);
  64763. var _typeof3 = _interopRequireDefault(_typeof2);
  64764. var _assist = __webpack_require__(3);
  64765. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  64766. exports.default = {
  64767. props: {
  64768. to: {
  64769. type: [Object, String]
  64770. },
  64771. replace: {
  64772. type: Boolean,
  64773. default: false
  64774. },
  64775. target: {
  64776. type: String,
  64777. validator: function validator(value) {
  64778. return (0, _assist.oneOf)(value, ['_blank', '_self', '_parent', '_top']);
  64779. },
  64780. default: '_self'
  64781. },
  64782. append: {
  64783. type: Boolean,
  64784. required: false,
  64785. default: false
  64786. }
  64787. },
  64788. computed: {
  64789. linkUrl: function linkUrl() {
  64790. var type = (0, _typeof3.default)(this.to);
  64791. if (type !== 'string') {
  64792. return null;
  64793. }
  64794. if (this.to.includes('//')) {
  64795. return this.to;
  64796. }
  64797. var router = this.$router;
  64798. if (router) {
  64799. var current = this.$route;
  64800. var route = router.resolve(this.to, current, this.append);
  64801. return route ? route.href : this.to;
  64802. }
  64803. return this.to;
  64804. }
  64805. },
  64806. methods: {
  64807. handleOpenTo: function handleOpenTo() {
  64808. var router = this.$router;
  64809. var to = this.to;
  64810. if (router) {
  64811. var current = this.$route;
  64812. var route = router.resolve(this.to, current, this.append);
  64813. to = route ? route.href : this.to;
  64814. }
  64815. if (typeof this.to === 'string') return;
  64816. window.open(to);
  64817. },
  64818. handleClick: function handleClick() {
  64819. var _this = this;
  64820. var new_window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  64821. var router = this.$router;
  64822. if (new_window) {
  64823. this.handleOpenTo();
  64824. } else {
  64825. if (router) {
  64826. if (typeof this.to === 'string' && this.to.includes('//')) {
  64827. window.location.href = this.to;
  64828. } else {
  64829. this.replace ? this.$router.replace(this.to, function () {
  64830. (0, _newArrowCheck3.default)(this, _this);
  64831. }.bind(this)) : this.$router.push(this.to, function () {
  64832. (0, _newArrowCheck3.default)(this, _this);
  64833. }.bind(this));
  64834. }
  64835. } else {
  64836. window.location.href = this.to;
  64837. }
  64838. }
  64839. },
  64840. handleCheckClick: function handleCheckClick(event) {
  64841. var new_window = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  64842. if (this.to) {
  64843. if (this.target === '_blank') {
  64844. this.handleOpenTo();
  64845. return false;
  64846. } else {
  64847. event.preventDefault();
  64848. this.handleClick(new_window);
  64849. }
  64850. }
  64851. }
  64852. }
  64853. };
  64854. /***/ }),
  64855. /* 49 */
  64856. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  64857. "use strict";
  64858. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  64859. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__ = __webpack_require__(142);
  64860. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__);
  64861. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  64862. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__ = __webpack_require__(381);
  64863. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__);
  64864. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  64865. /* script */
  64866. /* template */
  64867. /* template functional */
  64868. var __vue_template_functional__ = false
  64869. /* styles */
  64870. var __vue_styles__ = null
  64871. /* scopeId */
  64872. var __vue_scopeId__ = null
  64873. /* moduleIdentifier (server only) */
  64874. var __vue_module_identifier__ = null
  64875. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  64876. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_vue___default.a,
  64877. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__["render"],
  64878. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ecbefd0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_vue__["staticRenderFns"],
  64879. __vue_template_functional__,
  64880. __vue_styles__,
  64881. __vue_scopeId__,
  64882. __vue_module_identifier__
  64883. )
  64884. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  64885. /***/ }),
  64886. /* 50 */
  64887. /***/ (function(module, exports, __webpack_require__) {
  64888. "use strict";
  64889. Object.defineProperty(exports, "__esModule", {
  64890. value: true
  64891. });
  64892. exports.default = {
  64893. data: function data() {
  64894. return {
  64895. prefixCls: 'ivu-color-picker',
  64896. inputPrefixCls: 'ivu-input',
  64897. iconPrefixCls: 'ivu-icon',
  64898. transferPrefixCls: 'ivu-transfer'
  64899. };
  64900. }
  64901. };
  64902. /***/ }),
  64903. /* 51 */
  64904. /***/ (function(module, exports, __webpack_require__) {
  64905. var ctx = __webpack_require__(24);
  64906. var call = __webpack_require__(112);
  64907. var isArrayIter = __webpack_require__(113);
  64908. var anObject = __webpack_require__(22);
  64909. var toLength = __webpack_require__(52);
  64910. var getIterFn = __webpack_require__(73);
  64911. var BREAK = {};
  64912. var RETURN = {};
  64913. var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  64914. var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  64915. var f = ctx(fn, that, entries ? 2 : 1);
  64916. var index = 0;
  64917. var length, step, iterator, result;
  64918. if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  64919. // fast case for arrays with default iterator
  64920. if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
  64921. result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  64922. if (result === BREAK || result === RETURN) return result;
  64923. } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
  64924. result = call(iterator, f, step.value, entries);
  64925. if (result === BREAK || result === RETURN) return result;
  64926. }
  64927. };
  64928. exports.BREAK = BREAK;
  64929. exports.RETURN = RETURN;
  64930. /***/ }),
  64931. /* 52 */
  64932. /***/ (function(module, exports, __webpack_require__) {
  64933. // 7.1.15 ToLength
  64934. var toInteger = __webpack_require__(65);
  64935. var min = Math.min;
  64936. module.exports = function (it) {
  64937. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  64938. };
  64939. /***/ }),
  64940. /* 53 */
  64941. /***/ (function(module, exports) {
  64942. var id = 0;
  64943. var px = Math.random();
  64944. module.exports = function (key) {
  64945. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  64946. };
  64947. /***/ }),
  64948. /* 54 */
  64949. /***/ (function(module, exports) {
  64950. exports.f = {}.propertyIsEnumerable;
  64951. /***/ }),
  64952. /* 55 */
  64953. /***/ (function(module, exports, __webpack_require__) {
  64954. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  64955. var anObject = __webpack_require__(22);
  64956. var dPs = __webpack_require__(104);
  64957. var enumBugKeys = __webpack_require__(68);
  64958. var IE_PROTO = __webpack_require__(66)('IE_PROTO');
  64959. var Empty = function () { /* empty */ };
  64960. var PROTOTYPE = 'prototype';
  64961. // Create object with fake `null` prototype: use iframe Object with cleared prototype
  64962. var createDict = function () {
  64963. // Thrash, waste and sodomy: IE GC bug
  64964. var iframe = __webpack_require__(69)('iframe');
  64965. var i = enumBugKeys.length;
  64966. var lt = '<';
  64967. var gt = '>';
  64968. var iframeDocument;
  64969. iframe.style.display = 'none';
  64970. __webpack_require__(105).appendChild(iframe);
  64971. iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  64972. // createDict = iframe.contentWindow.Object;
  64973. // html.removeChild(iframe);
  64974. iframeDocument = iframe.contentWindow.document;
  64975. iframeDocument.open();
  64976. iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  64977. iframeDocument.close();
  64978. createDict = iframeDocument.F;
  64979. while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  64980. return createDict();
  64981. };
  64982. module.exports = Object.create || function create(O, Properties) {
  64983. var result;
  64984. if (O !== null) {
  64985. Empty[PROTOTYPE] = anObject(O);
  64986. result = new Empty();
  64987. Empty[PROTOTYPE] = null;
  64988. // add "__proto__" for Object.getPrototypeOf polyfill
  64989. result[IE_PROTO] = O;
  64990. } else result = createDict();
  64991. return Properties === undefined ? result : dPs(result, Properties);
  64992. };
  64993. /***/ }),
  64994. /* 56 */
  64995. /***/ (function(module, exports, __webpack_require__) {
  64996. // getting tag from 19.1.3.6 Object.prototype.toString()
  64997. var cof = __webpack_require__(41);
  64998. var TAG = __webpack_require__(10)('toStringTag');
  64999. // ES3 wrong here
  65000. var ARG = cof(function () { return arguments; }()) == 'Arguments';
  65001. // fallback for IE11 Script Access Denied error
  65002. var tryGet = function (it, key) {
  65003. try {
  65004. return it[key];
  65005. } catch (e) { /* empty */ }
  65006. };
  65007. module.exports = function (it) {
  65008. var O, T, B;
  65009. return it === undefined ? 'Undefined' : it === null ? 'Null'
  65010. // @@toStringTag case
  65011. : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
  65012. // builtinTag case
  65013. : ARG ? cof(O)
  65014. // ES3 arguments fallback
  65015. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  65016. };
  65017. /***/ }),
  65018. /* 57 */
  65019. /***/ (function(module, exports, __webpack_require__) {
  65020. module.exports = { "default": __webpack_require__(296), __esModule: true };
  65021. /***/ }),
  65022. /* 58 */
  65023. /***/ (function(module, exports, __webpack_require__) {
  65024. "use strict";
  65025. Object.defineProperty(exports, "__esModule", {
  65026. value: true
  65027. });
  65028. exports.default = {
  65029. props: {
  65030. disabledHours: {
  65031. type: Array,
  65032. default: function _default() {
  65033. return [];
  65034. }
  65035. },
  65036. disabledMinutes: {
  65037. type: Array,
  65038. default: function _default() {
  65039. return [];
  65040. }
  65041. },
  65042. disabledSeconds: {
  65043. type: Array,
  65044. default: function _default() {
  65045. return [];
  65046. }
  65047. },
  65048. hideDisabledOptions: {
  65049. type: Boolean,
  65050. default: false
  65051. }
  65052. }
  65053. };
  65054. /***/ }),
  65055. /* 59 */
  65056. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65057. "use strict";
  65058. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  65059. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__ = __webpack_require__(170);
  65060. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__);
  65061. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  65062. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__ = __webpack_require__(418);
  65063. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__);
  65064. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  65065. /* script */
  65066. /* template */
  65067. /* template functional */
  65068. var __vue_template_functional__ = false
  65069. /* styles */
  65070. var __vue_styles__ = null
  65071. /* scopeId */
  65072. var __vue_scopeId__ = null
  65073. /* moduleIdentifier (server only) */
  65074. var __vue_module_identifier__ = null
  65075. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  65076. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_confirm_vue___default.a,
  65077. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__["render"],
  65078. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_26b6f28e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_confirm_vue__["staticRenderFns"],
  65079. __vue_template_functional__,
  65080. __vue_styles__,
  65081. __vue_scopeId__,
  65082. __vue_module_identifier__
  65083. )
  65084. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  65085. /***/ }),
  65086. /* 60 */
  65087. /***/ (function(module, exports, __webpack_require__) {
  65088. "use strict";
  65089. Object.defineProperty(exports, "__esModule", {
  65090. value: true
  65091. });
  65092. var _newArrowCheck2 = __webpack_require__(1);
  65093. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  65094. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  65095. var prefixCls = 'ivu-picker-panel';
  65096. var datePrefixCls = 'ivu-date-picker';
  65097. exports.default = {
  65098. props: {
  65099. confirm: {
  65100. type: Boolean,
  65101. default: false
  65102. }
  65103. },
  65104. methods: {
  65105. iconBtnCls: function iconBtnCls(direction) {
  65106. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
  65107. return [prefixCls + '-icon-btn', datePrefixCls + '-' + String(direction) + '-btn', datePrefixCls + '-' + String(direction) + '-btn-arrow' + String(type)];
  65108. },
  65109. handleShortcutClick: function handleShortcutClick(shortcut) {
  65110. if (shortcut.value) this.$emit('on-pick', shortcut.value());
  65111. if (shortcut.onClick) shortcut.onClick(this);
  65112. },
  65113. handlePickClear: function handlePickClear() {
  65114. this.resetView();
  65115. this.$emit('on-pick-clear');
  65116. },
  65117. handlePickSuccess: function handlePickSuccess() {
  65118. this.resetView();
  65119. this.$emit('on-pick-success');
  65120. },
  65121. handlePickClick: function handlePickClick() {
  65122. this.$emit('on-pick-click');
  65123. },
  65124. resetView: function resetView() {
  65125. var _this = this;
  65126. setTimeout(function () {
  65127. (0, _newArrowCheck3.default)(this, _this);
  65128. return this.currentView = this.selectionMode;
  65129. }.bind(this), 500);
  65130. },
  65131. handleClear: function handleClear() {
  65132. var _this2 = this;
  65133. this.dates = this.dates.map(function () {
  65134. (0, _newArrowCheck3.default)(this, _this2);
  65135. return null;
  65136. }.bind(this));
  65137. this.rangeState = {};
  65138. this.$emit('on-pick', this.dates);
  65139. this.handleConfirm();
  65140. },
  65141. handleConfirm: function handleConfirm(visible, type) {
  65142. this.$emit('on-pick', this.dates, visible, type || this.type);
  65143. },
  65144. onToggleVisibility: function onToggleVisibility(open) {
  65145. var _$refs = this.$refs,
  65146. timeSpinner = _$refs.timeSpinner,
  65147. timeSpinnerEnd = _$refs.timeSpinnerEnd;
  65148. if (open && timeSpinner) timeSpinner.updateScroll();
  65149. if (open && timeSpinnerEnd) timeSpinnerEnd.updateScroll();
  65150. }
  65151. }
  65152. };
  65153. /***/ }),
  65154. /* 61 */
  65155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65156. "use strict";
  65157. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  65158. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__ = __webpack_require__(179);
  65159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__);
  65160. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  65161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__ = __webpack_require__(432);
  65162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__);
  65163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  65164. /* script */
  65165. /* template */
  65166. /* template functional */
  65167. var __vue_template_functional__ = false
  65168. /* styles */
  65169. var __vue_styles__ = null
  65170. /* scopeId */
  65171. var __vue_scopeId__ = null
  65172. /* moduleIdentifier (server only) */
  65173. var __vue_module_identifier__ = null
  65174. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  65175. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_vue___default.a,
  65176. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["render"],
  65177. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7c690a70_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_vue__["staticRenderFns"],
  65178. __vue_template_functional__,
  65179. __vue_styles__,
  65180. __vue_scopeId__,
  65181. __vue_module_identifier__
  65182. )
  65183. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  65184. /***/ }),
  65185. /* 62 */
  65186. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65187. "use strict";
  65188. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  65189. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__ = __webpack_require__(180);
  65190. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__);
  65191. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  65192. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__ = __webpack_require__(433);
  65193. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__);
  65194. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  65195. /* script */
  65196. /* template */
  65197. /* template functional */
  65198. var __vue_template_functional__ = false
  65199. /* styles */
  65200. var __vue_styles__ = null
  65201. /* scopeId */
  65202. var __vue_scopeId__ = null
  65203. /* moduleIdentifier (server only) */
  65204. var __vue_module_identifier__ = null
  65205. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  65206. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_menu_vue___default.a,
  65207. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__["render"],
  65208. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b48d9576_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_menu_vue__["staticRenderFns"],
  65209. __vue_template_functional__,
  65210. __vue_styles__,
  65211. __vue_scopeId__,
  65212. __vue_module_identifier__
  65213. )
  65214. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  65215. /***/ }),
  65216. /* 63 */
  65217. /***/ (function(module, exports) {
  65218. // 7.2.1 RequireObjectCoercible(argument)
  65219. module.exports = function (it) {
  65220. if (it == undefined) throw TypeError("Can't call method on " + it);
  65221. return it;
  65222. };
  65223. /***/ }),
  65224. /* 64 */
  65225. /***/ (function(module, exports, __webpack_require__) {
  65226. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  65227. var cof = __webpack_require__(41);
  65228. // eslint-disable-next-line no-prototype-builtins
  65229. module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  65230. return cof(it) == 'String' ? it.split('') : Object(it);
  65231. };
  65232. /***/ }),
  65233. /* 65 */
  65234. /***/ (function(module, exports) {
  65235. // 7.1.4 ToInteger
  65236. var ceil = Math.ceil;
  65237. var floor = Math.floor;
  65238. module.exports = function (it) {
  65239. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  65240. };
  65241. /***/ }),
  65242. /* 66 */
  65243. /***/ (function(module, exports, __webpack_require__) {
  65244. var shared = __webpack_require__(67)('keys');
  65245. var uid = __webpack_require__(53);
  65246. module.exports = function (key) {
  65247. return shared[key] || (shared[key] = uid(key));
  65248. };
  65249. /***/ }),
  65250. /* 67 */
  65251. /***/ (function(module, exports, __webpack_require__) {
  65252. var core = __webpack_require__(5);
  65253. var global = __webpack_require__(9);
  65254. var SHARED = '__core-js_shared__';
  65255. var store = global[SHARED] || (global[SHARED] = {});
  65256. (module.exports = function (key, value) {
  65257. return store[key] || (store[key] = value !== undefined ? value : {});
  65258. })('versions', []).push({
  65259. version: core.version,
  65260. mode: __webpack_require__(42) ? 'pure' : 'global',
  65261. copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  65262. });
  65263. /***/ }),
  65264. /* 68 */
  65265. /***/ (function(module, exports) {
  65266. // IE 8- don't enum bug keys
  65267. module.exports = (
  65268. 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  65269. ).split(',');
  65270. /***/ }),
  65271. /* 69 */
  65272. /***/ (function(module, exports, __webpack_require__) {
  65273. var isObject = __webpack_require__(18);
  65274. var document = __webpack_require__(9).document;
  65275. // typeof document.createElement is 'object' in old IE
  65276. var is = isObject(document) && isObject(document.createElement);
  65277. module.exports = function (it) {
  65278. return is ? document.createElement(it) : {};
  65279. };
  65280. /***/ }),
  65281. /* 70 */
  65282. /***/ (function(module, exports, __webpack_require__) {
  65283. // 7.1.1 ToPrimitive(input [, PreferredType])
  65284. var isObject = __webpack_require__(18);
  65285. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  65286. // and the second argument - flag - preferred type is a string
  65287. module.exports = function (it, S) {
  65288. if (!isObject(it)) return it;
  65289. var fn, val;
  65290. if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  65291. if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  65292. if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  65293. throw TypeError("Can't convert object to primitive value");
  65294. };
  65295. /***/ }),
  65296. /* 71 */
  65297. /***/ (function(module, exports) {
  65298. exports.f = Object.getOwnPropertySymbols;
  65299. /***/ }),
  65300. /* 72 */
  65301. /***/ (function(module, exports, __webpack_require__) {
  65302. "use strict";
  65303. var LIBRARY = __webpack_require__(42);
  65304. var $export = __webpack_require__(7);
  65305. var redefine = __webpack_require__(103);
  65306. var hide = __webpack_require__(25);
  65307. var Iterators = __webpack_require__(34);
  65308. var $iterCreate = __webpack_require__(279);
  65309. var setToStringTag = __webpack_require__(47);
  65310. var getPrototypeOf = __webpack_require__(106);
  65311. var ITERATOR = __webpack_require__(10)('iterator');
  65312. var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  65313. var FF_ITERATOR = '@@iterator';
  65314. var KEYS = 'keys';
  65315. var VALUES = 'values';
  65316. var returnThis = function () { return this; };
  65317. module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  65318. $iterCreate(Constructor, NAME, next);
  65319. var getMethod = function (kind) {
  65320. if (!BUGGY && kind in proto) return proto[kind];
  65321. switch (kind) {
  65322. case KEYS: return function keys() { return new Constructor(this, kind); };
  65323. case VALUES: return function values() { return new Constructor(this, kind); };
  65324. } return function entries() { return new Constructor(this, kind); };
  65325. };
  65326. var TAG = NAME + ' Iterator';
  65327. var DEF_VALUES = DEFAULT == VALUES;
  65328. var VALUES_BUG = false;
  65329. var proto = Base.prototype;
  65330. var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  65331. var $default = $native || getMethod(DEFAULT);
  65332. var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  65333. var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  65334. var methods, key, IteratorPrototype;
  65335. // Fix native
  65336. if ($anyNative) {
  65337. IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
  65338. if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
  65339. // Set @@toStringTag to native iterators
  65340. setToStringTag(IteratorPrototype, TAG, true);
  65341. // fix for some old engines
  65342. if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
  65343. }
  65344. }
  65345. // fix Array#{values, @@iterator}.name in V8 / FF
  65346. if (DEF_VALUES && $native && $native.name !== VALUES) {
  65347. VALUES_BUG = true;
  65348. $default = function values() { return $native.call(this); };
  65349. }
  65350. // Define iterator
  65351. if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
  65352. hide(proto, ITERATOR, $default);
  65353. }
  65354. // Plug for library
  65355. Iterators[NAME] = $default;
  65356. Iterators[TAG] = returnThis;
  65357. if (DEFAULT) {
  65358. methods = {
  65359. values: DEF_VALUES ? $default : getMethod(VALUES),
  65360. keys: IS_SET ? $default : getMethod(KEYS),
  65361. entries: $entries
  65362. };
  65363. if (FORCED) for (key in methods) {
  65364. if (!(key in proto)) redefine(proto, key, methods[key]);
  65365. } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  65366. }
  65367. return methods;
  65368. };
  65369. /***/ }),
  65370. /* 73 */
  65371. /***/ (function(module, exports, __webpack_require__) {
  65372. var classof = __webpack_require__(56);
  65373. var ITERATOR = __webpack_require__(10)('iterator');
  65374. var Iterators = __webpack_require__(34);
  65375. module.exports = __webpack_require__(5).getIteratorMethod = function (it) {
  65376. if (it != undefined) return it[ITERATOR]
  65377. || it['@@iterator']
  65378. || Iterators[classof(it)];
  65379. };
  65380. /***/ }),
  65381. /* 74 */
  65382. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65383. "use strict";
  65384. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  65385. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__ = __webpack_require__(110);
  65386. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__);
  65387. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  65388. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__ = __webpack_require__(327);
  65389. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__);
  65390. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  65391. /* script */
  65392. /* template */
  65393. /* template functional */
  65394. var __vue_template_functional__ = false
  65395. /* styles */
  65396. var __vue_styles__ = null
  65397. /* scopeId */
  65398. var __vue_scopeId__ = null
  65399. /* moduleIdentifier (server only) */
  65400. var __vue_module_identifier__ = null
  65401. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  65402. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_vue___default.a,
  65403. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__["render"],
  65404. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_20c68a7a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_vue__["staticRenderFns"],
  65405. __vue_template_functional__,
  65406. __vue_styles__,
  65407. __vue_scopeId__,
  65408. __vue_module_identifier__
  65409. )
  65410. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  65411. /***/ }),
  65412. /* 75 */
  65413. /***/ (function(module, exports, __webpack_require__) {
  65414. module.exports = { "default": __webpack_require__(294), __esModule: true };
  65415. /***/ }),
  65416. /* 76 */
  65417. /***/ (function(module, exports, __webpack_require__) {
  65418. "use strict";
  65419. Object.defineProperty(exports, "__esModule", {
  65420. value: true
  65421. });
  65422. exports.directive = undefined;
  65423. var _typeof2 = __webpack_require__(27);
  65424. var _typeof3 = _interopRequireDefault(_typeof2);
  65425. var _extends2 = __webpack_require__(32);
  65426. var _extends3 = _interopRequireDefault(_extends2);
  65427. var _defineProperties = __webpack_require__(311);
  65428. var _defineProperties2 = _interopRequireDefault(_defineProperties);
  65429. var _keys = __webpack_require__(21);
  65430. var _keys2 = _interopRequireDefault(_keys);
  65431. var _create = __webpack_require__(314);
  65432. var _create2 = _interopRequireDefault(_create);
  65433. exports.install = install;
  65434. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  65435. var CLICK = 'click';
  65436. var captureInstances = (0, _create2.default)(null);
  65437. var nonCaptureInstances = (0, _create2.default)(null);
  65438. var instancesList = [captureInstances, nonCaptureInstances];
  65439. var commonHandler = function _onCommonEvent(context, instances, event) {
  65440. var target = event.target;
  65441. var itemIteratee = function _itemIteratee(item) {
  65442. var el = item.el;
  65443. if (el !== target && !el.contains(target)) {
  65444. var binding = item.binding;
  65445. if (binding.modifiers.stop) {
  65446. event.stopPropagation();
  65447. }
  65448. if (binding.modifiers.prevent) {
  65449. event.preventDefault();
  65450. }
  65451. binding.value.call(context, event);
  65452. }
  65453. };
  65454. var keysIteratee = function _keysIteratee(eventName) {
  65455. return instances[eventName].forEach(itemIteratee);
  65456. };
  65457. (0, _keys2.default)(instances).forEach(keysIteratee);
  65458. };
  65459. var captureEventHandler = function onCaptureEvent(event) {
  65460. commonHandler(this, captureInstances, event);
  65461. };
  65462. var nonCaptureEventHandler = function onNonCaptureEvent(event) {
  65463. commonHandler(this, nonCaptureInstances, event);
  65464. };
  65465. var getEventHandler = function _getEventHandler(useCapture) {
  65466. return useCapture ? captureEventHandler : nonCaptureEventHandler;
  65467. };
  65468. var directive = exports.directive = (0, _defineProperties2.default)({}, {
  65469. $_captureInstances: {
  65470. value: captureInstances
  65471. },
  65472. $_nonCaptureInstances: {
  65473. value: nonCaptureInstances
  65474. },
  65475. $_onCaptureEvent: {
  65476. value: captureEventHandler
  65477. },
  65478. $_onNonCaptureEvent: {
  65479. value: nonCaptureEventHandler
  65480. },
  65481. bind: {
  65482. value: function bind(el, binding) {
  65483. if (typeof binding.value !== 'function') {
  65484. throw new TypeError('Binding value must be a function.');
  65485. }
  65486. var eventType = void 0;
  65487. var modifiers = binding.modifiers;
  65488. if (modifiers.click) eventType = 'click';else if (modifiers.mousedown) eventType = 'mousedown';else if (modifiers.touchstart) eventType = 'touchstart';else eventType = CLICK;
  65489. var useCapture = binding.arg;
  65490. var normalisedBinding = (0, _extends3.default)({}, binding, {
  65491. modifiers: (0, _extends3.default)({
  65492. capture: false,
  65493. prevent: false,
  65494. stop: false
  65495. }, binding.modifiers)
  65496. });
  65497. var instances = useCapture ? captureInstances : nonCaptureInstances;
  65498. if (!Array.isArray(instances[eventType])) {
  65499. instances[eventType] = [];
  65500. }
  65501. if (instances[eventType].push({ el: el, binding: normalisedBinding }) === 1) {
  65502. if ((typeof document === 'undefined' ? 'undefined' : (0, _typeof3.default)(document)) === 'object' && document) {
  65503. document.addEventListener(eventType, getEventHandler(useCapture), useCapture);
  65504. }
  65505. }
  65506. }
  65507. },
  65508. unbind: {
  65509. value: function unbind(el) {
  65510. var compareElements = function _compareElements(item) {
  65511. return item.el !== el;
  65512. };
  65513. var instancesIteratee = function _instancesIteratee(instances) {
  65514. var instanceKeys = (0, _keys2.default)(instances);
  65515. if (instanceKeys.length) {
  65516. var useCapture = instances === captureInstances;
  65517. var keysIteratee = function _keysIteratee(eventName) {
  65518. var newInstance = instances[eventName].filter(compareElements);
  65519. if (newInstance.length) {
  65520. instances[eventName] = newInstance;
  65521. } else {
  65522. if ((typeof document === 'undefined' ? 'undefined' : (0, _typeof3.default)(document)) === 'object' && document) {
  65523. document.removeEventListener(eventName, getEventHandler(useCapture), useCapture);
  65524. }
  65525. delete instances[eventName];
  65526. }
  65527. };
  65528. instanceKeys.forEach(keysIteratee);
  65529. }
  65530. };
  65531. instancesList.forEach(instancesIteratee);
  65532. }
  65533. },
  65534. version: {
  65535. enumerable: true,
  65536. value: '3.7.1'
  65537. }
  65538. });
  65539. function install(Vue) {
  65540. Vue.directive('click-outside', directive);
  65541. }
  65542. /***/ }),
  65543. /* 77 */
  65544. /***/ (function(module, exports, __webpack_require__) {
  65545. exports.f = __webpack_require__(10);
  65546. /***/ }),
  65547. /* 78 */
  65548. /***/ (function(module, exports, __webpack_require__) {
  65549. var META = __webpack_require__(53)('meta');
  65550. var isObject = __webpack_require__(18);
  65551. var has = __webpack_require__(30);
  65552. var setDesc = __webpack_require__(14).f;
  65553. var id = 0;
  65554. var isExtensible = Object.isExtensible || function () {
  65555. return true;
  65556. };
  65557. var FREEZE = !__webpack_require__(31)(function () {
  65558. return isExtensible(Object.preventExtensions({}));
  65559. });
  65560. var setMeta = function (it) {
  65561. setDesc(it, META, { value: {
  65562. i: 'O' + ++id, // object ID
  65563. w: {} // weak collections IDs
  65564. } });
  65565. };
  65566. var fastKey = function (it, create) {
  65567. // return primitive with prefix
  65568. if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  65569. if (!has(it, META)) {
  65570. // can't set metadata to uncaught frozen object
  65571. if (!isExtensible(it)) return 'F';
  65572. // not necessary to add metadata
  65573. if (!create) return 'E';
  65574. // add missing metadata
  65575. setMeta(it);
  65576. // return object ID
  65577. } return it[META].i;
  65578. };
  65579. var getWeak = function (it, create) {
  65580. if (!has(it, META)) {
  65581. // can't set metadata to uncaught frozen object
  65582. if (!isExtensible(it)) return true;
  65583. // not necessary to add metadata
  65584. if (!create) return false;
  65585. // add missing metadata
  65586. setMeta(it);
  65587. // return hash weak collections IDs
  65588. } return it[META].w;
  65589. };
  65590. // add metadata on freeze-family methods calling
  65591. var onFreeze = function (it) {
  65592. if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
  65593. return it;
  65594. };
  65595. var meta = module.exports = {
  65596. KEY: META,
  65597. NEED: false,
  65598. fastKey: fastKey,
  65599. getWeak: getWeak,
  65600. onFreeze: onFreeze
  65601. };
  65602. /***/ }),
  65603. /* 79 */
  65604. /***/ (function(module, exports, __webpack_require__) {
  65605. var global = __webpack_require__(9);
  65606. var core = __webpack_require__(5);
  65607. var LIBRARY = __webpack_require__(42);
  65608. var wksExt = __webpack_require__(77);
  65609. var defineProperty = __webpack_require__(14).f;
  65610. module.exports = function (name) {
  65611. var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
  65612. if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
  65613. };
  65614. /***/ }),
  65615. /* 80 */
  65616. /***/ (function(module, exports) {
  65617. /***/ }),
  65618. /* 81 */
  65619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  65620. "use strict";
  65621. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  65622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__ = __webpack_require__(123);
  65623. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__);
  65624. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  65625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__ = __webpack_require__(328);
  65626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__);
  65627. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  65628. /* script */
  65629. /* template */
  65630. /* template functional */
  65631. var __vue_template_functional__ = false
  65632. /* styles */
  65633. var __vue_styles__ = null
  65634. /* scopeId */
  65635. var __vue_scopeId__ = null
  65636. /* moduleIdentifier (server only) */
  65637. var __vue_module_identifier__ = null
  65638. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  65639. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_vue___default.a,
  65640. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__["render"],
  65641. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72d0cce2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_vue__["staticRenderFns"],
  65642. __vue_template_functional__,
  65643. __vue_styles__,
  65644. __vue_scopeId__,
  65645. __vue_module_identifier__
  65646. )
  65647. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  65648. /***/ }),
  65649. /* 82 */
  65650. /***/ (function(module, exports, __webpack_require__) {
  65651. "use strict";
  65652. Object.defineProperty(exports, "__esModule", {
  65653. value: true
  65654. });
  65655. exports.default = {
  65656. bind: function bind(el, binding, vnode) {
  65657. function documentHandler(e) {
  65658. if (el.contains(e.target)) {
  65659. return false;
  65660. }
  65661. if (binding.expression) {
  65662. binding.value(e);
  65663. }
  65664. }
  65665. el.__vueClickOutside__ = documentHandler;
  65666. document.addEventListener('click', documentHandler);
  65667. },
  65668. update: function update() {},
  65669. unbind: function unbind(el, binding) {
  65670. document.removeEventListener('click', el.__vueClickOutside__);
  65671. delete el.__vueClickOutside__;
  65672. }
  65673. };
  65674. /***/ }),
  65675. /* 83 */
  65676. /***/ (function(module, exports, __webpack_require__) {
  65677. "use strict";
  65678. Object.defineProperty(exports, "__esModule", {
  65679. value: true
  65680. });
  65681. var _assist = __webpack_require__(3);
  65682. var Transition = {
  65683. beforeEnter: function beforeEnter(el) {
  65684. (0, _assist.addClass)(el, 'collapse-transition');
  65685. if (!el.dataset) el.dataset = {};
  65686. el.dataset.oldPaddingTop = el.style.paddingTop;
  65687. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  65688. el.style.height = '0';
  65689. el.style.paddingTop = 0;
  65690. el.style.paddingBottom = 0;
  65691. },
  65692. enter: function enter(el) {
  65693. el.dataset.oldOverflow = el.style.overflow;
  65694. if (el.scrollHeight !== 0) {
  65695. el.style.height = el.scrollHeight + 'px';
  65696. el.style.paddingTop = el.dataset.oldPaddingTop;
  65697. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  65698. } else {
  65699. el.style.height = '';
  65700. el.style.paddingTop = el.dataset.oldPaddingTop;
  65701. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  65702. }
  65703. el.style.overflow = 'hidden';
  65704. },
  65705. afterEnter: function afterEnter(el) {
  65706. (0, _assist.removeClass)(el, 'collapse-transition');
  65707. el.style.height = '';
  65708. el.style.overflow = el.dataset.oldOverflow;
  65709. },
  65710. beforeLeave: function beforeLeave(el) {
  65711. if (!el.dataset) el.dataset = {};
  65712. el.dataset.oldPaddingTop = el.style.paddingTop;
  65713. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  65714. el.dataset.oldOverflow = el.style.overflow;
  65715. el.style.height = el.scrollHeight + 'px';
  65716. el.style.overflow = 'hidden';
  65717. },
  65718. leave: function leave(el) {
  65719. if (el.scrollHeight !== 0) {
  65720. (0, _assist.addClass)(el, 'collapse-transition');
  65721. el.style.height = 0;
  65722. el.style.paddingTop = 0;
  65723. el.style.paddingBottom = 0;
  65724. }
  65725. },
  65726. afterLeave: function afterLeave(el) {
  65727. (0, _assist.removeClass)(el, 'collapse-transition');
  65728. el.style.height = '';
  65729. el.style.overflow = el.dataset.oldOverflow;
  65730. el.style.paddingTop = el.dataset.oldPaddingTop;
  65731. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  65732. }
  65733. };
  65734. exports.default = {
  65735. name: 'CollapseTransition',
  65736. functional: true,
  65737. props: {
  65738. appear: Boolean
  65739. },
  65740. render: function render(h, _ref) {
  65741. var children = _ref.children,
  65742. props = _ref.props;
  65743. var data = {
  65744. on: Transition,
  65745. props: {
  65746. appear: props.appear
  65747. }
  65748. };
  65749. return h('transition', data, children);
  65750. }
  65751. };
  65752. /***/ }),
  65753. /* 84 */
  65754. /***/ (function(module, exports, __webpack_require__) {
  65755. "use strict";
  65756. Object.defineProperty(exports, "__esModule", {
  65757. value: true
  65758. });
  65759. var _newArrowCheck2 = __webpack_require__(1);
  65760. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  65761. var _emitter = __webpack_require__(4);
  65762. var _emitter2 = _interopRequireDefault(_emitter);
  65763. var _handleEscapeMixin = __webpack_require__(151);
  65764. var _handleEscapeMixin2 = _interopRequireDefault(_handleEscapeMixin);
  65765. var _utils = __webpack_require__(39);
  65766. var _dom = __webpack_require__(12);
  65767. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  65768. exports.default = {
  65769. mixins: [_emitter2.default, _handleEscapeMixin2.default],
  65770. props: {
  65771. focused: {
  65772. type: Boolean,
  65773. default: false
  65774. },
  65775. value: {
  65776. type: Object,
  65777. default: undefined
  65778. }
  65779. },
  65780. beforeDestroy: function beforeDestroy() {
  65781. this.unbindEventListeners();
  65782. },
  65783. created: function created() {
  65784. var _this = this;
  65785. if (this.focused) {
  65786. setTimeout(function () {
  65787. (0, _newArrowCheck3.default)(this, _this);
  65788. return this.$el.focus();
  65789. }.bind(this), 1);
  65790. }
  65791. },
  65792. methods: {
  65793. handleLeft: function handleLeft(e) {
  65794. this.handleSlide(e, this.left, 'left');
  65795. },
  65796. handleRight: function handleRight(e) {
  65797. this.handleSlide(e, this.right, 'right');
  65798. },
  65799. handleUp: function handleUp(e) {
  65800. this.handleSlide(e, this.up, 'up');
  65801. },
  65802. handleDown: function handleDown(e) {
  65803. this.handleSlide(e, this.down, 'down');
  65804. },
  65805. handleMouseDown: function handleMouseDown(e) {
  65806. this.dispatch('ColorPicker', 'on-dragging', true);
  65807. this.handleChange(e, true);
  65808. (0, _dom.on)(window, 'mousemove', this.handleChange);
  65809. (0, _dom.on)(window, 'mouseup', this.handleMouseUp);
  65810. },
  65811. handleMouseUp: function handleMouseUp() {
  65812. this.unbindEventListeners();
  65813. },
  65814. unbindEventListeners: function unbindEventListeners() {
  65815. var _this2 = this;
  65816. (0, _dom.off)(window, 'mousemove', this.handleChange);
  65817. (0, _dom.off)(window, 'mouseup', this.handleMouseUp);
  65818. setTimeout(function () {
  65819. (0, _newArrowCheck3.default)(this, _this2);
  65820. return this.dispatch('ColorPicker', 'on-dragging', false);
  65821. }.bind(this), 1);
  65822. },
  65823. getLeft: function getLeft(e) {
  65824. var container = this.$refs.container;
  65825. var xOffset = container.getBoundingClientRect().left + window.pageXOffset;
  65826. var pageX = e.pageX || (0, _utils.getTouches)(e, 'PageX');
  65827. return pageX - xOffset;
  65828. },
  65829. getTop: function getTop(e) {
  65830. var container = this.$refs.container;
  65831. var yOffset = container.getBoundingClientRect().top + window.pageYOffset;
  65832. var pageY = e.pageY || (0, _utils.getTouches)(e, 'PageY');
  65833. return pageY - yOffset;
  65834. }
  65835. }
  65836. };
  65837. /***/ }),
  65838. /* 85 */
  65839. /***/ (function(module, exports, __webpack_require__) {
  65840. "use strict";
  65841. Object.defineProperty(exports, "__esModule", {
  65842. value: true
  65843. });
  65844. var _newArrowCheck2 = __webpack_require__(1);
  65845. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  65846. var _util = __webpack_require__(20);
  65847. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  65848. exports.default = {
  65849. name: 'PanelTable',
  65850. props: {
  65851. tableDate: {
  65852. type: Date,
  65853. required: true
  65854. },
  65855. disabledDate: {
  65856. type: Function
  65857. },
  65858. selectionMode: {
  65859. type: String,
  65860. required: true
  65861. },
  65862. value: {
  65863. type: Array,
  65864. required: true
  65865. },
  65866. rangeState: {
  65867. type: Object,
  65868. default: function _default() {
  65869. (0, _newArrowCheck3.default)(undefined, undefined);
  65870. return {
  65871. from: null,
  65872. to: null,
  65873. selecting: false
  65874. };
  65875. }.bind(undefined)
  65876. },
  65877. focusedDate: {
  65878. type: Date,
  65879. required: true
  65880. }
  65881. },
  65882. computed: {
  65883. dates: function dates() {
  65884. var selectionMode = this.selectionMode,
  65885. value = this.value,
  65886. rangeState = this.rangeState;
  65887. var rangeSelecting = selectionMode === 'range' && rangeState.selecting;
  65888. return rangeSelecting ? [rangeState.from] : value;
  65889. }
  65890. },
  65891. methods: {
  65892. handleClick: function handleClick(cell, e) {
  65893. e.stopPropagation();
  65894. if (cell.disabled || cell.type === 'weekLabel') return;
  65895. var newDate = new Date((0, _util.clearHours)(cell.date));
  65896. this.$emit('on-pick', newDate);
  65897. this.$emit('on-pick-click');
  65898. },
  65899. handleMouseMove: function handleMouseMove(cell) {
  65900. if (!this.rangeState.selecting) return;
  65901. if (cell.disabled) return;
  65902. var newDate = cell.date;
  65903. this.$emit('on-change-range', newDate);
  65904. }
  65905. }
  65906. };
  65907. /***/ }),
  65908. /* 86 */
  65909. /***/ (function(module, exports, __webpack_require__) {
  65910. "use strict";
  65911. Object.defineProperty(exports, "__esModule", {
  65912. value: true
  65913. });
  65914. exports.default = 'ivu-date-picker-cells';
  65915. /***/ }),
  65916. /* 87 */
  65917. /***/ (function(module, exports, __webpack_require__) {
  65918. "use strict";
  65919. Object.defineProperty(exports, "__esModule", {
  65920. value: true
  65921. });
  65922. var _newArrowCheck2 = __webpack_require__(1);
  65923. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  65924. var _from = __webpack_require__(111);
  65925. var _from2 = _interopRequireDefault(_from);
  65926. var _assist = __webpack_require__(3);
  65927. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  65928. exports.default = {
  65929. props: {
  65930. lockScroll: {
  65931. type: Boolean,
  65932. default: true
  65933. }
  65934. },
  65935. methods: {
  65936. checkScrollBar: function checkScrollBar() {
  65937. var fullWindowWidth = window.innerWidth;
  65938. if (!fullWindowWidth) {
  65939. var documentElementRect = document.documentElement.getBoundingClientRect();
  65940. fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left);
  65941. }
  65942. this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth;
  65943. if (this.bodyIsOverflowing) {
  65944. this.scrollBarWidth = (0, _assist.getScrollBarSize)();
  65945. }
  65946. },
  65947. checkMaskInVisible: function checkMaskInVisible() {
  65948. var _this = this;
  65949. var masks = document.getElementsByClassName('ivu-modal-mask') || [];
  65950. return (0, _from2.default)(masks).every(function (m) {
  65951. (0, _newArrowCheck3.default)(this, _this);
  65952. return m.style.display === 'none' || m.classList.contains('fade-leave-to');
  65953. }.bind(this));
  65954. },
  65955. setScrollBar: function setScrollBar() {
  65956. if (this.bodyIsOverflowing && this.scrollBarWidth !== undefined) {
  65957. document.body.style.paddingRight = String(this.scrollBarWidth) + 'px';
  65958. }
  65959. },
  65960. resetScrollBar: function resetScrollBar() {
  65961. document.body.style.paddingRight = '';
  65962. },
  65963. addScrollEffect: function addScrollEffect() {
  65964. if (!this.lockScroll) return;
  65965. this.checkScrollBar();
  65966. this.setScrollBar();
  65967. document.body.style.overflow = 'hidden';
  65968. },
  65969. removeScrollEffect: function removeScrollEffect() {
  65970. if (!this.lockScroll) return;
  65971. if (this.checkMaskInVisible()) {
  65972. document.body.style.overflow = '';
  65973. this.resetScrollBar();
  65974. }
  65975. }
  65976. }
  65977. };
  65978. /***/ }),
  65979. /* 88 */
  65980. /***/ (function(module, exports) {
  65981. module.exports = function (it, Constructor, name, forbiddenField) {
  65982. if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
  65983. throw TypeError(name + ': incorrect invocation!');
  65984. } return it;
  65985. };
  65986. /***/ }),
  65987. /* 89 */
  65988. /***/ (function(module, exports, __webpack_require__) {
  65989. "use strict";
  65990. // 25.4.1.5 NewPromiseCapability(C)
  65991. var aFunction = __webpack_require__(43);
  65992. function PromiseCapability(C) {
  65993. var resolve, reject;
  65994. this.promise = new C(function ($$resolve, $$reject) {
  65995. if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
  65996. resolve = $$resolve;
  65997. reject = $$reject;
  65998. });
  65999. this.resolve = aFunction(resolve);
  66000. this.reject = aFunction(reject);
  66001. }
  66002. module.exports.f = function (C) {
  66003. return new PromiseCapability(C);
  66004. };
  66005. /***/ }),
  66006. /* 90 */
  66007. /***/ (function(module, exports, __webpack_require__) {
  66008. var hide = __webpack_require__(25);
  66009. module.exports = function (target, src, safe) {
  66010. for (var key in src) {
  66011. if (safe && target[key]) target[key] = src[key];
  66012. else hide(target, key, src[key]);
  66013. } return target;
  66014. };
  66015. /***/ }),
  66016. /* 91 */
  66017. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66018. "use strict";
  66019. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  66020. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__ = __webpack_require__(198);
  66021. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__);
  66022. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  66023. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__ = __webpack_require__(465);
  66024. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__);
  66025. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  66026. /* script */
  66027. /* template */
  66028. /* template functional */
  66029. var __vue_template_functional__ = false
  66030. /* styles */
  66031. var __vue_styles__ = null
  66032. /* scopeId */
  66033. var __vue_scopeId__ = null
  66034. /* moduleIdentifier (server only) */
  66035. var __vue_module_identifier__ = null
  66036. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  66037. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default.a,
  66038. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__["render"],
  66039. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_38ac6ee9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__["staticRenderFns"],
  66040. __vue_template_functional__,
  66041. __vue_styles__,
  66042. __vue_scopeId__,
  66043. __vue_module_identifier__
  66044. )
  66045. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  66046. /***/ }),
  66047. /* 92 */
  66048. /***/ (function(module, exports, __webpack_require__) {
  66049. "use strict";
  66050. Object.defineProperty(exports, "__esModule", {
  66051. value: true
  66052. });
  66053. var _assist = __webpack_require__(3);
  66054. exports.default = {
  66055. data: function data() {
  66056. return {
  66057. menu: (0, _assist.findComponentUpward)(this, 'Menu')
  66058. };
  66059. },
  66060. computed: {
  66061. hasParentSubmenu: function hasParentSubmenu() {
  66062. return !!(0, _assist.findComponentUpward)(this, 'Submenu');
  66063. },
  66064. parentSubmenuNum: function parentSubmenuNum() {
  66065. return (0, _assist.findComponentsUpward)(this, 'Submenu').length;
  66066. },
  66067. mode: function mode() {
  66068. return this.menu.mode;
  66069. }
  66070. }
  66071. };
  66072. /***/ }),
  66073. /* 93 */
  66074. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  66075. "use strict";
  66076. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  66077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__ = __webpack_require__(228);
  66078. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__);
  66079. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  66080. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__ = __webpack_require__(527);
  66081. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__);
  66082. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  66083. /* script */
  66084. /* template */
  66085. /* template functional */
  66086. var __vue_template_functional__ = false
  66087. /* styles */
  66088. var __vue_styles__ = null
  66089. /* scopeId */
  66090. var __vue_scopeId__ = null
  66091. /* moduleIdentifier (server only) */
  66092. var __vue_module_identifier__ = null
  66093. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  66094. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tooltip_vue___default.a,
  66095. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__["render"],
  66096. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_721e5989_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tooltip_vue__["staticRenderFns"],
  66097. __vue_template_functional__,
  66098. __vue_styles__,
  66099. __vue_scopeId__,
  66100. __vue_module_identifier__
  66101. )
  66102. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  66103. /***/ }),
  66104. /* 94 */
  66105. /***/ (function(module, exports, __webpack_require__) {
  66106. "use strict";
  66107. var forEach = __webpack_require__(229).forEach;
  66108. var elementUtilsMaker = __webpack_require__(529);
  66109. var listenerHandlerMaker = __webpack_require__(530);
  66110. var idGeneratorMaker = __webpack_require__(531);
  66111. var idHandlerMaker = __webpack_require__(532);
  66112. var reporterMaker = __webpack_require__(533);
  66113. var browserDetector = __webpack_require__(230);
  66114. var batchProcessorMaker = __webpack_require__(534);
  66115. var stateHandler = __webpack_require__(536);
  66116. //Detection strategies.
  66117. var objectStrategyMaker = __webpack_require__(537);
  66118. var scrollStrategyMaker = __webpack_require__(538);
  66119. function isCollection(obj) {
  66120. return Array.isArray(obj) || obj.length !== undefined;
  66121. }
  66122. function toArray(collection) {
  66123. if (!Array.isArray(collection)) {
  66124. var array = [];
  66125. forEach(collection, function (obj) {
  66126. array.push(obj);
  66127. });
  66128. return array;
  66129. } else {
  66130. return collection;
  66131. }
  66132. }
  66133. function isElement(obj) {
  66134. return obj && obj.nodeType === 1;
  66135. }
  66136. /**
  66137. * @typedef idHandler
  66138. * @type {object}
  66139. * @property {function} get Gets the resize detector id of the element.
  66140. * @property {function} set Generate and sets the resize detector id of the element.
  66141. */
  66142. /**
  66143. * @typedef Options
  66144. * @type {object}
  66145. * @property {boolean} callOnAdd Determines if listeners should be called when they are getting added.
  66146. Default is true. If true, the listener is guaranteed to be called when it has been added.
  66147. If false, the listener will not be guarenteed to be called when it has been added (does not prevent it from being called).
  66148. * @property {idHandler} idHandler A custom id handler that is responsible for generating, setting and retrieving id's for elements.
  66149. If not provided, a default id handler will be used.
  66150. * @property {reporter} reporter A custom reporter that handles reporting logs, warnings and errors.
  66151. If not provided, a default id handler will be used.
  66152. If set to false, then nothing will be reported.
  66153. * @property {boolean} debug If set to true, the the system will report debug messages as default for the listenTo method.
  66154. */
  66155. /**
  66156. * Creates an element resize detector instance.
  66157. * @public
  66158. * @param {Options?} options Optional global options object that will decide how this instance will work.
  66159. */
  66160. module.exports = function(options) {
  66161. options = options || {};
  66162. //idHandler is currently not an option to the listenTo function, so it should not be added to globalOptions.
  66163. var idHandler;
  66164. if (options.idHandler) {
  66165. // To maintain compatability with idHandler.get(element, readonly), make sure to wrap the given idHandler
  66166. // so that readonly flag always is true when it's used here. This may be removed next major version bump.
  66167. idHandler = {
  66168. get: function (element) { return options.idHandler.get(element, true); },
  66169. set: options.idHandler.set
  66170. };
  66171. } else {
  66172. var idGenerator = idGeneratorMaker();
  66173. var defaultIdHandler = idHandlerMaker({
  66174. idGenerator: idGenerator,
  66175. stateHandler: stateHandler
  66176. });
  66177. idHandler = defaultIdHandler;
  66178. }
  66179. //reporter is currently not an option to the listenTo function, so it should not be added to globalOptions.
  66180. var reporter = options.reporter;
  66181. if(!reporter) {
  66182. //If options.reporter is false, then the reporter should be quiet.
  66183. var quiet = reporter === false;
  66184. reporter = reporterMaker(quiet);
  66185. }
  66186. //batchProcessor is currently not an option to the listenTo function, so it should not be added to globalOptions.
  66187. var batchProcessor = getOption(options, "batchProcessor", batchProcessorMaker({ reporter: reporter }));
  66188. //Options to be used as default for the listenTo function.
  66189. var globalOptions = {};
  66190. globalOptions.callOnAdd = !!getOption(options, "callOnAdd", true);
  66191. globalOptions.debug = !!getOption(options, "debug", false);
  66192. var eventListenerHandler = listenerHandlerMaker(idHandler);
  66193. var elementUtils = elementUtilsMaker({
  66194. stateHandler: stateHandler
  66195. });
  66196. //The detection strategy to be used.
  66197. var detectionStrategy;
  66198. var desiredStrategy = getOption(options, "strategy", "object");
  66199. var importantCssRules = getOption(options, "important", false);
  66200. var strategyOptions = {
  66201. reporter: reporter,
  66202. batchProcessor: batchProcessor,
  66203. stateHandler: stateHandler,
  66204. idHandler: idHandler,
  66205. important: importantCssRules
  66206. };
  66207. if(desiredStrategy === "scroll") {
  66208. if (browserDetector.isLegacyOpera()) {
  66209. reporter.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy.");
  66210. desiredStrategy = "object";
  66211. } else if (browserDetector.isIE(9)) {
  66212. reporter.warn("Scroll strategy is not supported on IE9. Changing to object strategy.");
  66213. desiredStrategy = "object";
  66214. }
  66215. }
  66216. if(desiredStrategy === "scroll") {
  66217. detectionStrategy = scrollStrategyMaker(strategyOptions);
  66218. } else if(desiredStrategy === "object") {
  66219. detectionStrategy = objectStrategyMaker(strategyOptions);
  66220. } else {
  66221. throw new Error("Invalid strategy name: " + desiredStrategy);
  66222. }
  66223. //Calls can be made to listenTo with elements that are still being installed.
  66224. //Also, same elements can occur in the elements list in the listenTo function.
  66225. //With this map, the ready callbacks can be synchronized between the calls
  66226. //so that the ready callback can always be called when an element is ready - even if
  66227. //it wasn't installed from the function itself.
  66228. var onReadyCallbacks = {};
  66229. /**
  66230. * Makes the given elements resize-detectable and starts listening to resize events on the elements. Calls the event callback for each event for each element.
  66231. * @public
  66232. * @param {Options?} options Optional options object. These options will override the global options. Some options may not be overriden, such as idHandler.
  66233. * @param {element[]|element} elements The given array of elements to detect resize events of. Single element is also valid.
  66234. * @param {function} listener The callback to be executed for each resize event for each element.
  66235. */
  66236. function listenTo(options, elements, listener) {
  66237. function onResizeCallback(element) {
  66238. var listeners = eventListenerHandler.get(element);
  66239. forEach(listeners, function callListenerProxy(listener) {
  66240. listener(element);
  66241. });
  66242. }
  66243. function addListener(callOnAdd, element, listener) {
  66244. eventListenerHandler.add(element, listener);
  66245. if(callOnAdd) {
  66246. listener(element);
  66247. }
  66248. }
  66249. //Options object may be omitted.
  66250. if(!listener) {
  66251. listener = elements;
  66252. elements = options;
  66253. options = {};
  66254. }
  66255. if(!elements) {
  66256. throw new Error("At least one element required.");
  66257. }
  66258. if(!listener) {
  66259. throw new Error("Listener required.");
  66260. }
  66261. if (isElement(elements)) {
  66262. // A single element has been passed in.
  66263. elements = [elements];
  66264. } else if (isCollection(elements)) {
  66265. // Convert collection to array for plugins.
  66266. // TODO: May want to check so that all the elements in the collection are valid elements.
  66267. elements = toArray(elements);
  66268. } else {
  66269. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  66270. }
  66271. var elementsReady = 0;
  66272. var callOnAdd = getOption(options, "callOnAdd", globalOptions.callOnAdd);
  66273. var onReadyCallback = getOption(options, "onReady", function noop() {});
  66274. var debug = getOption(options, "debug", globalOptions.debug);
  66275. forEach(elements, function attachListenerToElement(element) {
  66276. if (!stateHandler.getState(element)) {
  66277. stateHandler.initState(element);
  66278. idHandler.set(element);
  66279. }
  66280. var id = idHandler.get(element);
  66281. debug && reporter.log("Attaching listener to element", id, element);
  66282. if(!elementUtils.isDetectable(element)) {
  66283. debug && reporter.log(id, "Not detectable.");
  66284. if(elementUtils.isBusy(element)) {
  66285. debug && reporter.log(id, "System busy making it detectable");
  66286. //The element is being prepared to be detectable. Do not make it detectable.
  66287. //Just add the listener, because the element will soon be detectable.
  66288. addListener(callOnAdd, element, listener);
  66289. onReadyCallbacks[id] = onReadyCallbacks[id] || [];
  66290. onReadyCallbacks[id].push(function onReady() {
  66291. elementsReady++;
  66292. if(elementsReady === elements.length) {
  66293. onReadyCallback();
  66294. }
  66295. });
  66296. return;
  66297. }
  66298. debug && reporter.log(id, "Making detectable...");
  66299. //The element is not prepared to be detectable, so do prepare it and add a listener to it.
  66300. elementUtils.markBusy(element, true);
  66301. return detectionStrategy.makeDetectable({ debug: debug, important: importantCssRules }, element, function onElementDetectable(element) {
  66302. debug && reporter.log(id, "onElementDetectable");
  66303. if (stateHandler.getState(element)) {
  66304. elementUtils.markAsDetectable(element);
  66305. elementUtils.markBusy(element, false);
  66306. detectionStrategy.addListener(element, onResizeCallback);
  66307. addListener(callOnAdd, element, listener);
  66308. // Since the element size might have changed since the call to "listenTo", we need to check for this change,
  66309. // so that a resize event may be emitted.
  66310. // Having the startSize object is optional (since it does not make sense in some cases such as unrendered elements), so check for its existance before.
  66311. // Also, check the state existance before since the element may have been uninstalled in the installation process.
  66312. var state = stateHandler.getState(element);
  66313. if (state && state.startSize) {
  66314. var width = element.offsetWidth;
  66315. var height = element.offsetHeight;
  66316. if (state.startSize.width !== width || state.startSize.height !== height) {
  66317. onResizeCallback(element);
  66318. }
  66319. }
  66320. if(onReadyCallbacks[id]) {
  66321. forEach(onReadyCallbacks[id], function(callback) {
  66322. callback();
  66323. });
  66324. }
  66325. } else {
  66326. // The element has been unisntalled before being detectable.
  66327. debug && reporter.log(id, "Element uninstalled before being detectable.");
  66328. }
  66329. delete onReadyCallbacks[id];
  66330. elementsReady++;
  66331. if(elementsReady === elements.length) {
  66332. onReadyCallback();
  66333. }
  66334. });
  66335. }
  66336. debug && reporter.log(id, "Already detecable, adding listener.");
  66337. //The element has been prepared to be detectable and is ready to be listened to.
  66338. addListener(callOnAdd, element, listener);
  66339. elementsReady++;
  66340. });
  66341. if(elementsReady === elements.length) {
  66342. onReadyCallback();
  66343. }
  66344. }
  66345. function uninstall(elements) {
  66346. if(!elements) {
  66347. return reporter.error("At least one element is required.");
  66348. }
  66349. if (isElement(elements)) {
  66350. // A single element has been passed in.
  66351. elements = [elements];
  66352. } else if (isCollection(elements)) {
  66353. // Convert collection to array for plugins.
  66354. // TODO: May want to check so that all the elements in the collection are valid elements.
  66355. elements = toArray(elements);
  66356. } else {
  66357. return reporter.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");
  66358. }
  66359. forEach(elements, function (element) {
  66360. eventListenerHandler.removeAllListeners(element);
  66361. detectionStrategy.uninstall(element);
  66362. stateHandler.cleanState(element);
  66363. });
  66364. }
  66365. function initDocument(targetDocument) {
  66366. detectionStrategy.initDocument && detectionStrategy.initDocument(targetDocument);
  66367. }
  66368. return {
  66369. listenTo: listenTo,
  66370. removeListener: eventListenerHandler.removeListener,
  66371. removeAllListeners: eventListenerHandler.removeAllListeners,
  66372. uninstall: uninstall,
  66373. initDocument: initDocument
  66374. };
  66375. };
  66376. function getOption(options, name, defaultValue) {
  66377. var value = options[name];
  66378. if((value === undefined || value === null) && defaultValue !== undefined) {
  66379. return defaultValue;
  66380. }
  66381. return value;
  66382. }
  66383. /***/ }),
  66384. /* 95 */
  66385. /***/ (function(module, exports, __webpack_require__) {
  66386. "use strict";
  66387. Object.defineProperty(exports, "__esModule", {
  66388. value: true
  66389. });
  66390. var _defineProperty2 = __webpack_require__(2);
  66391. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  66392. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66393. exports.default = {
  66394. methods: {
  66395. alignCls: function alignCls(column) {
  66396. var _ref;
  66397. var row = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  66398. var cellClassName = '';
  66399. if (row.cellClassName && column.key && row.cellClassName[column.key]) {
  66400. cellClassName = row.cellClassName[column.key];
  66401. }
  66402. return [String(this.prefixCls) + '-column-' + String(column.__id), (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(cellClassName), cellClassName), (0, _defineProperty3.default)(_ref, '' + String(column.className), column.className), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-column-' + String(column.align), column.align), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', this.fixed === 'left' && column.fixed !== 'left' || this.fixed === 'right' && column.fixed !== 'right' || !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')), _ref)];
  66403. },
  66404. isPopperShow: function isPopperShow(column) {
  66405. return column.filters && (!this.fixed && !column.fixed || this.fixed === 'left' && column.fixed === 'left' || this.fixed === 'right' && column.fixed === 'right');
  66406. },
  66407. setCellWidth: function setCellWidth(column) {
  66408. var width = '';
  66409. if (column.width) {
  66410. width = column.width;
  66411. } else if (this.columnsWidth[column._index]) {
  66412. width = this.columnsWidth[column._index].width;
  66413. }
  66414. if (width === '0') width = '';
  66415. return width;
  66416. }
  66417. }
  66418. };
  66419. /***/ }),
  66420. /* 96 */
  66421. /***/ (function(module, exports, __webpack_require__) {
  66422. var has = __webpack_require__(30);
  66423. var toIObject = __webpack_require__(33);
  66424. var arrayIndexOf = __webpack_require__(262)(false);
  66425. var IE_PROTO = __webpack_require__(66)('IE_PROTO');
  66426. module.exports = function (object, names) {
  66427. var O = toIObject(object);
  66428. var i = 0;
  66429. var result = [];
  66430. var key;
  66431. for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  66432. // Don't enum bug & hidden keys
  66433. while (names.length > i) if (has(O, key = names[i++])) {
  66434. ~arrayIndexOf(result, key) || result.push(key);
  66435. }
  66436. return result;
  66437. };
  66438. /***/ }),
  66439. /* 97 */
  66440. /***/ (function(module, exports, __webpack_require__) {
  66441. // most Object methods by ES6 should accept primitives
  66442. var $export = __webpack_require__(7);
  66443. var core = __webpack_require__(5);
  66444. var fails = __webpack_require__(31);
  66445. module.exports = function (KEY, exec) {
  66446. var fn = (core.Object || {})[KEY] || Object[KEY];
  66447. var exp = {};
  66448. exp[KEY] = exec(fn);
  66449. $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
  66450. };
  66451. /***/ }),
  66452. /* 98 */
  66453. /***/ (function(module, exports, __webpack_require__) {
  66454. module.exports = !__webpack_require__(13) && !__webpack_require__(31)(function () {
  66455. return Object.defineProperty(__webpack_require__(69)('div'), 'a', { get: function () { return 7; } }).a != 7;
  66456. });
  66457. /***/ }),
  66458. /* 99 */
  66459. /***/ (function(module, exports, __webpack_require__) {
  66460. "use strict";
  66461. Object.defineProperty(exports, "__esModule", {
  66462. value: true
  66463. });
  66464. var _newArrowCheck2 = __webpack_require__(1);
  66465. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  66466. var _defineProperty2 = __webpack_require__(2);
  66467. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  66468. var _dom = __webpack_require__(12);
  66469. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66470. var prefixCls = 'ivu-affix';
  66471. function getScroll(target, top) {
  66472. var prop = top ? 'pageYOffset' : 'pageXOffset';
  66473. var method = top ? 'scrollTop' : 'scrollLeft';
  66474. var ret = target[prop];
  66475. if (typeof ret !== 'number') {
  66476. ret = window.document.documentElement[method];
  66477. }
  66478. return ret;
  66479. }
  66480. function getOffset(element) {
  66481. var rect = element.getBoundingClientRect();
  66482. var scrollTop = getScroll(window, true);
  66483. var scrollLeft = getScroll(window);
  66484. var docEl = window.document.body;
  66485. var clientTop = docEl.clientTop || 0;
  66486. var clientLeft = docEl.clientLeft || 0;
  66487. return {
  66488. top: rect.top + scrollTop - clientTop,
  66489. left: rect.left + scrollLeft - clientLeft
  66490. };
  66491. }
  66492. exports.default = {
  66493. name: 'Affix',
  66494. props: {
  66495. offsetTop: {
  66496. type: Number,
  66497. default: 0
  66498. },
  66499. offsetBottom: {
  66500. type: Number
  66501. },
  66502. useCapture: {
  66503. type: Boolean,
  66504. default: false
  66505. }
  66506. },
  66507. data: function data() {
  66508. return {
  66509. affix: false,
  66510. styles: {},
  66511. slot: false,
  66512. slotStyle: {}
  66513. };
  66514. },
  66515. computed: {
  66516. offsetType: function offsetType() {
  66517. var type = 'top';
  66518. if (this.offsetBottom >= 0) {
  66519. type = 'bottom';
  66520. }
  66521. return type;
  66522. },
  66523. classes: function classes() {
  66524. return [(0, _defineProperty3.default)({}, '' + prefixCls, this.affix)];
  66525. }
  66526. },
  66527. mounted: function mounted() {
  66528. var _this = this;
  66529. (0, _dom.on)(window, 'scroll', this.handleScroll, this.useCapture);
  66530. (0, _dom.on)(window, 'resize', this.handleScroll, this.useCapture);
  66531. this.$nextTick(function () {
  66532. (0, _newArrowCheck3.default)(this, _this);
  66533. this.handleScroll();
  66534. }.bind(this));
  66535. },
  66536. beforeDestroy: function beforeDestroy() {
  66537. (0, _dom.off)(window, 'scroll', this.handleScroll, this.useCapture);
  66538. (0, _dom.off)(window, 'resize', this.handleScroll, this.useCapture);
  66539. },
  66540. methods: {
  66541. handleScroll: function handleScroll() {
  66542. var affix = this.affix;
  66543. var scrollTop = getScroll(window, true);
  66544. var elOffset = getOffset(this.$el);
  66545. var windowHeight = window.innerHeight;
  66546. var elHeight = this.$el.getElementsByTagName('div')[0].offsetHeight;
  66547. if (elOffset.top - this.offsetTop < scrollTop && this.offsetType == 'top' && !affix) {
  66548. this.affix = true;
  66549. this.slotStyle = {
  66550. width: this.$refs.point.clientWidth + 'px',
  66551. height: this.$refs.point.clientHeight + 'px'
  66552. };
  66553. this.slot = true;
  66554. this.styles = {
  66555. top: String(this.offsetTop) + 'px',
  66556. left: String(elOffset.left) + 'px',
  66557. width: String(this.$el.offsetWidth) + 'px'
  66558. };
  66559. this.$emit('on-change', true);
  66560. } else if (elOffset.top - this.offsetTop > scrollTop && this.offsetType == 'top' && affix) {
  66561. this.slot = false;
  66562. this.slotStyle = {};
  66563. this.affix = false;
  66564. this.styles = null;
  66565. this.$emit('on-change', false);
  66566. }
  66567. if (elOffset.top + this.offsetBottom + elHeight > scrollTop + windowHeight && this.offsetType == 'bottom' && !affix) {
  66568. this.affix = true;
  66569. this.styles = {
  66570. bottom: String(this.offsetBottom) + 'px',
  66571. left: String(elOffset.left) + 'px',
  66572. width: String(this.$el.offsetWidth) + 'px'
  66573. };
  66574. this.$emit('on-change', true);
  66575. } else if (elOffset.top + this.offsetBottom + elHeight < scrollTop + windowHeight && this.offsetType == 'bottom' && affix) {
  66576. this.affix = false;
  66577. this.styles = null;
  66578. this.$emit('on-change', false);
  66579. }
  66580. }
  66581. }
  66582. };
  66583. /***/ }),
  66584. /* 100 */
  66585. /***/ (function(module, exports, __webpack_require__) {
  66586. "use strict";
  66587. Object.defineProperty(exports, "__esModule", {
  66588. value: true
  66589. });
  66590. var _defineProperty2 = __webpack_require__(2);
  66591. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  66592. var _icon = __webpack_require__(19);
  66593. var _icon2 = _interopRequireDefault(_icon);
  66594. var _assist = __webpack_require__(3);
  66595. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66596. var prefixCls = 'ivu-alert';
  66597. exports.default = {
  66598. name: 'Alert',
  66599. components: { Icon: _icon2.default },
  66600. props: {
  66601. type: {
  66602. validator: function validator(value) {
  66603. return (0, _assist.oneOf)(value, ['success', 'info', 'warning', 'error']);
  66604. },
  66605. default: 'info'
  66606. },
  66607. closable: {
  66608. type: Boolean,
  66609. default: false
  66610. },
  66611. showIcon: {
  66612. type: Boolean,
  66613. default: false
  66614. },
  66615. banner: {
  66616. type: Boolean,
  66617. default: false
  66618. },
  66619. fade: {
  66620. type: Boolean,
  66621. default: true
  66622. }
  66623. },
  66624. data: function data() {
  66625. return {
  66626. closed: false,
  66627. desc: false
  66628. };
  66629. },
  66630. computed: {
  66631. wrapClasses: function wrapClasses() {
  66632. var _ref;
  66633. return ['' + prefixCls, prefixCls + '-' + String(this.type), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-icon', this.showIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-with-desc', this.desc), (0, _defineProperty3.default)(_ref, prefixCls + '-with-banner', this.banner), _ref)];
  66634. },
  66635. messageClasses: function messageClasses() {
  66636. return prefixCls + '-message';
  66637. },
  66638. descClasses: function descClasses() {
  66639. return prefixCls + '-desc';
  66640. },
  66641. closeClasses: function closeClasses() {
  66642. return prefixCls + '-close';
  66643. },
  66644. iconClasses: function iconClasses() {
  66645. return prefixCls + '-icon';
  66646. },
  66647. iconType: function iconType() {
  66648. var type = '';
  66649. switch (this.type) {
  66650. case 'success':
  66651. type = 'ios-checkmark-circle';
  66652. break;
  66653. case 'info':
  66654. type = 'ios-information-circle';
  66655. break;
  66656. case 'warning':
  66657. type = 'ios-alert';
  66658. break;
  66659. case 'error':
  66660. type = 'ios-close-circle';
  66661. break;
  66662. }
  66663. if (this.desc) type += '-outline';
  66664. return type;
  66665. }
  66666. },
  66667. methods: {
  66668. close: function close(e) {
  66669. this.closed = true;
  66670. this.$emit('on-close', e);
  66671. }
  66672. },
  66673. mounted: function mounted() {
  66674. this.desc = this.$slots.desc !== undefined;
  66675. }
  66676. };
  66677. /***/ }),
  66678. /* 101 */
  66679. /***/ (function(module, exports, __webpack_require__) {
  66680. "use strict";
  66681. Object.defineProperty(exports, "__esModule", {
  66682. value: true
  66683. });
  66684. var _defineProperty2 = __webpack_require__(2);
  66685. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  66686. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66687. var prefixCls = 'ivu-icon';
  66688. exports.default = {
  66689. name: 'Icon',
  66690. props: {
  66691. type: {
  66692. type: String,
  66693. default: ''
  66694. },
  66695. size: [Number, String],
  66696. color: String,
  66697. custom: {
  66698. type: String,
  66699. default: ''
  66700. }
  66701. },
  66702. computed: {
  66703. classes: function classes() {
  66704. var _ref;
  66705. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), this.type !== ''), (0, _defineProperty3.default)(_ref, '' + String(this.custom), this.custom !== ''), _ref)];
  66706. },
  66707. styles: function styles() {
  66708. var style = {};
  66709. if (this.size) {
  66710. style['font-size'] = String(this.size) + 'px';
  66711. }
  66712. if (this.color) {
  66713. style.color = this.color;
  66714. }
  66715. return style;
  66716. }
  66717. },
  66718. methods: {
  66719. handleClick: function handleClick(event) {
  66720. this.$emit('click', event);
  66721. }
  66722. }
  66723. };
  66724. /***/ }),
  66725. /* 102 */
  66726. /***/ (function(module, exports) {
  66727. module.exports = function (done, value) {
  66728. return { value: value, done: !!done };
  66729. };
  66730. /***/ }),
  66731. /* 103 */
  66732. /***/ (function(module, exports, __webpack_require__) {
  66733. module.exports = __webpack_require__(25);
  66734. /***/ }),
  66735. /* 104 */
  66736. /***/ (function(module, exports, __webpack_require__) {
  66737. var dP = __webpack_require__(14);
  66738. var anObject = __webpack_require__(22);
  66739. var getKeys = __webpack_require__(40);
  66740. module.exports = __webpack_require__(13) ? Object.defineProperties : function defineProperties(O, Properties) {
  66741. anObject(O);
  66742. var keys = getKeys(Properties);
  66743. var length = keys.length;
  66744. var i = 0;
  66745. var P;
  66746. while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  66747. return O;
  66748. };
  66749. /***/ }),
  66750. /* 105 */
  66751. /***/ (function(module, exports, __webpack_require__) {
  66752. var document = __webpack_require__(9).document;
  66753. module.exports = document && document.documentElement;
  66754. /***/ }),
  66755. /* 106 */
  66756. /***/ (function(module, exports, __webpack_require__) {
  66757. // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
  66758. var has = __webpack_require__(30);
  66759. var toObject = __webpack_require__(29);
  66760. var IE_PROTO = __webpack_require__(66)('IE_PROTO');
  66761. var ObjectProto = Object.prototype;
  66762. module.exports = Object.getPrototypeOf || function (O) {
  66763. O = toObject(O);
  66764. if (has(O, IE_PROTO)) return O[IE_PROTO];
  66765. if (typeof O.constructor == 'function' && O instanceof O.constructor) {
  66766. return O.constructor.prototype;
  66767. } return O instanceof Object ? ObjectProto : null;
  66768. };
  66769. /***/ }),
  66770. /* 107 */
  66771. /***/ (function(module, exports, __webpack_require__) {
  66772. "use strict";
  66773. Object.defineProperty(exports, "__esModule", {
  66774. value: true
  66775. });
  66776. var _newArrowCheck2 = __webpack_require__(1);
  66777. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  66778. var _assist = __webpack_require__(3);
  66779. var _dom = __webpack_require__(12);
  66780. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66781. exports.default = {
  66782. name: 'Anchor',
  66783. provide: function provide() {
  66784. return {
  66785. anchorCom: this
  66786. };
  66787. },
  66788. data: function data() {
  66789. return {
  66790. prefix: 'ivu-anchor',
  66791. isAffixed: false,
  66792. inkTop: 0,
  66793. animating: false,
  66794. currentLink: '',
  66795. currentId: '',
  66796. scrollContainer: null,
  66797. scrollElement: null,
  66798. titlesOffsetArr: [],
  66799. wrapperTop: 0,
  66800. upperFirstTitle: true
  66801. };
  66802. },
  66803. props: {
  66804. affix: {
  66805. type: Boolean,
  66806. default: true
  66807. },
  66808. offsetTop: {
  66809. type: Number,
  66810. default: 0
  66811. },
  66812. offsetBottom: Number,
  66813. bounds: {
  66814. type: Number,
  66815. default: 5
  66816. },
  66817. container: null,
  66818. showInk: {
  66819. type: Boolean,
  66820. default: false
  66821. },
  66822. scrollOffset: {
  66823. type: Number,
  66824. default: 0
  66825. }
  66826. },
  66827. computed: {
  66828. wrapperComponent: function wrapperComponent() {
  66829. return this.affix ? 'Affix' : 'div';
  66830. },
  66831. wrapperStyle: function wrapperStyle() {
  66832. return {
  66833. maxHeight: this.offsetTop ? 'calc(100vh - ' + String(this.offsetTop) + 'px)' : '100vh'
  66834. };
  66835. },
  66836. containerIsWindow: function containerIsWindow() {
  66837. return this.scrollContainer === window;
  66838. }
  66839. },
  66840. methods: {
  66841. handleAffixStateChange: function handleAffixStateChange(state) {
  66842. this.isAffixed = this.affix && state;
  66843. },
  66844. handleScroll: function handleScroll(e) {
  66845. this.upperFirstTitle = e.target.scrollTop < this.titlesOffsetArr[0].offset;
  66846. if (this.animating) return;
  66847. this.updateTitleOffset();
  66848. var scrollTop = document.documentElement.scrollTop || document.body.scrollTop || e.target.scrollTop;
  66849. this.getCurrentScrollAtTitleId(scrollTop);
  66850. },
  66851. handleHashChange: function handleHashChange() {
  66852. var url = window.location.href;
  66853. var sharpLinkMatch = _assist.sharpMatcherRegx.exec(url);
  66854. if (!sharpLinkMatch) return;
  66855. this.currentLink = sharpLinkMatch[0];
  66856. this.currentId = sharpLinkMatch[1];
  66857. },
  66858. handleScrollTo: function handleScrollTo() {
  66859. var _this = this;
  66860. var anchor = document.getElementById(this.currentId);
  66861. var currentLinkElementA = document.querySelector('a[data-href="' + String(this.currentLink) + '"]');
  66862. var offset = this.scrollOffset;
  66863. if (currentLinkElementA) {
  66864. offset = parseFloat(currentLinkElementA.getAttribute('data-scroll-offset'));
  66865. }
  66866. if (!anchor) return;
  66867. var offsetTop = anchor.offsetTop - this.wrapperTop - offset;
  66868. this.animating = true;
  66869. (0, _assist.scrollTop)(this.scrollContainer, this.scrollElement.scrollTop, offsetTop, 600, function () {
  66870. (0, _newArrowCheck3.default)(this, _this);
  66871. this.animating = false;
  66872. }.bind(this));
  66873. this.handleSetInkTop();
  66874. },
  66875. handleSetInkTop: function handleSetInkTop() {
  66876. var currentLinkElementA = document.querySelector('a[data-href="' + String(this.currentLink) + '"]');
  66877. if (!currentLinkElementA) return;
  66878. var elementATop = currentLinkElementA.offsetTop;
  66879. var top = elementATop < 0 ? this.offsetTop : elementATop;
  66880. this.inkTop = top;
  66881. },
  66882. updateTitleOffset: function updateTitleOffset() {
  66883. var _this2 = this;
  66884. var links = (0, _assist.findComponentsDownward)(this, 'AnchorLink').map(function (link) {
  66885. (0, _newArrowCheck3.default)(this, _this2);
  66886. return link.href;
  66887. }.bind(this));
  66888. var idArr = links.map(function (link) {
  66889. (0, _newArrowCheck3.default)(this, _this2);
  66890. return link.split('#')[1];
  66891. }.bind(this));
  66892. var offsetArr = [];
  66893. idArr.forEach(function (id) {
  66894. (0, _newArrowCheck3.default)(this, _this2);
  66895. var titleEle = document.getElementById(id);
  66896. if (titleEle) offsetArr.push({
  66897. link: '#' + String(id),
  66898. offset: titleEle.offsetTop - this.scrollElement.offsetTop
  66899. });
  66900. }.bind(this));
  66901. this.titlesOffsetArr = offsetArr;
  66902. },
  66903. getCurrentScrollAtTitleId: function getCurrentScrollAtTitleId(scrollTop) {
  66904. var i = -1;
  66905. var len = this.titlesOffsetArr.length;
  66906. var titleItem = {
  66907. link: '#',
  66908. offset: 0
  66909. };
  66910. scrollTop += this.bounds;
  66911. while (++i < len) {
  66912. var currentEle = this.titlesOffsetArr[i];
  66913. var nextEle = this.titlesOffsetArr[i + 1];
  66914. if (scrollTop >= currentEle.offset && scrollTop < (nextEle && nextEle.offset || Infinity)) {
  66915. titleItem = this.titlesOffsetArr[i];
  66916. break;
  66917. }
  66918. }
  66919. this.currentLink = titleItem.link;
  66920. this.handleSetInkTop();
  66921. },
  66922. getContainer: function getContainer() {
  66923. this.scrollContainer = this.container ? typeof this.container === 'string' ? document.querySelector(this.container) : this.container : window;
  66924. this.scrollElement = this.container ? this.scrollContainer : document.documentElement || document.body;
  66925. },
  66926. removeListener: function removeListener() {
  66927. (0, _dom.off)(this.scrollContainer, 'scroll', this.handleScroll);
  66928. (0, _dom.off)(window, 'hashchange', this.handleHashChange);
  66929. },
  66930. init: function init() {
  66931. var _this3 = this;
  66932. this.handleHashChange();
  66933. this.$nextTick(function () {
  66934. (0, _newArrowCheck3.default)(this, _this3);
  66935. this.removeListener();
  66936. this.getContainer();
  66937. this.wrapperTop = this.containerIsWindow ? 0 : this.scrollElement.offsetTop;
  66938. this.handleScrollTo();
  66939. this.handleSetInkTop();
  66940. this.updateTitleOffset();
  66941. if (this.titlesOffsetArr[0]) {
  66942. this.upperFirstTitle = this.scrollElement.scrollTop < this.titlesOffsetArr[0].offset;
  66943. }
  66944. (0, _dom.on)(this.scrollContainer, 'scroll', this.handleScroll);
  66945. (0, _dom.on)(window, 'hashchange', this.handleHashChange);
  66946. }.bind(this));
  66947. }
  66948. },
  66949. watch: {
  66950. '$route': function $route() {
  66951. var _this4 = this;
  66952. this.handleHashChange();
  66953. this.$nextTick(function () {
  66954. (0, _newArrowCheck3.default)(this, _this4);
  66955. this.handleScrollTo();
  66956. }.bind(this));
  66957. },
  66958. container: function container() {
  66959. this.init();
  66960. },
  66961. currentLink: function currentLink(newHref, oldHref) {
  66962. this.$emit('on-change', newHref, oldHref);
  66963. }
  66964. },
  66965. mounted: function mounted() {
  66966. this.init();
  66967. },
  66968. beforeDestroy: function beforeDestroy() {
  66969. this.removeListener();
  66970. }
  66971. };
  66972. /***/ }),
  66973. /* 108 */
  66974. /***/ (function(module, exports, __webpack_require__) {
  66975. "use strict";
  66976. Object.defineProperty(exports, "__esModule", {
  66977. value: true
  66978. });
  66979. var _newArrowCheck2 = __webpack_require__(1);
  66980. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  66981. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  66982. exports.default = {
  66983. name: 'AnchorLink',
  66984. inject: ['anchorCom'],
  66985. props: {
  66986. href: String,
  66987. title: String,
  66988. scrollOffset: {
  66989. type: Number,
  66990. default: function _default() {
  66991. return this.anchorCom.scrollOffset;
  66992. }
  66993. }
  66994. },
  66995. data: function data() {
  66996. return {
  66997. prefix: 'ivu-anchor-link'
  66998. };
  66999. },
  67000. computed: {
  67001. anchorLinkClasses: function anchorLinkClasses() {
  67002. return [this.prefix, this.anchorCom.currentLink === this.href ? String(this.prefix) + '-active' : ''];
  67003. },
  67004. linkTitleClasses: function linkTitleClasses() {
  67005. return [String(this.prefix) + '-title'];
  67006. }
  67007. },
  67008. methods: {
  67009. goAnchor: function goAnchor() {
  67010. var _this = this;
  67011. this.currentLink = this.href;
  67012. this.anchorCom.handleHashChange();
  67013. this.anchorCom.handleScrollTo();
  67014. this.anchorCom.$emit('on-select', this.href);
  67015. var isRoute = this.$router;
  67016. if (isRoute) {
  67017. this.$router.push(this.href, function () {
  67018. (0, _newArrowCheck3.default)(this, _this);
  67019. }.bind(this));
  67020. } else {
  67021. window.location.href = this.href;
  67022. }
  67023. }
  67024. },
  67025. mounted: function mounted() {
  67026. var _this2 = this;
  67027. this.$nextTick(function () {
  67028. (0, _newArrowCheck3.default)(this, _this2);
  67029. this.anchorCom.init();
  67030. }.bind(this));
  67031. }
  67032. };
  67033. /***/ }),
  67034. /* 109 */
  67035. /***/ (function(module, exports, __webpack_require__) {
  67036. "use strict";
  67037. Object.defineProperty(exports, "__esModule", {
  67038. value: true
  67039. });
  67040. var _newArrowCheck2 = __webpack_require__(1);
  67041. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  67042. var _select = __webpack_require__(74);
  67043. var _select2 = _interopRequireDefault(_select);
  67044. var _option = __webpack_require__(81);
  67045. var _option2 = _interopRequireDefault(_option);
  67046. var _input = __webpack_require__(38);
  67047. var _input2 = _interopRequireDefault(_input);
  67048. var _assist = __webpack_require__(3);
  67049. var _emitter = __webpack_require__(4);
  67050. var _emitter2 = _interopRequireDefault(_emitter);
  67051. var _form = __webpack_require__(11);
  67052. var _form2 = _interopRequireDefault(_form);
  67053. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67054. exports.default = {
  67055. name: 'AutoComplete',
  67056. mixins: [_emitter2.default, _form2.default],
  67057. components: { iSelect: _select2.default, iOption: _option2.default, iInput: _input2.default },
  67058. props: {
  67059. value: {
  67060. type: [String, Number],
  67061. default: ''
  67062. },
  67063. label: {
  67064. type: [String, Number],
  67065. default: ''
  67066. },
  67067. data: {
  67068. type: Array,
  67069. default: function _default() {
  67070. (0, _newArrowCheck3.default)(undefined, undefined);
  67071. return [];
  67072. }.bind(undefined)
  67073. },
  67074. disabled: {
  67075. type: Boolean,
  67076. default: false
  67077. },
  67078. clearable: {
  67079. type: Boolean,
  67080. default: false
  67081. },
  67082. placeholder: {
  67083. type: String
  67084. },
  67085. size: {
  67086. validator: function validator(value) {
  67087. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  67088. },
  67089. default: function _default() {
  67090. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  67091. }
  67092. },
  67093. icon: {
  67094. type: String
  67095. },
  67096. filterMethod: {
  67097. type: [Function, Boolean],
  67098. default: false
  67099. },
  67100. placement: {
  67101. validator: function validator(value) {
  67102. return (0, _assist.oneOf)(value, ['top', 'bottom', 'top-start', 'bottom-start', 'top-end', 'bottom-end']);
  67103. },
  67104. default: 'bottom-start'
  67105. },
  67106. transfer: {
  67107. type: Boolean,
  67108. default: function _default() {
  67109. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  67110. }
  67111. },
  67112. name: {
  67113. type: String
  67114. },
  67115. elementId: {
  67116. type: String
  67117. },
  67118. transferClassName: {
  67119. type: String
  67120. },
  67121. capture: {
  67122. type: Boolean,
  67123. default: function _default() {
  67124. return !this.$IVIEW ? true : this.$IVIEW.capture;
  67125. }
  67126. },
  67127. eventsEnabled: {
  67128. type: Boolean,
  67129. default: false
  67130. }
  67131. },
  67132. data: function data() {
  67133. return {
  67134. currentValue: this.value,
  67135. disableEmitChange: false };
  67136. },
  67137. computed: {
  67138. inputIcon: function inputIcon() {
  67139. var icon = '';
  67140. if (this.clearable && this.currentValue && !this.disabled) {
  67141. icon = 'ios-close-circle';
  67142. } else if (this.icon) {
  67143. icon = this.icon;
  67144. }
  67145. return icon;
  67146. },
  67147. filteredData: function filteredData() {
  67148. var _this = this;
  67149. if (this.filterMethod) {
  67150. return this.data.filter(function (item) {
  67151. (0, _newArrowCheck3.default)(this, _this);
  67152. return this.filterMethod(this.currentValue, item);
  67153. }.bind(this));
  67154. } else {
  67155. return this.data;
  67156. }
  67157. }
  67158. },
  67159. watch: {
  67160. value: function value(val) {
  67161. if (this.currentValue !== val) {
  67162. this.disableEmitChange = true;
  67163. }
  67164. this.currentValue = val;
  67165. },
  67166. currentValue: function currentValue(val) {
  67167. this.$refs.select.setQuery(val);
  67168. this.$emit('input', val);
  67169. if (this.disableEmitChange) {
  67170. this.disableEmitChange = false;
  67171. return;
  67172. }
  67173. this.$emit('on-change', val);
  67174. this.dispatch('FormItem', 'on-form-change', val);
  67175. }
  67176. },
  67177. methods: {
  67178. remoteMethod: function remoteMethod(query) {
  67179. this.$emit('on-search', query);
  67180. },
  67181. handleSelect: function handleSelect(option) {
  67182. var val = option.value;
  67183. if (val === undefined || val === null) return;
  67184. this.currentValue = val;
  67185. this.$refs.input.blur();
  67186. this.$emit('on-select', val);
  67187. },
  67188. handleFocus: function handleFocus(event) {
  67189. this.$emit('on-focus', event);
  67190. },
  67191. handleBlur: function handleBlur(event) {
  67192. this.$emit('on-blur', event);
  67193. },
  67194. handleClear: function handleClear() {
  67195. if (!this.clearable) return;
  67196. this.currentValue = '';
  67197. this.$refs.select.reset();
  67198. this.$emit('on-clear');
  67199. },
  67200. handleClickOutside: function handleClickOutside() {
  67201. var _this2 = this;
  67202. this.$nextTick(function () {
  67203. (0, _newArrowCheck3.default)(this, _this2);
  67204. this.$refs.input.blur();
  67205. }.bind(this));
  67206. }
  67207. }
  67208. };
  67209. /***/ }),
  67210. /* 110 */
  67211. /***/ (function(module, exports, __webpack_require__) {
  67212. "use strict";
  67213. Object.defineProperty(exports, "__esModule", {
  67214. value: true
  67215. });
  67216. var _slicedToArray2 = __webpack_require__(26);
  67217. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  67218. var _isFinite = __webpack_require__(75);
  67219. var _isFinite2 = _interopRequireDefault(_isFinite);
  67220. var _getIterator2 = __webpack_require__(45);
  67221. var _getIterator3 = _interopRequireDefault(_getIterator2);
  67222. var _stringify = __webpack_require__(57);
  67223. var _stringify2 = _interopRequireDefault(_stringify);
  67224. var _defineProperty2 = __webpack_require__(2);
  67225. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  67226. var _extends3 = __webpack_require__(32);
  67227. var _extends4 = _interopRequireDefault(_extends3);
  67228. var _toConsumableArray2 = __webpack_require__(17);
  67229. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  67230. var _newArrowCheck2 = __webpack_require__(1);
  67231. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  67232. var _dropdown = __webpack_require__(36);
  67233. var _dropdown2 = _interopRequireDefault(_dropdown);
  67234. var _icon = __webpack_require__(19);
  67235. var _icon2 = _interopRequireDefault(_icon);
  67236. var _vClickOutsideX = __webpack_require__(76);
  67237. var _transferDom = __webpack_require__(23);
  67238. var _transferDom2 = _interopRequireDefault(_transferDom);
  67239. var _assist = __webpack_require__(3);
  67240. var _emitter = __webpack_require__(4);
  67241. var _emitter2 = _interopRequireDefault(_emitter);
  67242. var _form = __webpack_require__(11);
  67243. var _form2 = _interopRequireDefault(_form);
  67244. var _locale = __webpack_require__(6);
  67245. var _locale2 = _interopRequireDefault(_locale);
  67246. var _selectHead = __webpack_require__(324);
  67247. var _selectHead2 = _interopRequireDefault(_selectHead);
  67248. var _functionalOptions = __webpack_require__(326);
  67249. var _functionalOptions2 = _interopRequireDefault(_functionalOptions);
  67250. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  67251. var prefixCls = 'ivu-select';
  67252. var optionRegexp = /^i-option$|^Option$/i;
  67253. var optionGroupRegexp = /option-?group/i;
  67254. var findChild = function (instance, checkFn) {
  67255. (0, _newArrowCheck3.default)(undefined, undefined);
  67256. var match = checkFn(instance);
  67257. if (match) return instance;
  67258. for (var i = 0, l = instance.$children.length; i < l; i++) {
  67259. var child = instance.$children[i];
  67260. match = findChild(child, checkFn);
  67261. if (match) return match;
  67262. }
  67263. }.bind(undefined);
  67264. var findOptionsInVNode = function (node) {
  67265. (0, _newArrowCheck3.default)(undefined, undefined);
  67266. var opts = node.componentOptions;
  67267. if (opts && optionRegexp.test(opts.tag)) return [node];
  67268. if (!node.children && (!opts || !opts.children)) return [];
  67269. var children = [].concat((0, _toConsumableArray3.default)(node.children || []), (0, _toConsumableArray3.default)(opts && opts.children || []));
  67270. var options = children.reduce(function (arr, el) {
  67271. (0, _newArrowCheck3.default)(undefined, undefined);
  67272. return [].concat((0, _toConsumableArray3.default)(arr), (0, _toConsumableArray3.default)(findOptionsInVNode(el)));
  67273. }.bind(undefined), []).filter(Boolean);
  67274. return options.length > 0 ? options : [];
  67275. }.bind(undefined);
  67276. var extractOptions = function (options) {
  67277. (0, _newArrowCheck3.default)(undefined, undefined);
  67278. return options.reduce(function (options, slotEntry) {
  67279. (0, _newArrowCheck3.default)(undefined, undefined);
  67280. return options.concat(findOptionsInVNode(slotEntry));
  67281. }.bind(undefined), []);
  67282. }.bind(undefined);
  67283. var applyProp = function (node, propName, value) {
  67284. (0, _newArrowCheck3.default)(undefined, undefined);
  67285. return (0, _extends4.default)({}, node, {
  67286. componentOptions: (0, _extends4.default)({}, node.componentOptions, {
  67287. propsData: (0, _extends4.default)({}, node.componentOptions.propsData, (0, _defineProperty3.default)({}, propName, value))
  67288. })
  67289. });
  67290. }.bind(undefined);
  67291. var getNestedProperty = function (obj, path) {
  67292. (0, _newArrowCheck3.default)(undefined, undefined);
  67293. var keys = path.split('.');
  67294. return keys.reduce(function (o, key) {
  67295. (0, _newArrowCheck3.default)(undefined, undefined);
  67296. return o && o[key] || null;
  67297. }.bind(undefined), obj);
  67298. }.bind(undefined);
  67299. var getOptionLabel = function (option) {
  67300. (0, _newArrowCheck3.default)(undefined, undefined);
  67301. if (option.componentOptions.propsData.label) return option.componentOptions.propsData.label;
  67302. var textContent = (option.componentOptions.children || []).reduce(function (str, child) {
  67303. (0, _newArrowCheck3.default)(undefined, undefined);
  67304. return str + (child.text || '');
  67305. }.bind(undefined), '');
  67306. var innerHTML = getNestedProperty(option, 'data.domProps.innerHTML');
  67307. return textContent || (typeof innerHTML === 'string' ? innerHTML : '');
  67308. }.bind(undefined);
  67309. var checkValuesNotEqual = function (value, publicValue, values) {
  67310. (0, _newArrowCheck3.default)(undefined, undefined);
  67311. var strValue = (0, _stringify2.default)(value);
  67312. var strPublic = (0, _stringify2.default)(publicValue);
  67313. var strValues = (0, _stringify2.default)(values.map(function (item) {
  67314. (0, _newArrowCheck3.default)(undefined, undefined);
  67315. return item.value;
  67316. }.bind(undefined)));
  67317. return strValue !== strPublic || strValue !== strValues || strValues !== strPublic;
  67318. }.bind(undefined);
  67319. var ANIMATION_TIMEOUT = 300;
  67320. exports.default = {
  67321. name: 'iSelect',
  67322. mixins: [_emitter2.default, _locale2.default, _form2.default],
  67323. components: { FunctionalOptions: _functionalOptions2.default, Drop: _dropdown2.default, SelectHead: _selectHead2.default, Icon: _icon2.default },
  67324. directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
  67325. props: {
  67326. value: {
  67327. type: [String, Number, Array],
  67328. default: ''
  67329. },
  67330. label: {
  67331. type: [String, Number, Array],
  67332. default: ''
  67333. },
  67334. defaultLabel: {
  67335. type: [String, Number, Array],
  67336. default: ''
  67337. },
  67338. multiple: {
  67339. type: Boolean,
  67340. default: false
  67341. },
  67342. disabled: {
  67343. type: Boolean,
  67344. default: false
  67345. },
  67346. clearable: {
  67347. type: Boolean,
  67348. default: false
  67349. },
  67350. placeholder: {
  67351. type: String
  67352. },
  67353. filterable: {
  67354. type: Boolean,
  67355. default: false
  67356. },
  67357. filterMethod: {
  67358. type: Function
  67359. },
  67360. remoteMethod: {
  67361. type: Function
  67362. },
  67363. loading: {
  67364. type: Boolean,
  67365. default: false
  67366. },
  67367. loadingText: {
  67368. type: String
  67369. },
  67370. size: {
  67371. validator: function validator(value) {
  67372. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  67373. },
  67374. default: function _default() {
  67375. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  67376. }
  67377. },
  67378. labelInValue: {
  67379. type: Boolean,
  67380. default: false
  67381. },
  67382. notFoundText: {
  67383. type: String
  67384. },
  67385. placement: {
  67386. validator: function validator(value) {
  67387. return (0, _assist.oneOf)(value, ['top', 'bottom', 'top-start', 'bottom-start', 'top-end', 'bottom-end']);
  67388. },
  67389. default: 'bottom-start'
  67390. },
  67391. transfer: {
  67392. type: Boolean,
  67393. default: function _default() {
  67394. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  67395. }
  67396. },
  67397. autoComplete: {
  67398. type: Boolean,
  67399. default: false
  67400. },
  67401. name: {
  67402. type: String
  67403. },
  67404. elementId: {
  67405. type: String
  67406. },
  67407. transferClassName: {
  67408. type: String
  67409. },
  67410. prefix: {
  67411. type: String
  67412. },
  67413. maxTagCount: {
  67414. type: Number
  67415. },
  67416. maxTagPlaceholder: {
  67417. type: Function
  67418. },
  67419. allowCreate: {
  67420. type: Boolean,
  67421. default: false
  67422. },
  67423. capture: {
  67424. type: Boolean,
  67425. default: function _default() {
  67426. return !this.$IVIEW ? true : this.$IVIEW.capture;
  67427. }
  67428. },
  67429. filterByLabel: {
  67430. type: Boolean,
  67431. default: false
  67432. },
  67433. eventsEnabled: {
  67434. type: Boolean,
  67435. default: false
  67436. }
  67437. },
  67438. mounted: function mounted() {
  67439. var _this = this;
  67440. this.$on('on-select-selected', this.onOptionClick);
  67441. if (!this.remote && this.selectOptions.length > 0) {
  67442. this.values = this.getInitialValue().map(function (value) {
  67443. (0, _newArrowCheck3.default)(this, _this);
  67444. if (typeof value !== 'number' && !value) return null;
  67445. return this.getOptionData(value);
  67446. }.bind(this)).filter(Boolean);
  67447. }
  67448. this.checkUpdateStatus();
  67449. if (this.remote && this.value && this.defaultLabel) {
  67450. if (!this.multiple) {
  67451. this.query = this.defaultLabel;
  67452. } else if (this.multiple && this.defaultLabel instanceof Array && this.value.length === this.defaultLabel.length) {
  67453. var values = this.value.map(function (item, index) {
  67454. (0, _newArrowCheck3.default)(this, _this);
  67455. return {
  67456. value: item,
  67457. label: this.defaultLabel[index]
  67458. };
  67459. }.bind(this));
  67460. this.$emit('on-set-default-options', JSON.parse((0, _stringify2.default)(values)));
  67461. setTimeout(function () {
  67462. (0, _newArrowCheck3.default)(this, _this);
  67463. this.values = values;
  67464. }.bind(this));
  67465. }
  67466. }
  67467. },
  67468. beforeDestroy: function beforeDestroy() {
  67469. this.$off('on-select-selected');
  67470. },
  67471. data: function data() {
  67472. return {
  67473. prefixCls: prefixCls,
  67474. values: [],
  67475. dropDownWidth: 0,
  67476. visible: false,
  67477. focusIndex: -1,
  67478. isFocused: false,
  67479. query: '',
  67480. initialLabel: this.label,
  67481. hasMouseHoverHead: false,
  67482. slotOptions: this.$slots.default,
  67483. caretPosition: -1,
  67484. lastRemoteQuery: '',
  67485. unchangedQuery: true,
  67486. hasExpectedValue: false,
  67487. isTyping: false,
  67488. preventRemoteCall: false,
  67489. filterQueryChange: false };
  67490. },
  67491. computed: {
  67492. classes: function classes() {
  67493. var _ref;
  67494. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-visible', this.visible), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-multiple', this.multiple), (0, _defineProperty3.default)(_ref, prefixCls + '-single', !this.multiple), (0, _defineProperty3.default)(_ref, prefixCls + '-show-clear', this.showCloseIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), _ref)];
  67495. },
  67496. dropdownCls: function dropdownCls() {
  67497. var _ref2;
  67498. return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-dropdown-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, prefixCls + '-multiple', this.multiple && this.transfer), (0, _defineProperty3.default)(_ref2, 'ivu-auto-complete', this.autoComplete), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
  67499. },
  67500. selectionCls: function selectionCls() {
  67501. var _ref3;
  67502. return _ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-selection', !this.autoComplete), (0, _defineProperty3.default)(_ref3, prefixCls + '-selection-focused', this.isFocused), _ref3;
  67503. },
  67504. localeNotFoundText: function localeNotFoundText() {
  67505. if (typeof this.notFoundText === 'undefined') {
  67506. return this.t('i.select.noMatch');
  67507. } else {
  67508. return this.notFoundText;
  67509. }
  67510. },
  67511. localeLoadingText: function localeLoadingText() {
  67512. if (typeof this.loadingText === 'undefined') {
  67513. return this.t('i.select.loading');
  67514. } else {
  67515. return this.loadingText;
  67516. }
  67517. },
  67518. showCreateItem: function showCreateItem() {
  67519. var _this2 = this;
  67520. var state = false;
  67521. if (this.allowCreate && this.query !== '') {
  67522. state = true;
  67523. var $options = (0, _assist.findComponentsDownward)(this, 'iOption');
  67524. if ($options && $options.length) {
  67525. if ($options.find(function (item) {
  67526. (0, _newArrowCheck3.default)(this, _this2);
  67527. return item.optionLabel === this.query;
  67528. }.bind(this))) state = false;
  67529. }
  67530. }
  67531. return state;
  67532. },
  67533. transitionName: function transitionName() {
  67534. return this.placement === 'bottom' ? 'slide-up' : 'slide-down';
  67535. },
  67536. dropVisible: function dropVisible() {
  67537. var status = true;
  67538. var noOptions = !this.selectOptions || this.selectOptions.length === 0;
  67539. if (!this.loading && this.remote && this.query === '' && noOptions) status = false;
  67540. if (this.autoComplete && noOptions) status = false;
  67541. return this.visible && status;
  67542. },
  67543. showNotFoundLabel: function showNotFoundLabel() {
  67544. var loading = this.loading,
  67545. remote = this.remote,
  67546. selectOptions = this.selectOptions;
  67547. return selectOptions && selectOptions.length === 0 && (!remote || remote && !loading);
  67548. },
  67549. publicValue: function publicValue() {
  67550. var _this3 = this;
  67551. return this.multiple ? this.values.map(function (option) {
  67552. (0, _newArrowCheck3.default)(this, _this3);
  67553. return option.value;
  67554. }.bind(this)) : (this.values[0] || {}).value;
  67555. },
  67556. canBeCleared: function canBeCleared() {
  67557. var uiStateMatch = this.hasMouseHoverHead || this.active;
  67558. var qualifiesForClear = !this.multiple && !this.itemDisabled && this.clearable;
  67559. return uiStateMatch && qualifiesForClear && this.reset;
  67560. },
  67561. selectOptions: function selectOptions() {
  67562. var _this4 = this;
  67563. var selectOptions = [];
  67564. var slotOptions = this.slotOptions || [];
  67565. var optionCounter = -1;
  67566. var currentIndex = this.focusIndex;
  67567. var selectedValues = this.values.filter(Boolean).map(function (_ref4) {
  67568. var value = _ref4.value;
  67569. (0, _newArrowCheck3.default)(this, _this4);
  67570. return value;
  67571. }.bind(this));
  67572. if (this.autoComplete) {
  67573. var copyChildren = function (node, fn) {
  67574. (0, _newArrowCheck3.default)(this, _this4);
  67575. return (0, _extends4.default)({}, node, {
  67576. children: (node.children || []).map(fn).map(function (child) {
  67577. (0, _newArrowCheck3.default)(this, _this4);
  67578. return copyChildren(child, fn);
  67579. }.bind(this))
  67580. });
  67581. }.bind(this);
  67582. var autoCompleteOptions = extractOptions(slotOptions);
  67583. var selectedSlotOption = autoCompleteOptions[currentIndex];
  67584. return slotOptions.map(function (node) {
  67585. (0, _newArrowCheck3.default)(this, _this4);
  67586. if (node === selectedSlotOption || getNestedProperty(node, 'componentOptions.propsData.value') === this.value) return applyProp(node, 'isFocused', true);
  67587. return copyChildren(node, function (child) {
  67588. (0, _newArrowCheck3.default)(this, _this4);
  67589. if (child !== selectedSlotOption) return child;
  67590. return applyProp(child, 'isFocused', true);
  67591. }.bind(this));
  67592. }.bind(this));
  67593. }
  67594. var _iteratorNormalCompletion = true;
  67595. var _didIteratorError = false;
  67596. var _iteratorError = undefined;
  67597. try {
  67598. for (var _iterator = (0, _getIterator3.default)(slotOptions), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  67599. var option = _step.value;
  67600. var cOptions = option.componentOptions;
  67601. if (!cOptions) continue;
  67602. if (optionGroupRegexp.test(cOptions.tag)) {
  67603. var children = cOptions.children;
  67604. if (this.filterable && this.isTyping) {
  67605. children = children.filter(function (_ref5) {
  67606. var componentOptions = _ref5.componentOptions;
  67607. (0, _newArrowCheck3.default)(this, _this4);
  67608. return this.validateOption(componentOptions);
  67609. }.bind(this));
  67610. }
  67611. children = children.map(function (opt) {
  67612. (0, _newArrowCheck3.default)(this, _this4);
  67613. optionCounter = optionCounter + 1;
  67614. return this.processOption(opt, selectedValues, optionCounter === currentIndex);
  67615. }.bind(this));
  67616. if (children.length > 0) selectOptions.push((0, _extends4.default)({}, option, { componentOptions: (0, _extends4.default)({}, cOptions, { children: children }) }));
  67617. } else {
  67618. if (this.filterQueryChange) {
  67619. var optionPassesFilter = this.filterable ? this.validateOption(cOptions) : option;
  67620. if (!optionPassesFilter) continue;
  67621. }
  67622. optionCounter = optionCounter + 1;
  67623. selectOptions.push(this.processOption(option, selectedValues, optionCounter === currentIndex));
  67624. }
  67625. }
  67626. } catch (err) {
  67627. _didIteratorError = true;
  67628. _iteratorError = err;
  67629. } finally {
  67630. try {
  67631. if (!_iteratorNormalCompletion && _iterator.return) {
  67632. _iterator.return();
  67633. }
  67634. } finally {
  67635. if (_didIteratorError) {
  67636. throw _iteratorError;
  67637. }
  67638. }
  67639. }
  67640. return selectOptions;
  67641. },
  67642. flatOptions: function flatOptions() {
  67643. return extractOptions(this.selectOptions);
  67644. },
  67645. selectTabindex: function selectTabindex() {
  67646. return this.itemDisabled || this.filterable ? -1 : 0;
  67647. },
  67648. remote: function remote() {
  67649. return typeof this.remoteMethod === 'function';
  67650. }
  67651. },
  67652. methods: {
  67653. setQuery: function setQuery(query) {
  67654. if (query) {
  67655. this.onQueryChange(query);
  67656. return;
  67657. }
  67658. if (query === null) {
  67659. this.onQueryChange('');
  67660. this.values = [];
  67661. this.lastRemoteQuery = '';
  67662. }
  67663. },
  67664. clearSingleSelect: function clearSingleSelect() {
  67665. if (!this.multiple) this.$emit('input', '');
  67666. this.$emit('on-clear');
  67667. this.hideMenu();
  67668. if (this.clearable) this.reset();
  67669. },
  67670. getOptionData: function getOptionData(value) {
  67671. var _this5 = this;
  67672. var option = this.flatOptions.find(function (_ref6) {
  67673. var componentOptions = _ref6.componentOptions;
  67674. (0, _newArrowCheck3.default)(this, _this5);
  67675. return componentOptions.propsData.value === value;
  67676. }.bind(this));
  67677. if (!option) return null;
  67678. var label = getOptionLabel(option);
  67679. var disabled = option.componentOptions.propsData.disabled;
  67680. return {
  67681. value: value,
  67682. label: label,
  67683. disabled: disabled
  67684. };
  67685. },
  67686. getInitialValue: function getInitialValue() {
  67687. var _this6 = this;
  67688. var multiple = this.multiple,
  67689. remote = this.remote,
  67690. value = this.value;
  67691. var initialValue = Array.isArray(value) ? value : [value];
  67692. if (!multiple && (typeof initialValue[0] === 'undefined' || String(initialValue[0]).trim() === '' && !(0, _isFinite2.default)(initialValue[0]))) initialValue = [];
  67693. if (remote && !multiple && value) {
  67694. var data = this.getOptionData(value);
  67695. this.query = data ? data.label : String(value);
  67696. }
  67697. return initialValue.filter(function (item) {
  67698. (0, _newArrowCheck3.default)(this, _this6);
  67699. return Boolean(item) || item === 0;
  67700. }.bind(this));
  67701. },
  67702. processOption: function processOption(option, values, isFocused) {
  67703. if (!option.componentOptions) return option;
  67704. var optionValue = option.componentOptions.propsData.value;
  67705. var disabled = option.componentOptions.propsData.disabled;
  67706. var isSelected = values.includes(optionValue);
  67707. var propsData = (0, _extends4.default)({}, option.componentOptions.propsData, {
  67708. selected: isSelected,
  67709. isFocused: isFocused,
  67710. disabled: typeof disabled === 'undefined' ? false : disabled !== false
  67711. });
  67712. return (0, _extends4.default)({}, option, {
  67713. componentOptions: (0, _extends4.default)({}, option.componentOptions, {
  67714. propsData: propsData
  67715. })
  67716. });
  67717. },
  67718. validateOption: function validateOption(_ref7) {
  67719. var _this7 = this;
  67720. var children = _ref7.children,
  67721. elm = _ref7.elm,
  67722. propsData = _ref7.propsData;
  67723. var value = propsData.value;
  67724. var label = propsData.label || '';
  67725. var textContent = elm && elm.textContent || (children || []).reduce(function (str, node) {
  67726. (0, _newArrowCheck3.default)(this, _this7);
  67727. var nodeText = node.elm ? node.elm.textContent : node.text;
  67728. return String(str) + ' ' + String(nodeText);
  67729. }.bind(this), '') || '';
  67730. var stringValues = this.filterByLabel ? [label].toString() : [value, label, textContent].toString();
  67731. var query = this.query.toLowerCase().trim();
  67732. return stringValues.toLowerCase().includes(query);
  67733. },
  67734. toggleMenu: function toggleMenu(e, force) {
  67735. if (this.itemDisabled) {
  67736. return false;
  67737. }
  67738. this.visible = typeof force !== 'undefined' ? force : !this.visible;
  67739. if (this.visible) {
  67740. this.dropDownWidth = this.$el.getBoundingClientRect().width;
  67741. this.broadcast('Drop', 'on-update-popper');
  67742. }
  67743. },
  67744. hideMenu: function hideMenu() {
  67745. var _this8 = this;
  67746. this.toggleMenu(null, false);
  67747. this.isTyping = false;
  67748. setTimeout(function () {
  67749. (0, _newArrowCheck3.default)(this, _this8);
  67750. return this.unchangedQuery = true;
  67751. }.bind(this), ANIMATION_TIMEOUT);
  67752. },
  67753. onClickOutside: function onClickOutside(event) {
  67754. var _this9 = this;
  67755. if (this.visible) {
  67756. if (event.type === 'mousedown') {
  67757. event.preventDefault();
  67758. return;
  67759. }
  67760. if (this.transfer) {
  67761. var $el = this.$refs.dropdown.$el;
  67762. if ($el === event.target || $el.contains(event.target)) {
  67763. return;
  67764. }
  67765. }
  67766. if (this.filterable) {
  67767. var input = this.$el.querySelector('input[type="text"]');
  67768. this.caretPosition = input.selectionStart;
  67769. this.$nextTick(function () {
  67770. (0, _newArrowCheck3.default)(this, _this9);
  67771. var caretPosition = this.caretPosition === -1 ? input.value.length : this.caretPosition;
  67772. input.setSelectionRange(caretPosition, caretPosition);
  67773. }.bind(this));
  67774. }
  67775. if (!this.autoComplete) event.stopPropagation();
  67776. event.preventDefault();
  67777. this.hideMenu();
  67778. this.isFocused = true;
  67779. this.$emit('on-clickoutside', event);
  67780. } else {
  67781. this.caretPosition = -1;
  67782. this.isFocused = false;
  67783. }
  67784. },
  67785. reset: function reset() {
  67786. this.query = '';
  67787. this.focusIndex = -1;
  67788. this.unchangedQuery = true;
  67789. this.values = [];
  67790. this.filterQueryChange = false;
  67791. },
  67792. handleKeydown: function handleKeydown(e) {
  67793. var key = e.key || e.code;
  67794. var keyCode = e.keyCode || e.which;
  67795. if (key === 'Backspace' || keyCode === 8) {
  67796. return;
  67797. }
  67798. if (this.visible) {
  67799. e.preventDefault();
  67800. if (key === 'Tab') {
  67801. e.stopPropagation();
  67802. }
  67803. if (key === 'Escape') {
  67804. e.stopPropagation();
  67805. this.hideMenu();
  67806. }
  67807. if (key === 'ArrowUp') {
  67808. this.navigateOptions(-1);
  67809. }
  67810. if (key === 'ArrowDown') {
  67811. this.navigateOptions(1);
  67812. }
  67813. if (key === 'Enter') {
  67814. if (this.focusIndex === -1) return this.hideMenu();
  67815. var optionComponent = this.flatOptions[this.focusIndex];
  67816. if (optionComponent) {
  67817. var option = this.getOptionData(optionComponent.componentOptions.propsData.value);
  67818. this.onOptionClick(option);
  67819. } else {
  67820. this.hideMenu();
  67821. }
  67822. }
  67823. } else {
  67824. var keysThatCanOpenSelect = ['ArrowUp', 'ArrowDown'];
  67825. if (keysThatCanOpenSelect.includes(e.key)) this.toggleMenu(null, true);
  67826. }
  67827. },
  67828. navigateOptions: function navigateOptions(direction) {
  67829. var optionsLength = this.flatOptions.length - 1;
  67830. if (optionsLength < 0) return;
  67831. var index = this.focusIndex + direction;
  67832. if (index < 0) index = optionsLength;
  67833. if (index > optionsLength) index = 0;
  67834. if (direction > 0) {
  67835. var nearestActiveOption = -1;
  67836. for (var i = 0; i < this.flatOptions.length; i++) {
  67837. var optionIsActive = !this.flatOptions[i].componentOptions.propsData.disabled;
  67838. if (optionIsActive) nearestActiveOption = i;
  67839. if (nearestActiveOption >= index) break;
  67840. }
  67841. index = nearestActiveOption;
  67842. } else {
  67843. var _nearestActiveOption = this.flatOptions.length;
  67844. for (var _i = optionsLength; _i >= 0; _i--) {
  67845. var _optionIsActive = !this.flatOptions[_i].componentOptions.propsData.disabled;
  67846. if (_optionIsActive) _nearestActiveOption = _i;
  67847. if (_nearestActiveOption <= index) break;
  67848. }
  67849. index = _nearestActiveOption;
  67850. }
  67851. this.focusIndex = index;
  67852. },
  67853. onOptionClick: function onOptionClick(option) {
  67854. var _this10 = this;
  67855. if (this.multiple) {
  67856. if (this.remote) this.lastRemoteQuery = this.lastRemoteQuery || this.query;else this.lastRemoteQuery = '';
  67857. var valueIsSelected = this.values.find(function (_ref8) {
  67858. var value = _ref8.value;
  67859. (0, _newArrowCheck3.default)(this, _this10);
  67860. return value === option.value;
  67861. }.bind(this));
  67862. if (valueIsSelected) {
  67863. this.values = this.values.filter(function (_ref9) {
  67864. var value = _ref9.value;
  67865. (0, _newArrowCheck3.default)(this, _this10);
  67866. return value !== option.value;
  67867. }.bind(this));
  67868. } else {
  67869. this.values = this.values.concat(option);
  67870. }
  67871. this.isFocused = true;
  67872. } else {
  67873. this.query = String(option.label).trim();
  67874. this.values = [option];
  67875. this.lastRemoteQuery = '';
  67876. this.hideMenu();
  67877. }
  67878. this.focusIndex = this.flatOptions.findIndex(function (opt) {
  67879. (0, _newArrowCheck3.default)(this, _this10);
  67880. if (!opt || !opt.componentOptions) return false;
  67881. return opt.componentOptions.propsData.value === option.value;
  67882. }.bind(this));
  67883. if (this.filterable) {
  67884. var inputField = this.$el.querySelector('input[type="text"]');
  67885. if (!this.autoComplete) this.$nextTick(function () {
  67886. (0, _newArrowCheck3.default)(this, _this10);
  67887. return inputField.focus();
  67888. }.bind(this));
  67889. }
  67890. this.$emit('on-select', option);
  67891. this.broadcast('Drop', 'on-update-popper');
  67892. setTimeout(function () {
  67893. (0, _newArrowCheck3.default)(this, _this10);
  67894. this.filterQueryChange = false;
  67895. }.bind(this), ANIMATION_TIMEOUT);
  67896. },
  67897. onQueryChange: function onQueryChange(query) {
  67898. this.isTyping = true;
  67899. if (query.length > 0 && query !== this.query) {
  67900. if (this.autoComplete) {
  67901. var isInputFocused = document.hasFocus && document.hasFocus() && document.activeElement === this.$el.querySelector('input');
  67902. this.visible = isInputFocused;
  67903. } else {
  67904. this.visible = true;
  67905. }
  67906. }
  67907. this.query = query;
  67908. this.unchangedQuery = this.visible;
  67909. this.filterQueryChange = true;
  67910. },
  67911. toggleHeaderFocus: function toggleHeaderFocus(_ref10) {
  67912. var type = _ref10.type;
  67913. if (this.itemDisabled) {
  67914. return;
  67915. }
  67916. this.isFocused = type === 'focus';
  67917. },
  67918. updateSlotOptions: function updateSlotOptions() {
  67919. this.slotOptions = this.$slots.default;
  67920. },
  67921. checkUpdateStatus: function checkUpdateStatus() {
  67922. if (this.getInitialValue().length > 0 && this.selectOptions.length === 0) {
  67923. this.hasExpectedValue = true;
  67924. }
  67925. },
  67926. handleCreateItem: function handleCreateItem() {
  67927. var _this11 = this;
  67928. if (this.allowCreate && this.query !== '' && this.showCreateItem) {
  67929. var query = this.query;
  67930. this.$emit('on-create', query);
  67931. this.query = '';
  67932. var option = {
  67933. value: query,
  67934. label: query,
  67935. tag: undefined
  67936. };
  67937. this.$nextTick(function () {
  67938. (0, _newArrowCheck3.default)(this, _this11);
  67939. return this.onOptionClick(option);
  67940. }.bind(this));
  67941. }
  67942. }
  67943. },
  67944. watch: {
  67945. value: function value(_value) {
  67946. var _this12 = this;
  67947. var getInitialValue = this.getInitialValue,
  67948. getOptionData = this.getOptionData,
  67949. publicValue = this.publicValue,
  67950. values = this.values;
  67951. this.checkUpdateStatus();
  67952. if (_value === '') this.values = [];else if (checkValuesNotEqual(_value, publicValue, values)) {
  67953. this.$nextTick(function () {
  67954. (0, _newArrowCheck3.default)(this, _this12);
  67955. return this.values = getInitialValue().map(getOptionData).filter(Boolean);
  67956. }.bind(this));
  67957. if (!this.multiple) this.dispatch('FormItem', 'on-form-change', this.publicValue);
  67958. }
  67959. },
  67960. values: function values(now, before) {
  67961. var newValue = (0, _stringify2.default)(now);
  67962. var oldValue = (0, _stringify2.default)(before);
  67963. var vModelValue = this.publicValue;
  67964. var shouldEmitInput = newValue !== oldValue && vModelValue !== this.value;
  67965. if (shouldEmitInput) {
  67966. var emitValue = this.publicValue;
  67967. if (this.labelInValue) {
  67968. if (this.multiple) {
  67969. emitValue = this.values;
  67970. } else {
  67971. emitValue = this.values[0];
  67972. }
  67973. }
  67974. if (Array.isArray(vModelValue) && !vModelValue.length && this.value === null) vModelValue = null;else if (vModelValue === undefined && this.value === null) vModelValue = null;
  67975. this.$emit('input', vModelValue);
  67976. this.$emit('on-change', emitValue);
  67977. this.dispatch('FormItem', 'on-form-change', emitValue);
  67978. }
  67979. },
  67980. query: function query(_query) {
  67981. var _this13 = this;
  67982. this.$emit('on-query-change', _query);
  67983. var remoteMethod = this.remoteMethod,
  67984. lastRemoteQuery = this.lastRemoteQuery;
  67985. var hasValidQuery = _query !== '' && (_query !== lastRemoteQuery || !lastRemoteQuery);
  67986. var shouldCallRemoteMethod = remoteMethod && hasValidQuery && !this.preventRemoteCall;
  67987. this.preventRemoteCall = false;
  67988. if (shouldCallRemoteMethod) {
  67989. this.focusIndex = -1;
  67990. var promise = this.remoteMethod(_query);
  67991. this.initialLabel = '';
  67992. if (promise && promise.then) {
  67993. promise.then(function (options) {
  67994. (0, _newArrowCheck3.default)(this, _this13);
  67995. if (options) this.options = options;
  67996. }.bind(this));
  67997. }
  67998. }
  67999. if (_query !== '' && this.remote) this.lastRemoteQuery = _query;
  68000. },
  68001. loading: function loading(state) {
  68002. if (state === false) {
  68003. this.updateSlotOptions();
  68004. }
  68005. },
  68006. isFocused: function isFocused(focused) {
  68007. var el = this.filterable ? this.$el.querySelector('input[type="text"]') : this.$el;
  68008. el[this.isFocused ? 'focus' : 'blur']();
  68009. var _values = (0, _slicedToArray3.default)(this.values, 1),
  68010. selectedOption = _values[0];
  68011. if (selectedOption && this.filterable && !this.multiple && !focused) {
  68012. var selectedLabel = String(selectedOption.label || selectedOption.value).trim();
  68013. if (selectedLabel && this.query !== selectedLabel) {
  68014. this.preventRemoteCall = true;
  68015. this.query = selectedLabel;
  68016. }
  68017. }
  68018. },
  68019. focusIndex: function focusIndex(index) {
  68020. var _this14 = this;
  68021. if (index < 0 || this.autoComplete) return;
  68022. var optionValue = this.flatOptions[index].componentOptions.propsData.value;
  68023. var optionInstance = findChild(this, function (_ref11) {
  68024. var $options = _ref11.$options;
  68025. (0, _newArrowCheck3.default)(this, _this14);
  68026. return $options.componentName === 'select-item' && $options.propsData.value === optionValue;
  68027. }.bind(this));
  68028. var bottomOverflowDistance = optionInstance.$el.getBoundingClientRect().bottom - this.$refs.dropdown.$el.getBoundingClientRect().bottom;
  68029. var topOverflowDistance = optionInstance.$el.getBoundingClientRect().top - this.$refs.dropdown.$el.getBoundingClientRect().top;
  68030. if (bottomOverflowDistance > 0) {
  68031. this.$refs.dropdown.$el.scrollTop += bottomOverflowDistance;
  68032. }
  68033. if (topOverflowDistance < 0) {
  68034. this.$refs.dropdown.$el.scrollTop += topOverflowDistance;
  68035. }
  68036. },
  68037. dropVisible: function dropVisible(open) {
  68038. this.broadcast('Drop', open ? 'on-update-popper' : 'on-destroy-popper');
  68039. },
  68040. selectOptions: function selectOptions() {
  68041. if (this.hasExpectedValue && this.selectOptions.length > 0) {
  68042. if (this.values.length === 0) {
  68043. this.values = this.getInitialValue();
  68044. }
  68045. this.values = this.values.map(this.getOptionData).filter(Boolean);
  68046. this.hasExpectedValue = false;
  68047. }
  68048. if (this.slotOptions && this.slotOptions.length === 0) {
  68049. this.query = '';
  68050. }
  68051. this.broadcast('Drop', 'on-update-popper');
  68052. },
  68053. visible: function visible(state) {
  68054. this.$emit('on-open-change', state);
  68055. },
  68056. slotOptions: function slotOptions(options, old) {
  68057. if (!this.remote) {
  68058. var values = this.getInitialValue();
  68059. if (this.flatOptions && this.flatOptions.length && values.length && !this.multiple) {
  68060. this.values = values.map(this.getOptionData).filter(Boolean);
  68061. }
  68062. }
  68063. if (options && old && options.length !== old.length) {
  68064. this.broadcast('Drop', 'on-update-popper');
  68065. }
  68066. }
  68067. }
  68068. };
  68069. /***/ }),
  68070. /* 111 */
  68071. /***/ (function(module, exports, __webpack_require__) {
  68072. module.exports = { "default": __webpack_require__(297), __esModule: true };
  68073. /***/ }),
  68074. /* 112 */
  68075. /***/ (function(module, exports, __webpack_require__) {
  68076. // call something on iterator step with safe closing on error
  68077. var anObject = __webpack_require__(22);
  68078. module.exports = function (iterator, fn, value, entries) {
  68079. try {
  68080. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  68081. // 7.4.6 IteratorClose(iterator, completion)
  68082. } catch (e) {
  68083. var ret = iterator['return'];
  68084. if (ret !== undefined) anObject(ret.call(iterator));
  68085. throw e;
  68086. }
  68087. };
  68088. /***/ }),
  68089. /* 113 */
  68090. /***/ (function(module, exports, __webpack_require__) {
  68091. // check on default Array iterator
  68092. var Iterators = __webpack_require__(34);
  68093. var ITERATOR = __webpack_require__(10)('iterator');
  68094. var ArrayProto = Array.prototype;
  68095. module.exports = function (it) {
  68096. return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
  68097. };
  68098. /***/ }),
  68099. /* 114 */
  68100. /***/ (function(module, exports, __webpack_require__) {
  68101. var ITERATOR = __webpack_require__(10)('iterator');
  68102. var SAFE_CLOSING = false;
  68103. try {
  68104. var riter = [7][ITERATOR]();
  68105. riter['return'] = function () { SAFE_CLOSING = true; };
  68106. // eslint-disable-next-line no-throw-literal
  68107. Array.from(riter, function () { throw 2; });
  68108. } catch (e) { /* empty */ }
  68109. module.exports = function (exec, skipClosing) {
  68110. if (!skipClosing && !SAFE_CLOSING) return false;
  68111. var safe = false;
  68112. try {
  68113. var arr = [7];
  68114. var iter = arr[ITERATOR]();
  68115. iter.next = function () { return { done: safe = true }; };
  68116. arr[ITERATOR] = function () { return iter; };
  68117. exec(arr);
  68118. } catch (e) { /* empty */ }
  68119. return safe;
  68120. };
  68121. /***/ }),
  68122. /* 115 */
  68123. /***/ (function(module, exports, __webpack_require__) {
  68124. "use strict";
  68125. Object.defineProperty(exports, "__esModule", {
  68126. value: true
  68127. });
  68128. var _newArrowCheck2 = __webpack_require__(1);
  68129. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  68130. var _vue = __webpack_require__(16);
  68131. var _vue2 = _interopRequireDefault(_vue);
  68132. var _assist = __webpack_require__(3);
  68133. var _transferQueue = __webpack_require__(37);
  68134. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  68135. var isServer = _vue2.default.prototype.$isServer;
  68136. var Popper = isServer ? function () {} : __webpack_require__(116);exports.default = {
  68137. name: 'Drop',
  68138. props: {
  68139. placement: {
  68140. type: String,
  68141. default: 'bottom-start'
  68142. },
  68143. className: {
  68144. type: String
  68145. },
  68146. transfer: {
  68147. type: Boolean
  68148. },
  68149. eventsEnabled: {
  68150. type: Boolean,
  68151. default: false
  68152. }
  68153. },
  68154. data: function data() {
  68155. return {
  68156. popper: null,
  68157. width: '',
  68158. popperStatus: false,
  68159. tIndex: this.handleGetIndex()
  68160. };
  68161. },
  68162. computed: {
  68163. styles: function styles() {
  68164. var style = {};
  68165. if (this.width) style.minWidth = String(this.width) + 'px';
  68166. if (this.transfer) style['z-index'] = 1060 + this.tIndex;
  68167. return style;
  68168. }
  68169. },
  68170. methods: {
  68171. update: function update() {
  68172. var _this = this;
  68173. if (isServer) return;
  68174. this.$nextTick(function () {
  68175. (0, _newArrowCheck3.default)(this, _this);
  68176. if (this.popper) {
  68177. this.popper.update();
  68178. this.popperStatus = true;
  68179. } else {
  68180. this.popper = new Popper(this.$parent.$refs.reference, this.$el, {
  68181. eventsEnabled: this.eventsEnabled,
  68182. placement: this.placement,
  68183. modifiers: {
  68184. computeStyle: {
  68185. gpuAcceleration: false
  68186. },
  68187. preventOverflow: {
  68188. boundariesElement: 'window'
  68189. }
  68190. },
  68191. onCreate: function onCreate() {
  68192. (0, _newArrowCheck3.default)(this, _this);
  68193. this.resetTransformOrigin();
  68194. this.$nextTick(this.popper.update());
  68195. }.bind(this),
  68196. onUpdate: function onUpdate() {
  68197. (0, _newArrowCheck3.default)(this, _this);
  68198. this.resetTransformOrigin();
  68199. }.bind(this)
  68200. });
  68201. }
  68202. if (this.$parent.$options.name === 'iSelect') {
  68203. this.width = parseInt((0, _assist.getStyle)(this.$parent.$el, 'width'));
  68204. }
  68205. this.tIndex = this.handleGetIndex();
  68206. }.bind(this));
  68207. },
  68208. destroy: function destroy() {
  68209. var _this2 = this;
  68210. if (this.popper) {
  68211. setTimeout(function () {
  68212. (0, _newArrowCheck3.default)(this, _this2);
  68213. if (this.popper && !this.popperStatus) {
  68214. this.popper.popper.style.display = 'none';
  68215. this.popper.destroy();
  68216. this.popper = null;
  68217. }
  68218. this.popperStatus = false;
  68219. }.bind(this), 300);
  68220. }
  68221. },
  68222. resetTransformOrigin: function resetTransformOrigin() {
  68223. if (!this.popper) return;
  68224. var x_placement = this.popper.popper.getAttribute('x-placement');
  68225. var placementStart = x_placement.split('-')[0];
  68226. var placementEnd = x_placement.split('-')[1];
  68227. var leftOrRight = x_placement === 'left' || x_placement === 'right';
  68228. if (!leftOrRight) {
  68229. this.popper.popper.style.transformOrigin = placementStart === 'bottom' || placementStart !== 'top' && placementEnd === 'start' ? 'center top' : 'center bottom';
  68230. }
  68231. },
  68232. handleGetIndex: function handleGetIndex() {
  68233. (0, _transferQueue.transferIncrease)();
  68234. return _transferQueue.transferIndex;
  68235. }
  68236. },
  68237. created: function created() {
  68238. this.$on('on-update-popper', this.update);
  68239. this.$on('on-destroy-popper', this.destroy);
  68240. },
  68241. beforeDestroy: function beforeDestroy() {
  68242. this.$off('on-update-popper', this.update);
  68243. this.$off('on-destroy-popper', this.destroy);
  68244. if (this.popper) {
  68245. this.popper.destroy();
  68246. this.popper = null;
  68247. }
  68248. }
  68249. };
  68250. /***/ }),
  68251. /* 116 */
  68252. /***/ (function(module, exports, __webpack_require__) {
  68253. /* WEBPACK VAR INJECTION */(function(global) {/**!
  68254. * @fileOverview Kickass library to create and place poppers near their reference elements.
  68255. * @version 1.15.0
  68256. * @license
  68257. * Copyright (c) 2016 Federico Zivolo and contributors
  68258. *
  68259. * Permission is hereby granted, free of charge, to any person obtaining a copy
  68260. * of this software and associated documentation files (the "Software"), to deal
  68261. * in the Software without restriction, including without limitation the rights
  68262. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  68263. * copies of the Software, and to permit persons to whom the Software is
  68264. * furnished to do so, subject to the following conditions:
  68265. *
  68266. * The above copyright notice and this permission notice shall be included in all
  68267. * copies or substantial portions of the Software.
  68268. *
  68269. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  68270. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  68271. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  68272. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  68273. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  68274. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  68275. * SOFTWARE.
  68276. */
  68277. (function (global, factory) {
  68278. true ? module.exports = factory() :
  68279. typeof define === 'function' && define.amd ? define(factory) :
  68280. (global.Popper = factory());
  68281. }(this, (function () { 'use strict';
  68282. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
  68283. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  68284. var timeoutDuration = 0;
  68285. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  68286. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  68287. timeoutDuration = 1;
  68288. break;
  68289. }
  68290. }
  68291. function microtaskDebounce(fn) {
  68292. var called = false;
  68293. return function () {
  68294. if (called) {
  68295. return;
  68296. }
  68297. called = true;
  68298. window.Promise.resolve().then(function () {
  68299. called = false;
  68300. fn();
  68301. });
  68302. };
  68303. }
  68304. function taskDebounce(fn) {
  68305. var scheduled = false;
  68306. return function () {
  68307. if (!scheduled) {
  68308. scheduled = true;
  68309. setTimeout(function () {
  68310. scheduled = false;
  68311. fn();
  68312. }, timeoutDuration);
  68313. }
  68314. };
  68315. }
  68316. var supportsMicroTasks = isBrowser && window.Promise;
  68317. /**
  68318. * Create a debounced version of a method, that's asynchronously deferred
  68319. * but called in the minimum time possible.
  68320. *
  68321. * @method
  68322. * @memberof Popper.Utils
  68323. * @argument {Function} fn
  68324. * @returns {Function}
  68325. */
  68326. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  68327. /**
  68328. * Check if the given variable is a function
  68329. * @method
  68330. * @memberof Popper.Utils
  68331. * @argument {Any} functionToCheck - variable to check
  68332. * @returns {Boolean} answer to: is a function?
  68333. */
  68334. function isFunction(functionToCheck) {
  68335. var getType = {};
  68336. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  68337. }
  68338. /**
  68339. * Get CSS computed property of the given element
  68340. * @method
  68341. * @memberof Popper.Utils
  68342. * @argument {Eement} element
  68343. * @argument {String} property
  68344. */
  68345. function getStyleComputedProperty(element, property) {
  68346. if (element.nodeType !== 1) {
  68347. return [];
  68348. }
  68349. // NOTE: 1 DOM access here
  68350. var window = element.ownerDocument.defaultView;
  68351. var css = window.getComputedStyle(element, null);
  68352. return property ? css[property] : css;
  68353. }
  68354. /**
  68355. * Returns the parentNode or the host of the element
  68356. * @method
  68357. * @memberof Popper.Utils
  68358. * @argument {Element} element
  68359. * @returns {Element} parent
  68360. */
  68361. function getParentNode(element) {
  68362. if (element.nodeName === 'HTML') {
  68363. return element;
  68364. }
  68365. return element.parentNode || element.host;
  68366. }
  68367. /**
  68368. * Returns the scrolling parent of the given element
  68369. * @method
  68370. * @memberof Popper.Utils
  68371. * @argument {Element} element
  68372. * @returns {Element} scroll parent
  68373. */
  68374. function getScrollParent(element) {
  68375. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  68376. if (!element) {
  68377. return document.body;
  68378. }
  68379. switch (element.nodeName) {
  68380. case 'HTML':
  68381. case 'BODY':
  68382. return element.ownerDocument.body;
  68383. case '#document':
  68384. return element.body;
  68385. }
  68386. // Firefox want us to check `-x` and `-y` variations as well
  68387. var _getStyleComputedProp = getStyleComputedProperty(element),
  68388. overflow = _getStyleComputedProp.overflow,
  68389. overflowX = _getStyleComputedProp.overflowX,
  68390. overflowY = _getStyleComputedProp.overflowY;
  68391. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  68392. return element;
  68393. }
  68394. return getScrollParent(getParentNode(element));
  68395. }
  68396. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  68397. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  68398. /**
  68399. * Determines if the browser is Internet Explorer
  68400. * @method
  68401. * @memberof Popper.Utils
  68402. * @param {Number} version to check
  68403. * @returns {Boolean} isIE
  68404. */
  68405. function isIE(version) {
  68406. if (version === 11) {
  68407. return isIE11;
  68408. }
  68409. if (version === 10) {
  68410. return isIE10;
  68411. }
  68412. return isIE11 || isIE10;
  68413. }
  68414. /**
  68415. * Returns the offset parent of the given element
  68416. * @method
  68417. * @memberof Popper.Utils
  68418. * @argument {Element} element
  68419. * @returns {Element} offset parent
  68420. */
  68421. function getOffsetParent(element) {
  68422. if (!element) {
  68423. return document.documentElement;
  68424. }
  68425. var noOffsetParent = isIE(10) ? document.body : null;
  68426. // NOTE: 1 DOM access here
  68427. var offsetParent = element.offsetParent || null;
  68428. // Skip hidden elements which don't have an offsetParent
  68429. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  68430. offsetParent = (element = element.nextElementSibling).offsetParent;
  68431. }
  68432. var nodeName = offsetParent && offsetParent.nodeName;
  68433. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  68434. return element ? element.ownerDocument.documentElement : document.documentElement;
  68435. }
  68436. // .offsetParent will return the closest TH, TD or TABLE in case
  68437. // no offsetParent is present, I hate this job...
  68438. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  68439. return getOffsetParent(offsetParent);
  68440. }
  68441. return offsetParent;
  68442. }
  68443. function isOffsetContainer(element) {
  68444. var nodeName = element.nodeName;
  68445. if (nodeName === 'BODY') {
  68446. return false;
  68447. }
  68448. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  68449. }
  68450. /**
  68451. * Finds the root node (document, shadowDOM root) of the given element
  68452. * @method
  68453. * @memberof Popper.Utils
  68454. * @argument {Element} node
  68455. * @returns {Element} root node
  68456. */
  68457. function getRoot(node) {
  68458. if (node.parentNode !== null) {
  68459. return getRoot(node.parentNode);
  68460. }
  68461. return node;
  68462. }
  68463. /**
  68464. * Finds the offset parent common to the two provided nodes
  68465. * @method
  68466. * @memberof Popper.Utils
  68467. * @argument {Element} element1
  68468. * @argument {Element} element2
  68469. * @returns {Element} common offset parent
  68470. */
  68471. function findCommonOffsetParent(element1, element2) {
  68472. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  68473. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  68474. return document.documentElement;
  68475. }
  68476. // Here we make sure to give as "start" the element that comes first in the DOM
  68477. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  68478. var start = order ? element1 : element2;
  68479. var end = order ? element2 : element1;
  68480. // Get common ancestor container
  68481. var range = document.createRange();
  68482. range.setStart(start, 0);
  68483. range.setEnd(end, 0);
  68484. var commonAncestorContainer = range.commonAncestorContainer;
  68485. // Both nodes are inside #document
  68486. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  68487. if (isOffsetContainer(commonAncestorContainer)) {
  68488. return commonAncestorContainer;
  68489. }
  68490. return getOffsetParent(commonAncestorContainer);
  68491. }
  68492. // one of the nodes is inside shadowDOM, find which one
  68493. var element1root = getRoot(element1);
  68494. if (element1root.host) {
  68495. return findCommonOffsetParent(element1root.host, element2);
  68496. } else {
  68497. return findCommonOffsetParent(element1, getRoot(element2).host);
  68498. }
  68499. }
  68500. /**
  68501. * Gets the scroll value of the given element in the given side (top and left)
  68502. * @method
  68503. * @memberof Popper.Utils
  68504. * @argument {Element} element
  68505. * @argument {String} side `top` or `left`
  68506. * @returns {number} amount of scrolled pixels
  68507. */
  68508. function getScroll(element) {
  68509. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  68510. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  68511. var nodeName = element.nodeName;
  68512. if (nodeName === 'BODY' || nodeName === 'HTML') {
  68513. var html = element.ownerDocument.documentElement;
  68514. var scrollingElement = element.ownerDocument.scrollingElement || html;
  68515. return scrollingElement[upperSide];
  68516. }
  68517. return element[upperSide];
  68518. }
  68519. /*
  68520. * Sum or subtract the element scroll values (left and top) from a given rect object
  68521. * @method
  68522. * @memberof Popper.Utils
  68523. * @param {Object} rect - Rect object you want to change
  68524. * @param {HTMLElement} element - The element from the function reads the scroll values
  68525. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  68526. * @return {Object} rect - The modifier rect object
  68527. */
  68528. function includeScroll(rect, element) {
  68529. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  68530. var scrollTop = getScroll(element, 'top');
  68531. var scrollLeft = getScroll(element, 'left');
  68532. var modifier = subtract ? -1 : 1;
  68533. rect.top += scrollTop * modifier;
  68534. rect.bottom += scrollTop * modifier;
  68535. rect.left += scrollLeft * modifier;
  68536. rect.right += scrollLeft * modifier;
  68537. return rect;
  68538. }
  68539. /*
  68540. * Helper to detect borders of a given element
  68541. * @method
  68542. * @memberof Popper.Utils
  68543. * @param {CSSStyleDeclaration} styles
  68544. * Result of `getStyleComputedProperty` on the given element
  68545. * @param {String} axis - `x` or `y`
  68546. * @return {number} borders - The borders size of the given axis
  68547. */
  68548. function getBordersSize(styles, axis) {
  68549. var sideA = axis === 'x' ? 'Left' : 'Top';
  68550. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  68551. return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
  68552. }
  68553. function getSize(axis, body, html, computedStyle) {
  68554. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  68555. }
  68556. function getWindowSizes(document) {
  68557. var body = document.body;
  68558. var html = document.documentElement;
  68559. var computedStyle = isIE(10) && getComputedStyle(html);
  68560. return {
  68561. height: getSize('Height', body, html, computedStyle),
  68562. width: getSize('Width', body, html, computedStyle)
  68563. };
  68564. }
  68565. var classCallCheck = function (instance, Constructor) {
  68566. if (!(instance instanceof Constructor)) {
  68567. throw new TypeError("Cannot call a class as a function");
  68568. }
  68569. };
  68570. var createClass = function () {
  68571. function defineProperties(target, props) {
  68572. for (var i = 0; i < props.length; i++) {
  68573. var descriptor = props[i];
  68574. descriptor.enumerable = descriptor.enumerable || false;
  68575. descriptor.configurable = true;
  68576. if ("value" in descriptor) descriptor.writable = true;
  68577. Object.defineProperty(target, descriptor.key, descriptor);
  68578. }
  68579. }
  68580. return function (Constructor, protoProps, staticProps) {
  68581. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  68582. if (staticProps) defineProperties(Constructor, staticProps);
  68583. return Constructor;
  68584. };
  68585. }();
  68586. var defineProperty = function (obj, key, value) {
  68587. if (key in obj) {
  68588. Object.defineProperty(obj, key, {
  68589. value: value,
  68590. enumerable: true,
  68591. configurable: true,
  68592. writable: true
  68593. });
  68594. } else {
  68595. obj[key] = value;
  68596. }
  68597. return obj;
  68598. };
  68599. var _extends = Object.assign || function (target) {
  68600. for (var i = 1; i < arguments.length; i++) {
  68601. var source = arguments[i];
  68602. for (var key in source) {
  68603. if (Object.prototype.hasOwnProperty.call(source, key)) {
  68604. target[key] = source[key];
  68605. }
  68606. }
  68607. }
  68608. return target;
  68609. };
  68610. /**
  68611. * Given element offsets, generate an output similar to getBoundingClientRect
  68612. * @method
  68613. * @memberof Popper.Utils
  68614. * @argument {Object} offsets
  68615. * @returns {Object} ClientRect like output
  68616. */
  68617. function getClientRect(offsets) {
  68618. return _extends({}, offsets, {
  68619. right: offsets.left + offsets.width,
  68620. bottom: offsets.top + offsets.height
  68621. });
  68622. }
  68623. /**
  68624. * Get bounding client rect of given element
  68625. * @method
  68626. * @memberof Popper.Utils
  68627. * @param {HTMLElement} element
  68628. * @return {Object} client rect
  68629. */
  68630. function getBoundingClientRect(element) {
  68631. var rect = {};
  68632. // IE10 10 FIX: Please, don't ask, the element isn't
  68633. // considered in DOM in some circumstances...
  68634. // This isn't reproducible in IE10 compatibility mode of IE11
  68635. try {
  68636. if (isIE(10)) {
  68637. rect = element.getBoundingClientRect();
  68638. var scrollTop = getScroll(element, 'top');
  68639. var scrollLeft = getScroll(element, 'left');
  68640. rect.top += scrollTop;
  68641. rect.left += scrollLeft;
  68642. rect.bottom += scrollTop;
  68643. rect.right += scrollLeft;
  68644. } else {
  68645. rect = element.getBoundingClientRect();
  68646. }
  68647. } catch (e) {}
  68648. var result = {
  68649. left: rect.left,
  68650. top: rect.top,
  68651. width: rect.right - rect.left,
  68652. height: rect.bottom - rect.top
  68653. };
  68654. // subtract scrollbar size from sizes
  68655. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  68656. var width = sizes.width || element.clientWidth || result.right - result.left;
  68657. var height = sizes.height || element.clientHeight || result.bottom - result.top;
  68658. var horizScrollbar = element.offsetWidth - width;
  68659. var vertScrollbar = element.offsetHeight - height;
  68660. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  68661. // we make this check conditional for performance reasons
  68662. if (horizScrollbar || vertScrollbar) {
  68663. var styles = getStyleComputedProperty(element);
  68664. horizScrollbar -= getBordersSize(styles, 'x');
  68665. vertScrollbar -= getBordersSize(styles, 'y');
  68666. result.width -= horizScrollbar;
  68667. result.height -= vertScrollbar;
  68668. }
  68669. return getClientRect(result);
  68670. }
  68671. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  68672. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  68673. var isIE10 = isIE(10);
  68674. var isHTML = parent.nodeName === 'HTML';
  68675. var childrenRect = getBoundingClientRect(children);
  68676. var parentRect = getBoundingClientRect(parent);
  68677. var scrollParent = getScrollParent(children);
  68678. var styles = getStyleComputedProperty(parent);
  68679. var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
  68680. var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
  68681. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  68682. if (fixedPosition && isHTML) {
  68683. parentRect.top = Math.max(parentRect.top, 0);
  68684. parentRect.left = Math.max(parentRect.left, 0);
  68685. }
  68686. var offsets = getClientRect({
  68687. top: childrenRect.top - parentRect.top - borderTopWidth,
  68688. left: childrenRect.left - parentRect.left - borderLeftWidth,
  68689. width: childrenRect.width,
  68690. height: childrenRect.height
  68691. });
  68692. offsets.marginTop = 0;
  68693. offsets.marginLeft = 0;
  68694. // Subtract margins of documentElement in case it's being used as parent
  68695. // we do this only on HTML because it's the only element that behaves
  68696. // differently when margins are applied to it. The margins are included in
  68697. // the box of the documentElement, in the other cases not.
  68698. if (!isIE10 && isHTML) {
  68699. var marginTop = parseFloat(styles.marginTop, 10);
  68700. var marginLeft = parseFloat(styles.marginLeft, 10);
  68701. offsets.top -= borderTopWidth - marginTop;
  68702. offsets.bottom -= borderTopWidth - marginTop;
  68703. offsets.left -= borderLeftWidth - marginLeft;
  68704. offsets.right -= borderLeftWidth - marginLeft;
  68705. // Attach marginTop and marginLeft because in some circumstances we may need them
  68706. offsets.marginTop = marginTop;
  68707. offsets.marginLeft = marginLeft;
  68708. }
  68709. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  68710. offsets = includeScroll(offsets, parent);
  68711. }
  68712. return offsets;
  68713. }
  68714. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  68715. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  68716. var html = element.ownerDocument.documentElement;
  68717. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  68718. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  68719. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  68720. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  68721. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  68722. var offset = {
  68723. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  68724. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  68725. width: width,
  68726. height: height
  68727. };
  68728. return getClientRect(offset);
  68729. }
  68730. /**
  68731. * Check if the given element is fixed or is inside a fixed parent
  68732. * @method
  68733. * @memberof Popper.Utils
  68734. * @argument {Element} element
  68735. * @argument {Element} customContainer
  68736. * @returns {Boolean} answer to "isFixed?"
  68737. */
  68738. function isFixed(element) {
  68739. var nodeName = element.nodeName;
  68740. if (nodeName === 'BODY' || nodeName === 'HTML') {
  68741. return false;
  68742. }
  68743. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  68744. return true;
  68745. }
  68746. var parentNode = getParentNode(element);
  68747. if (!parentNode) {
  68748. return false;
  68749. }
  68750. return isFixed(parentNode);
  68751. }
  68752. /**
  68753. * Finds the first parent of an element that has a transformed property defined
  68754. * @method
  68755. * @memberof Popper.Utils
  68756. * @argument {Element} element
  68757. * @returns {Element} first transformed parent or documentElement
  68758. */
  68759. function getFixedPositionOffsetParent(element) {
  68760. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  68761. if (!element || !element.parentElement || isIE()) {
  68762. return document.documentElement;
  68763. }
  68764. var el = element.parentElement;
  68765. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  68766. el = el.parentElement;
  68767. }
  68768. return el || document.documentElement;
  68769. }
  68770. /**
  68771. * Computed the boundaries limits and return them
  68772. * @method
  68773. * @memberof Popper.Utils
  68774. * @param {HTMLElement} popper
  68775. * @param {HTMLElement} reference
  68776. * @param {number} padding
  68777. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  68778. * @param {Boolean} fixedPosition - Is in fixed position mode
  68779. * @returns {Object} Coordinates of the boundaries
  68780. */
  68781. function getBoundaries(popper, reference, padding, boundariesElement) {
  68782. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  68783. // NOTE: 1 DOM access here
  68784. var boundaries = { top: 0, left: 0 };
  68785. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  68786. // Handle viewport case
  68787. if (boundariesElement === 'viewport') {
  68788. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  68789. } else {
  68790. // Handle other cases based on DOM element used as boundaries
  68791. var boundariesNode = void 0;
  68792. if (boundariesElement === 'scrollParent') {
  68793. boundariesNode = getScrollParent(getParentNode(reference));
  68794. if (boundariesNode.nodeName === 'BODY') {
  68795. boundariesNode = popper.ownerDocument.documentElement;
  68796. }
  68797. } else if (boundariesElement === 'window') {
  68798. boundariesNode = popper.ownerDocument.documentElement;
  68799. } else {
  68800. boundariesNode = boundariesElement;
  68801. }
  68802. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  68803. // In case of HTML, we need a different computation
  68804. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  68805. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  68806. height = _getWindowSizes.height,
  68807. width = _getWindowSizes.width;
  68808. boundaries.top += offsets.top - offsets.marginTop;
  68809. boundaries.bottom = height + offsets.top;
  68810. boundaries.left += offsets.left - offsets.marginLeft;
  68811. boundaries.right = width + offsets.left;
  68812. } else {
  68813. // for all the other DOM elements, this one is good
  68814. boundaries = offsets;
  68815. }
  68816. }
  68817. // Add paddings
  68818. padding = padding || 0;
  68819. var isPaddingNumber = typeof padding === 'number';
  68820. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  68821. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  68822. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  68823. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  68824. return boundaries;
  68825. }
  68826. function getArea(_ref) {
  68827. var width = _ref.width,
  68828. height = _ref.height;
  68829. return width * height;
  68830. }
  68831. /**
  68832. * Utility used to transform the `auto` placement to the placement with more
  68833. * available space.
  68834. * @method
  68835. * @memberof Popper.Utils
  68836. * @argument {Object} data - The data object generated by update method
  68837. * @argument {Object} options - Modifiers configuration and options
  68838. * @returns {Object} The data object, properly modified
  68839. */
  68840. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  68841. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  68842. if (placement.indexOf('auto') === -1) {
  68843. return placement;
  68844. }
  68845. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  68846. var rects = {
  68847. top: {
  68848. width: boundaries.width,
  68849. height: refRect.top - boundaries.top
  68850. },
  68851. right: {
  68852. width: boundaries.right - refRect.right,
  68853. height: boundaries.height
  68854. },
  68855. bottom: {
  68856. width: boundaries.width,
  68857. height: boundaries.bottom - refRect.bottom
  68858. },
  68859. left: {
  68860. width: refRect.left - boundaries.left,
  68861. height: boundaries.height
  68862. }
  68863. };
  68864. var sortedAreas = Object.keys(rects).map(function (key) {
  68865. return _extends({
  68866. key: key
  68867. }, rects[key], {
  68868. area: getArea(rects[key])
  68869. });
  68870. }).sort(function (a, b) {
  68871. return b.area - a.area;
  68872. });
  68873. var filteredAreas = sortedAreas.filter(function (_ref2) {
  68874. var width = _ref2.width,
  68875. height = _ref2.height;
  68876. return width >= popper.clientWidth && height >= popper.clientHeight;
  68877. });
  68878. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  68879. var variation = placement.split('-')[1];
  68880. return computedPlacement + (variation ? '-' + variation : '');
  68881. }
  68882. /**
  68883. * Get offsets to the reference element
  68884. * @method
  68885. * @memberof Popper.Utils
  68886. * @param {Object} state
  68887. * @param {Element} popper - the popper element
  68888. * @param {Element} reference - the reference element (the popper will be relative to this)
  68889. * @param {Element} fixedPosition - is in fixed position mode
  68890. * @returns {Object} An object containing the offsets which will be applied to the popper
  68891. */
  68892. function getReferenceOffsets(state, popper, reference) {
  68893. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  68894. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
  68895. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  68896. }
  68897. /**
  68898. * Get the outer sizes of the given element (offset size + margins)
  68899. * @method
  68900. * @memberof Popper.Utils
  68901. * @argument {Element} element
  68902. * @returns {Object} object containing width and height properties
  68903. */
  68904. function getOuterSizes(element) {
  68905. var window = element.ownerDocument.defaultView;
  68906. var styles = window.getComputedStyle(element);
  68907. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  68908. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  68909. var result = {
  68910. width: element.offsetWidth + y,
  68911. height: element.offsetHeight + x
  68912. };
  68913. return result;
  68914. }
  68915. /**
  68916. * Get the opposite placement of the given one
  68917. * @method
  68918. * @memberof Popper.Utils
  68919. * @argument {String} placement
  68920. * @returns {String} flipped placement
  68921. */
  68922. function getOppositePlacement(placement) {
  68923. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  68924. return placement.replace(/left|right|bottom|top/g, function (matched) {
  68925. return hash[matched];
  68926. });
  68927. }
  68928. /**
  68929. * Get offsets to the popper
  68930. * @method
  68931. * @memberof Popper.Utils
  68932. * @param {Object} position - CSS position the Popper will get applied
  68933. * @param {HTMLElement} popper - the popper element
  68934. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  68935. * @param {String} placement - one of the valid placement options
  68936. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  68937. */
  68938. function getPopperOffsets(popper, referenceOffsets, placement) {
  68939. placement = placement.split('-')[0];
  68940. // Get popper node sizes
  68941. var popperRect = getOuterSizes(popper);
  68942. // Add position, width and height to our offsets object
  68943. var popperOffsets = {
  68944. width: popperRect.width,
  68945. height: popperRect.height
  68946. };
  68947. // depending by the popper placement we have to compute its offsets slightly differently
  68948. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  68949. var mainSide = isHoriz ? 'top' : 'left';
  68950. var secondarySide = isHoriz ? 'left' : 'top';
  68951. var measurement = isHoriz ? 'height' : 'width';
  68952. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  68953. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  68954. if (placement === secondarySide) {
  68955. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  68956. } else {
  68957. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  68958. }
  68959. return popperOffsets;
  68960. }
  68961. /**
  68962. * Mimics the `find` method of Array
  68963. * @method
  68964. * @memberof Popper.Utils
  68965. * @argument {Array} arr
  68966. * @argument prop
  68967. * @argument value
  68968. * @returns index or -1
  68969. */
  68970. function find(arr, check) {
  68971. // use native find if supported
  68972. if (Array.prototype.find) {
  68973. return arr.find(check);
  68974. }
  68975. // use `filter` to obtain the same behavior of `find`
  68976. return arr.filter(check)[0];
  68977. }
  68978. /**
  68979. * Return the index of the matching object
  68980. * @method
  68981. * @memberof Popper.Utils
  68982. * @argument {Array} arr
  68983. * @argument prop
  68984. * @argument value
  68985. * @returns index or -1
  68986. */
  68987. function findIndex(arr, prop, value) {
  68988. // use native findIndex if supported
  68989. if (Array.prototype.findIndex) {
  68990. return arr.findIndex(function (cur) {
  68991. return cur[prop] === value;
  68992. });
  68993. }
  68994. // use `find` + `indexOf` if `findIndex` isn't supported
  68995. var match = find(arr, function (obj) {
  68996. return obj[prop] === value;
  68997. });
  68998. return arr.indexOf(match);
  68999. }
  69000. /**
  69001. * Loop trough the list of modifiers and run them in order,
  69002. * each of them will then edit the data object.
  69003. * @method
  69004. * @memberof Popper.Utils
  69005. * @param {dataObject} data
  69006. * @param {Array} modifiers
  69007. * @param {String} ends - Optional modifier name used as stopper
  69008. * @returns {dataObject}
  69009. */
  69010. function runModifiers(modifiers, data, ends) {
  69011. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  69012. modifiersToRun.forEach(function (modifier) {
  69013. if (modifier['function']) {
  69014. // eslint-disable-line dot-notation
  69015. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  69016. }
  69017. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  69018. if (modifier.enabled && isFunction(fn)) {
  69019. // Add properties to offsets to make them a complete clientRect object
  69020. // we do this before each modifier to make sure the previous one doesn't
  69021. // mess with these values
  69022. data.offsets.popper = getClientRect(data.offsets.popper);
  69023. data.offsets.reference = getClientRect(data.offsets.reference);
  69024. data = fn(data, modifier);
  69025. }
  69026. });
  69027. return data;
  69028. }
  69029. /**
  69030. * Updates the position of the popper, computing the new offsets and applying
  69031. * the new style.<br />
  69032. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  69033. * @method
  69034. * @memberof Popper
  69035. */
  69036. function update() {
  69037. // if popper is destroyed, don't perform any further update
  69038. if (this.state.isDestroyed) {
  69039. return;
  69040. }
  69041. var data = {
  69042. instance: this,
  69043. styles: {},
  69044. arrowStyles: {},
  69045. attributes: {},
  69046. flipped: false,
  69047. offsets: {}
  69048. };
  69049. // compute reference element offsets
  69050. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  69051. // compute auto placement, store placement inside the data object,
  69052. // modifiers will be able to edit `placement` if needed
  69053. // and refer to originalPlacement to know the original value
  69054. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  69055. // store the computed placement inside `originalPlacement`
  69056. data.originalPlacement = data.placement;
  69057. data.positionFixed = this.options.positionFixed;
  69058. // compute the popper offsets
  69059. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  69060. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  69061. // run the modifiers
  69062. data = runModifiers(this.modifiers, data);
  69063. // the first `update` will call `onCreate` callback
  69064. // the other ones will call `onUpdate` callback
  69065. if (!this.state.isCreated) {
  69066. this.state.isCreated = true;
  69067. this.options.onCreate(data);
  69068. } else {
  69069. this.options.onUpdate(data);
  69070. }
  69071. }
  69072. /**
  69073. * Helper used to know if the given modifier is enabled.
  69074. * @method
  69075. * @memberof Popper.Utils
  69076. * @returns {Boolean}
  69077. */
  69078. function isModifierEnabled(modifiers, modifierName) {
  69079. return modifiers.some(function (_ref) {
  69080. var name = _ref.name,
  69081. enabled = _ref.enabled;
  69082. return enabled && name === modifierName;
  69083. });
  69084. }
  69085. /**
  69086. * Get the prefixed supported property name
  69087. * @method
  69088. * @memberof Popper.Utils
  69089. * @argument {String} property (camelCase)
  69090. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  69091. */
  69092. function getSupportedPropertyName(property) {
  69093. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  69094. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  69095. for (var i = 0; i < prefixes.length; i++) {
  69096. var prefix = prefixes[i];
  69097. var toCheck = prefix ? '' + prefix + upperProp : property;
  69098. if (typeof document.body.style[toCheck] !== 'undefined') {
  69099. return toCheck;
  69100. }
  69101. }
  69102. return null;
  69103. }
  69104. /**
  69105. * Destroys the popper.
  69106. * @method
  69107. * @memberof Popper
  69108. */
  69109. function destroy() {
  69110. this.state.isDestroyed = true;
  69111. // touch DOM only if `applyStyle` modifier is enabled
  69112. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  69113. this.popper.removeAttribute('x-placement');
  69114. this.popper.style.position = '';
  69115. this.popper.style.top = '';
  69116. this.popper.style.left = '';
  69117. this.popper.style.right = '';
  69118. this.popper.style.bottom = '';
  69119. this.popper.style.willChange = '';
  69120. this.popper.style[getSupportedPropertyName('transform')] = '';
  69121. }
  69122. this.disableEventListeners();
  69123. // remove the popper if user explicity asked for the deletion on destroy
  69124. // do not use `remove` because IE11 doesn't support it
  69125. if (this.options.removeOnDestroy) {
  69126. this.popper.parentNode.removeChild(this.popper);
  69127. }
  69128. return this;
  69129. }
  69130. /**
  69131. * Get the window associated with the element
  69132. * @argument {Element} element
  69133. * @returns {Window}
  69134. */
  69135. function getWindow(element) {
  69136. var ownerDocument = element.ownerDocument;
  69137. return ownerDocument ? ownerDocument.defaultView : window;
  69138. }
  69139. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  69140. var isBody = scrollParent.nodeName === 'BODY';
  69141. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  69142. target.addEventListener(event, callback, { passive: true });
  69143. if (!isBody) {
  69144. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  69145. }
  69146. scrollParents.push(target);
  69147. }
  69148. /**
  69149. * Setup needed event listeners used to update the popper position
  69150. * @method
  69151. * @memberof Popper.Utils
  69152. * @private
  69153. */
  69154. function setupEventListeners(reference, options, state, updateBound) {
  69155. // Resize event listener on window
  69156. state.updateBound = updateBound;
  69157. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  69158. // Scroll event listener on scroll parents
  69159. var scrollElement = getScrollParent(reference);
  69160. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  69161. state.scrollElement = scrollElement;
  69162. state.eventsEnabled = true;
  69163. return state;
  69164. }
  69165. /**
  69166. * It will add resize/scroll events and start recalculating
  69167. * position of the popper element when they are triggered.
  69168. * @method
  69169. * @memberof Popper
  69170. */
  69171. function enableEventListeners() {
  69172. if (!this.state.eventsEnabled) {
  69173. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  69174. }
  69175. }
  69176. /**
  69177. * Remove event listeners used to update the popper position
  69178. * @method
  69179. * @memberof Popper.Utils
  69180. * @private
  69181. */
  69182. function removeEventListeners(reference, state) {
  69183. // Remove resize event listener on window
  69184. getWindow(reference).removeEventListener('resize', state.updateBound);
  69185. // Remove scroll event listener on scroll parents
  69186. state.scrollParents.forEach(function (target) {
  69187. target.removeEventListener('scroll', state.updateBound);
  69188. });
  69189. // Reset state
  69190. state.updateBound = null;
  69191. state.scrollParents = [];
  69192. state.scrollElement = null;
  69193. state.eventsEnabled = false;
  69194. return state;
  69195. }
  69196. /**
  69197. * It will remove resize/scroll events and won't recalculate popper position
  69198. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  69199. * unless you call `update` method manually.
  69200. * @method
  69201. * @memberof Popper
  69202. */
  69203. function disableEventListeners() {
  69204. if (this.state.eventsEnabled) {
  69205. cancelAnimationFrame(this.scheduleUpdate);
  69206. this.state = removeEventListeners(this.reference, this.state);
  69207. }
  69208. }
  69209. /**
  69210. * Tells if a given input is a number
  69211. * @method
  69212. * @memberof Popper.Utils
  69213. * @param {*} input to check
  69214. * @return {Boolean}
  69215. */
  69216. function isNumeric(n) {
  69217. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  69218. }
  69219. /**
  69220. * Set the style to the given popper
  69221. * @method
  69222. * @memberof Popper.Utils
  69223. * @argument {Element} element - Element to apply the style to
  69224. * @argument {Object} styles
  69225. * Object with a list of properties and values which will be applied to the element
  69226. */
  69227. function setStyles(element, styles) {
  69228. Object.keys(styles).forEach(function (prop) {
  69229. var unit = '';
  69230. // add unit if the value is numeric and is one of the following
  69231. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  69232. unit = 'px';
  69233. }
  69234. element.style[prop] = styles[prop] + unit;
  69235. });
  69236. }
  69237. /**
  69238. * Set the attributes to the given popper
  69239. * @method
  69240. * @memberof Popper.Utils
  69241. * @argument {Element} element - Element to apply the attributes to
  69242. * @argument {Object} styles
  69243. * Object with a list of properties and values which will be applied to the element
  69244. */
  69245. function setAttributes(element, attributes) {
  69246. Object.keys(attributes).forEach(function (prop) {
  69247. var value = attributes[prop];
  69248. if (value !== false) {
  69249. element.setAttribute(prop, attributes[prop]);
  69250. } else {
  69251. element.removeAttribute(prop);
  69252. }
  69253. });
  69254. }
  69255. /**
  69256. * @function
  69257. * @memberof Modifiers
  69258. * @argument {Object} data - The data object generated by `update` method
  69259. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  69260. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  69261. * @argument {Object} options - Modifiers configuration and options
  69262. * @returns {Object} The same data object
  69263. */
  69264. function applyStyle(data) {
  69265. // any property present in `data.styles` will be applied to the popper,
  69266. // in this way we can make the 3rd party modifiers add custom styles to it
  69267. // Be aware, modifiers could override the properties defined in the previous
  69268. // lines of this modifier!
  69269. setStyles(data.instance.popper, data.styles);
  69270. // any property present in `data.attributes` will be applied to the popper,
  69271. // they will be set as HTML attributes of the element
  69272. setAttributes(data.instance.popper, data.attributes);
  69273. // if arrowElement is defined and arrowStyles has some properties
  69274. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  69275. setStyles(data.arrowElement, data.arrowStyles);
  69276. }
  69277. return data;
  69278. }
  69279. /**
  69280. * Set the x-placement attribute before everything else because it could be used
  69281. * to add margins to the popper margins needs to be calculated to get the
  69282. * correct popper offsets.
  69283. * @method
  69284. * @memberof Popper.modifiers
  69285. * @param {HTMLElement} reference - The reference element used to position the popper
  69286. * @param {HTMLElement} popper - The HTML element used as popper
  69287. * @param {Object} options - Popper.js options
  69288. */
  69289. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  69290. // compute reference element offsets
  69291. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  69292. // compute auto placement, store placement inside the data object,
  69293. // modifiers will be able to edit `placement` if needed
  69294. // and refer to originalPlacement to know the original value
  69295. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  69296. popper.setAttribute('x-placement', placement);
  69297. // Apply `position` to popper before anything else because
  69298. // without the position applied we can't guarantee correct computations
  69299. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  69300. return options;
  69301. }
  69302. /**
  69303. * @function
  69304. * @memberof Popper.Utils
  69305. * @argument {Object} data - The data object generated by `update` method
  69306. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  69307. * @returns {Object} The popper's position offsets rounded
  69308. *
  69309. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  69310. * good as it can be within reason.
  69311. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  69312. *
  69313. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  69314. * as well on High DPI screens).
  69315. *
  69316. * Firefox prefers no rounding for positioning and does not have blurriness on
  69317. * high DPI screens.
  69318. *
  69319. * Only horizontal placement and left/right values need to be considered.
  69320. */
  69321. function getRoundedOffsets(data, shouldRound) {
  69322. var _data$offsets = data.offsets,
  69323. popper = _data$offsets.popper,
  69324. reference = _data$offsets.reference;
  69325. var round = Math.round,
  69326. floor = Math.floor;
  69327. var noRound = function noRound(v) {
  69328. return v;
  69329. };
  69330. var referenceWidth = round(reference.width);
  69331. var popperWidth = round(popper.width);
  69332. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  69333. var isVariation = data.placement.indexOf('-') !== -1;
  69334. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  69335. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  69336. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  69337. var verticalToInteger = !shouldRound ? noRound : round;
  69338. return {
  69339. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  69340. top: verticalToInteger(popper.top),
  69341. bottom: verticalToInteger(popper.bottom),
  69342. right: horizontalToInteger(popper.right)
  69343. };
  69344. }
  69345. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  69346. /**
  69347. * @function
  69348. * @memberof Modifiers
  69349. * @argument {Object} data - The data object generated by `update` method
  69350. * @argument {Object} options - Modifiers configuration and options
  69351. * @returns {Object} The data object, properly modified
  69352. */
  69353. function computeStyle(data, options) {
  69354. var x = options.x,
  69355. y = options.y;
  69356. var popper = data.offsets.popper;
  69357. // Remove this legacy support in Popper.js v2
  69358. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  69359. return modifier.name === 'applyStyle';
  69360. }).gpuAcceleration;
  69361. if (legacyGpuAccelerationOption !== undefined) {
  69362. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  69363. }
  69364. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  69365. var offsetParent = getOffsetParent(data.instance.popper);
  69366. var offsetParentRect = getBoundingClientRect(offsetParent);
  69367. // Styles
  69368. var styles = {
  69369. position: popper.position
  69370. };
  69371. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  69372. var sideA = x === 'bottom' ? 'top' : 'bottom';
  69373. var sideB = y === 'right' ? 'left' : 'right';
  69374. // if gpuAcceleration is set to `true` and transform is supported,
  69375. // we use `translate3d` to apply the position to the popper we
  69376. // automatically use the supported prefixed version if needed
  69377. var prefixedProperty = getSupportedPropertyName('transform');
  69378. // now, let's make a step back and look at this code closely (wtf?)
  69379. // If the content of the popper grows once it's been positioned, it
  69380. // may happen that the popper gets misplaced because of the new content
  69381. // overflowing its reference element
  69382. // To avoid this problem, we provide two options (x and y), which allow
  69383. // the consumer to define the offset origin.
  69384. // If we position a popper on top of a reference element, we can set
  69385. // `x` to `top` to make the popper grow towards its top instead of
  69386. // its bottom.
  69387. var left = void 0,
  69388. top = void 0;
  69389. if (sideA === 'bottom') {
  69390. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  69391. // and not the bottom of the html element
  69392. if (offsetParent.nodeName === 'HTML') {
  69393. top = -offsetParent.clientHeight + offsets.bottom;
  69394. } else {
  69395. top = -offsetParentRect.height + offsets.bottom;
  69396. }
  69397. } else {
  69398. top = offsets.top;
  69399. }
  69400. if (sideB === 'right') {
  69401. if (offsetParent.nodeName === 'HTML') {
  69402. left = -offsetParent.clientWidth + offsets.right;
  69403. } else {
  69404. left = -offsetParentRect.width + offsets.right;
  69405. }
  69406. } else {
  69407. left = offsets.left;
  69408. }
  69409. if (gpuAcceleration && prefixedProperty) {
  69410. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  69411. styles[sideA] = 0;
  69412. styles[sideB] = 0;
  69413. styles.willChange = 'transform';
  69414. } else {
  69415. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  69416. var invertTop = sideA === 'bottom' ? -1 : 1;
  69417. var invertLeft = sideB === 'right' ? -1 : 1;
  69418. styles[sideA] = top * invertTop;
  69419. styles[sideB] = left * invertLeft;
  69420. styles.willChange = sideA + ', ' + sideB;
  69421. }
  69422. // Attributes
  69423. var attributes = {
  69424. 'x-placement': data.placement
  69425. };
  69426. // Update `data` attributes, styles and arrowStyles
  69427. data.attributes = _extends({}, attributes, data.attributes);
  69428. data.styles = _extends({}, styles, data.styles);
  69429. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  69430. return data;
  69431. }
  69432. /**
  69433. * Helper used to know if the given modifier depends from another one.<br />
  69434. * It checks if the needed modifier is listed and enabled.
  69435. * @method
  69436. * @memberof Popper.Utils
  69437. * @param {Array} modifiers - list of modifiers
  69438. * @param {String} requestingName - name of requesting modifier
  69439. * @param {String} requestedName - name of requested modifier
  69440. * @returns {Boolean}
  69441. */
  69442. function isModifierRequired(modifiers, requestingName, requestedName) {
  69443. var requesting = find(modifiers, function (_ref) {
  69444. var name = _ref.name;
  69445. return name === requestingName;
  69446. });
  69447. var isRequired = !!requesting && modifiers.some(function (modifier) {
  69448. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  69449. });
  69450. if (!isRequired) {
  69451. var _requesting = '`' + requestingName + '`';
  69452. var requested = '`' + requestedName + '`';
  69453. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  69454. }
  69455. return isRequired;
  69456. }
  69457. /**
  69458. * @function
  69459. * @memberof Modifiers
  69460. * @argument {Object} data - The data object generated by update method
  69461. * @argument {Object} options - Modifiers configuration and options
  69462. * @returns {Object} The data object, properly modified
  69463. */
  69464. function arrow(data, options) {
  69465. var _data$offsets$arrow;
  69466. // arrow depends on keepTogether in order to work
  69467. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  69468. return data;
  69469. }
  69470. var arrowElement = options.element;
  69471. // if arrowElement is a string, suppose it's a CSS selector
  69472. if (typeof arrowElement === 'string') {
  69473. arrowElement = data.instance.popper.querySelector(arrowElement);
  69474. // if arrowElement is not found, don't run the modifier
  69475. if (!arrowElement) {
  69476. return data;
  69477. }
  69478. } else {
  69479. // if the arrowElement isn't a query selector we must check that the
  69480. // provided DOM node is child of its popper node
  69481. if (!data.instance.popper.contains(arrowElement)) {
  69482. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  69483. return data;
  69484. }
  69485. }
  69486. var placement = data.placement.split('-')[0];
  69487. var _data$offsets = data.offsets,
  69488. popper = _data$offsets.popper,
  69489. reference = _data$offsets.reference;
  69490. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  69491. var len = isVertical ? 'height' : 'width';
  69492. var sideCapitalized = isVertical ? 'Top' : 'Left';
  69493. var side = sideCapitalized.toLowerCase();
  69494. var altSide = isVertical ? 'left' : 'top';
  69495. var opSide = isVertical ? 'bottom' : 'right';
  69496. var arrowElementSize = getOuterSizes(arrowElement)[len];
  69497. //
  69498. // extends keepTogether behavior making sure the popper and its
  69499. // reference have enough pixels in conjunction
  69500. //
  69501. // top/left side
  69502. if (reference[opSide] - arrowElementSize < popper[side]) {
  69503. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  69504. }
  69505. // bottom/right side
  69506. if (reference[side] + arrowElementSize > popper[opSide]) {
  69507. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  69508. }
  69509. data.offsets.popper = getClientRect(data.offsets.popper);
  69510. // compute center of the popper
  69511. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  69512. // Compute the sideValue using the updated popper offsets
  69513. // take popper margin in account because we don't have this info available
  69514. var css = getStyleComputedProperty(data.instance.popper);
  69515. var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
  69516. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
  69517. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  69518. // prevent arrowElement from being placed not contiguously to its popper
  69519. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  69520. data.arrowElement = arrowElement;
  69521. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  69522. return data;
  69523. }
  69524. /**
  69525. * Get the opposite placement variation of the given one
  69526. * @method
  69527. * @memberof Popper.Utils
  69528. * @argument {String} placement variation
  69529. * @returns {String} flipped placement variation
  69530. */
  69531. function getOppositeVariation(variation) {
  69532. if (variation === 'end') {
  69533. return 'start';
  69534. } else if (variation === 'start') {
  69535. return 'end';
  69536. }
  69537. return variation;
  69538. }
  69539. /**
  69540. * List of accepted placements to use as values of the `placement` option.<br />
  69541. * Valid placements are:
  69542. * - `auto`
  69543. * - `top`
  69544. * - `right`
  69545. * - `bottom`
  69546. * - `left`
  69547. *
  69548. * Each placement can have a variation from this list:
  69549. * - `-start`
  69550. * - `-end`
  69551. *
  69552. * Variations are interpreted easily if you think of them as the left to right
  69553. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  69554. * is right.<br />
  69555. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  69556. *
  69557. * Some valid examples are:
  69558. * - `top-end` (on top of reference, right aligned)
  69559. * - `right-start` (on right of reference, top aligned)
  69560. * - `bottom` (on bottom, centered)
  69561. * - `auto-end` (on the side with more space available, alignment depends by placement)
  69562. *
  69563. * @static
  69564. * @type {Array}
  69565. * @enum {String}
  69566. * @readonly
  69567. * @method placements
  69568. * @memberof Popper
  69569. */
  69570. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  69571. // Get rid of `auto` `auto-start` and `auto-end`
  69572. var validPlacements = placements.slice(3);
  69573. /**
  69574. * Given an initial placement, returns all the subsequent placements
  69575. * clockwise (or counter-clockwise).
  69576. *
  69577. * @method
  69578. * @memberof Popper.Utils
  69579. * @argument {String} placement - A valid placement (it accepts variations)
  69580. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  69581. * @returns {Array} placements including their variations
  69582. */
  69583. function clockwise(placement) {
  69584. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  69585. var index = validPlacements.indexOf(placement);
  69586. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  69587. return counter ? arr.reverse() : arr;
  69588. }
  69589. var BEHAVIORS = {
  69590. FLIP: 'flip',
  69591. CLOCKWISE: 'clockwise',
  69592. COUNTERCLOCKWISE: 'counterclockwise'
  69593. };
  69594. /**
  69595. * @function
  69596. * @memberof Modifiers
  69597. * @argument {Object} data - The data object generated by update method
  69598. * @argument {Object} options - Modifiers configuration and options
  69599. * @returns {Object} The data object, properly modified
  69600. */
  69601. function flip(data, options) {
  69602. // if `inner` modifier is enabled, we can't use the `flip` modifier
  69603. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  69604. return data;
  69605. }
  69606. if (data.flipped && data.placement === data.originalPlacement) {
  69607. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  69608. return data;
  69609. }
  69610. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  69611. var placement = data.placement.split('-')[0];
  69612. var placementOpposite = getOppositePlacement(placement);
  69613. var variation = data.placement.split('-')[1] || '';
  69614. var flipOrder = [];
  69615. switch (options.behavior) {
  69616. case BEHAVIORS.FLIP:
  69617. flipOrder = [placement, placementOpposite];
  69618. break;
  69619. case BEHAVIORS.CLOCKWISE:
  69620. flipOrder = clockwise(placement);
  69621. break;
  69622. case BEHAVIORS.COUNTERCLOCKWISE:
  69623. flipOrder = clockwise(placement, true);
  69624. break;
  69625. default:
  69626. flipOrder = options.behavior;
  69627. }
  69628. flipOrder.forEach(function (step, index) {
  69629. if (placement !== step || flipOrder.length === index + 1) {
  69630. return data;
  69631. }
  69632. placement = data.placement.split('-')[0];
  69633. placementOpposite = getOppositePlacement(placement);
  69634. var popperOffsets = data.offsets.popper;
  69635. var refOffsets = data.offsets.reference;
  69636. // using floor because the reference offsets may contain decimals we are not going to consider here
  69637. var floor = Math.floor;
  69638. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  69639. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  69640. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  69641. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  69642. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  69643. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  69644. // flip the variation if required
  69645. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  69646. // flips variation if reference element overflows boundaries
  69647. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  69648. // flips variation if popper content overflows boundaries
  69649. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  69650. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  69651. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  69652. // this boolean to detect any flip loop
  69653. data.flipped = true;
  69654. if (overlapsRef || overflowsBoundaries) {
  69655. placement = flipOrder[index + 1];
  69656. }
  69657. if (flippedVariation) {
  69658. variation = getOppositeVariation(variation);
  69659. }
  69660. data.placement = placement + (variation ? '-' + variation : '');
  69661. // this object contains `position`, we want to preserve it along with
  69662. // any additional property we may add in the future
  69663. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  69664. data = runModifiers(data.instance.modifiers, data, 'flip');
  69665. }
  69666. });
  69667. return data;
  69668. }
  69669. /**
  69670. * @function
  69671. * @memberof Modifiers
  69672. * @argument {Object} data - The data object generated by update method
  69673. * @argument {Object} options - Modifiers configuration and options
  69674. * @returns {Object} The data object, properly modified
  69675. */
  69676. function keepTogether(data) {
  69677. var _data$offsets = data.offsets,
  69678. popper = _data$offsets.popper,
  69679. reference = _data$offsets.reference;
  69680. var placement = data.placement.split('-')[0];
  69681. var floor = Math.floor;
  69682. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  69683. var side = isVertical ? 'right' : 'bottom';
  69684. var opSide = isVertical ? 'left' : 'top';
  69685. var measurement = isVertical ? 'width' : 'height';
  69686. if (popper[side] < floor(reference[opSide])) {
  69687. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  69688. }
  69689. if (popper[opSide] > floor(reference[side])) {
  69690. data.offsets.popper[opSide] = floor(reference[side]);
  69691. }
  69692. return data;
  69693. }
  69694. /**
  69695. * Converts a string containing value + unit into a px value number
  69696. * @function
  69697. * @memberof {modifiers~offset}
  69698. * @private
  69699. * @argument {String} str - Value + unit string
  69700. * @argument {String} measurement - `height` or `width`
  69701. * @argument {Object} popperOffsets
  69702. * @argument {Object} referenceOffsets
  69703. * @returns {Number|String}
  69704. * Value in pixels, or original string if no values were extracted
  69705. */
  69706. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  69707. // separate value from unit
  69708. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  69709. var value = +split[1];
  69710. var unit = split[2];
  69711. // If it's not a number it's an operator, I guess
  69712. if (!value) {
  69713. return str;
  69714. }
  69715. if (unit.indexOf('%') === 0) {
  69716. var element = void 0;
  69717. switch (unit) {
  69718. case '%p':
  69719. element = popperOffsets;
  69720. break;
  69721. case '%':
  69722. case '%r':
  69723. default:
  69724. element = referenceOffsets;
  69725. }
  69726. var rect = getClientRect(element);
  69727. return rect[measurement] / 100 * value;
  69728. } else if (unit === 'vh' || unit === 'vw') {
  69729. // if is a vh or vw, we calculate the size based on the viewport
  69730. var size = void 0;
  69731. if (unit === 'vh') {
  69732. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  69733. } else {
  69734. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  69735. }
  69736. return size / 100 * value;
  69737. } else {
  69738. // if is an explicit pixel unit, we get rid of the unit and keep the value
  69739. // if is an implicit unit, it's px, and we return just the value
  69740. return value;
  69741. }
  69742. }
  69743. /**
  69744. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  69745. * @function
  69746. * @memberof {modifiers~offset}
  69747. * @private
  69748. * @argument {String} offset
  69749. * @argument {Object} popperOffsets
  69750. * @argument {Object} referenceOffsets
  69751. * @argument {String} basePlacement
  69752. * @returns {Array} a two cells array with x and y offsets in numbers
  69753. */
  69754. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  69755. var offsets = [0, 0];
  69756. // Use height if placement is left or right and index is 0 otherwise use width
  69757. // in this way the first offset will use an axis and the second one
  69758. // will use the other one
  69759. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  69760. // Split the offset string to obtain a list of values and operands
  69761. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  69762. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  69763. return frag.trim();
  69764. });
  69765. // Detect if the offset string contains a pair of values or a single one
  69766. // they could be separated by comma or space
  69767. var divider = fragments.indexOf(find(fragments, function (frag) {
  69768. return frag.search(/,|\s/) !== -1;
  69769. }));
  69770. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  69771. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  69772. }
  69773. // If divider is found, we divide the list of values and operands to divide
  69774. // them by ofset X and Y.
  69775. var splitRegex = /\s*,\s*|\s+/;
  69776. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  69777. // Convert the values with units to absolute pixels to allow our computations
  69778. ops = ops.map(function (op, index) {
  69779. // Most of the units rely on the orientation of the popper
  69780. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  69781. var mergeWithPrevious = false;
  69782. return op
  69783. // This aggregates any `+` or `-` sign that aren't considered operators
  69784. // e.g.: 10 + +5 => [10, +, +5]
  69785. .reduce(function (a, b) {
  69786. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  69787. a[a.length - 1] = b;
  69788. mergeWithPrevious = true;
  69789. return a;
  69790. } else if (mergeWithPrevious) {
  69791. a[a.length - 1] += b;
  69792. mergeWithPrevious = false;
  69793. return a;
  69794. } else {
  69795. return a.concat(b);
  69796. }
  69797. }, [])
  69798. // Here we convert the string values into number values (in px)
  69799. .map(function (str) {
  69800. return toValue(str, measurement, popperOffsets, referenceOffsets);
  69801. });
  69802. });
  69803. // Loop trough the offsets arrays and execute the operations
  69804. ops.forEach(function (op, index) {
  69805. op.forEach(function (frag, index2) {
  69806. if (isNumeric(frag)) {
  69807. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  69808. }
  69809. });
  69810. });
  69811. return offsets;
  69812. }
  69813. /**
  69814. * @function
  69815. * @memberof Modifiers
  69816. * @argument {Object} data - The data object generated by update method
  69817. * @argument {Object} options - Modifiers configuration and options
  69818. * @argument {Number|String} options.offset=0
  69819. * The offset value as described in the modifier description
  69820. * @returns {Object} The data object, properly modified
  69821. */
  69822. function offset(data, _ref) {
  69823. var offset = _ref.offset;
  69824. var placement = data.placement,
  69825. _data$offsets = data.offsets,
  69826. popper = _data$offsets.popper,
  69827. reference = _data$offsets.reference;
  69828. var basePlacement = placement.split('-')[0];
  69829. var offsets = void 0;
  69830. if (isNumeric(+offset)) {
  69831. offsets = [+offset, 0];
  69832. } else {
  69833. offsets = parseOffset(offset, popper, reference, basePlacement);
  69834. }
  69835. if (basePlacement === 'left') {
  69836. popper.top += offsets[0];
  69837. popper.left -= offsets[1];
  69838. } else if (basePlacement === 'right') {
  69839. popper.top += offsets[0];
  69840. popper.left += offsets[1];
  69841. } else if (basePlacement === 'top') {
  69842. popper.left += offsets[0];
  69843. popper.top -= offsets[1];
  69844. } else if (basePlacement === 'bottom') {
  69845. popper.left += offsets[0];
  69846. popper.top += offsets[1];
  69847. }
  69848. data.popper = popper;
  69849. return data;
  69850. }
  69851. /**
  69852. * @function
  69853. * @memberof Modifiers
  69854. * @argument {Object} data - The data object generated by `update` method
  69855. * @argument {Object} options - Modifiers configuration and options
  69856. * @returns {Object} The data object, properly modified
  69857. */
  69858. function preventOverflow(data, options) {
  69859. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  69860. // If offsetParent is the reference element, we really want to
  69861. // go one step up and use the next offsetParent as reference to
  69862. // avoid to make this modifier completely useless and look like broken
  69863. if (data.instance.reference === boundariesElement) {
  69864. boundariesElement = getOffsetParent(boundariesElement);
  69865. }
  69866. // NOTE: DOM access here
  69867. // resets the popper's position so that the document size can be calculated excluding
  69868. // the size of the popper element itself
  69869. var transformProp = getSupportedPropertyName('transform');
  69870. var popperStyles = data.instance.popper.style; // assignment to help minification
  69871. var top = popperStyles.top,
  69872. left = popperStyles.left,
  69873. transform = popperStyles[transformProp];
  69874. popperStyles.top = '';
  69875. popperStyles.left = '';
  69876. popperStyles[transformProp] = '';
  69877. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  69878. // NOTE: DOM access here
  69879. // restores the original style properties after the offsets have been computed
  69880. popperStyles.top = top;
  69881. popperStyles.left = left;
  69882. popperStyles[transformProp] = transform;
  69883. options.boundaries = boundaries;
  69884. var order = options.priority;
  69885. var popper = data.offsets.popper;
  69886. var check = {
  69887. primary: function primary(placement) {
  69888. var value = popper[placement];
  69889. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  69890. value = Math.max(popper[placement], boundaries[placement]);
  69891. }
  69892. return defineProperty({}, placement, value);
  69893. },
  69894. secondary: function secondary(placement) {
  69895. var mainSide = placement === 'right' ? 'left' : 'top';
  69896. var value = popper[mainSide];
  69897. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  69898. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  69899. }
  69900. return defineProperty({}, mainSide, value);
  69901. }
  69902. };
  69903. order.forEach(function (placement) {
  69904. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  69905. popper = _extends({}, popper, check[side](placement));
  69906. });
  69907. data.offsets.popper = popper;
  69908. return data;
  69909. }
  69910. /**
  69911. * @function
  69912. * @memberof Modifiers
  69913. * @argument {Object} data - The data object generated by `update` method
  69914. * @argument {Object} options - Modifiers configuration and options
  69915. * @returns {Object} The data object, properly modified
  69916. */
  69917. function shift(data) {
  69918. var placement = data.placement;
  69919. var basePlacement = placement.split('-')[0];
  69920. var shiftvariation = placement.split('-')[1];
  69921. // if shift shiftvariation is specified, run the modifier
  69922. if (shiftvariation) {
  69923. var _data$offsets = data.offsets,
  69924. reference = _data$offsets.reference,
  69925. popper = _data$offsets.popper;
  69926. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  69927. var side = isVertical ? 'left' : 'top';
  69928. var measurement = isVertical ? 'width' : 'height';
  69929. var shiftOffsets = {
  69930. start: defineProperty({}, side, reference[side]),
  69931. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  69932. };
  69933. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  69934. }
  69935. return data;
  69936. }
  69937. /**
  69938. * @function
  69939. * @memberof Modifiers
  69940. * @argument {Object} data - The data object generated by update method
  69941. * @argument {Object} options - Modifiers configuration and options
  69942. * @returns {Object} The data object, properly modified
  69943. */
  69944. function hide(data) {
  69945. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  69946. return data;
  69947. }
  69948. var refRect = data.offsets.reference;
  69949. var bound = find(data.instance.modifiers, function (modifier) {
  69950. return modifier.name === 'preventOverflow';
  69951. }).boundaries;
  69952. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  69953. // Avoid unnecessary DOM access if visibility hasn't changed
  69954. if (data.hide === true) {
  69955. return data;
  69956. }
  69957. data.hide = true;
  69958. data.attributes['x-out-of-boundaries'] = '';
  69959. } else {
  69960. // Avoid unnecessary DOM access if visibility hasn't changed
  69961. if (data.hide === false) {
  69962. return data;
  69963. }
  69964. data.hide = false;
  69965. data.attributes['x-out-of-boundaries'] = false;
  69966. }
  69967. return data;
  69968. }
  69969. /**
  69970. * @function
  69971. * @memberof Modifiers
  69972. * @argument {Object} data - The data object generated by `update` method
  69973. * @argument {Object} options - Modifiers configuration and options
  69974. * @returns {Object} The data object, properly modified
  69975. */
  69976. function inner(data) {
  69977. var placement = data.placement;
  69978. var basePlacement = placement.split('-')[0];
  69979. var _data$offsets = data.offsets,
  69980. popper = _data$offsets.popper,
  69981. reference = _data$offsets.reference;
  69982. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  69983. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  69984. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  69985. data.placement = getOppositePlacement(placement);
  69986. data.offsets.popper = getClientRect(popper);
  69987. return data;
  69988. }
  69989. /**
  69990. * Modifier function, each modifier can have a function of this type assigned
  69991. * to its `fn` property.<br />
  69992. * These functions will be called on each update, this means that you must
  69993. * make sure they are performant enough to avoid performance bottlenecks.
  69994. *
  69995. * @function ModifierFn
  69996. * @argument {dataObject} data - The data object generated by `update` method
  69997. * @argument {Object} options - Modifiers configuration and options
  69998. * @returns {dataObject} The data object, properly modified
  69999. */
  70000. /**
  70001. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  70002. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  70003. * needed by the library.
  70004. *
  70005. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  70006. * All the other properties are configurations that could be tweaked.
  70007. * @namespace modifiers
  70008. */
  70009. var modifiers = {
  70010. /**
  70011. * Modifier used to shift the popper on the start or end of its reference
  70012. * element.<br />
  70013. * It will read the variation of the `placement` property.<br />
  70014. * It can be one either `-end` or `-start`.
  70015. * @memberof modifiers
  70016. * @inner
  70017. */
  70018. shift: {
  70019. /** @prop {number} order=100 - Index used to define the order of execution */
  70020. order: 100,
  70021. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70022. enabled: true,
  70023. /** @prop {ModifierFn} */
  70024. fn: shift
  70025. },
  70026. /**
  70027. * The `offset` modifier can shift your popper on both its axis.
  70028. *
  70029. * It accepts the following units:
  70030. * - `px` or unit-less, interpreted as pixels
  70031. * - `%` or `%r`, percentage relative to the length of the reference element
  70032. * - `%p`, percentage relative to the length of the popper element
  70033. * - `vw`, CSS viewport width unit
  70034. * - `vh`, CSS viewport height unit
  70035. *
  70036. * For length is intended the main axis relative to the placement of the popper.<br />
  70037. * This means that if the placement is `top` or `bottom`, the length will be the
  70038. * `width`. In case of `left` or `right`, it will be the `height`.
  70039. *
  70040. * You can provide a single value (as `Number` or `String`), or a pair of values
  70041. * as `String` divided by a comma or one (or more) white spaces.<br />
  70042. * The latter is a deprecated method because it leads to confusion and will be
  70043. * removed in v2.<br />
  70044. * Additionally, it accepts additions and subtractions between different units.
  70045. * Note that multiplications and divisions aren't supported.
  70046. *
  70047. * Valid examples are:
  70048. * ```
  70049. * 10
  70050. * '10%'
  70051. * '10, 10'
  70052. * '10%, 10'
  70053. * '10 + 10%'
  70054. * '10 - 5vh + 3%'
  70055. * '-10px + 5vh, 5px - 6%'
  70056. * ```
  70057. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  70058. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  70059. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  70060. *
  70061. * @memberof modifiers
  70062. * @inner
  70063. */
  70064. offset: {
  70065. /** @prop {number} order=200 - Index used to define the order of execution */
  70066. order: 200,
  70067. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70068. enabled: true,
  70069. /** @prop {ModifierFn} */
  70070. fn: offset,
  70071. /** @prop {Number|String} offset=0
  70072. * The offset value as described in the modifier description
  70073. */
  70074. offset: 0
  70075. },
  70076. /**
  70077. * Modifier used to prevent the popper from being positioned outside the boundary.
  70078. *
  70079. * A scenario exists where the reference itself is not within the boundaries.<br />
  70080. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  70081. * In this case we need to decide whether the popper should either:
  70082. *
  70083. * - detach from the reference and remain "trapped" in the boundaries, or
  70084. * - if it should ignore the boundary and "escape with its reference"
  70085. *
  70086. * When `escapeWithReference` is set to`true` and reference is completely
  70087. * outside its boundaries, the popper will overflow (or completely leave)
  70088. * the boundaries in order to remain attached to the edge of the reference.
  70089. *
  70090. * @memberof modifiers
  70091. * @inner
  70092. */
  70093. preventOverflow: {
  70094. /** @prop {number} order=300 - Index used to define the order of execution */
  70095. order: 300,
  70096. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70097. enabled: true,
  70098. /** @prop {ModifierFn} */
  70099. fn: preventOverflow,
  70100. /**
  70101. * @prop {Array} [priority=['left','right','top','bottom']]
  70102. * Popper will try to prevent overflow following these priorities by default,
  70103. * then, it could overflow on the left and on top of the `boundariesElement`
  70104. */
  70105. priority: ['left', 'right', 'top', 'bottom'],
  70106. /**
  70107. * @prop {number} padding=5
  70108. * Amount of pixel used to define a minimum distance between the boundaries
  70109. * and the popper. This makes sure the popper always has a little padding
  70110. * between the edges of its container
  70111. */
  70112. padding: 5,
  70113. /**
  70114. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  70115. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  70116. * `viewport` or any DOM element.
  70117. */
  70118. boundariesElement: 'scrollParent'
  70119. },
  70120. /**
  70121. * Modifier used to make sure the reference and its popper stay near each other
  70122. * without leaving any gap between the two. Especially useful when the arrow is
  70123. * enabled and you want to ensure that it points to its reference element.
  70124. * It cares only about the first axis. You can still have poppers with margin
  70125. * between the popper and its reference element.
  70126. * @memberof modifiers
  70127. * @inner
  70128. */
  70129. keepTogether: {
  70130. /** @prop {number} order=400 - Index used to define the order of execution */
  70131. order: 400,
  70132. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70133. enabled: true,
  70134. /** @prop {ModifierFn} */
  70135. fn: keepTogether
  70136. },
  70137. /**
  70138. * This modifier is used to move the `arrowElement` of the popper to make
  70139. * sure it is positioned between the reference element and its popper element.
  70140. * It will read the outer size of the `arrowElement` node to detect how many
  70141. * pixels of conjunction are needed.
  70142. *
  70143. * It has no effect if no `arrowElement` is provided.
  70144. * @memberof modifiers
  70145. * @inner
  70146. */
  70147. arrow: {
  70148. /** @prop {number} order=500 - Index used to define the order of execution */
  70149. order: 500,
  70150. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70151. enabled: true,
  70152. /** @prop {ModifierFn} */
  70153. fn: arrow,
  70154. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  70155. element: '[x-arrow]'
  70156. },
  70157. /**
  70158. * Modifier used to flip the popper's placement when it starts to overlap its
  70159. * reference element.
  70160. *
  70161. * Requires the `preventOverflow` modifier before it in order to work.
  70162. *
  70163. * **NOTE:** this modifier will interrupt the current update cycle and will
  70164. * restart it if it detects the need to flip the placement.
  70165. * @memberof modifiers
  70166. * @inner
  70167. */
  70168. flip: {
  70169. /** @prop {number} order=600 - Index used to define the order of execution */
  70170. order: 600,
  70171. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70172. enabled: true,
  70173. /** @prop {ModifierFn} */
  70174. fn: flip,
  70175. /**
  70176. * @prop {String|Array} behavior='flip'
  70177. * The behavior used to change the popper's placement. It can be one of
  70178. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  70179. * placements (with optional variations)
  70180. */
  70181. behavior: 'flip',
  70182. /**
  70183. * @prop {number} padding=5
  70184. * The popper will flip if it hits the edges of the `boundariesElement`
  70185. */
  70186. padding: 5,
  70187. /**
  70188. * @prop {String|HTMLElement} boundariesElement='viewport'
  70189. * The element which will define the boundaries of the popper position.
  70190. * The popper will never be placed outside of the defined boundaries
  70191. * (except if `keepTogether` is enabled)
  70192. */
  70193. boundariesElement: 'viewport',
  70194. /**
  70195. * @prop {Boolean} flipVariations=false
  70196. * The popper will switch placement variation between `-start` and `-end` when
  70197. * the reference element overlaps its boundaries.
  70198. *
  70199. * The original placement should have a set variation.
  70200. */
  70201. flipVariations: false,
  70202. /**
  70203. * @prop {Boolean} flipVariationsByContent=false
  70204. * The popper will switch placement variation between `-start` and `-end` when
  70205. * the popper element overlaps its reference boundaries.
  70206. *
  70207. * The original placement should have a set variation.
  70208. */
  70209. flipVariationsByContent: false
  70210. },
  70211. /**
  70212. * Modifier used to make the popper flow toward the inner of the reference element.
  70213. * By default, when this modifier is disabled, the popper will be placed outside
  70214. * the reference element.
  70215. * @memberof modifiers
  70216. * @inner
  70217. */
  70218. inner: {
  70219. /** @prop {number} order=700 - Index used to define the order of execution */
  70220. order: 700,
  70221. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  70222. enabled: false,
  70223. /** @prop {ModifierFn} */
  70224. fn: inner
  70225. },
  70226. /**
  70227. * Modifier used to hide the popper when its reference element is outside of the
  70228. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  70229. * be used to hide with a CSS selector the popper when its reference is
  70230. * out of boundaries.
  70231. *
  70232. * Requires the `preventOverflow` modifier before it in order to work.
  70233. * @memberof modifiers
  70234. * @inner
  70235. */
  70236. hide: {
  70237. /** @prop {number} order=800 - Index used to define the order of execution */
  70238. order: 800,
  70239. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70240. enabled: true,
  70241. /** @prop {ModifierFn} */
  70242. fn: hide
  70243. },
  70244. /**
  70245. * Computes the style that will be applied to the popper element to gets
  70246. * properly positioned.
  70247. *
  70248. * Note that this modifier will not touch the DOM, it just prepares the styles
  70249. * so that `applyStyle` modifier can apply it. This separation is useful
  70250. * in case you need to replace `applyStyle` with a custom implementation.
  70251. *
  70252. * This modifier has `850` as `order` value to maintain backward compatibility
  70253. * with previous versions of Popper.js. Expect the modifiers ordering method
  70254. * to change in future major versions of the library.
  70255. *
  70256. * @memberof modifiers
  70257. * @inner
  70258. */
  70259. computeStyle: {
  70260. /** @prop {number} order=850 - Index used to define the order of execution */
  70261. order: 850,
  70262. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70263. enabled: true,
  70264. /** @prop {ModifierFn} */
  70265. fn: computeStyle,
  70266. /**
  70267. * @prop {Boolean} gpuAcceleration=true
  70268. * If true, it uses the CSS 3D transformation to position the popper.
  70269. * Otherwise, it will use the `top` and `left` properties
  70270. */
  70271. gpuAcceleration: true,
  70272. /**
  70273. * @prop {string} [x='bottom']
  70274. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  70275. * Change this if your popper should grow in a direction different from `bottom`
  70276. */
  70277. x: 'bottom',
  70278. /**
  70279. * @prop {string} [x='left']
  70280. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  70281. * Change this if your popper should grow in a direction different from `right`
  70282. */
  70283. y: 'right'
  70284. },
  70285. /**
  70286. * Applies the computed styles to the popper element.
  70287. *
  70288. * All the DOM manipulations are limited to this modifier. This is useful in case
  70289. * you want to integrate Popper.js inside a framework or view library and you
  70290. * want to delegate all the DOM manipulations to it.
  70291. *
  70292. * Note that if you disable this modifier, you must make sure the popper element
  70293. * has its position set to `absolute` before Popper.js can do its work!
  70294. *
  70295. * Just disable this modifier and define your own to achieve the desired effect.
  70296. *
  70297. * @memberof modifiers
  70298. * @inner
  70299. */
  70300. applyStyle: {
  70301. /** @prop {number} order=900 - Index used to define the order of execution */
  70302. order: 900,
  70303. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  70304. enabled: true,
  70305. /** @prop {ModifierFn} */
  70306. fn: applyStyle,
  70307. /** @prop {Function} */
  70308. onLoad: applyStyleOnLoad,
  70309. /**
  70310. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  70311. * @prop {Boolean} gpuAcceleration=true
  70312. * If true, it uses the CSS 3D transformation to position the popper.
  70313. * Otherwise, it will use the `top` and `left` properties
  70314. */
  70315. gpuAcceleration: undefined
  70316. }
  70317. };
  70318. /**
  70319. * The `dataObject` is an object containing all the information used by Popper.js.
  70320. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  70321. * @name dataObject
  70322. * @property {Object} data.instance The Popper.js instance
  70323. * @property {String} data.placement Placement applied to popper
  70324. * @property {String} data.originalPlacement Placement originally defined on init
  70325. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  70326. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  70327. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  70328. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  70329. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  70330. * @property {Object} data.boundaries Offsets of the popper boundaries
  70331. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  70332. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  70333. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  70334. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  70335. */
  70336. /**
  70337. * Default options provided to Popper.js constructor.<br />
  70338. * These can be overridden using the `options` argument of Popper.js.<br />
  70339. * To override an option, simply pass an object with the same
  70340. * structure of the `options` object, as the 3rd argument. For example:
  70341. * ```
  70342. * new Popper(ref, pop, {
  70343. * modifiers: {
  70344. * preventOverflow: { enabled: false }
  70345. * }
  70346. * })
  70347. * ```
  70348. * @type {Object}
  70349. * @static
  70350. * @memberof Popper
  70351. */
  70352. var Defaults = {
  70353. /**
  70354. * Popper's placement.
  70355. * @prop {Popper.placements} placement='bottom'
  70356. */
  70357. placement: 'bottom',
  70358. /**
  70359. * Set this to true if you want popper to position it self in 'fixed' mode
  70360. * @prop {Boolean} positionFixed=false
  70361. */
  70362. positionFixed: false,
  70363. /**
  70364. * Whether events (resize, scroll) are initially enabled.
  70365. * @prop {Boolean} eventsEnabled=true
  70366. */
  70367. eventsEnabled: true,
  70368. /**
  70369. * Set to true if you want to automatically remove the popper when
  70370. * you call the `destroy` method.
  70371. * @prop {Boolean} removeOnDestroy=false
  70372. */
  70373. removeOnDestroy: false,
  70374. /**
  70375. * Callback called when the popper is created.<br />
  70376. * By default, it is set to no-op.<br />
  70377. * Access Popper.js instance with `data.instance`.
  70378. * @prop {onCreate}
  70379. */
  70380. onCreate: function onCreate() {},
  70381. /**
  70382. * Callback called when the popper is updated. This callback is not called
  70383. * on the initialization/creation of the popper, but only on subsequent
  70384. * updates.<br />
  70385. * By default, it is set to no-op.<br />
  70386. * Access Popper.js instance with `data.instance`.
  70387. * @prop {onUpdate}
  70388. */
  70389. onUpdate: function onUpdate() {},
  70390. /**
  70391. * List of modifiers used to modify the offsets before they are applied to the popper.
  70392. * They provide most of the functionalities of Popper.js.
  70393. * @prop {modifiers}
  70394. */
  70395. modifiers: modifiers
  70396. };
  70397. /**
  70398. * @callback onCreate
  70399. * @param {dataObject} data
  70400. */
  70401. /**
  70402. * @callback onUpdate
  70403. * @param {dataObject} data
  70404. */
  70405. // Utils
  70406. // Methods
  70407. var Popper = function () {
  70408. /**
  70409. * Creates a new Popper.js instance.
  70410. * @class Popper
  70411. * @param {Element|referenceObject} reference - The reference element used to position the popper
  70412. * @param {Element} popper - The HTML / XML element used as the popper
  70413. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  70414. * @return {Object} instance - The generated Popper.js instance
  70415. */
  70416. function Popper(reference, popper) {
  70417. var _this = this;
  70418. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  70419. classCallCheck(this, Popper);
  70420. this.scheduleUpdate = function () {
  70421. return requestAnimationFrame(_this.update);
  70422. };
  70423. // make update() debounced, so that it only runs at most once-per-tick
  70424. this.update = debounce(this.update.bind(this));
  70425. // with {} we create a new object with the options inside it
  70426. this.options = _extends({}, Popper.Defaults, options);
  70427. // init state
  70428. this.state = {
  70429. isDestroyed: false,
  70430. isCreated: false,
  70431. scrollParents: []
  70432. };
  70433. // get reference and popper elements (allow jQuery wrappers)
  70434. this.reference = reference && reference.jquery ? reference[0] : reference;
  70435. this.popper = popper && popper.jquery ? popper[0] : popper;
  70436. // Deep merge modifiers options
  70437. this.options.modifiers = {};
  70438. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  70439. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  70440. });
  70441. // Refactoring modifiers' list (Object => Array)
  70442. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  70443. return _extends({
  70444. name: name
  70445. }, _this.options.modifiers[name]);
  70446. })
  70447. // sort the modifiers by order
  70448. .sort(function (a, b) {
  70449. return a.order - b.order;
  70450. });
  70451. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  70452. // such code is executed in the same order of its modifier
  70453. // they could add new properties to their options configuration
  70454. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  70455. this.modifiers.forEach(function (modifierOptions) {
  70456. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  70457. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  70458. }
  70459. });
  70460. // fire the first update to position the popper in the right place
  70461. this.update();
  70462. var eventsEnabled = this.options.eventsEnabled;
  70463. if (eventsEnabled) {
  70464. // setup event listeners, they will take care of update the position in specific situations
  70465. this.enableEventListeners();
  70466. }
  70467. this.state.eventsEnabled = eventsEnabled;
  70468. }
  70469. // We can't use class properties because they don't get listed in the
  70470. // class prototype and break stuff like Sinon stubs
  70471. createClass(Popper, [{
  70472. key: 'update',
  70473. value: function update$$1() {
  70474. return update.call(this);
  70475. }
  70476. }, {
  70477. key: 'destroy',
  70478. value: function destroy$$1() {
  70479. return destroy.call(this);
  70480. }
  70481. }, {
  70482. key: 'enableEventListeners',
  70483. value: function enableEventListeners$$1() {
  70484. return enableEventListeners.call(this);
  70485. }
  70486. }, {
  70487. key: 'disableEventListeners',
  70488. value: function disableEventListeners$$1() {
  70489. return disableEventListeners.call(this);
  70490. }
  70491. /**
  70492. * Schedules an update. It will run on the next UI update available.
  70493. * @method scheduleUpdate
  70494. * @memberof Popper
  70495. */
  70496. /**
  70497. * Collection of utilities useful when writing custom modifiers.
  70498. * Starting from version 1.7, this method is available only if you
  70499. * include `popper-utils.js` before `popper.js`.
  70500. *
  70501. * **DEPRECATION**: This way to access PopperUtils is deprecated
  70502. * and will be removed in v2! Use the PopperUtils module directly instead.
  70503. * Due to the high instability of the methods contained in Utils, we can't
  70504. * guarantee them to follow semver. Use them at your own risk!
  70505. * @static
  70506. * @private
  70507. * @type {Object}
  70508. * @deprecated since version 1.8
  70509. * @member Utils
  70510. * @memberof Popper
  70511. */
  70512. }]);
  70513. return Popper;
  70514. }();
  70515. /**
  70516. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  70517. * and lets you use it as replacement of a real DOM node.<br />
  70518. * You can use this method to position a popper relatively to a set of coordinates
  70519. * in case you don't have a DOM node to use as reference.
  70520. *
  70521. * ```
  70522. * new Popper(referenceObject, popperNode);
  70523. * ```
  70524. *
  70525. * NB: This feature isn't supported in Internet Explorer 10.
  70526. * @name referenceObject
  70527. * @property {Function} data.getBoundingClientRect
  70528. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  70529. * @property {number} data.clientWidth
  70530. * An ES6 getter that will return the width of the virtual reference element.
  70531. * @property {number} data.clientHeight
  70532. * An ES6 getter that will return the height of the virtual reference element.
  70533. */
  70534. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  70535. Popper.placements = placements;
  70536. Popper.Defaults = Defaults;
  70537. return Popper;
  70538. })));
  70539. //# sourceMappingURL=popper.js.map
  70540. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(117)))
  70541. /***/ }),
  70542. /* 117 */
  70543. /***/ (function(module, exports) {
  70544. var g;
  70545. // This works in non-strict mode
  70546. g = (function() {
  70547. return this;
  70548. })();
  70549. try {
  70550. // This works if eval is allowed (see CSP)
  70551. g = g || Function("return this")() || (1,eval)("this");
  70552. } catch(e) {
  70553. // This works if the window reference is available
  70554. if(typeof window === "object")
  70555. g = window;
  70556. }
  70557. // g can still be undefined, but nothing to do about it...
  70558. // We return undefined, instead of nothing here, so it's
  70559. // easier to handle this case. if(!global) { ...}
  70560. module.exports = g;
  70561. /***/ }),
  70562. /* 118 */
  70563. /***/ (function(module, exports, __webpack_require__) {
  70564. // 7.2.2 IsArray(argument)
  70565. var cof = __webpack_require__(41);
  70566. module.exports = Array.isArray || function isArray(arg) {
  70567. return cof(arg) == 'Array';
  70568. };
  70569. /***/ }),
  70570. /* 119 */
  70571. /***/ (function(module, exports, __webpack_require__) {
  70572. // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
  70573. var $keys = __webpack_require__(96);
  70574. var hiddenKeys = __webpack_require__(68).concat('length', 'prototype');
  70575. exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
  70576. return $keys(O, hiddenKeys);
  70577. };
  70578. /***/ }),
  70579. /* 120 */
  70580. /***/ (function(module, exports, __webpack_require__) {
  70581. "use strict";
  70582. Object.defineProperty(exports, "__esModule", {
  70583. value: true
  70584. });
  70585. exports.i18n = exports.use = exports.t = undefined;
  70586. var _getPrototypeOf = __webpack_require__(317);
  70587. var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
  70588. var _zhCN = __webpack_require__(320);
  70589. var _zhCN2 = _interopRequireDefault(_zhCN);
  70590. var _vue = __webpack_require__(16);
  70591. var _vue2 = _interopRequireDefault(_vue);
  70592. var _deepmerge = __webpack_require__(322);
  70593. var _deepmerge2 = _interopRequireDefault(_deepmerge);
  70594. var _format = __webpack_require__(323);
  70595. var _format2 = _interopRequireDefault(_format);
  70596. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70597. var format = (0, _format2.default)(_vue2.default);
  70598. var lang = _zhCN2.default;
  70599. var merged = false;
  70600. var i18nHandler = function i18nHandler() {
  70601. var vuei18n = (0, _getPrototypeOf2.default)(this || _vue2.default).$t;
  70602. if (typeof vuei18n === 'function' && !!_vue2.default.locale) {
  70603. if (!merged) {
  70604. merged = true;
  70605. _vue2.default.locale(_vue2.default.config.lang, (0, _deepmerge2.default)(lang, _vue2.default.locale(_vue2.default.config.lang) || {}, { clone: true }));
  70606. }
  70607. return vuei18n.apply(this, arguments);
  70608. }
  70609. };
  70610. var t = exports.t = function t(path, options) {
  70611. var value = i18nHandler.apply(this, arguments);
  70612. if (value !== null && value !== undefined) return value;
  70613. var array = path.split('.');
  70614. var current = lang;
  70615. for (var i = 0, j = array.length; i < j; i++) {
  70616. var property = array[i];
  70617. value = current[property];
  70618. if (i === j - 1) return format(value, options);
  70619. if (!value) return '';
  70620. current = value;
  70621. }
  70622. return '';
  70623. };
  70624. var use = exports.use = function use(l) {
  70625. lang = l || lang;
  70626. };
  70627. var i18n = exports.i18n = function i18n(fn) {
  70628. i18nHandler = fn || i18nHandler;
  70629. };
  70630. exports.default = { use: use, t: t, i18n: i18n };
  70631. /***/ }),
  70632. /* 121 */
  70633. /***/ (function(module, exports, __webpack_require__) {
  70634. "use strict";
  70635. Object.defineProperty(exports, "__esModule", {
  70636. value: true
  70637. });
  70638. var _slicedToArray2 = __webpack_require__(26);
  70639. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  70640. var _defineProperty2 = __webpack_require__(2);
  70641. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  70642. var _newArrowCheck2 = __webpack_require__(1);
  70643. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  70644. var _icon = __webpack_require__(19);
  70645. var _icon2 = _interopRequireDefault(_icon);
  70646. var _emitter = __webpack_require__(4);
  70647. var _emitter2 = _interopRequireDefault(_emitter);
  70648. var _locale = __webpack_require__(6);
  70649. var _locale2 = _interopRequireDefault(_locale);
  70650. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70651. var prefixCls = 'ivu-select';
  70652. exports.default = {
  70653. name: 'iSelectHead',
  70654. mixins: [_emitter2.default, _locale2.default],
  70655. components: { Icon: _icon2.default },
  70656. props: {
  70657. disabled: {
  70658. type: Boolean,
  70659. default: false
  70660. },
  70661. filterable: {
  70662. type: Boolean,
  70663. default: false
  70664. },
  70665. multiple: {
  70666. type: Boolean,
  70667. default: false
  70668. },
  70669. remote: {
  70670. type: Boolean,
  70671. default: false
  70672. },
  70673. initialLabel: {
  70674. type: [String, Number, Array]
  70675. },
  70676. values: {
  70677. type: Array,
  70678. default: function _default() {
  70679. (0, _newArrowCheck3.default)(undefined, undefined);
  70680. return [];
  70681. }.bind(undefined)
  70682. },
  70683. clearable: {
  70684. type: [Function, Boolean],
  70685. default: false
  70686. },
  70687. inputElementId: {
  70688. type: String
  70689. },
  70690. placeholder: {
  70691. type: String
  70692. },
  70693. queryProp: {
  70694. type: String,
  70695. default: ''
  70696. },
  70697. prefix: {
  70698. type: String
  70699. },
  70700. maxTagCount: {
  70701. type: Number
  70702. },
  70703. maxTagPlaceholder: {
  70704. type: Function
  70705. },
  70706. allowCreate: {
  70707. type: Boolean
  70708. },
  70709. showCreateItem: {
  70710. type: Boolean
  70711. }
  70712. },
  70713. data: function data() {
  70714. return {
  70715. prefixCls: prefixCls,
  70716. query: '',
  70717. inputLength: 20,
  70718. remoteInitialLabel: this.initialLabel,
  70719. preventRemoteCall: false
  70720. };
  70721. },
  70722. computed: {
  70723. singleDisplayClasses: function singleDisplayClasses() {
  70724. var _ref;
  70725. var filterable = this.filterable,
  70726. multiple = this.multiple,
  70727. showPlaceholder = this.showPlaceholder;
  70728. return [(_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-head-with-prefix', this.$slots.prefix || this.prefix), (0, _defineProperty3.default)(_ref, prefixCls + '-placeholder', showPlaceholder && !filterable), (0, _defineProperty3.default)(_ref, prefixCls + '-selected-value', !showPlaceholder && !multiple && !filterable), _ref)];
  70729. },
  70730. singleDisplayValue: function singleDisplayValue() {
  70731. if (this.multiple && this.values.length > 0 || this.filterable) return '';
  70732. return '' + String(this.selectedSingle) || this.localePlaceholder;
  70733. },
  70734. showPlaceholder: function showPlaceholder() {
  70735. var status = false;
  70736. if (!this.multiple) {
  70737. var value = this.values[0];
  70738. if (typeof value === 'undefined' || String(value).trim() === '') {
  70739. status = !this.remoteInitialLabel;
  70740. }
  70741. } else {
  70742. if (!this.values.length > 0) {
  70743. status = true;
  70744. }
  70745. }
  70746. return status;
  70747. },
  70748. resetSelect: function resetSelect() {
  70749. return !this.showPlaceholder && this.clearable;
  70750. },
  70751. inputStyle: function inputStyle() {
  70752. var style = {};
  70753. if (this.multiple) {
  70754. if (this.showPlaceholder) {
  70755. style.width = '100%';
  70756. } else {
  70757. style.width = String(this.inputLength) + 'px';
  70758. }
  70759. }
  70760. return style;
  70761. },
  70762. localePlaceholder: function localePlaceholder() {
  70763. if (this.placeholder === undefined) {
  70764. return this.t('i.select.placeholder');
  70765. } else {
  70766. return this.placeholder;
  70767. }
  70768. },
  70769. selectedSingle: function selectedSingle() {
  70770. var selected = this.values[0];
  70771. return selected ? selected.label : this.remoteInitialLabel || '';
  70772. },
  70773. selectedMultiple: function selectedMultiple() {
  70774. return this.multiple ? this.values : [];
  70775. },
  70776. headCls: function headCls() {
  70777. return (0, _defineProperty3.default)({}, prefixCls + '-head-flex', this.filterable && (this.$slots.prefix || this.prefix));
  70778. },
  70779. arrowType: function arrowType() {
  70780. var type = 'ios-arrow-down';
  70781. if (this.$IVIEW) {
  70782. if (this.$IVIEW.select.customArrow) {
  70783. type = '';
  70784. } else if (this.$IVIEW.select.arrow) {
  70785. type = this.$IVIEW.select.arrow;
  70786. }
  70787. }
  70788. return type;
  70789. },
  70790. customArrowType: function customArrowType() {
  70791. var type = '';
  70792. if (this.$IVIEW) {
  70793. if (this.$IVIEW.select.customArrow) {
  70794. type = this.$IVIEW.select.customArrow;
  70795. }
  70796. }
  70797. return type;
  70798. },
  70799. arrowSize: function arrowSize() {
  70800. var size = '';
  70801. if (this.$IVIEW) {
  70802. if (this.$IVIEW.select.arrowSize) {
  70803. size = this.$IVIEW.select.arrowSize;
  70804. }
  70805. }
  70806. return size;
  70807. }
  70808. },
  70809. methods: {
  70810. onInputFocus: function onInputFocus() {
  70811. this.$emit('on-input-focus');
  70812. },
  70813. onInputBlur: function onInputBlur() {
  70814. if (this.showCreateItem) return;
  70815. if (!this.values.length) this.query = '';
  70816. this.$emit('on-input-blur');
  70817. },
  70818. removeTag: function removeTag(value) {
  70819. if (this.disabled) return false;
  70820. this.dispatch('iSelect', 'on-select-selected', value);
  70821. },
  70822. resetInputState: function resetInputState() {
  70823. this.inputLength = this.$refs.input.value.length * 12 + 20;
  70824. this.$emit('on-keydown');
  70825. },
  70826. handleInputDelete: function handleInputDelete(e) {
  70827. var targetValue = e.target.value;
  70828. if (this.multiple && this.selectedMultiple.length && this.query === '' && targetValue === '') {
  70829. this.removeTag(this.selectedMultiple[this.selectedMultiple.length - 1]);
  70830. }
  70831. },
  70832. handleInputEnter: function handleInputEnter(e) {
  70833. this.$emit('on-enter');
  70834. if (this.showCreateItem) e.stopPropagation();
  70835. },
  70836. onHeaderClick: function onHeaderClick(e) {
  70837. if (this.filterable && e.target === this.$el) {
  70838. this.$refs.input.focus();
  70839. }
  70840. },
  70841. onClear: function onClear() {
  70842. this.$emit('on-clear');
  70843. }
  70844. },
  70845. watch: {
  70846. values: function values(_ref3) {
  70847. var _this = this;
  70848. var _ref4 = (0, _slicedToArray3.default)(_ref3, 1),
  70849. value = _ref4[0];
  70850. if (!this.filterable) return;
  70851. this.preventRemoteCall = true;
  70852. if (this.multiple) {
  70853. this.query = '';
  70854. this.preventRemoteCall = false;
  70855. return;
  70856. }
  70857. if (typeof value === 'undefined' || value === '' || value === null) this.query = '';else this.query = value.label;
  70858. this.$nextTick(function () {
  70859. (0, _newArrowCheck3.default)(this, _this);
  70860. return this.preventRemoteCall = false;
  70861. }.bind(this));
  70862. },
  70863. query: function query(val) {
  70864. if (this.preventRemoteCall) {
  70865. this.preventRemoteCall = false;
  70866. return;
  70867. }
  70868. this.$emit('on-query-change', val);
  70869. },
  70870. queryProp: function queryProp(query) {
  70871. if (query !== this.query) this.query = query;
  70872. }
  70873. }
  70874. };
  70875. /***/ }),
  70876. /* 122 */
  70877. /***/ (function(module, exports, __webpack_require__) {
  70878. "use strict";
  70879. Object.defineProperty(exports, "__esModule", {
  70880. value: true
  70881. });
  70882. var _newArrowCheck2 = __webpack_require__(1);
  70883. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  70884. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70885. var returnArrayFn = function () {
  70886. (0, _newArrowCheck3.default)(undefined, undefined);
  70887. return [];
  70888. }.bind(undefined);
  70889. exports.default = {
  70890. props: {
  70891. options: {
  70892. type: Array,
  70893. default: returnArrayFn
  70894. },
  70895. slotOptions: {
  70896. type: Array,
  70897. default: returnArrayFn
  70898. },
  70899. slotUpdateHook: {
  70900. type: Function,
  70901. default: function _default() {
  70902. (0, _newArrowCheck3.default)(undefined, undefined);
  70903. }.bind(undefined)
  70904. }
  70905. },
  70906. render: function render(h) {
  70907. if (this.slotOptions !== this.$parent.$slots.default) this.slotUpdateHook();
  70908. return h('ul', [this.$slots.default, this.options]);
  70909. }
  70910. };
  70911. /***/ }),
  70912. /* 123 */
  70913. /***/ (function(module, exports, __webpack_require__) {
  70914. "use strict";
  70915. Object.defineProperty(exports, "__esModule", {
  70916. value: true
  70917. });
  70918. var _defineProperty2 = __webpack_require__(2);
  70919. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  70920. var _emitter = __webpack_require__(4);
  70921. var _emitter2 = _interopRequireDefault(_emitter);
  70922. var _form = __webpack_require__(11);
  70923. var _form2 = _interopRequireDefault(_form);
  70924. var _assist = __webpack_require__(3);
  70925. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  70926. var prefixCls = 'ivu-select-item';
  70927. exports.default = {
  70928. name: 'iOption',
  70929. componentName: 'select-item',
  70930. mixins: [_emitter2.default, _form2.default],
  70931. props: {
  70932. value: {
  70933. type: [String, Number],
  70934. required: true
  70935. },
  70936. label: {
  70937. type: [String, Number]
  70938. },
  70939. disabled: {
  70940. type: Boolean,
  70941. default: false
  70942. },
  70943. selected: {
  70944. type: Boolean,
  70945. default: false
  70946. },
  70947. isFocused: {
  70948. type: Boolean,
  70949. default: false
  70950. },
  70951. tag: {
  70952. type: [String, Number]
  70953. }
  70954. },
  70955. data: function data() {
  70956. return {
  70957. searchLabel: '',
  70958. autoComplete: false
  70959. };
  70960. },
  70961. computed: {
  70962. classes: function classes() {
  70963. var _ref;
  70964. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected && !this.autoComplete), (0, _defineProperty3.default)(_ref, prefixCls + '-focus', this.isFocused), _ref)];
  70965. },
  70966. showLabel: function showLabel() {
  70967. return this.label ? this.label : this.value;
  70968. },
  70969. optionLabel: function optionLabel() {
  70970. return this.label || this.$el && this.$el.textContent;
  70971. }
  70972. },
  70973. methods: {
  70974. select: function select() {
  70975. if (this.itemDisabled) return false;
  70976. this.dispatch('iSelect', 'on-select-selected', {
  70977. value: this.value,
  70978. label: this.optionLabel,
  70979. tag: this.tag
  70980. });
  70981. this.$emit('on-select-selected', {
  70982. value: this.value,
  70983. label: this.optionLabel,
  70984. tag: this.tag
  70985. });
  70986. }
  70987. },
  70988. mounted: function mounted() {
  70989. var Select = (0, _assist.findComponentUpward)(this, 'iSelect');
  70990. if (Select) this.autoComplete = Select.autoComplete;
  70991. }
  70992. };
  70993. /***/ }),
  70994. /* 124 */
  70995. /***/ (function(module, exports, __webpack_require__) {
  70996. "use strict";
  70997. Object.defineProperty(exports, "__esModule", {
  70998. value: true
  70999. });
  71000. var _newArrowCheck2 = __webpack_require__(1);
  71001. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  71002. var _isNan = __webpack_require__(329);
  71003. var _isNan2 = _interopRequireDefault(_isNan);
  71004. var _defineProperty2 = __webpack_require__(2);
  71005. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71006. var _assist = __webpack_require__(3);
  71007. var _calcTextareaHeight = __webpack_require__(332);
  71008. var _calcTextareaHeight2 = _interopRequireDefault(_calcTextareaHeight);
  71009. var _emitter = __webpack_require__(4);
  71010. var _emitter2 = _interopRequireDefault(_emitter);
  71011. var _form = __webpack_require__(11);
  71012. var _form2 = _interopRequireDefault(_form);
  71013. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71014. var prefixCls = 'ivu-input';
  71015. exports.default = {
  71016. name: 'Input',
  71017. mixins: [_emitter2.default, _form2.default],
  71018. props: {
  71019. type: {
  71020. validator: function validator(value) {
  71021. return (0, _assist.oneOf)(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number', 'tel']);
  71022. },
  71023. default: 'text'
  71024. },
  71025. value: {
  71026. type: [String, Number],
  71027. default: ''
  71028. },
  71029. size: {
  71030. validator: function validator(value) {
  71031. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  71032. },
  71033. default: function _default() {
  71034. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  71035. }
  71036. },
  71037. placeholder: {
  71038. type: String,
  71039. default: ''
  71040. },
  71041. maxlength: {
  71042. type: [String, Number]
  71043. },
  71044. disabled: {
  71045. type: Boolean,
  71046. default: false
  71047. },
  71048. icon: String,
  71049. autosize: {
  71050. type: [Boolean, Object],
  71051. default: false
  71052. },
  71053. rows: {
  71054. type: Number,
  71055. default: 2
  71056. },
  71057. readonly: {
  71058. type: Boolean,
  71059. default: false
  71060. },
  71061. name: {
  71062. type: String
  71063. },
  71064. number: {
  71065. type: Boolean,
  71066. default: false
  71067. },
  71068. autofocus: {
  71069. type: Boolean,
  71070. default: false
  71071. },
  71072. spellcheck: {
  71073. type: Boolean,
  71074. default: false
  71075. },
  71076. autocomplete: {
  71077. type: String,
  71078. default: 'off'
  71079. },
  71080. clearable: {
  71081. type: Boolean,
  71082. default: false
  71083. },
  71084. elementId: {
  71085. type: String
  71086. },
  71087. wrap: {
  71088. validator: function validator(value) {
  71089. return (0, _assist.oneOf)(value, ['hard', 'soft']);
  71090. },
  71091. default: 'soft'
  71092. },
  71093. prefix: {
  71094. type: String,
  71095. default: ''
  71096. },
  71097. suffix: {
  71098. type: String,
  71099. default: ''
  71100. },
  71101. search: {
  71102. type: Boolean,
  71103. default: false
  71104. },
  71105. enterButton: {
  71106. type: [Boolean, String],
  71107. default: false
  71108. },
  71109. showWordLimit: {
  71110. type: Boolean,
  71111. default: false
  71112. },
  71113. password: {
  71114. type: Boolean,
  71115. default: false
  71116. },
  71117. border: {
  71118. type: Boolean,
  71119. default: true
  71120. }
  71121. },
  71122. data: function data() {
  71123. return {
  71124. currentValue: this.value,
  71125. prefixCls: prefixCls,
  71126. slotReady: false,
  71127. textareaStyles: {},
  71128. isOnComposition: false,
  71129. showPassword: false,
  71130. clearableIconOffset: 0
  71131. };
  71132. },
  71133. computed: {
  71134. currentType: function currentType() {
  71135. var type = this.type;
  71136. if (type === 'password' && this.password && this.showPassword) type = 'text';
  71137. return type;
  71138. },
  71139. prepend: function prepend() {
  71140. var state = false;
  71141. if (this.type !== 'textarea') state = this.$slots.prepend !== undefined;
  71142. return state;
  71143. },
  71144. append: function append() {
  71145. var state = false;
  71146. if (this.type !== 'textarea') state = this.$slots.append !== undefined;
  71147. return state;
  71148. },
  71149. showPrefix: function showPrefix() {
  71150. var state = false;
  71151. if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined;
  71152. return state;
  71153. },
  71154. showSuffix: function showSuffix() {
  71155. var state = false;
  71156. if (this.type !== 'textarea') state = this.suffix !== '' || this.$slots.suffix !== undefined;
  71157. return state;
  71158. },
  71159. wrapClasses: function wrapClasses() {
  71160. var _ref;
  71161. return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-type-' + String(this.type), this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-group', this.prepend || this.append || this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-group-' + String(this.size), (this.prepend || this.append || this.search && this.enterButton) && !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-group-with-prepend', this.prepend), (0, _defineProperty3.default)(_ref, prefixCls + '-group-with-append', this.append || this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-hide-icon', this.append), (0, _defineProperty3.default)(_ref, prefixCls + '-with-search', this.search && this.enterButton), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), _ref)];
  71162. },
  71163. inputClasses: function inputClasses() {
  71164. var _ref2;
  71165. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-no-border', !this.border), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-prefix', this.showPrefix), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-suffix', this.showSuffix || this.search && this.enterButton === false), _ref2)];
  71166. },
  71167. textareaClasses: function textareaClasses() {
  71168. var _ref3;
  71169. return ['' + prefixCls, (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref3, prefixCls + '-no-border', !this.border), _ref3)];
  71170. },
  71171. upperLimit: function upperLimit() {
  71172. return this.maxlength;
  71173. },
  71174. textLength: function textLength() {
  71175. if (typeof this.value === 'number') {
  71176. return String(this.value).length;
  71177. }
  71178. return (this.value || '').length;
  71179. },
  71180. clearableStyles: function clearableStyles() {
  71181. var style = {};
  71182. var offset = this.clearableIconOffset;
  71183. if (offset) style.transform = 'translateX(-' + String(offset) + 'px)';
  71184. return style;
  71185. }
  71186. },
  71187. methods: {
  71188. handleEnter: function handleEnter(event) {
  71189. this.$emit('on-enter', event);
  71190. if (this.search) this.$emit('on-search', this.currentValue);
  71191. },
  71192. handleKeydown: function handleKeydown(event) {
  71193. this.$emit('on-keydown', event);
  71194. },
  71195. handleKeypress: function handleKeypress(event) {
  71196. this.$emit('on-keypress', event);
  71197. },
  71198. handleKeyup: function handleKeyup(event) {
  71199. this.$emit('on-keyup', event);
  71200. },
  71201. handleIconClick: function handleIconClick(event) {
  71202. this.$emit('on-click', event);
  71203. },
  71204. handleFocus: function handleFocus(event) {
  71205. this.$emit('on-focus', event);
  71206. },
  71207. handleBlur: function handleBlur(event) {
  71208. this.$emit('on-blur', event);
  71209. if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
  71210. this.dispatch('FormItem', 'on-form-blur', this.currentValue);
  71211. }
  71212. },
  71213. handleComposition: function handleComposition(event) {
  71214. if (event.type === 'compositionstart') {
  71215. this.isOnComposition = true;
  71216. }
  71217. if (event.type === 'compositionend') {
  71218. this.isOnComposition = false;
  71219. this.handleInput(event);
  71220. }
  71221. },
  71222. handleInput: function handleInput(event) {
  71223. if (this.isOnComposition) return;
  71224. var value = event.target.value;
  71225. if (this.number && value !== '') value = (0, _isNan2.default)(Number(value)) ? value : Number(value);
  71226. this.$emit('input', value);
  71227. this.setCurrentValue(value);
  71228. this.$emit('on-change', event);
  71229. },
  71230. handleChange: function handleChange(event) {
  71231. this.$emit('on-input-change', event);
  71232. },
  71233. setCurrentValue: function setCurrentValue(value) {
  71234. var _this = this;
  71235. if (value === this.currentValue) return;
  71236. this.$nextTick(function () {
  71237. (0, _newArrowCheck3.default)(this, _this);
  71238. this.resizeTextarea();
  71239. }.bind(this));
  71240. this.currentValue = value;
  71241. if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
  71242. this.dispatch('FormItem', 'on-form-change', value);
  71243. }
  71244. },
  71245. resizeTextarea: function resizeTextarea() {
  71246. var autosize = this.autosize;
  71247. if (!autosize || this.type !== 'textarea') {
  71248. return false;
  71249. }
  71250. var minRows = autosize.minRows;
  71251. var maxRows = autosize.maxRows;
  71252. this.textareaStyles = (0, _calcTextareaHeight2.default)(this.$refs.textarea, minRows, maxRows);
  71253. },
  71254. focus: function focus(option) {
  71255. var $el = this.type === 'textarea' ? this.$refs.textarea : this.$refs.input;
  71256. $el.focus(option);
  71257. var _ref4 = option || {},
  71258. cursor = _ref4.cursor;
  71259. if (cursor) {
  71260. var len = $el.value.length;
  71261. switch (cursor) {
  71262. case 'start':
  71263. $el.setSelectionRange(0, 0);
  71264. break;
  71265. case 'end':
  71266. $el.setSelectionRange(len, len);
  71267. break;
  71268. default:
  71269. $el.setSelectionRange(0, len);
  71270. }
  71271. }
  71272. },
  71273. blur: function blur() {
  71274. if (this.type === 'textarea') {
  71275. this.$refs.textarea.blur();
  71276. } else {
  71277. this.$refs.input.blur();
  71278. }
  71279. },
  71280. handleClear: function handleClear() {
  71281. var e = { target: { value: '' } };
  71282. this.$emit('input', '');
  71283. this.setCurrentValue('');
  71284. this.$emit('on-change', e);
  71285. this.$emit('on-clear');
  71286. },
  71287. handleSearch: function handleSearch() {
  71288. if (this.itemDisabled) return false;
  71289. this.$refs.input.focus();
  71290. this.$emit('on-search', this.currentValue);
  71291. },
  71292. handleToggleShowPassword: function handleToggleShowPassword() {
  71293. var _this2 = this;
  71294. if (this.itemDisabled) return false;
  71295. this.showPassword = !this.showPassword;
  71296. this.focus();
  71297. var len = this.currentValue.length;
  71298. setTimeout(function () {
  71299. (0, _newArrowCheck3.default)(this, _this2);
  71300. this.$refs.input.setSelectionRange(len, len);
  71301. }.bind(this), 0);
  71302. },
  71303. handleCalcIconOffset: function handleCalcIconOffset() {
  71304. var $el = this.$el.querySelectorAll('.ivu-input-group-append')[0];
  71305. if ($el) {
  71306. this.clearableIconOffset = $el.offsetWidth;
  71307. } else {
  71308. this.clearableIconOffset = 0;
  71309. }
  71310. }
  71311. },
  71312. watch: {
  71313. value: function value(val) {
  71314. this.setCurrentValue(val);
  71315. },
  71316. type: function type() {
  71317. this.$nextTick(this.handleCalcIconOffset);
  71318. }
  71319. },
  71320. mounted: function mounted() {
  71321. this.slotReady = true;
  71322. this.resizeTextarea();
  71323. this.handleCalcIconOffset();
  71324. },
  71325. updated: function updated() {
  71326. this.$nextTick(this.handleCalcIconOffset);
  71327. }
  71328. };
  71329. /***/ }),
  71330. /* 125 */
  71331. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  71332. "use strict";
  71333. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  71334. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__ = __webpack_require__(126);
  71335. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__);
  71336. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  71337. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__ = __webpack_require__(342);
  71338. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__);
  71339. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  71340. /* script */
  71341. /* template */
  71342. /* template functional */
  71343. var __vue_template_functional__ = false
  71344. /* styles */
  71345. var __vue_styles__ = null
  71346. /* scopeId */
  71347. var __vue_scopeId__ = null
  71348. /* moduleIdentifier (server only) */
  71349. var __vue_module_identifier__ = null
  71350. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  71351. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_avatar_vue___default.a,
  71352. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__["render"],
  71353. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_265ad4ab_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_avatar_vue__["staticRenderFns"],
  71354. __vue_template_functional__,
  71355. __vue_styles__,
  71356. __vue_scopeId__,
  71357. __vue_module_identifier__
  71358. )
  71359. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  71360. /***/ }),
  71361. /* 126 */
  71362. /***/ (function(module, exports, __webpack_require__) {
  71363. "use strict";
  71364. Object.defineProperty(exports, "__esModule", {
  71365. value: true
  71366. });
  71367. var _defineProperty2 = __webpack_require__(2);
  71368. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71369. var _icon = __webpack_require__(19);
  71370. var _icon2 = _interopRequireDefault(_icon);
  71371. var _assist = __webpack_require__(3);
  71372. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71373. var prefixCls = 'ivu-avatar';
  71374. var sizeList = ['small', 'large', 'default'];
  71375. exports.default = {
  71376. name: 'Avatar',
  71377. components: { Icon: _icon2.default },
  71378. props: {
  71379. shape: {
  71380. validator: function validator(value) {
  71381. return (0, _assist.oneOf)(value, ['circle', 'square']);
  71382. },
  71383. default: 'circle'
  71384. },
  71385. size: {
  71386. type: [String, Number],
  71387. default: function _default() {
  71388. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  71389. }
  71390. },
  71391. src: {
  71392. type: String
  71393. },
  71394. icon: {
  71395. type: String
  71396. },
  71397. customIcon: {
  71398. type: String,
  71399. default: ''
  71400. }
  71401. },
  71402. data: function data() {
  71403. return {
  71404. prefixCls: prefixCls,
  71405. scale: 1,
  71406. childrenWidth: 0,
  71407. isSlotShow: false,
  71408. slotTemp: null
  71409. };
  71410. },
  71411. computed: {
  71412. classes: function classes() {
  71413. var _ref;
  71414. return ['' + prefixCls, prefixCls + '-' + String(this.shape), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-image', !!this.src), (0, _defineProperty3.default)(_ref, prefixCls + '-icon', !!this.icon || !!this.customIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), (0, _assist.oneOf)(this.size, sizeList)), _ref)];
  71415. },
  71416. styles: function styles() {
  71417. var style = {};
  71418. if (this.size && !(0, _assist.oneOf)(this.size, sizeList)) {
  71419. style.width = String(this.size) + 'px';
  71420. style.height = String(this.size) + 'px';
  71421. style.lineHeight = String(this.size) + 'px';
  71422. style.fontSize = this.size / 2 + 'px';
  71423. }
  71424. return style;
  71425. },
  71426. childrenStyle: function childrenStyle() {
  71427. var style = {};
  71428. if (this.isSlotShow) {
  71429. style = {
  71430. msTransform: 'scale(' + String(this.scale) + ')',
  71431. WebkitTransform: 'scale(' + String(this.scale) + ')',
  71432. transform: 'scale(' + String(this.scale) + ')',
  71433. position: 'absolute',
  71434. display: 'inline-block',
  71435. left: 'calc(50% - ' + String(Math.round(this.childrenWidth / 2)) + 'px)'
  71436. };
  71437. }
  71438. return style;
  71439. }
  71440. },
  71441. watch: {
  71442. size: function size(val, oldVal) {
  71443. if (val !== oldVal) this.setScale();
  71444. }
  71445. },
  71446. methods: {
  71447. setScale: function setScale() {
  71448. this.isSlotShow = !this.src && !this.icon;
  71449. if (this.$refs.children) {
  71450. this.childrenWidth = this.$refs.children.offsetWidth;
  71451. var avatarWidth = this.$el.getBoundingClientRect().width;
  71452. if (avatarWidth - 8 < this.childrenWidth) {
  71453. this.scale = (avatarWidth - 8) / this.childrenWidth;
  71454. } else {
  71455. this.scale = 1;
  71456. }
  71457. }
  71458. },
  71459. handleError: function handleError(e) {
  71460. this.$emit('on-error', e);
  71461. }
  71462. },
  71463. beforeCreate: function beforeCreate() {
  71464. this.slotTemp = this.$slots.default;
  71465. },
  71466. mounted: function mounted() {
  71467. this.setScale();
  71468. },
  71469. updated: function updated() {
  71470. if (this.$slots.default !== this.slotTemp) {
  71471. this.slotTemp = this.$slots.default;
  71472. this.setScale();
  71473. }
  71474. }
  71475. };
  71476. /***/ }),
  71477. /* 127 */
  71478. /***/ (function(module, exports, __webpack_require__) {
  71479. "use strict";
  71480. Object.defineProperty(exports, "__esModule", {
  71481. value: true
  71482. });
  71483. var _defineProperty2 = __webpack_require__(2);
  71484. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71485. var _assist = __webpack_require__(3);
  71486. var _dom = __webpack_require__(12);
  71487. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71488. var prefixCls = 'ivu-back-top';
  71489. exports.default = {
  71490. props: {
  71491. height: {
  71492. type: Number,
  71493. default: 400
  71494. },
  71495. bottom: {
  71496. type: Number,
  71497. default: 30
  71498. },
  71499. right: {
  71500. type: Number,
  71501. default: 30
  71502. },
  71503. duration: {
  71504. type: Number,
  71505. default: 1000
  71506. }
  71507. },
  71508. data: function data() {
  71509. return {
  71510. backTop: false
  71511. };
  71512. },
  71513. mounted: function mounted() {
  71514. (0, _dom.on)(window, 'scroll', this.handleScroll);
  71515. (0, _dom.on)(window, 'resize', this.handleScroll);
  71516. },
  71517. beforeDestroy: function beforeDestroy() {
  71518. (0, _dom.off)(window, 'scroll', this.handleScroll);
  71519. (0, _dom.off)(window, 'resize', this.handleScroll);
  71520. },
  71521. computed: {
  71522. classes: function classes() {
  71523. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-show', this.backTop)];
  71524. },
  71525. styles: function styles() {
  71526. return {
  71527. bottom: String(this.bottom) + 'px',
  71528. right: String(this.right) + 'px'
  71529. };
  71530. },
  71531. innerClasses: function innerClasses() {
  71532. return prefixCls + '-inner';
  71533. }
  71534. },
  71535. methods: {
  71536. handleScroll: function handleScroll() {
  71537. this.backTop = window.pageYOffset >= this.height;
  71538. },
  71539. back: function back() {
  71540. var sTop = document.documentElement.scrollTop || document.body.scrollTop;
  71541. (0, _assist.scrollTop)(window, sTop, 0, this.duration);
  71542. this.$emit('on-click');
  71543. }
  71544. }
  71545. };
  71546. /***/ }),
  71547. /* 128 */
  71548. /***/ (function(module, exports, __webpack_require__) {
  71549. "use strict";
  71550. Object.defineProperty(exports, "__esModule", {
  71551. value: true
  71552. });
  71553. var _defineProperty2 = __webpack_require__(2);
  71554. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71555. var _assist = __webpack_require__(3);
  71556. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71557. var initColorList = ['blue', 'green', 'red', 'yellow', 'pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
  71558. var prefixCls = 'ivu-badge';
  71559. exports.default = {
  71560. name: 'Badge',
  71561. props: {
  71562. count: Number,
  71563. dot: {
  71564. type: Boolean,
  71565. default: false
  71566. },
  71567. overflowCount: {
  71568. type: [Number, String],
  71569. default: 99
  71570. },
  71571. className: String,
  71572. showZero: {
  71573. type: Boolean,
  71574. default: false
  71575. },
  71576. text: {
  71577. type: String,
  71578. default: ''
  71579. },
  71580. status: {
  71581. validator: function validator(value) {
  71582. return (0, _assist.oneOf)(value, ['success', 'processing', 'default', 'error', 'warning']);
  71583. }
  71584. },
  71585. type: {
  71586. validator: function validator(value) {
  71587. return (0, _assist.oneOf)(value, ['success', 'primary', 'normal', 'error', 'warning', 'info']);
  71588. }
  71589. },
  71590. offset: {
  71591. type: Array
  71592. },
  71593. color: {
  71594. type: String
  71595. }
  71596. },
  71597. computed: {
  71598. classes: function classes() {
  71599. return '' + prefixCls;
  71600. },
  71601. dotClasses: function dotClasses() {
  71602. return prefixCls + '-dot';
  71603. },
  71604. countClasses: function countClasses() {
  71605. var _ref;
  71606. return [prefixCls + '-count', (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-count-alone', this.alone), (0, _defineProperty3.default)(_ref, prefixCls + '-count-' + String(this.type), !!this.type), _ref)];
  71607. },
  71608. customCountClasses: function customCountClasses() {
  71609. return [prefixCls + '-count', prefixCls + '-count-custom', (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
  71610. },
  71611. statusClasses: function statusClasses() {
  71612. var _ref3;
  71613. return [prefixCls + '-status-dot', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-status-' + String(this.status), !!this.status), (0, _defineProperty3.default)(_ref3, prefixCls + '-status-' + String(this.color), !!this.color && (0, _assist.oneOf)(this.color, initColorList)), _ref3)];
  71614. },
  71615. statusStyles: function statusStyles() {
  71616. return (0, _assist.oneOf)(this.color, initColorList) ? {} : { backgroundColor: this.color };
  71617. },
  71618. styles: function styles() {
  71619. var style = {};
  71620. if (this.offset && this.offset.length === 2) {
  71621. style['margin-top'] = String(this.offset[0]) + 'px';
  71622. style['margin-right'] = String(this.offset[1]) + 'px';
  71623. }
  71624. return style;
  71625. },
  71626. finalCount: function finalCount() {
  71627. if (this.text !== '') return this.text;
  71628. return parseInt(this.count) >= parseInt(this.overflowCount) ? String(this.overflowCount) + '+' : this.count;
  71629. },
  71630. badge: function badge() {
  71631. var status = false;
  71632. if (this.count) {
  71633. status = !(parseInt(this.count) === 0);
  71634. }
  71635. if (this.dot) {
  71636. status = true;
  71637. if (this.count !== null) {
  71638. if (parseInt(this.count) === 0) {
  71639. status = false;
  71640. }
  71641. }
  71642. }
  71643. if (this.text !== '') status = true;
  71644. return status || this.showZero;
  71645. },
  71646. hasCount: function hasCount() {
  71647. if (this.count || this.text !== '') return true;
  71648. if (this.showZero && parseInt(this.count) === 0) return true;else return false;
  71649. },
  71650. alone: function alone() {
  71651. return this.$slots.default === undefined;
  71652. }
  71653. }
  71654. };
  71655. /***/ }),
  71656. /* 129 */
  71657. /***/ (function(module, exports, __webpack_require__) {
  71658. "use strict";
  71659. Object.defineProperty(exports, "__esModule", {
  71660. value: true
  71661. });
  71662. var _newArrowCheck2 = __webpack_require__(1);
  71663. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  71664. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71665. var prefixCls = 'ivu-breadcrumb';
  71666. exports.default = {
  71667. name: 'Breadcrumb',
  71668. props: {
  71669. separator: {
  71670. type: String,
  71671. default: '/'
  71672. }
  71673. },
  71674. computed: {
  71675. classes: function classes() {
  71676. return '' + prefixCls;
  71677. }
  71678. },
  71679. mounted: function mounted() {
  71680. this.updateChildren();
  71681. },
  71682. updated: function updated() {
  71683. var _this = this;
  71684. this.$nextTick(function () {
  71685. (0, _newArrowCheck3.default)(this, _this);
  71686. this.updateChildren();
  71687. }.bind(this));
  71688. },
  71689. methods: {
  71690. updateChildren: function updateChildren() {
  71691. var _this2 = this;
  71692. this.$children.forEach(function (child) {
  71693. (0, _newArrowCheck3.default)(this, _this2);
  71694. child.separator = this.separator;
  71695. }.bind(this));
  71696. }
  71697. },
  71698. watch: {
  71699. separator: function separator() {
  71700. this.updateChildren();
  71701. }
  71702. }
  71703. };
  71704. /***/ }),
  71705. /* 130 */
  71706. /***/ (function(module, exports, __webpack_require__) {
  71707. "use strict";
  71708. Object.defineProperty(exports, "__esModule", {
  71709. value: true
  71710. });
  71711. var _link = __webpack_require__(48);
  71712. var _link2 = _interopRequireDefault(_link);
  71713. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71714. var prefixCls = 'ivu-breadcrumb-item';
  71715. exports.default = {
  71716. name: 'BreadcrumbItem',
  71717. mixins: [_link2.default],
  71718. props: {},
  71719. data: function data() {
  71720. return {
  71721. separator: '',
  71722. showSeparator: false
  71723. };
  71724. },
  71725. computed: {
  71726. linkClasses: function linkClasses() {
  71727. return prefixCls + '-link';
  71728. },
  71729. separatorClasses: function separatorClasses() {
  71730. return prefixCls + '-separator';
  71731. }
  71732. },
  71733. mounted: function mounted() {
  71734. this.showSeparator = this.$slots.separator !== undefined;
  71735. }
  71736. };
  71737. /***/ }),
  71738. /* 131 */
  71739. /***/ (function(module, exports, __webpack_require__) {
  71740. "use strict";
  71741. Object.defineProperty(exports, "__esModule", {
  71742. value: true
  71743. });
  71744. var _defineProperty2 = __webpack_require__(2);
  71745. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71746. var _icon = __webpack_require__(19);
  71747. var _icon2 = _interopRequireDefault(_icon);
  71748. var _assist = __webpack_require__(3);
  71749. var _link = __webpack_require__(48);
  71750. var _link2 = _interopRequireDefault(_link);
  71751. var _form = __webpack_require__(11);
  71752. var _form2 = _interopRequireDefault(_form);
  71753. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71754. var prefixCls = 'ivu-btn';
  71755. exports.default = {
  71756. name: 'Button',
  71757. mixins: [_link2.default, _form2.default],
  71758. components: { Icon: _icon2.default },
  71759. props: {
  71760. type: {
  71761. validator: function validator(value) {
  71762. return (0, _assist.oneOf)(value, ['default', 'primary', 'dashed', 'text', 'info', 'success', 'warning', 'error']);
  71763. },
  71764. default: 'default'
  71765. },
  71766. shape: {
  71767. validator: function validator(value) {
  71768. return (0, _assist.oneOf)(value, ['circle', 'circle-outline']);
  71769. }
  71770. },
  71771. size: {
  71772. validator: function validator(value) {
  71773. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  71774. },
  71775. default: function _default() {
  71776. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  71777. }
  71778. },
  71779. loading: Boolean,
  71780. disabled: Boolean,
  71781. htmlType: {
  71782. default: 'button',
  71783. validator: function validator(value) {
  71784. return (0, _assist.oneOf)(value, ['button', 'submit', 'reset']);
  71785. }
  71786. },
  71787. icon: {
  71788. type: String,
  71789. default: ''
  71790. },
  71791. customIcon: {
  71792. type: String,
  71793. default: ''
  71794. },
  71795. long: {
  71796. type: Boolean,
  71797. default: false
  71798. },
  71799. ghost: {
  71800. type: Boolean,
  71801. default: false
  71802. }
  71803. },
  71804. computed: {
  71805. showSlot: function showSlot() {
  71806. return !!this.$slots.default;
  71807. },
  71808. classes: function classes() {
  71809. var _ref;
  71810. return ['' + prefixCls, prefixCls + '-' + String(this.type), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-long', this.long), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.shape), !!this.shape), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), this.size !== 'default'), (0, _defineProperty3.default)(_ref, prefixCls + '-loading', this.loading != null && this.loading), (0, _defineProperty3.default)(_ref, prefixCls + '-icon-only', !this.showSlot && (!!this.icon || !!this.customIcon || this.loading)), (0, _defineProperty3.default)(_ref, prefixCls + '-ghost', this.ghost), _ref)];
  71811. },
  71812. isHrefPattern: function isHrefPattern() {
  71813. var to = this.to;
  71814. return !!to;
  71815. },
  71816. tagName: function tagName() {
  71817. var isHrefPattern = this.isHrefPattern;
  71818. return isHrefPattern ? 'a' : 'button';
  71819. },
  71820. tagProps: function tagProps() {
  71821. var isHrefPattern = this.isHrefPattern;
  71822. if (isHrefPattern) {
  71823. var linkUrl = this.linkUrl,
  71824. target = this.target;
  71825. return { href: linkUrl, target: target };
  71826. } else {
  71827. var htmlType = this.htmlType;
  71828. return { type: htmlType };
  71829. }
  71830. }
  71831. },
  71832. methods: {
  71833. handleClickLink: function handleClickLink(event) {
  71834. this.$emit('click', event);
  71835. var openInNewWindow = event.ctrlKey || event.metaKey;
  71836. this.handleCheckClick(event, openInNewWindow);
  71837. }
  71838. }
  71839. };
  71840. /***/ }),
  71841. /* 132 */
  71842. /***/ (function(module, exports, __webpack_require__) {
  71843. "use strict";
  71844. Object.defineProperty(exports, "__esModule", {
  71845. value: true
  71846. });
  71847. var _defineProperty2 = __webpack_require__(2);
  71848. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71849. var _assist = __webpack_require__(3);
  71850. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71851. var prefixCls = 'ivu-btn-group';
  71852. exports.default = {
  71853. name: 'ButtonGroup',
  71854. props: {
  71855. size: {
  71856. validator: function validator(value) {
  71857. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  71858. },
  71859. default: function _default() {
  71860. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  71861. }
  71862. },
  71863. shape: {
  71864. validator: function validator(value) {
  71865. return (0, _assist.oneOf)(value, ['circle', 'circle-outline']);
  71866. }
  71867. },
  71868. vertical: {
  71869. type: Boolean,
  71870. default: false
  71871. }
  71872. },
  71873. computed: {
  71874. classes: function classes() {
  71875. var _ref;
  71876. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.shape), !!this.shape), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
  71877. }
  71878. }
  71879. };
  71880. /***/ }),
  71881. /* 133 */
  71882. /***/ (function(module, exports, __webpack_require__) {
  71883. "use strict";
  71884. Object.defineProperty(exports, "__esModule", {
  71885. value: true
  71886. });
  71887. var _defineProperty2 = __webpack_require__(2);
  71888. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  71889. var _icon = __webpack_require__(8);
  71890. var _icon2 = _interopRequireDefault(_icon);
  71891. var _link = __webpack_require__(48);
  71892. var _link2 = _interopRequireDefault(_link);
  71893. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71894. var prefixCls = 'ivu-card';
  71895. var defaultPadding = 16;
  71896. exports.default = {
  71897. name: 'Card',
  71898. mixins: [_link2.default],
  71899. components: { Icon: _icon2.default },
  71900. props: {
  71901. bordered: {
  71902. type: Boolean,
  71903. default: true
  71904. },
  71905. disHover: {
  71906. type: Boolean,
  71907. default: false
  71908. },
  71909. shadow: {
  71910. type: Boolean,
  71911. default: false
  71912. },
  71913. padding: {
  71914. type: Number,
  71915. default: defaultPadding
  71916. },
  71917. title: {
  71918. type: String
  71919. },
  71920. icon: {
  71921. type: String
  71922. }
  71923. },
  71924. data: function data() {
  71925. return {
  71926. showHead: true,
  71927. showExtra: true
  71928. };
  71929. },
  71930. computed: {
  71931. classes: function classes() {
  71932. var _ref;
  71933. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-bordered', this.bordered && !this.shadow), (0, _defineProperty3.default)(_ref, prefixCls + '-dis-hover', this.disHover || this.shadow), (0, _defineProperty3.default)(_ref, prefixCls + '-shadow', this.shadow), _ref)];
  71934. },
  71935. headClasses: function headClasses() {
  71936. return prefixCls + '-head';
  71937. },
  71938. extraClasses: function extraClasses() {
  71939. return prefixCls + '-extra';
  71940. },
  71941. bodyClasses: function bodyClasses() {
  71942. return prefixCls + '-body';
  71943. },
  71944. bodyStyles: function bodyStyles() {
  71945. if (this.padding !== defaultPadding) {
  71946. return {
  71947. padding: String(this.padding) + 'px'
  71948. };
  71949. } else {
  71950. return '';
  71951. }
  71952. },
  71953. isHrefPattern: function isHrefPattern() {
  71954. var to = this.to;
  71955. return !!to;
  71956. },
  71957. tagName: function tagName() {
  71958. var isHrefPattern = this.isHrefPattern;
  71959. return isHrefPattern ? 'a' : 'div';
  71960. },
  71961. tagProps: function tagProps() {
  71962. var isHrefPattern = this.isHrefPattern;
  71963. if (isHrefPattern) {
  71964. var linkUrl = this.linkUrl,
  71965. target = this.target;
  71966. return { href: linkUrl, target: target };
  71967. } else {
  71968. return {};
  71969. }
  71970. }
  71971. },
  71972. methods: {
  71973. handleClickLink: function handleClickLink(event) {
  71974. if (!this.isHrefPattern) return;
  71975. var openInNewWindow = event.ctrlKey || event.metaKey;
  71976. this.handleCheckClick(event, openInNewWindow);
  71977. }
  71978. },
  71979. mounted: function mounted() {
  71980. this.showHead = this.title || this.$slots.title !== undefined;
  71981. this.showExtra = this.$slots.extra !== undefined;
  71982. }
  71983. };
  71984. /***/ }),
  71985. /* 134 */
  71986. /***/ (function(module, exports, __webpack_require__) {
  71987. "use strict";
  71988. Object.defineProperty(exports, "__esModule", {
  71989. value: true
  71990. });
  71991. var _newArrowCheck2 = __webpack_require__(1);
  71992. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  71993. var _icon = __webpack_require__(8);
  71994. var _icon2 = _interopRequireDefault(_icon);
  71995. var _assist = __webpack_require__(3);
  71996. var _dom = __webpack_require__(12);
  71997. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  71998. var prefixCls = 'ivu-carousel';
  71999. exports.default = {
  72000. name: 'Carousel',
  72001. components: { Icon: _icon2.default },
  72002. props: {
  72003. arrow: {
  72004. type: String,
  72005. default: 'hover',
  72006. validator: function validator(value) {
  72007. return (0, _assist.oneOf)(value, ['hover', 'always', 'never']);
  72008. }
  72009. },
  72010. autoplay: {
  72011. type: Boolean,
  72012. default: false
  72013. },
  72014. autoplaySpeed: {
  72015. type: Number,
  72016. default: 2000
  72017. },
  72018. loop: {
  72019. type: Boolean,
  72020. default: false
  72021. },
  72022. easing: {
  72023. type: String,
  72024. default: 'ease'
  72025. },
  72026. dots: {
  72027. type: String,
  72028. default: 'inside',
  72029. validator: function validator(value) {
  72030. return (0, _assist.oneOf)(value, ['inside', 'outside', 'none']);
  72031. }
  72032. },
  72033. radiusDot: {
  72034. type: Boolean,
  72035. default: false
  72036. },
  72037. trigger: {
  72038. type: String,
  72039. default: 'click',
  72040. validator: function validator(value) {
  72041. return (0, _assist.oneOf)(value, ['click', 'hover']);
  72042. }
  72043. },
  72044. value: {
  72045. type: Number,
  72046. default: 0
  72047. },
  72048. height: {
  72049. type: [String, Number],
  72050. default: 'auto',
  72051. validator: function validator(value) {
  72052. return value === 'auto' || Object.prototype.toString.call(value) === '[object Number]';
  72053. }
  72054. }
  72055. },
  72056. data: function data() {
  72057. return {
  72058. prefixCls: prefixCls,
  72059. listWidth: 0,
  72060. trackWidth: 0,
  72061. trackOffset: 0,
  72062. trackCopyOffset: 0,
  72063. showCopyTrack: false,
  72064. slides: [],
  72065. slideInstances: [],
  72066. timer: null,
  72067. ready: false,
  72068. currentIndex: this.value,
  72069. trackIndex: this.value,
  72070. copyTrackIndex: this.value,
  72071. hideTrackPos: -1 };
  72072. },
  72073. computed: {
  72074. classes: function classes() {
  72075. return ['' + prefixCls];
  72076. },
  72077. trackStyles: function trackStyles() {
  72078. var visibleStyle = this.trackIndex === -1 ? 'hidden' : 'visible';
  72079. return {
  72080. width: String(this.trackWidth) + 'px',
  72081. transform: 'translate3d(' + -this.trackOffset + 'px, 0px, 0px)',
  72082. transition: 'transform 500ms ' + String(this.easing),
  72083. visibility: visibleStyle
  72084. };
  72085. },
  72086. copyTrackStyles: function copyTrackStyles() {
  72087. return {
  72088. width: String(this.trackWidth) + 'px',
  72089. transform: 'translate3d(' + -this.trackCopyOffset + 'px, 0px, 0px)',
  72090. transition: 'transform 500ms ' + String(this.easing),
  72091. position: 'absolute'
  72092. };
  72093. },
  72094. arrowClasses: function arrowClasses() {
  72095. return [prefixCls + '-arrow', prefixCls + '-arrow-' + String(this.arrow)];
  72096. },
  72097. dotsClasses: function dotsClasses() {
  72098. return [prefixCls + '-dots', prefixCls + '-dots-' + String(this.dots)];
  72099. }
  72100. },
  72101. methods: {
  72102. findChild: function findChild(cb) {
  72103. var _this2 = this;
  72104. var find = function find(child) {
  72105. var _this = this;
  72106. var name = child.$options.componentName;
  72107. if (name) {
  72108. cb(child);
  72109. } else if (child.$children.length) {
  72110. child.$children.forEach(function (innerChild) {
  72111. (0, _newArrowCheck3.default)(this, _this);
  72112. find(innerChild, cb);
  72113. }.bind(this));
  72114. }
  72115. };
  72116. if (this.slideInstances.length || !this.$children) {
  72117. this.slideInstances.forEach(function (child) {
  72118. (0, _newArrowCheck3.default)(this, _this2);
  72119. find(child);
  72120. }.bind(this));
  72121. } else {
  72122. this.$children.forEach(function (child) {
  72123. (0, _newArrowCheck3.default)(this, _this2);
  72124. find(child);
  72125. }.bind(this));
  72126. }
  72127. },
  72128. initCopyTrackDom: function initCopyTrackDom() {
  72129. var _this3 = this;
  72130. this.$nextTick(function () {
  72131. (0, _newArrowCheck3.default)(this, _this3);
  72132. this.$refs.copyTrack.innerHTML = this.$refs.originTrack.innerHTML;
  72133. }.bind(this));
  72134. },
  72135. updateSlides: function updateSlides(init) {
  72136. var _this4 = this;
  72137. var slides = [];
  72138. var index = 1;
  72139. this.findChild(function (child) {
  72140. (0, _newArrowCheck3.default)(this, _this4);
  72141. slides.push({
  72142. $el: child.$el
  72143. });
  72144. child.index = index++;
  72145. if (init) {
  72146. this.slideInstances.push(child);
  72147. }
  72148. }.bind(this));
  72149. this.slides = slides;
  72150. this.updatePos();
  72151. },
  72152. updatePos: function updatePos() {
  72153. var _this5 = this;
  72154. this.findChild(function (child) {
  72155. (0, _newArrowCheck3.default)(this, _this5);
  72156. child.width = this.listWidth;
  72157. child.height = typeof this.height === 'number' ? String(this.height) + 'px' : this.height;
  72158. }.bind(this));
  72159. this.trackWidth = (this.slides.length || 0) * this.listWidth;
  72160. },
  72161. slotChange: function slotChange() {
  72162. var _this6 = this;
  72163. this.$nextTick(function () {
  72164. (0, _newArrowCheck3.default)(this, _this6);
  72165. this.slides = [];
  72166. this.slideInstances = [];
  72167. this.updateSlides(true, true);
  72168. this.updatePos();
  72169. this.updateOffset();
  72170. }.bind(this));
  72171. },
  72172. handleResize: function handleResize() {
  72173. this.listWidth = parseInt((0, _assist.getStyle)(this.$el, 'width'));
  72174. this.updatePos();
  72175. this.updateOffset();
  72176. },
  72177. updateTrackPos: function updateTrackPos(index) {
  72178. if (this.showCopyTrack) {
  72179. this.trackIndex = index;
  72180. } else {
  72181. this.copyTrackIndex = index;
  72182. }
  72183. },
  72184. updateTrackIndex: function updateTrackIndex(index) {
  72185. if (this.showCopyTrack) {
  72186. this.copyTrackIndex = index;
  72187. } else {
  72188. this.trackIndex = index;
  72189. }
  72190. this.currentIndex = index;
  72191. },
  72192. add: function add(offset) {
  72193. var slidesLen = this.slides.length;
  72194. if (this.loop) {
  72195. if (offset > 0) {
  72196. this.hideTrackPos = -1;
  72197. } else {
  72198. this.hideTrackPos = slidesLen;
  72199. }
  72200. this.updateTrackPos(this.hideTrackPos);
  72201. }
  72202. var oldIndex = this.showCopyTrack ? this.copyTrackIndex : this.trackIndex;
  72203. var index = oldIndex + offset;
  72204. while (index < 0) {
  72205. index += slidesLen;
  72206. }if ((offset > 0 && index === slidesLen || offset < 0 && index === slidesLen - 1) && this.loop) {
  72207. this.showCopyTrack = !this.showCopyTrack;
  72208. this.trackIndex += offset;
  72209. this.copyTrackIndex += offset;
  72210. } else {
  72211. if (!this.loop) index = index % this.slides.length;
  72212. this.updateTrackIndex(index);
  72213. }
  72214. this.currentIndex = index === this.slides.length ? 0 : index;
  72215. this.$emit('on-change', oldIndex, this.currentIndex);
  72216. this.$emit('input', this.currentIndex);
  72217. },
  72218. arrowEvent: function arrowEvent(offset) {
  72219. this.setAutoplay();
  72220. this.add(offset);
  72221. },
  72222. dotsEvent: function dotsEvent(event, n) {
  72223. var curIndex = this.showCopyTrack ? this.copyTrackIndex : this.trackIndex;
  72224. var oldCurrentIndex = this.currentIndex;
  72225. if (event === this.trigger && curIndex !== n) {
  72226. this.updateTrackIndex(n);
  72227. this.$emit('on-change', oldCurrentIndex, this.currentIndex);
  72228. this.$emit('input', n);
  72229. this.setAutoplay();
  72230. }
  72231. },
  72232. setAutoplay: function setAutoplay() {
  72233. var _this7 = this;
  72234. window.clearInterval(this.timer);
  72235. if (this.autoplay) {
  72236. this.timer = window.setInterval(function () {
  72237. (0, _newArrowCheck3.default)(this, _this7);
  72238. this.add(1);
  72239. }.bind(this), this.autoplaySpeed);
  72240. }
  72241. },
  72242. updateOffset: function updateOffset() {
  72243. var _this8 = this;
  72244. this.$nextTick(function () {
  72245. (0, _newArrowCheck3.default)(this, _this8);
  72246. var ofs = this.copyTrackIndex > 0 ? -1 : 1;
  72247. this.trackOffset = this.trackIndex * this.listWidth;
  72248. this.trackCopyOffset = this.copyTrackIndex * this.listWidth + ofs;
  72249. }.bind(this));
  72250. },
  72251. handleClick: function handleClick(type) {
  72252. this.$emit('on-click', this[type]);
  72253. }
  72254. },
  72255. watch: {
  72256. autoplay: function autoplay() {
  72257. this.setAutoplay();
  72258. },
  72259. autoplaySpeed: function autoplaySpeed() {
  72260. this.setAutoplay();
  72261. },
  72262. trackIndex: function trackIndex() {
  72263. this.updateOffset();
  72264. },
  72265. copyTrackIndex: function copyTrackIndex() {
  72266. this.updateOffset();
  72267. },
  72268. height: function height() {
  72269. this.updatePos();
  72270. },
  72271. value: function value(val) {
  72272. this.updateTrackIndex(val);
  72273. this.setAutoplay();
  72274. }
  72275. },
  72276. mounted: function mounted() {
  72277. this.updateSlides(true);
  72278. this.handleResize();
  72279. this.setAutoplay();
  72280. (0, _dom.on)(window, 'resize', this.handleResize);
  72281. },
  72282. beforeDestroy: function beforeDestroy() {
  72283. (0, _dom.off)(window, 'resize', this.handleResize);
  72284. }
  72285. };
  72286. /***/ }),
  72287. /* 135 */
  72288. /***/ (function(module, exports, __webpack_require__) {
  72289. "use strict";
  72290. Object.defineProperty(exports, "__esModule", {
  72291. value: true
  72292. });
  72293. var _newArrowCheck2 = __webpack_require__(1);
  72294. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  72295. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72296. var prefixCls = 'ivu-carousel-item';
  72297. exports.default = {
  72298. componentName: 'carousel-item',
  72299. name: 'CarouselItem',
  72300. data: function data() {
  72301. return {
  72302. prefixCls: prefixCls,
  72303. width: 0,
  72304. height: 'auto',
  72305. left: 0
  72306. };
  72307. },
  72308. computed: {
  72309. styles: function styles() {
  72310. return {
  72311. width: String(this.width) + 'px',
  72312. height: '' + String(this.height),
  72313. left: String(this.left) + 'px'
  72314. };
  72315. }
  72316. },
  72317. mounted: function mounted() {
  72318. this.$parent.slotChange();
  72319. },
  72320. watch: {
  72321. width: function width(val) {
  72322. var _this = this;
  72323. if (val && this.$parent.loop) {
  72324. this.$nextTick(function () {
  72325. (0, _newArrowCheck3.default)(this, _this);
  72326. this.$parent.initCopyTrackDom();
  72327. }.bind(this));
  72328. }
  72329. },
  72330. height: function height(val) {
  72331. var _this2 = this;
  72332. if (val && this.$parent.loop) {
  72333. this.$nextTick(function () {
  72334. (0, _newArrowCheck3.default)(this, _this2);
  72335. this.$parent.initCopyTrackDom();
  72336. }.bind(this));
  72337. }
  72338. }
  72339. },
  72340. beforeDestroy: function beforeDestroy() {
  72341. this.$parent.slotChange();
  72342. }
  72343. };
  72344. /***/ }),
  72345. /* 136 */
  72346. /***/ (function(module, exports, __webpack_require__) {
  72347. "use strict";
  72348. Object.defineProperty(exports, "__esModule", {
  72349. value: true
  72350. });
  72351. var _assign = __webpack_require__(15);
  72352. var _assign2 = _interopRequireDefault(_assign);
  72353. var _stringify = __webpack_require__(57);
  72354. var _stringify2 = _interopRequireDefault(_stringify);
  72355. var _newArrowCheck2 = __webpack_require__(1);
  72356. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  72357. var _defineProperty2 = __webpack_require__(2);
  72358. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  72359. var _input = __webpack_require__(38);
  72360. var _input2 = _interopRequireDefault(_input);
  72361. var _dropdown = __webpack_require__(36);
  72362. var _dropdown2 = _interopRequireDefault(_dropdown);
  72363. var _icon = __webpack_require__(8);
  72364. var _icon2 = _interopRequireDefault(_icon);
  72365. var _caspanel = __webpack_require__(368);
  72366. var _caspanel2 = _interopRequireDefault(_caspanel);
  72367. var _clickoutside = __webpack_require__(82);
  72368. var _clickoutside2 = _interopRequireDefault(_clickoutside);
  72369. var _transferDom = __webpack_require__(23);
  72370. var _transferDom2 = _interopRequireDefault(_transferDom);
  72371. var _assist = __webpack_require__(3);
  72372. var _emitter = __webpack_require__(4);
  72373. var _emitter2 = _interopRequireDefault(_emitter);
  72374. var _locale = __webpack_require__(6);
  72375. var _locale2 = _interopRequireDefault(_locale);
  72376. var _form = __webpack_require__(11);
  72377. var _form2 = _interopRequireDefault(_form);
  72378. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72379. var prefixCls = 'ivu-cascader';
  72380. var selectPrefixCls = 'ivu-select';
  72381. exports.default = {
  72382. name: 'Cascader',
  72383. mixins: [_emitter2.default, _locale2.default, _form2.default],
  72384. components: { iInput: _input2.default, Drop: _dropdown2.default, Icon: _icon2.default, Caspanel: _caspanel2.default },
  72385. directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
  72386. props: {
  72387. data: {
  72388. type: Array,
  72389. default: function _default() {
  72390. return [];
  72391. }
  72392. },
  72393. value: {
  72394. type: Array,
  72395. default: function _default() {
  72396. return [];
  72397. }
  72398. },
  72399. disabled: {
  72400. type: Boolean,
  72401. default: false
  72402. },
  72403. clearable: {
  72404. type: Boolean,
  72405. default: true
  72406. },
  72407. placeholder: {
  72408. type: String
  72409. },
  72410. size: {
  72411. validator: function validator(value) {
  72412. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  72413. },
  72414. default: function _default() {
  72415. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  72416. }
  72417. },
  72418. trigger: {
  72419. validator: function validator(value) {
  72420. return (0, _assist.oneOf)(value, ['click', 'hover']);
  72421. },
  72422. default: 'click'
  72423. },
  72424. changeOnSelect: {
  72425. type: Boolean,
  72426. default: false
  72427. },
  72428. renderFormat: {
  72429. type: Function,
  72430. default: function _default(label) {
  72431. return label.join(' / ');
  72432. }
  72433. },
  72434. loadData: {
  72435. type: Function
  72436. },
  72437. filterable: {
  72438. type: Boolean,
  72439. default: false
  72440. },
  72441. notFoundText: {
  72442. type: String
  72443. },
  72444. transfer: {
  72445. type: Boolean,
  72446. default: function _default() {
  72447. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  72448. }
  72449. },
  72450. name: {
  72451. type: String
  72452. },
  72453. elementId: {
  72454. type: String
  72455. },
  72456. capture: {
  72457. type: Boolean,
  72458. default: function _default() {
  72459. return !this.$IVIEW ? true : this.$IVIEW.capture;
  72460. }
  72461. },
  72462. transferClassName: {
  72463. type: String
  72464. },
  72465. eventsEnabled: {
  72466. type: Boolean,
  72467. default: false
  72468. }
  72469. },
  72470. data: function data() {
  72471. return {
  72472. prefixCls: prefixCls,
  72473. selectPrefixCls: selectPrefixCls,
  72474. visible: false,
  72475. selected: [],
  72476. tmpSelected: [],
  72477. updatingValue: false,
  72478. currentValue: this.value || [],
  72479. query: '',
  72480. validDataStr: '',
  72481. isLoadedChildren: false,
  72482. isValueNull: false };
  72483. },
  72484. computed: {
  72485. classes: function classes() {
  72486. var _ref;
  72487. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-show-clear', this.showCloseIcon), (0, _defineProperty3.default)(_ref, prefixCls + '-size-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-visible', this.visible), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-not-found', this.filterable && this.query !== '' && !this.querySelections.length), _ref)];
  72488. },
  72489. showCloseIcon: function showCloseIcon() {
  72490. return this.currentValue && this.currentValue.length && this.clearable && !this.itemDisabled;
  72491. },
  72492. displayRender: function displayRender() {
  72493. var label = [];
  72494. for (var i = 0; i < this.selected.length; i++) {
  72495. label.push(this.selected[i].label);
  72496. }
  72497. return this.renderFormat(label, this.selected);
  72498. },
  72499. displayInputRender: function displayInputRender() {
  72500. return this.filterable ? '' : this.displayRender;
  72501. },
  72502. localePlaceholder: function localePlaceholder() {
  72503. if (this.placeholder === undefined) {
  72504. return this.t('i.select.placeholder');
  72505. } else {
  72506. return this.placeholder;
  72507. }
  72508. },
  72509. inputPlaceholder: function inputPlaceholder() {
  72510. return this.filterable && this.currentValue.length ? null : this.localePlaceholder;
  72511. },
  72512. localeNotFoundText: function localeNotFoundText() {
  72513. if (this.notFoundText === undefined) {
  72514. return this.t('i.select.noMatch');
  72515. } else {
  72516. return this.notFoundText;
  72517. }
  72518. },
  72519. querySelections: function querySelections() {
  72520. var _this = this;
  72521. var selections = [];
  72522. function getSelections(arr, label, value) {
  72523. for (var i = 0; i < arr.length; i++) {
  72524. var item = arr[i];
  72525. item.__label = label ? label + ' / ' + item.label : item.label;
  72526. item.__value = value ? value + ',' + item.value : item.value;
  72527. if (item.children && item.children.length) {
  72528. getSelections(item.children, item.__label, item.__value);
  72529. delete item.__label;
  72530. delete item.__value;
  72531. } else {
  72532. selections.push({
  72533. label: item.__label,
  72534. value: item.__value,
  72535. display: item.__label,
  72536. item: item,
  72537. disabled: !!item.disabled
  72538. });
  72539. }
  72540. }
  72541. }
  72542. getSelections(this.data);
  72543. selections = selections.filter(function (item) {
  72544. (0, _newArrowCheck3.default)(this, _this);
  72545. return item.label ? item.label.indexOf(this.query) > -1 : false;
  72546. }.bind(this)).map(function (item) {
  72547. (0, _newArrowCheck3.default)(this, _this);
  72548. item.display = item.display.replace(new RegExp(this.query, 'g'), '<span>' + String(this.query) + '</span>');
  72549. return item;
  72550. }.bind(this));
  72551. return selections;
  72552. },
  72553. arrowType: function arrowType() {
  72554. var type = 'ios-arrow-down';
  72555. if (this.$IVIEW) {
  72556. if (this.$IVIEW.cascader.customArrow) {
  72557. type = '';
  72558. } else if (this.$IVIEW.cascader.arrow) {
  72559. type = this.$IVIEW.cascader.arrow;
  72560. }
  72561. }
  72562. return type;
  72563. },
  72564. customArrowType: function customArrowType() {
  72565. var type = '';
  72566. if (this.$IVIEW) {
  72567. if (this.$IVIEW.cascader.customArrow) {
  72568. type = this.$IVIEW.cascader.customArrow;
  72569. }
  72570. }
  72571. return type;
  72572. },
  72573. arrowSize: function arrowSize() {
  72574. var size = '';
  72575. if (this.$IVIEW) {
  72576. if (this.$IVIEW.cascader.arrowSize) {
  72577. size = this.$IVIEW.cascader.arrowSize;
  72578. }
  72579. }
  72580. return size;
  72581. },
  72582. dropdownCls: function dropdownCls() {
  72583. var _ref2;
  72584. return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
  72585. }
  72586. },
  72587. methods: {
  72588. clearSelect: function clearSelect() {
  72589. if (this.itemDisabled) return false;
  72590. var oldVal = (0, _stringify2.default)(this.currentValue);
  72591. this.currentValue = this.selected = this.tmpSelected = [];
  72592. this.handleClose();
  72593. this.emitValue(this.currentValue, oldVal);
  72594. this.broadcast('Caspanel', 'on-clear');
  72595. },
  72596. handleClose: function handleClose() {
  72597. this.visible = false;
  72598. },
  72599. toggleOpen: function toggleOpen() {
  72600. if (this.itemDisabled) return false;
  72601. if (this.visible) {
  72602. if (!this.filterable) this.handleClose();
  72603. } else {
  72604. this.onFocus();
  72605. }
  72606. },
  72607. onFocus: function onFocus() {
  72608. this.visible = true;
  72609. if (!this.currentValue.length) {
  72610. this.broadcast('Caspanel', 'on-clear');
  72611. }
  72612. },
  72613. updateResult: function updateResult(result) {
  72614. this.tmpSelected = result;
  72615. },
  72616. updateSelected: function updateSelected() {
  72617. var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  72618. var changeOnSelectDataChange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  72619. if (!this.changeOnSelect || init || changeOnSelectDataChange) {
  72620. this.broadcast('Caspanel', 'on-find-selected', {
  72621. value: this.currentValue
  72622. });
  72623. }
  72624. },
  72625. emitValue: function emitValue(val, oldVal) {
  72626. var _this2 = this;
  72627. if ((0, _stringify2.default)(val) !== oldVal) {
  72628. this.$emit('on-change', this.currentValue, JSON.parse((0, _stringify2.default)(this.selected)));
  72629. this.$nextTick(function () {
  72630. (0, _newArrowCheck3.default)(this, _this2);
  72631. this.dispatch('FormItem', 'on-form-change', {
  72632. value: this.currentValue,
  72633. selected: JSON.parse((0, _stringify2.default)(this.selected))
  72634. });
  72635. }.bind(this));
  72636. }
  72637. },
  72638. handleInput: function handleInput(event) {
  72639. this.query = event.target.value;
  72640. },
  72641. handleSelectItem: function handleSelectItem(index) {
  72642. var _this3 = this;
  72643. var item = this.querySelections[index];
  72644. if (item.item.disabled) return false;
  72645. this.query = '';
  72646. this.$refs.input.currentValue = '';
  72647. var oldVal = (0, _stringify2.default)(this.currentValue);
  72648. this.currentValue = item.value.split(',');
  72649. setTimeout(function () {
  72650. (0, _newArrowCheck3.default)(this, _this3);
  72651. this.emitValue(this.currentValue, oldVal);
  72652. this.handleClose();
  72653. }.bind(this), 0);
  72654. },
  72655. handleFocus: function handleFocus() {
  72656. this.$refs.input.focus();
  72657. },
  72658. getValidData: function getValidData(data) {
  72659. var _this5 = this;
  72660. function deleteData(item) {
  72661. var _this4 = this;
  72662. var new_item = (0, _assign2.default)({}, item);
  72663. if ('loading' in new_item) {
  72664. delete new_item.loading;
  72665. }
  72666. if ('__value' in new_item) {
  72667. delete new_item.__value;
  72668. }
  72669. if ('__label' in new_item) {
  72670. delete new_item.__label;
  72671. }
  72672. if ('children' in new_item && new_item.children.length) {
  72673. new_item.children = new_item.children.map(function (i) {
  72674. (0, _newArrowCheck3.default)(this, _this4);
  72675. return deleteData(i);
  72676. }.bind(this));
  72677. }
  72678. return new_item;
  72679. }
  72680. return data.map(function (item) {
  72681. (0, _newArrowCheck3.default)(this, _this5);
  72682. return deleteData(item);
  72683. }.bind(this));
  72684. }
  72685. },
  72686. created: function created() {
  72687. var _this6 = this;
  72688. this.validDataStr = (0, _stringify2.default)(this.getValidData(this.data));
  72689. this.$on('on-result-change', function (params) {
  72690. (0, _newArrowCheck3.default)(this, _this6);
  72691. var lastValue = params.lastValue;
  72692. var changeOnSelect = params.changeOnSelect;
  72693. var fromInit = params.fromInit;
  72694. if (lastValue || changeOnSelect) {
  72695. var oldVal = (0, _stringify2.default)(this.currentValue);
  72696. this.selected = this.tmpSelected;
  72697. var newVal = [];
  72698. this.selected.forEach(function (item) {
  72699. (0, _newArrowCheck3.default)(this, _this6);
  72700. newVal.push(item.value);
  72701. }.bind(this));
  72702. if (!fromInit) {
  72703. this.updatingValue = true;
  72704. this.currentValue = newVal;
  72705. this.emitValue(this.currentValue, oldVal);
  72706. }
  72707. }
  72708. if (lastValue && !fromInit) {
  72709. this.handleClose();
  72710. }
  72711. }.bind(this));
  72712. },
  72713. mounted: function mounted() {
  72714. this.updateSelected(true);
  72715. },
  72716. watch: {
  72717. visible: function visible(val) {
  72718. if (val) {
  72719. if (this.currentValue.length) {
  72720. this.updateSelected();
  72721. }
  72722. if (this.transfer) {
  72723. this.$refs.drop.update();
  72724. }
  72725. this.broadcast('Drop', 'on-update-popper');
  72726. } else {
  72727. if (this.filterable) {
  72728. this.query = '';
  72729. this.$refs.input.currentValue = '';
  72730. }
  72731. if (this.transfer) {
  72732. this.$refs.drop.destroy();
  72733. }
  72734. this.broadcast('Drop', 'on-destroy-popper');
  72735. }
  72736. this.$emit('on-visible-change', val);
  72737. },
  72738. value: function value(val) {
  72739. if (val === null) this.isValueNull = true;
  72740. this.currentValue = val || [];
  72741. if (val === null || !val.length) this.selected = [];
  72742. },
  72743. currentValue: function currentValue() {
  72744. if (this.isValueNull) {
  72745. this.isValueNull = false;
  72746. this.$emit('input', null);
  72747. } else {
  72748. this.$emit('input', this.currentValue);
  72749. }
  72750. if (this.updatingValue) {
  72751. this.updatingValue = false;
  72752. return;
  72753. }
  72754. this.updateSelected(true);
  72755. },
  72756. data: {
  72757. deep: true,
  72758. handler: function handler() {
  72759. var _this7 = this;
  72760. var validDataStr = (0, _stringify2.default)(this.getValidData(this.data));
  72761. if (validDataStr !== this.validDataStr) {
  72762. this.validDataStr = validDataStr;
  72763. if (!this.isLoadedChildren) {
  72764. this.$nextTick(function () {
  72765. (0, _newArrowCheck3.default)(this, _this7);
  72766. return this.updateSelected(false, this.changeOnSelect);
  72767. }.bind(this));
  72768. }
  72769. this.isLoadedChildren = false;
  72770. }
  72771. }
  72772. }
  72773. }
  72774. };
  72775. /***/ }),
  72776. /* 137 */
  72777. /***/ (function(module, exports, __webpack_require__) {
  72778. "use strict";
  72779. Object.defineProperty(exports, "__esModule", {
  72780. value: true
  72781. });
  72782. var _toConsumableArray2 = __webpack_require__(17);
  72783. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  72784. var _assign = __webpack_require__(15);
  72785. var _assign2 = _interopRequireDefault(_assign);
  72786. var _newArrowCheck2 = __webpack_require__(1);
  72787. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  72788. var _casitem = __webpack_require__(369);
  72789. var _casitem2 = _interopRequireDefault(_casitem);
  72790. var _emitter = __webpack_require__(4);
  72791. var _emitter2 = _interopRequireDefault(_emitter);
  72792. var _assist = __webpack_require__(3);
  72793. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72794. var key = 1;
  72795. exports.default = {
  72796. name: 'Caspanel',
  72797. mixins: [_emitter2.default],
  72798. components: { Casitem: _casitem2.default },
  72799. props: {
  72800. data: {
  72801. type: Array,
  72802. default: function _default() {
  72803. return [];
  72804. }
  72805. },
  72806. disabled: Boolean,
  72807. changeOnSelect: Boolean,
  72808. trigger: String,
  72809. prefixCls: String
  72810. },
  72811. data: function data() {
  72812. return {
  72813. tmpItem: {},
  72814. result: [],
  72815. sublist: []
  72816. };
  72817. },
  72818. watch: {
  72819. data: function data() {
  72820. this.sublist = [];
  72821. }
  72822. },
  72823. methods: {
  72824. handleClickItem: function handleClickItem(item) {
  72825. if (this.trigger !== 'click' && item.children && item.children.length) return;
  72826. this.handleTriggerItem(item, false, true);
  72827. },
  72828. handleHoverItem: function handleHoverItem(item) {
  72829. if (this.trigger !== 'hover' || !item.children || !item.children.length) return;
  72830. this.handleTriggerItem(item, false, true);
  72831. },
  72832. handleTriggerItem: function handleTriggerItem(item) {
  72833. var _this = this;
  72834. var fromInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  72835. var fromUser = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  72836. if (item.disabled) return;
  72837. var cascader = (0, _assist.findComponentUpward)(this, 'Cascader');
  72838. if (item.loading !== undefined && !item.children.length) {
  72839. if (cascader && cascader.loadData) {
  72840. cascader.loadData(item, function () {
  72841. (0, _newArrowCheck3.default)(this, _this);
  72842. if (fromUser) {
  72843. cascader.isLoadedChildren = true;
  72844. }
  72845. if (item.children.length) {
  72846. this.handleTriggerItem(item);
  72847. }
  72848. }.bind(this));
  72849. return;
  72850. }
  72851. }
  72852. var backItem = this.getBaseItem(item);
  72853. if (this.changeOnSelect || backItem.label !== this.tmpItem.label || backItem.value !== this.tmpItem.value || backItem.label === this.tmpItem.label && backItem.value === this.tmpItem.value) {
  72854. this.tmpItem = backItem;
  72855. this.emitUpdate([backItem]);
  72856. }
  72857. if (item.children && item.children.length) {
  72858. this.sublist = item.children;
  72859. this.dispatch('Cascader', 'on-result-change', {
  72860. lastValue: false,
  72861. changeOnSelect: this.changeOnSelect,
  72862. fromInit: fromInit
  72863. });
  72864. if (this.changeOnSelect) {
  72865. var Caspanel = (0, _assist.findComponentDownward)(this, 'Caspanel');
  72866. if (Caspanel) {
  72867. Caspanel.$emit('on-clear', true);
  72868. }
  72869. }
  72870. } else {
  72871. this.sublist = [];
  72872. this.dispatch('Cascader', 'on-result-change', {
  72873. lastValue: true,
  72874. changeOnSelect: this.changeOnSelect,
  72875. fromInit: fromInit
  72876. });
  72877. }
  72878. if (cascader) {
  72879. cascader.$refs.drop.update();
  72880. }
  72881. },
  72882. updateResult: function updateResult(item) {
  72883. this.result = [this.tmpItem].concat(item);
  72884. this.emitUpdate(this.result);
  72885. },
  72886. getBaseItem: function getBaseItem(item) {
  72887. var backItem = (0, _assign2.default)({}, item);
  72888. if (backItem.children) {
  72889. delete backItem.children;
  72890. }
  72891. return backItem;
  72892. },
  72893. emitUpdate: function emitUpdate(result) {
  72894. if (this.$parent.$options.name === 'Caspanel') {
  72895. this.$parent.updateResult(result);
  72896. } else {
  72897. this.$parent.$parent.updateResult(result);
  72898. }
  72899. },
  72900. getKey: function getKey() {
  72901. return key++;
  72902. }
  72903. },
  72904. mounted: function mounted() {
  72905. var _this2 = this;
  72906. this.$on('on-find-selected', function (params) {
  72907. (0, _newArrowCheck3.default)(this, _this2);
  72908. var val = params.value;
  72909. var value = [].concat((0, _toConsumableArray3.default)(val));
  72910. for (var i = 0; i < value.length; i++) {
  72911. for (var j = 0; j < this.data.length; j++) {
  72912. if (value[i] === this.data[j].value) {
  72913. this.handleTriggerItem(this.data[j], true);
  72914. value.splice(0, 1);
  72915. this.$nextTick(function () {
  72916. (0, _newArrowCheck3.default)(this, _this2);
  72917. this.broadcast('Caspanel', 'on-find-selected', {
  72918. value: value
  72919. });
  72920. }.bind(this));
  72921. return false;
  72922. }
  72923. }
  72924. }
  72925. }.bind(this));
  72926. this.$on('on-clear', function () {
  72927. var deep = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  72928. (0, _newArrowCheck3.default)(this, _this2);
  72929. this.sublist = [];
  72930. this.tmpItem = {};
  72931. if (deep) {
  72932. var Caspanel = (0, _assist.findComponentDownward)(this, 'Caspanel');
  72933. if (Caspanel) {
  72934. Caspanel.$emit('on-clear', true);
  72935. }
  72936. }
  72937. }.bind(this));
  72938. }
  72939. };
  72940. /***/ }),
  72941. /* 138 */
  72942. /***/ (function(module, exports, __webpack_require__) {
  72943. "use strict";
  72944. Object.defineProperty(exports, "__esModule", {
  72945. value: true
  72946. });
  72947. var _defineProperty2 = __webpack_require__(2);
  72948. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  72949. var _icon = __webpack_require__(8);
  72950. var _icon2 = _interopRequireDefault(_icon);
  72951. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  72952. exports.default = {
  72953. name: 'Casitem',
  72954. components: { Icon: _icon2.default },
  72955. props: {
  72956. data: Object,
  72957. prefixCls: String,
  72958. tmpItem: Object
  72959. },
  72960. computed: {
  72961. classes: function classes() {
  72962. var _ref;
  72963. return [String(this.prefixCls) + '-menu-item', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-menu-item-active', this.tmpItem.value === this.data.value), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-menu-item-disabled', this.data.disabled), _ref)];
  72964. },
  72965. showArrow: function showArrow() {
  72966. return this.data.children && this.data.children.length || 'loading' in this.data && !this.data.loading;
  72967. },
  72968. showLoading: function showLoading() {
  72969. return 'loading' in this.data && this.data.loading;
  72970. },
  72971. arrowType: function arrowType() {
  72972. var type = 'ios-arrow-forward';
  72973. if (this.$IVIEW) {
  72974. if (this.$IVIEW.cascader.customItemArrow) {
  72975. type = '';
  72976. } else if (this.$IVIEW.cascader.itemArrow) {
  72977. type = this.$IVIEW.cascader.itemArrow;
  72978. }
  72979. }
  72980. return type;
  72981. },
  72982. customArrowType: function customArrowType() {
  72983. var type = '';
  72984. if (this.$IVIEW) {
  72985. if (this.$IVIEW.cascader.customItemArrow) {
  72986. type = this.$IVIEW.cascader.customItemArrow;
  72987. }
  72988. }
  72989. return type;
  72990. },
  72991. arrowSize: function arrowSize() {
  72992. var size = '';
  72993. if (this.$IVIEW) {
  72994. if (this.$IVIEW.cascader.itemArrowSize) {
  72995. size = this.$IVIEW.cascader.itemArrowSize;
  72996. }
  72997. }
  72998. return size;
  72999. }
  73000. }
  73001. };
  73002. /***/ }),
  73003. /* 139 */
  73004. /***/ (function(module, exports, __webpack_require__) {
  73005. "use strict";
  73006. Object.defineProperty(exports, "__esModule", {
  73007. value: true
  73008. });
  73009. var _defineProperty2 = __webpack_require__(2);
  73010. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73011. var _cellItem = __webpack_require__(375);
  73012. var _cellItem2 = _interopRequireDefault(_cellItem);
  73013. var _icon = __webpack_require__(8);
  73014. var _icon2 = _interopRequireDefault(_icon);
  73015. var _link = __webpack_require__(48);
  73016. var _link2 = _interopRequireDefault(_link);
  73017. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73018. var prefixCls = 'ivu-cell';
  73019. exports.default = {
  73020. name: 'Cell',
  73021. inject: ['cellGroup'],
  73022. mixins: [_link2.default],
  73023. components: { CellItem: _cellItem2.default, Icon: _icon2.default },
  73024. props: {
  73025. name: {
  73026. type: [String, Number]
  73027. },
  73028. title: {
  73029. type: String,
  73030. default: ''
  73031. },
  73032. label: {
  73033. type: String,
  73034. default: ''
  73035. },
  73036. extra: {
  73037. type: String,
  73038. default: ''
  73039. },
  73040. disabled: {
  73041. type: Boolean,
  73042. default: false
  73043. },
  73044. selected: {
  73045. type: Boolean,
  73046. default: false
  73047. }
  73048. },
  73049. data: function data() {
  73050. return {
  73051. prefixCls: prefixCls
  73052. };
  73053. },
  73054. computed: {
  73055. classes: function classes() {
  73056. var _ref;
  73057. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected), (0, _defineProperty3.default)(_ref, prefixCls + '-with-link', this.to), _ref)];
  73058. },
  73059. arrowType: function arrowType() {
  73060. var type = 'ios-arrow-forward';
  73061. if (this.$IVIEW) {
  73062. if (this.$IVIEW.cell.customArrow) {
  73063. type = '';
  73064. } else if (this.$IVIEW.cell.arrow) {
  73065. type = this.$IVIEW.cell.arrow;
  73066. }
  73067. }
  73068. return type;
  73069. },
  73070. customArrowType: function customArrowType() {
  73071. var type = '';
  73072. if (this.$IVIEW) {
  73073. if (this.$IVIEW.cell.customArrow) {
  73074. type = this.$IVIEW.cell.customArrow;
  73075. }
  73076. }
  73077. return type;
  73078. },
  73079. arrowSize: function arrowSize() {
  73080. var size = '';
  73081. if (this.$IVIEW) {
  73082. if (this.$IVIEW.cell.arrowSize) {
  73083. size = this.$IVIEW.cell.arrowSize;
  73084. }
  73085. }
  73086. return size;
  73087. }
  73088. },
  73089. methods: {
  73090. handleClickItem: function handleClickItem(event, new_window) {
  73091. this.cellGroup.handleClick(this.name);
  73092. this.handleCheckClick(event, new_window);
  73093. }
  73094. }
  73095. };
  73096. /***/ }),
  73097. /* 140 */
  73098. /***/ (function(module, exports, __webpack_require__) {
  73099. "use strict";
  73100. Object.defineProperty(exports, "__esModule", {
  73101. value: true
  73102. });
  73103. exports.default = {
  73104. props: {
  73105. title: {
  73106. type: String,
  73107. default: ''
  73108. },
  73109. label: {
  73110. type: String,
  73111. default: ''
  73112. },
  73113. extra: {
  73114. type: String,
  73115. default: ''
  73116. }
  73117. }
  73118. };
  73119. /***/ }),
  73120. /* 141 */
  73121. /***/ (function(module, exports, __webpack_require__) {
  73122. "use strict";
  73123. Object.defineProperty(exports, "__esModule", {
  73124. value: true
  73125. });
  73126. exports.default = {
  73127. name: 'CellGroup',
  73128. provide: function provide() {
  73129. return {
  73130. cellGroup: this
  73131. };
  73132. },
  73133. methods: {
  73134. handleClick: function handleClick(name) {
  73135. this.$emit('on-click', name);
  73136. }
  73137. }
  73138. };
  73139. /***/ }),
  73140. /* 142 */
  73141. /***/ (function(module, exports, __webpack_require__) {
  73142. "use strict";
  73143. Object.defineProperty(exports, "__esModule", {
  73144. value: true
  73145. });
  73146. var _defineProperty2 = __webpack_require__(2);
  73147. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73148. var _assist = __webpack_require__(3);
  73149. var _emitter = __webpack_require__(4);
  73150. var _emitter2 = _interopRequireDefault(_emitter);
  73151. var _form = __webpack_require__(11);
  73152. var _form2 = _interopRequireDefault(_form);
  73153. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73154. var prefixCls = 'ivu-checkbox';
  73155. exports.default = {
  73156. name: 'Checkbox',
  73157. mixins: [_emitter2.default, _form2.default],
  73158. props: {
  73159. disabled: {
  73160. type: Boolean,
  73161. default: false
  73162. },
  73163. value: {
  73164. type: [String, Number, Boolean],
  73165. default: false
  73166. },
  73167. trueValue: {
  73168. type: [String, Number, Boolean],
  73169. default: true
  73170. },
  73171. falseValue: {
  73172. type: [String, Number, Boolean],
  73173. default: false
  73174. },
  73175. label: {
  73176. type: [String, Number, Boolean]
  73177. },
  73178. indeterminate: {
  73179. type: Boolean,
  73180. default: false
  73181. },
  73182. size: {
  73183. validator: function validator(value) {
  73184. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  73185. },
  73186. default: function _default() {
  73187. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  73188. }
  73189. },
  73190. name: {
  73191. type: String
  73192. },
  73193. border: {
  73194. type: Boolean,
  73195. default: false
  73196. }
  73197. },
  73198. data: function data() {
  73199. return {
  73200. model: [],
  73201. currentValue: this.value,
  73202. group: false,
  73203. showSlot: true,
  73204. parent: (0, _assist.findComponentUpward)(this, 'CheckboxGroup'),
  73205. focusInner: false
  73206. };
  73207. },
  73208. computed: {
  73209. wrapClasses: function wrapClasses() {
  73210. var _ref;
  73211. return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-group-item', this.group), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-checked', this.currentValue), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-border', this.border), _ref)];
  73212. },
  73213. checkboxClasses: function checkboxClasses() {
  73214. var _ref2;
  73215. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-checked', this.currentValue), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-indeterminate', this.indeterminate), _ref2)];
  73216. },
  73217. innerClasses: function innerClasses() {
  73218. return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-focus', this.focusInner)];
  73219. },
  73220. inputClasses: function inputClasses() {
  73221. return prefixCls + '-input';
  73222. }
  73223. },
  73224. mounted: function mounted() {
  73225. this.parent = (0, _assist.findComponentUpward)(this, 'CheckboxGroup');
  73226. if (this.parent) {
  73227. this.group = true;
  73228. }
  73229. if (this.group) {
  73230. this.parent.updateModel(true);
  73231. } else {
  73232. this.updateModel();
  73233. this.showSlot = this.$slots.default !== undefined;
  73234. }
  73235. },
  73236. methods: {
  73237. change: function change(event) {
  73238. if (this.itemDisabled) {
  73239. return false;
  73240. }
  73241. var checked = event.target.checked;
  73242. this.currentValue = checked;
  73243. var value = checked ? this.trueValue : this.falseValue;
  73244. this.$emit('input', value);
  73245. if (this.group) {
  73246. this.parent.change(this.model);
  73247. } else {
  73248. this.$emit('on-change', value);
  73249. this.dispatch('FormItem', 'on-form-change', value);
  73250. }
  73251. },
  73252. updateModel: function updateModel() {
  73253. this.currentValue = this.value === this.trueValue;
  73254. },
  73255. onBlur: function onBlur() {
  73256. this.focusInner = false;
  73257. },
  73258. onFocus: function onFocus() {
  73259. this.focusInner = true;
  73260. }
  73261. },
  73262. watch: {
  73263. value: function value(val) {
  73264. if (val === this.trueValue || val === this.falseValue) {
  73265. this.updateModel();
  73266. } else {
  73267. throw 'Value should be trueValue or falseValue.';
  73268. }
  73269. }
  73270. }
  73271. };
  73272. /***/ }),
  73273. /* 143 */
  73274. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  73275. "use strict";
  73276. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  73277. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__ = __webpack_require__(144);
  73278. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__);
  73279. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  73280. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__ = __webpack_require__(382);
  73281. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__);
  73282. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  73283. /* script */
  73284. /* template */
  73285. /* template functional */
  73286. var __vue_template_functional__ = false
  73287. /* styles */
  73288. var __vue_styles__ = null
  73289. /* scopeId */
  73290. var __vue_scopeId__ = null
  73291. /* moduleIdentifier (server only) */
  73292. var __vue_module_identifier__ = null
  73293. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  73294. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_checkbox_group_vue___default.a,
  73295. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__["render"],
  73296. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a659251_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_checkbox_group_vue__["staticRenderFns"],
  73297. __vue_template_functional__,
  73298. __vue_styles__,
  73299. __vue_scopeId__,
  73300. __vue_module_identifier__
  73301. )
  73302. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  73303. /***/ }),
  73304. /* 144 */
  73305. /***/ (function(module, exports, __webpack_require__) {
  73306. "use strict";
  73307. Object.defineProperty(exports, "__esModule", {
  73308. value: true
  73309. });
  73310. var _newArrowCheck2 = __webpack_require__(1);
  73311. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  73312. var _defineProperty2 = __webpack_require__(2);
  73313. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73314. var _assist = __webpack_require__(3);
  73315. var _emitter = __webpack_require__(4);
  73316. var _emitter2 = _interopRequireDefault(_emitter);
  73317. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73318. var prefixCls = 'ivu-checkbox-group';
  73319. exports.default = {
  73320. name: 'CheckboxGroup',
  73321. mixins: [_emitter2.default],
  73322. props: {
  73323. value: {
  73324. type: Array,
  73325. default: function _default() {
  73326. return [];
  73327. }
  73328. },
  73329. size: {
  73330. validator: function validator(value) {
  73331. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  73332. },
  73333. default: function _default() {
  73334. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  73335. }
  73336. }
  73337. },
  73338. data: function data() {
  73339. return {
  73340. currentValue: this.value || [],
  73341. children: []
  73342. };
  73343. },
  73344. computed: {
  73345. classes: function classes() {
  73346. return ['' + prefixCls, (0, _defineProperty3.default)({}, 'ivu-checkbox-' + String(this.size), !!this.size)];
  73347. }
  73348. },
  73349. mounted: function mounted() {
  73350. this.updateModel(true);
  73351. },
  73352. methods: {
  73353. updateModel: function updateModel(update) {
  73354. var _this = this;
  73355. this.children = (0, _assist.findComponentsDownward)(this, 'Checkbox');
  73356. if (this.children) {
  73357. var value = this.value || [];
  73358. this.children.forEach(function (child) {
  73359. (0, _newArrowCheck3.default)(this, _this);
  73360. child.model = value;
  73361. if (update) {
  73362. child.currentValue = value.indexOf(child.label) >= 0;
  73363. child.group = true;
  73364. }
  73365. }.bind(this));
  73366. }
  73367. },
  73368. change: function change(data) {
  73369. this.currentValue = data;
  73370. this.$emit('input', data);
  73371. this.$emit('on-change', data);
  73372. this.dispatch('FormItem', 'on-form-change', data);
  73373. }
  73374. },
  73375. watch: {
  73376. value: function value() {
  73377. this.updateModel(true);
  73378. }
  73379. }
  73380. };
  73381. /***/ }),
  73382. /* 145 */
  73383. /***/ (function(module, exports, __webpack_require__) {
  73384. "use strict";
  73385. Object.defineProperty(exports, "__esModule", {
  73386. value: true
  73387. });
  73388. var _assist = __webpack_require__(3);
  73389. var _random_str = __webpack_require__(385);
  73390. var _random_str2 = _interopRequireDefault(_random_str);
  73391. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73392. var prefixCls = 'ivu-chart-circle';
  73393. exports.default = {
  73394. name: 'iCircle',
  73395. props: {
  73396. percent: {
  73397. type: Number,
  73398. default: 0
  73399. },
  73400. size: {
  73401. type: Number,
  73402. default: 120
  73403. },
  73404. strokeWidth: {
  73405. type: Number,
  73406. default: 6
  73407. },
  73408. strokeColor: {
  73409. type: [String, Array],
  73410. default: '#2d8cf0'
  73411. },
  73412. strokeLinecap: {
  73413. validator: function validator(value) {
  73414. return (0, _assist.oneOf)(value, ['square', 'round']);
  73415. },
  73416. default: 'round'
  73417. },
  73418. trailWidth: {
  73419. type: Number,
  73420. default: 5
  73421. },
  73422. trailColor: {
  73423. type: String,
  73424. default: '#eaeef2'
  73425. },
  73426. dashboard: {
  73427. type: Boolean,
  73428. default: false
  73429. }
  73430. },
  73431. data: function data() {
  73432. return {
  73433. id: 'ivu-chart-circle-' + String((0, _random_str2.default)(3))
  73434. };
  73435. },
  73436. computed: {
  73437. circleSize: function circleSize() {
  73438. return {
  73439. width: String(this.size) + 'px',
  73440. height: String(this.size) + 'px'
  73441. };
  73442. },
  73443. computedStrokeWidth: function computedStrokeWidth() {
  73444. return this.percent === 0 && this.dashboard ? 0 : this.strokeWidth;
  73445. },
  73446. radius: function radius() {
  73447. return 50 - this.strokeWidth / 2;
  73448. },
  73449. pathString: function pathString() {
  73450. if (this.dashboard) {
  73451. return 'M 50,50 m 0,' + String(this.radius) + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,-' + 2 * this.radius + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,' + 2 * this.radius;
  73452. } else {
  73453. return 'M 50,50 m 0,-' + String(this.radius) + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,' + 2 * this.radius + '\n a ' + String(this.radius) + ',' + String(this.radius) + ' 0 1 1 0,-' + 2 * this.radius;
  73454. }
  73455. },
  73456. len: function len() {
  73457. return Math.PI * 2 * this.radius;
  73458. },
  73459. trailStyle: function trailStyle() {
  73460. var style = {};
  73461. if (this.dashboard) {
  73462. style = {
  73463. 'stroke-dasharray': this.len - 75 + 'px ' + String(this.len) + 'px',
  73464. 'stroke-dashoffset': '-' + 75 / 2 + 'px',
  73465. 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s'
  73466. };
  73467. }
  73468. return style;
  73469. },
  73470. pathStyle: function pathStyle() {
  73471. var style = {};
  73472. if (this.dashboard) {
  73473. style = {
  73474. 'stroke-dasharray': this.percent / 100 * (this.len - 75) + 'px ' + String(this.len) + 'px',
  73475. 'stroke-dashoffset': '-' + 75 / 2 + 'px',
  73476. 'transition': 'stroke-dashoffset .3s ease 0s, stroke-dasharray .6s ease 0s, stroke .6s, stroke-width .06s ease .6s'
  73477. };
  73478. } else {
  73479. style = {
  73480. 'stroke-dasharray': String(this.len) + 'px ' + String(this.len) + 'px',
  73481. 'stroke-dashoffset': (100 - this.percent) / 100 * this.len + 'px',
  73482. 'transition': 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease'
  73483. };
  73484. }
  73485. return style;
  73486. },
  73487. wrapClasses: function wrapClasses() {
  73488. return '' + prefixCls;
  73489. },
  73490. innerClasses: function innerClasses() {
  73491. return prefixCls + '-inner';
  73492. },
  73493. strokeValue: function strokeValue() {
  73494. var color = this.strokeColor;
  73495. if (typeof this.strokeColor !== 'string') {
  73496. color = 'url(#' + String(this.id) + ')';
  73497. }
  73498. return color;
  73499. },
  73500. showDefs: function showDefs() {
  73501. return typeof this.strokeColor !== 'string';
  73502. }
  73503. }
  73504. };
  73505. /***/ }),
  73506. /* 146 */
  73507. /***/ (function(module, exports, __webpack_require__) {
  73508. "use strict";
  73509. Object.defineProperty(exports, "__esModule", {
  73510. value: true
  73511. });
  73512. var _newArrowCheck2 = __webpack_require__(1);
  73513. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  73514. var _defineProperty2 = __webpack_require__(2);
  73515. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73516. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73517. var prefixCls = 'ivu-collapse';
  73518. exports.default = {
  73519. name: 'Collapse',
  73520. props: {
  73521. accordion: {
  73522. type: Boolean,
  73523. default: false
  73524. },
  73525. value: {
  73526. type: [Array, String]
  73527. },
  73528. simple: {
  73529. type: Boolean,
  73530. default: false
  73531. }
  73532. },
  73533. data: function data() {
  73534. return {
  73535. currentValue: this.value
  73536. };
  73537. },
  73538. computed: {
  73539. classes: function classes() {
  73540. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-simple', this.simple)];
  73541. }
  73542. },
  73543. mounted: function mounted() {
  73544. this.setActive();
  73545. },
  73546. methods: {
  73547. setActive: function setActive() {
  73548. var _this = this;
  73549. var activeKey = this.getActiveKey();
  73550. this.$children.forEach(function (child, index) {
  73551. (0, _newArrowCheck3.default)(this, _this);
  73552. var name = child.name || index.toString();
  73553. child.isActive = activeKey.indexOf(name) > -1;
  73554. child.index = index;
  73555. }.bind(this));
  73556. },
  73557. getActiveKey: function getActiveKey() {
  73558. var activeKey = this.currentValue || [];
  73559. var accordion = this.accordion;
  73560. if (!Array.isArray(activeKey)) {
  73561. activeKey = [activeKey];
  73562. }
  73563. if (accordion && activeKey.length > 1) {
  73564. activeKey = [activeKey[0]];
  73565. }
  73566. for (var i = 0; i < activeKey.length; i++) {
  73567. activeKey[i] = activeKey[i].toString();
  73568. }
  73569. return activeKey;
  73570. },
  73571. toggle: function toggle(data) {
  73572. var name = data.name.toString();
  73573. var newActiveKey = [];
  73574. if (this.accordion) {
  73575. if (!data.isActive) {
  73576. newActiveKey.push(name);
  73577. }
  73578. } else {
  73579. var activeKey = this.getActiveKey();
  73580. var nameIndex = activeKey.indexOf(name);
  73581. if (data.isActive) {
  73582. if (nameIndex > -1) {
  73583. activeKey.splice(nameIndex, 1);
  73584. }
  73585. } else {
  73586. if (nameIndex < 0) {
  73587. activeKey.push(name);
  73588. }
  73589. }
  73590. newActiveKey = activeKey;
  73591. }
  73592. this.currentValue = newActiveKey;
  73593. this.$emit('input', newActiveKey);
  73594. this.$emit('on-change', newActiveKey);
  73595. }
  73596. },
  73597. watch: {
  73598. value: function value(val) {
  73599. this.currentValue = val;
  73600. },
  73601. currentValue: function currentValue() {
  73602. this.setActive();
  73603. }
  73604. }
  73605. };
  73606. /***/ }),
  73607. /* 147 */
  73608. /***/ (function(module, exports, __webpack_require__) {
  73609. "use strict";
  73610. Object.defineProperty(exports, "__esModule", {
  73611. value: true
  73612. });
  73613. var _defineProperty2 = __webpack_require__(2);
  73614. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73615. var _icon = __webpack_require__(8);
  73616. var _icon2 = _interopRequireDefault(_icon);
  73617. var _collapseTransition = __webpack_require__(83);
  73618. var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
  73619. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73620. var prefixCls = 'ivu-collapse';
  73621. exports.default = {
  73622. name: 'Panel',
  73623. components: { Icon: _icon2.default, CollapseTransition: _collapseTransition2.default },
  73624. props: {
  73625. name: {
  73626. type: String
  73627. },
  73628. hideArrow: {
  73629. type: Boolean,
  73630. default: false
  73631. }
  73632. },
  73633. data: function data() {
  73634. return {
  73635. index: 0,
  73636. isActive: false,
  73637. mounted: false
  73638. };
  73639. },
  73640. computed: {
  73641. itemClasses: function itemClasses() {
  73642. return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.isActive)];
  73643. },
  73644. headerClasses: function headerClasses() {
  73645. return prefixCls + '-header';
  73646. },
  73647. contentClasses: function contentClasses() {
  73648. return prefixCls + '-content';
  73649. },
  73650. boxClasses: function boxClasses() {
  73651. return prefixCls + '-content-box';
  73652. }
  73653. },
  73654. methods: {
  73655. toggle: function toggle() {
  73656. this.$parent.toggle({
  73657. name: this.name || this.index,
  73658. isActive: this.isActive
  73659. });
  73660. }
  73661. },
  73662. mounted: function mounted() {
  73663. this.mounted = true;
  73664. this.$parent.setActive();
  73665. }
  73666. };
  73667. /***/ }),
  73668. /* 148 */
  73669. /***/ (function(module, exports, __webpack_require__) {
  73670. "use strict";
  73671. Object.defineProperty(exports, "__esModule", {
  73672. value: true
  73673. });
  73674. var _defineProperty2 = __webpack_require__(2);
  73675. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  73676. var _tinycolor = __webpack_require__(149);
  73677. var _tinycolor2 = _interopRequireDefault(_tinycolor);
  73678. var _vClickOutsideX = __webpack_require__(76);
  73679. var _transferDom = __webpack_require__(23);
  73680. var _transferDom2 = _interopRequireDefault(_transferDom);
  73681. var _dropdown = __webpack_require__(36);
  73682. var _dropdown2 = _interopRequireDefault(_dropdown);
  73683. var _recommendColors = __webpack_require__(394);
  73684. var _recommendColors2 = _interopRequireDefault(_recommendColors);
  73685. var _saturation = __webpack_require__(396);
  73686. var _saturation2 = _interopRequireDefault(_saturation);
  73687. var _hue = __webpack_require__(398);
  73688. var _hue2 = _interopRequireDefault(_hue);
  73689. var _alpha = __webpack_require__(400);
  73690. var _alpha2 = _interopRequireDefault(_alpha);
  73691. var _input = __webpack_require__(38);
  73692. var _input2 = _interopRequireDefault(_input);
  73693. var _button = __webpack_require__(28);
  73694. var _button2 = _interopRequireDefault(_button);
  73695. var _icon = __webpack_require__(8);
  73696. var _icon2 = _interopRequireDefault(_icon);
  73697. var _locale = __webpack_require__(6);
  73698. var _locale2 = _interopRequireDefault(_locale);
  73699. var _assist = __webpack_require__(3);
  73700. var _emitter = __webpack_require__(4);
  73701. var _emitter2 = _interopRequireDefault(_emitter);
  73702. var _form = __webpack_require__(11);
  73703. var _form2 = _interopRequireDefault(_form);
  73704. var _prefixMixin = __webpack_require__(50);
  73705. var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
  73706. var _utils = __webpack_require__(39);
  73707. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  73708. exports.default = {
  73709. name: 'ColorPicker',
  73710. components: { Drop: _dropdown2.default, RecommendColors: _recommendColors2.default, Saturation: _saturation2.default, Hue: _hue2.default, Alpha: _alpha2.default, iInput: _input2.default, iButton: _button2.default, Icon: _icon2.default },
  73711. directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
  73712. mixins: [_emitter2.default, _locale2.default, _prefixMixin2.default, _form2.default],
  73713. props: {
  73714. value: {
  73715. type: String,
  73716. default: undefined
  73717. },
  73718. hue: {
  73719. type: Boolean,
  73720. default: true
  73721. },
  73722. alpha: {
  73723. type: Boolean,
  73724. default: false
  73725. },
  73726. recommend: {
  73727. type: Boolean,
  73728. default: false
  73729. },
  73730. format: {
  73731. type: String,
  73732. validator: function validator(value) {
  73733. return (0, _assist.oneOf)(value, ['hsl', 'hsv', 'hex', 'rgb']);
  73734. },
  73735. default: undefined
  73736. },
  73737. colors: {
  73738. type: Array,
  73739. default: function _default() {
  73740. return [];
  73741. }
  73742. },
  73743. disabled: {
  73744. type: Boolean,
  73745. default: false
  73746. },
  73747. size: {
  73748. validator: function validator(value) {
  73749. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  73750. },
  73751. default: function _default() {
  73752. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  73753. }
  73754. },
  73755. hideDropDown: {
  73756. type: Boolean,
  73757. default: false
  73758. },
  73759. placement: {
  73760. type: String,
  73761. validator: function validator(value) {
  73762. return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
  73763. },
  73764. default: 'bottom'
  73765. },
  73766. transfer: {
  73767. type: Boolean,
  73768. default: function _default() {
  73769. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  73770. }
  73771. },
  73772. name: {
  73773. type: String,
  73774. default: undefined
  73775. },
  73776. editable: {
  73777. type: Boolean,
  73778. default: true
  73779. },
  73780. capture: {
  73781. type: Boolean,
  73782. default: function _default() {
  73783. return !this.$IVIEW ? true : this.$IVIEW.capture;
  73784. }
  73785. },
  73786. transferClassName: {
  73787. type: String
  73788. },
  73789. eventsEnabled: {
  73790. type: Boolean,
  73791. default: false
  73792. }
  73793. },
  73794. data: function data() {
  73795. return {
  73796. val: (0, _utils.changeColor)(this.value || ''),
  73797. currentValue: this.value || '',
  73798. dragging: false,
  73799. visible: false,
  73800. recommendedColor: ['#2d8cf0', '#19be6b', '#ff9900', '#ed4014', '#00b5ff', '#19c919', '#f9e31c', '#ea1a1a', '#9b1dea', '#00c2b1', '#ac7a33', '#1d35ea', '#8bc34a', '#f16b62', '#ea4ca3', '#0d94aa', '#febd79', '#5d4037', '#00bcd4', '#f06292', '#cddc39', '#607d8b', '#000000', '#ffffff']
  73801. };
  73802. },
  73803. computed: {
  73804. arrowClasses: function arrowClasses() {
  73805. return [String(this.inputPrefixCls) + '-icon', String(this.inputPrefixCls) + '-icon-normal'];
  73806. },
  73807. transition: function transition() {
  73808. return (0, _assist.oneOf)(this.placement, ['bottom-start', 'bottom', 'bottom-end']) ? 'slide-up' : 'fade';
  73809. },
  73810. saturationColors: {
  73811. get: function get() {
  73812. return this.val;
  73813. },
  73814. set: function set(newVal) {
  73815. this.val = newVal;
  73816. this.$emit('on-active-change', this.formatColor);
  73817. }
  73818. },
  73819. classes: function classes() {
  73820. return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-transfer', this.transfer)];
  73821. },
  73822. wrapClasses: function wrapClasses() {
  73823. return [String(this.prefixCls) + '-rel', String(this.prefixCls) + '-' + String(this.size), String(this.inputPrefixCls) + '-wrapper', String(this.inputPrefixCls) + '-wrapper-' + String(this.size), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-disabled', this.itemDisabled)];
  73824. },
  73825. inputClasses: function inputClasses() {
  73826. var _ref3;
  73827. return [String(this.prefixCls) + '-input', '' + String(this.inputPrefixCls), String(this.inputPrefixCls) + '-' + String(this.size), (_ref3 = {}, (0, _defineProperty3.default)(_ref3, String(this.prefixCls) + '-focused', this.visible), (0, _defineProperty3.default)(_ref3, String(this.prefixCls) + '-disabled', this.itemDisabled), _ref3)];
  73828. },
  73829. dropClasses: function dropClasses() {
  73830. var _ref4;
  73831. return [String(this.transferPrefixCls) + '-no-max-height', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, String(this.prefixCls) + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref4, String(this.prefixCls) + '-hide-drop', this.hideDropDown), (0, _defineProperty3.default)(_ref4, this.transferClassName, this.transferClassName), _ref4)];
  73832. },
  73833. displayedColorStyle: function displayedColorStyle() {
  73834. return { backgroundColor: (0, _utils.toRGBAString)(this.visible ? this.saturationColors.rgba : (0, _tinycolor2.default)(this.value).toRgb()) };
  73835. },
  73836. formatColor: function formatColor() {
  73837. var format = this.format,
  73838. saturationColors = this.saturationColors;
  73839. if (format) {
  73840. if (format === 'hsl') {
  73841. return (0, _tinycolor2.default)(saturationColors.hsl).toHslString();
  73842. }
  73843. if (format === 'hsv') {
  73844. return (0, _tinycolor2.default)(saturationColors.hsv).toHsvString();
  73845. }
  73846. if (format === 'hex') {
  73847. return saturationColors.hex;
  73848. }
  73849. if (format === 'rgb') {
  73850. return (0, _utils.toRGBAString)(saturationColors.rgba);
  73851. }
  73852. } else if (this.alpha) {
  73853. return (0, _utils.toRGBAString)(saturationColors.rgba);
  73854. }
  73855. return saturationColors.hex;
  73856. },
  73857. confirmColorClasses: function confirmColorClasses() {
  73858. return [String(this.prefixCls) + '-confirm-color', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-confirm-color-editable', this.editable)];
  73859. },
  73860. arrowType: function arrowType() {
  73861. var type = 'ios-arrow-down';
  73862. if (this.$IVIEW) {
  73863. if (this.$IVIEW.colorPicker.customArrow) {
  73864. type = '';
  73865. } else if (this.$IVIEW.colorPicker.arrow) {
  73866. type = this.$IVIEW.colorPicker.arrow;
  73867. }
  73868. }
  73869. return type;
  73870. },
  73871. customArrowType: function customArrowType() {
  73872. var type = '';
  73873. if (this.$IVIEW) {
  73874. if (this.$IVIEW.colorPicker.customArrow) {
  73875. type = this.$IVIEW.colorPicker.customArrow;
  73876. }
  73877. }
  73878. return type;
  73879. },
  73880. arrowSize: function arrowSize() {
  73881. var size = '';
  73882. if (this.$IVIEW) {
  73883. if (this.$IVIEW.colorPicker.arrowSize) {
  73884. size = this.$IVIEW.colorPicker.arrowSize;
  73885. }
  73886. }
  73887. return size;
  73888. }
  73889. },
  73890. watch: {
  73891. value: function value(newVal) {
  73892. this.val = (0, _utils.changeColor)(newVal || '');
  73893. },
  73894. visible: function visible(val) {
  73895. this.val = (0, _utils.changeColor)(this.value || '');
  73896. this.$refs.drop[val ? 'update' : 'destroy']();
  73897. this.$emit('on-open-change', Boolean(val));
  73898. }
  73899. },
  73900. mounted: function mounted() {
  73901. this.$on('on-escape-keydown', this.closer);
  73902. this.$on('on-dragging', this.setDragging);
  73903. },
  73904. methods: {
  73905. setDragging: function setDragging(value) {
  73906. this.dragging = value;
  73907. },
  73908. handleClose: function handleClose(event) {
  73909. if (this.visible) {
  73910. if (this.dragging || event.type === 'mousedown') {
  73911. if (this.$refs.editColorInput && event.target !== this.$refs.editColorInput.$el.querySelector('input')) {
  73912. event.preventDefault();
  73913. }
  73914. return;
  73915. }
  73916. if (this.transfer) {
  73917. var $el = this.$refs.drop.$el;
  73918. if ($el === event.target || $el.contains(event.target)) {
  73919. return;
  73920. }
  73921. }
  73922. this.closer(event);
  73923. return;
  73924. }
  73925. this.visible = false;
  73926. },
  73927. toggleVisible: function toggleVisible() {
  73928. if (this.itemDisabled) {
  73929. return;
  73930. }
  73931. this.visible = !this.visible;
  73932. this.$refs.input.focus();
  73933. },
  73934. childChange: function childChange(data) {
  73935. this.colorChange(data);
  73936. },
  73937. colorChange: function colorChange(data, oldHue) {
  73938. this.oldHue = this.saturationColors.hsl.h;
  73939. this.saturationColors = (0, _utils.changeColor)(data, oldHue || this.oldHue);
  73940. },
  73941. closer: function closer(event) {
  73942. if (event) {
  73943. event.preventDefault();
  73944. event.stopPropagation();
  73945. }
  73946. this.visible = false;
  73947. this.$refs.input.focus();
  73948. },
  73949. handleButtons: function handleButtons(event, value) {
  73950. this.currentValue = value;
  73951. this.$emit('input', value);
  73952. this.$emit('on-change', value);
  73953. this.dispatch('FormItem', 'on-form-change', value);
  73954. this.closer(event);
  73955. },
  73956. handleSuccess: function handleSuccess(event) {
  73957. this.handleButtons(event, this.formatColor);
  73958. this.$emit('on-pick-success');
  73959. },
  73960. handleClear: function handleClear(event) {
  73961. this.handleButtons(event, '');
  73962. this.$emit('on-pick-clear');
  73963. },
  73964. handleSelectColor: function handleSelectColor(color) {
  73965. this.val = (0, _utils.changeColor)(color);
  73966. this.$emit('on-active-change', this.formatColor);
  73967. },
  73968. handleEditColor: function handleEditColor(event) {
  73969. var value = event.target.value;
  73970. this.handleSelectColor(value);
  73971. },
  73972. handleFirstTab: function handleFirstTab(event) {
  73973. if (event.shiftKey) {
  73974. event.preventDefault();
  73975. event.stopPropagation();
  73976. this.$refs.ok.$el.focus();
  73977. }
  73978. },
  73979. handleLastTab: function handleLastTab(event) {
  73980. if (!event.shiftKey) {
  73981. event.preventDefault();
  73982. event.stopPropagation();
  73983. this.$refs.saturation.$el.focus();
  73984. }
  73985. },
  73986. onTab: function onTab(event) {
  73987. if (this.visible) {
  73988. event.preventDefault();
  73989. }
  73990. },
  73991. onEscape: function onEscape(event) {
  73992. if (this.visible) {
  73993. this.closer(event);
  73994. }
  73995. },
  73996. onArrow: function onArrow(event) {
  73997. if (!this.visible) {
  73998. event.preventDefault();
  73999. event.stopPropagation();
  74000. this.visible = true;
  74001. }
  74002. }
  74003. }
  74004. };
  74005. /***/ }),
  74006. /* 149 */
  74007. /***/ (function(module, exports, __webpack_require__) {
  74008. var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.1
  74009. // https://github.com/bgrins/TinyColor
  74010. // Brian Grinstead, MIT License
  74011. (function(Math) {
  74012. var trimLeft = /^\s+/,
  74013. trimRight = /\s+$/,
  74014. tinyCounter = 0,
  74015. mathRound = Math.round,
  74016. mathMin = Math.min,
  74017. mathMax = Math.max,
  74018. mathRandom = Math.random;
  74019. function tinycolor (color, opts) {
  74020. color = (color) ? color : '';
  74021. opts = opts || { };
  74022. // If input is already a tinycolor, return itself
  74023. if (color instanceof tinycolor) {
  74024. return color;
  74025. }
  74026. // If we are called as a function, call using new instead
  74027. if (!(this instanceof tinycolor)) {
  74028. return new tinycolor(color, opts);
  74029. }
  74030. var rgb = inputToRGB(color);
  74031. this._originalInput = color,
  74032. this._r = rgb.r,
  74033. this._g = rgb.g,
  74034. this._b = rgb.b,
  74035. this._a = rgb.a,
  74036. this._roundA = mathRound(100*this._a) / 100,
  74037. this._format = opts.format || rgb.format;
  74038. this._gradientType = opts.gradientType;
  74039. // Don't let the range of [0,255] come back in [0,1].
  74040. // Potentially lose a little bit of precision here, but will fix issues where
  74041. // .5 gets interpreted as half of the total, instead of half of 1
  74042. // If it was supposed to be 128, this was already taken care of by `inputToRgb`
  74043. if (this._r < 1) { this._r = mathRound(this._r); }
  74044. if (this._g < 1) { this._g = mathRound(this._g); }
  74045. if (this._b < 1) { this._b = mathRound(this._b); }
  74046. this._ok = rgb.ok;
  74047. this._tc_id = tinyCounter++;
  74048. }
  74049. tinycolor.prototype = {
  74050. isDark: function() {
  74051. return this.getBrightness() < 128;
  74052. },
  74053. isLight: function() {
  74054. return !this.isDark();
  74055. },
  74056. isValid: function() {
  74057. return this._ok;
  74058. },
  74059. getOriginalInput: function() {
  74060. return this._originalInput;
  74061. },
  74062. getFormat: function() {
  74063. return this._format;
  74064. },
  74065. getAlpha: function() {
  74066. return this._a;
  74067. },
  74068. getBrightness: function() {
  74069. //http://www.w3.org/TR/AERT#color-contrast
  74070. var rgb = this.toRgb();
  74071. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
  74072. },
  74073. getLuminance: function() {
  74074. //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
  74075. var rgb = this.toRgb();
  74076. var RsRGB, GsRGB, BsRGB, R, G, B;
  74077. RsRGB = rgb.r/255;
  74078. GsRGB = rgb.g/255;
  74079. BsRGB = rgb.b/255;
  74080. if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}
  74081. if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}
  74082. if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}
  74083. return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);
  74084. },
  74085. setAlpha: function(value) {
  74086. this._a = boundAlpha(value);
  74087. this._roundA = mathRound(100*this._a) / 100;
  74088. return this;
  74089. },
  74090. toHsv: function() {
  74091. var hsv = rgbToHsv(this._r, this._g, this._b);
  74092. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
  74093. },
  74094. toHsvString: function() {
  74095. var hsv = rgbToHsv(this._r, this._g, this._b);
  74096. var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
  74097. return (this._a == 1) ?
  74098. "hsv(" + h + ", " + s + "%, " + v + "%)" :
  74099. "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")";
  74100. },
  74101. toHsl: function() {
  74102. var hsl = rgbToHsl(this._r, this._g, this._b);
  74103. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
  74104. },
  74105. toHslString: function() {
  74106. var hsl = rgbToHsl(this._r, this._g, this._b);
  74107. var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
  74108. return (this._a == 1) ?
  74109. "hsl(" + h + ", " + s + "%, " + l + "%)" :
  74110. "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")";
  74111. },
  74112. toHex: function(allow3Char) {
  74113. return rgbToHex(this._r, this._g, this._b, allow3Char);
  74114. },
  74115. toHexString: function(allow3Char) {
  74116. return '#' + this.toHex(allow3Char);
  74117. },
  74118. toHex8: function(allow4Char) {
  74119. return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
  74120. },
  74121. toHex8String: function(allow4Char) {
  74122. return '#' + this.toHex8(allow4Char);
  74123. },
  74124. toRgb: function() {
  74125. return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
  74126. },
  74127. toRgbString: function() {
  74128. return (this._a == 1) ?
  74129. "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" :
  74130. "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
  74131. },
  74132. toPercentageRgb: function() {
  74133. return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
  74134. },
  74135. toPercentageRgbString: function() {
  74136. return (this._a == 1) ?
  74137. "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" :
  74138. "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
  74139. },
  74140. toName: function() {
  74141. if (this._a === 0) {
  74142. return "transparent";
  74143. }
  74144. if (this._a < 1) {
  74145. return false;
  74146. }
  74147. return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
  74148. },
  74149. toFilter: function(secondColor) {
  74150. var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);
  74151. var secondHex8String = hex8String;
  74152. var gradientType = this._gradientType ? "GradientType = 1, " : "";
  74153. if (secondColor) {
  74154. var s = tinycolor(secondColor);
  74155. secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);
  74156. }
  74157. return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")";
  74158. },
  74159. toString: function(format) {
  74160. var formatSet = !!format;
  74161. format = format || this._format;
  74162. var formattedString = false;
  74163. var hasAlpha = this._a < 1 && this._a >= 0;
  74164. var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
  74165. if (needsAlphaFormat) {
  74166. // Special case for "transparent", all other non-alpha formats
  74167. // will return rgba when there is transparency.
  74168. if (format === "name" && this._a === 0) {
  74169. return this.toName();
  74170. }
  74171. return this.toRgbString();
  74172. }
  74173. if (format === "rgb") {
  74174. formattedString = this.toRgbString();
  74175. }
  74176. if (format === "prgb") {
  74177. formattedString = this.toPercentageRgbString();
  74178. }
  74179. if (format === "hex" || format === "hex6") {
  74180. formattedString = this.toHexString();
  74181. }
  74182. if (format === "hex3") {
  74183. formattedString = this.toHexString(true);
  74184. }
  74185. if (format === "hex4") {
  74186. formattedString = this.toHex8String(true);
  74187. }
  74188. if (format === "hex8") {
  74189. formattedString = this.toHex8String();
  74190. }
  74191. if (format === "name") {
  74192. formattedString = this.toName();
  74193. }
  74194. if (format === "hsl") {
  74195. formattedString = this.toHslString();
  74196. }
  74197. if (format === "hsv") {
  74198. formattedString = this.toHsvString();
  74199. }
  74200. return formattedString || this.toHexString();
  74201. },
  74202. clone: function() {
  74203. return tinycolor(this.toString());
  74204. },
  74205. _applyModification: function(fn, args) {
  74206. var color = fn.apply(null, [this].concat([].slice.call(args)));
  74207. this._r = color._r;
  74208. this._g = color._g;
  74209. this._b = color._b;
  74210. this.setAlpha(color._a);
  74211. return this;
  74212. },
  74213. lighten: function() {
  74214. return this._applyModification(lighten, arguments);
  74215. },
  74216. brighten: function() {
  74217. return this._applyModification(brighten, arguments);
  74218. },
  74219. darken: function() {
  74220. return this._applyModification(darken, arguments);
  74221. },
  74222. desaturate: function() {
  74223. return this._applyModification(desaturate, arguments);
  74224. },
  74225. saturate: function() {
  74226. return this._applyModification(saturate, arguments);
  74227. },
  74228. greyscale: function() {
  74229. return this._applyModification(greyscale, arguments);
  74230. },
  74231. spin: function() {
  74232. return this._applyModification(spin, arguments);
  74233. },
  74234. _applyCombination: function(fn, args) {
  74235. return fn.apply(null, [this].concat([].slice.call(args)));
  74236. },
  74237. analogous: function() {
  74238. return this._applyCombination(analogous, arguments);
  74239. },
  74240. complement: function() {
  74241. return this._applyCombination(complement, arguments);
  74242. },
  74243. monochromatic: function() {
  74244. return this._applyCombination(monochromatic, arguments);
  74245. },
  74246. splitcomplement: function() {
  74247. return this._applyCombination(splitcomplement, arguments);
  74248. },
  74249. triad: function() {
  74250. return this._applyCombination(triad, arguments);
  74251. },
  74252. tetrad: function() {
  74253. return this._applyCombination(tetrad, arguments);
  74254. }
  74255. };
  74256. // If input is an object, force 1 into "1.0" to handle ratios properly
  74257. // String input requires "1.0" as input, so 1 will be treated as 1
  74258. tinycolor.fromRatio = function(color, opts) {
  74259. if (typeof color == "object") {
  74260. var newColor = {};
  74261. for (var i in color) {
  74262. if (color.hasOwnProperty(i)) {
  74263. if (i === "a") {
  74264. newColor[i] = color[i];
  74265. }
  74266. else {
  74267. newColor[i] = convertToPercentage(color[i]);
  74268. }
  74269. }
  74270. }
  74271. color = newColor;
  74272. }
  74273. return tinycolor(color, opts);
  74274. };
  74275. // Given a string or object, convert that input to RGB
  74276. // Possible string inputs:
  74277. //
  74278. // "red"
  74279. // "#f00" or "f00"
  74280. // "#ff0000" or "ff0000"
  74281. // "#ff000000" or "ff000000"
  74282. // "rgb 255 0 0" or "rgb (255, 0, 0)"
  74283. // "rgb 1.0 0 0" or "rgb (1, 0, 0)"
  74284. // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
  74285. // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
  74286. // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
  74287. // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
  74288. // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
  74289. //
  74290. function inputToRGB(color) {
  74291. var rgb = { r: 0, g: 0, b: 0 };
  74292. var a = 1;
  74293. var s = null;
  74294. var v = null;
  74295. var l = null;
  74296. var ok = false;
  74297. var format = false;
  74298. if (typeof color == "string") {
  74299. color = stringInputToObject(color);
  74300. }
  74301. if (typeof color == "object") {
  74302. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  74303. rgb = rgbToRgb(color.r, color.g, color.b);
  74304. ok = true;
  74305. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  74306. }
  74307. else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  74308. s = convertToPercentage(color.s);
  74309. v = convertToPercentage(color.v);
  74310. rgb = hsvToRgb(color.h, s, v);
  74311. ok = true;
  74312. format = "hsv";
  74313. }
  74314. else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  74315. s = convertToPercentage(color.s);
  74316. l = convertToPercentage(color.l);
  74317. rgb = hslToRgb(color.h, s, l);
  74318. ok = true;
  74319. format = "hsl";
  74320. }
  74321. if (color.hasOwnProperty("a")) {
  74322. a = color.a;
  74323. }
  74324. }
  74325. a = boundAlpha(a);
  74326. return {
  74327. ok: ok,
  74328. format: color.format || format,
  74329. r: mathMin(255, mathMax(rgb.r, 0)),
  74330. g: mathMin(255, mathMax(rgb.g, 0)),
  74331. b: mathMin(255, mathMax(rgb.b, 0)),
  74332. a: a
  74333. };
  74334. }
  74335. // Conversion Functions
  74336. // --------------------
  74337. // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
  74338. // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
  74339. // `rgbToRgb`
  74340. // Handle bounds / percentage checking to conform to CSS color spec
  74341. // <http://www.w3.org/TR/css3-color/>
  74342. // *Assumes:* r, g, b in [0, 255] or [0, 1]
  74343. // *Returns:* { r, g, b } in [0, 255]
  74344. function rgbToRgb(r, g, b){
  74345. return {
  74346. r: bound01(r, 255) * 255,
  74347. g: bound01(g, 255) * 255,
  74348. b: bound01(b, 255) * 255
  74349. };
  74350. }
  74351. // `rgbToHsl`
  74352. // Converts an RGB color value to HSL.
  74353. // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
  74354. // *Returns:* { h, s, l } in [0,1]
  74355. function rgbToHsl(r, g, b) {
  74356. r = bound01(r, 255);
  74357. g = bound01(g, 255);
  74358. b = bound01(b, 255);
  74359. var max = mathMax(r, g, b), min = mathMin(r, g, b);
  74360. var h, s, l = (max + min) / 2;
  74361. if(max == min) {
  74362. h = s = 0; // achromatic
  74363. }
  74364. else {
  74365. var d = max - min;
  74366. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  74367. switch(max) {
  74368. case r: h = (g - b) / d + (g < b ? 6 : 0); break;
  74369. case g: h = (b - r) / d + 2; break;
  74370. case b: h = (r - g) / d + 4; break;
  74371. }
  74372. h /= 6;
  74373. }
  74374. return { h: h, s: s, l: l };
  74375. }
  74376. // `hslToRgb`
  74377. // Converts an HSL color value to RGB.
  74378. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
  74379. // *Returns:* { r, g, b } in the set [0, 255]
  74380. function hslToRgb(h, s, l) {
  74381. var r, g, b;
  74382. h = bound01(h, 360);
  74383. s = bound01(s, 100);
  74384. l = bound01(l, 100);
  74385. function hue2rgb(p, q, t) {
  74386. if(t < 0) t += 1;
  74387. if(t > 1) t -= 1;
  74388. if(t < 1/6) return p + (q - p) * 6 * t;
  74389. if(t < 1/2) return q;
  74390. if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;
  74391. return p;
  74392. }
  74393. if(s === 0) {
  74394. r = g = b = l; // achromatic
  74395. }
  74396. else {
  74397. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  74398. var p = 2 * l - q;
  74399. r = hue2rgb(p, q, h + 1/3);
  74400. g = hue2rgb(p, q, h);
  74401. b = hue2rgb(p, q, h - 1/3);
  74402. }
  74403. return { r: r * 255, g: g * 255, b: b * 255 };
  74404. }
  74405. // `rgbToHsv`
  74406. // Converts an RGB color value to HSV
  74407. // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  74408. // *Returns:* { h, s, v } in [0,1]
  74409. function rgbToHsv(r, g, b) {
  74410. r = bound01(r, 255);
  74411. g = bound01(g, 255);
  74412. b = bound01(b, 255);
  74413. var max = mathMax(r, g, b), min = mathMin(r, g, b);
  74414. var h, s, v = max;
  74415. var d = max - min;
  74416. s = max === 0 ? 0 : d / max;
  74417. if(max == min) {
  74418. h = 0; // achromatic
  74419. }
  74420. else {
  74421. switch(max) {
  74422. case r: h = (g - b) / d + (g < b ? 6 : 0); break;
  74423. case g: h = (b - r) / d + 2; break;
  74424. case b: h = (r - g) / d + 4; break;
  74425. }
  74426. h /= 6;
  74427. }
  74428. return { h: h, s: s, v: v };
  74429. }
  74430. // `hsvToRgb`
  74431. // Converts an HSV color value to RGB.
  74432. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  74433. // *Returns:* { r, g, b } in the set [0, 255]
  74434. function hsvToRgb(h, s, v) {
  74435. h = bound01(h, 360) * 6;
  74436. s = bound01(s, 100);
  74437. v = bound01(v, 100);
  74438. var i = Math.floor(h),
  74439. f = h - i,
  74440. p = v * (1 - s),
  74441. q = v * (1 - f * s),
  74442. t = v * (1 - (1 - f) * s),
  74443. mod = i % 6,
  74444. r = [v, q, p, p, t, v][mod],
  74445. g = [t, v, v, q, p, p][mod],
  74446. b = [p, p, t, v, v, q][mod];
  74447. return { r: r * 255, g: g * 255, b: b * 255 };
  74448. }
  74449. // `rgbToHex`
  74450. // Converts an RGB color to hex
  74451. // Assumes r, g, and b are contained in the set [0, 255]
  74452. // Returns a 3 or 6 character hex
  74453. function rgbToHex(r, g, b, allow3Char) {
  74454. var hex = [
  74455. pad2(mathRound(r).toString(16)),
  74456. pad2(mathRound(g).toString(16)),
  74457. pad2(mathRound(b).toString(16))
  74458. ];
  74459. // Return a 3 character hex if possible
  74460. if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
  74461. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  74462. }
  74463. return hex.join("");
  74464. }
  74465. // `rgbaToHex`
  74466. // Converts an RGBA color plus alpha transparency to hex
  74467. // Assumes r, g, b are contained in the set [0, 255] and
  74468. // a in [0, 1]. Returns a 4 or 8 character rgba hex
  74469. function rgbaToHex(r, g, b, a, allow4Char) {
  74470. var hex = [
  74471. pad2(mathRound(r).toString(16)),
  74472. pad2(mathRound(g).toString(16)),
  74473. pad2(mathRound(b).toString(16)),
  74474. pad2(convertDecimalToHex(a))
  74475. ];
  74476. // Return a 4 character hex if possible
  74477. if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
  74478. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  74479. }
  74480. return hex.join("");
  74481. }
  74482. // `rgbaToArgbHex`
  74483. // Converts an RGBA color to an ARGB Hex8 string
  74484. // Rarely used, but required for "toFilter()"
  74485. function rgbaToArgbHex(r, g, b, a) {
  74486. var hex = [
  74487. pad2(convertDecimalToHex(a)),
  74488. pad2(mathRound(r).toString(16)),
  74489. pad2(mathRound(g).toString(16)),
  74490. pad2(mathRound(b).toString(16))
  74491. ];
  74492. return hex.join("");
  74493. }
  74494. // `equals`
  74495. // Can be called with any tinycolor input
  74496. tinycolor.equals = function (color1, color2) {
  74497. if (!color1 || !color2) { return false; }
  74498. return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();
  74499. };
  74500. tinycolor.random = function() {
  74501. return tinycolor.fromRatio({
  74502. r: mathRandom(),
  74503. g: mathRandom(),
  74504. b: mathRandom()
  74505. });
  74506. };
  74507. // Modification Functions
  74508. // ----------------------
  74509. // Thanks to less.js for some of the basics here
  74510. // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js>
  74511. function desaturate(color, amount) {
  74512. amount = (amount === 0) ? 0 : (amount || 10);
  74513. var hsl = tinycolor(color).toHsl();
  74514. hsl.s -= amount / 100;
  74515. hsl.s = clamp01(hsl.s);
  74516. return tinycolor(hsl);
  74517. }
  74518. function saturate(color, amount) {
  74519. amount = (amount === 0) ? 0 : (amount || 10);
  74520. var hsl = tinycolor(color).toHsl();
  74521. hsl.s += amount / 100;
  74522. hsl.s = clamp01(hsl.s);
  74523. return tinycolor(hsl);
  74524. }
  74525. function greyscale(color) {
  74526. return tinycolor(color).desaturate(100);
  74527. }
  74528. function lighten (color, amount) {
  74529. amount = (amount === 0) ? 0 : (amount || 10);
  74530. var hsl = tinycolor(color).toHsl();
  74531. hsl.l += amount / 100;
  74532. hsl.l = clamp01(hsl.l);
  74533. return tinycolor(hsl);
  74534. }
  74535. function brighten(color, amount) {
  74536. amount = (amount === 0) ? 0 : (amount || 10);
  74537. var rgb = tinycolor(color).toRgb();
  74538. rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));
  74539. rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));
  74540. rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));
  74541. return tinycolor(rgb);
  74542. }
  74543. function darken (color, amount) {
  74544. amount = (amount === 0) ? 0 : (amount || 10);
  74545. var hsl = tinycolor(color).toHsl();
  74546. hsl.l -= amount / 100;
  74547. hsl.l = clamp01(hsl.l);
  74548. return tinycolor(hsl);
  74549. }
  74550. // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
  74551. // Values outside of this range will be wrapped into this range.
  74552. function spin(color, amount) {
  74553. var hsl = tinycolor(color).toHsl();
  74554. var hue = (hsl.h + amount) % 360;
  74555. hsl.h = hue < 0 ? 360 + hue : hue;
  74556. return tinycolor(hsl);
  74557. }
  74558. // Combination Functions
  74559. // ---------------------
  74560. // Thanks to jQuery xColor for some of the ideas behind these
  74561. // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js>
  74562. function complement(color) {
  74563. var hsl = tinycolor(color).toHsl();
  74564. hsl.h = (hsl.h + 180) % 360;
  74565. return tinycolor(hsl);
  74566. }
  74567. function triad(color) {
  74568. var hsl = tinycolor(color).toHsl();
  74569. var h = hsl.h;
  74570. return [
  74571. tinycolor(color),
  74572. tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
  74573. tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
  74574. ];
  74575. }
  74576. function tetrad(color) {
  74577. var hsl = tinycolor(color).toHsl();
  74578. var h = hsl.h;
  74579. return [
  74580. tinycolor(color),
  74581. tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
  74582. tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
  74583. tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
  74584. ];
  74585. }
  74586. function splitcomplement(color) {
  74587. var hsl = tinycolor(color).toHsl();
  74588. var h = hsl.h;
  74589. return [
  74590. tinycolor(color),
  74591. tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),
  74592. tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})
  74593. ];
  74594. }
  74595. function analogous(color, results, slices) {
  74596. results = results || 6;
  74597. slices = slices || 30;
  74598. var hsl = tinycolor(color).toHsl();
  74599. var part = 360 / slices;
  74600. var ret = [tinycolor(color)];
  74601. for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {
  74602. hsl.h = (hsl.h + part) % 360;
  74603. ret.push(tinycolor(hsl));
  74604. }
  74605. return ret;
  74606. }
  74607. function monochromatic(color, results) {
  74608. results = results || 6;
  74609. var hsv = tinycolor(color).toHsv();
  74610. var h = hsv.h, s = hsv.s, v = hsv.v;
  74611. var ret = [];
  74612. var modification = 1 / results;
  74613. while (results--) {
  74614. ret.push(tinycolor({ h: h, s: s, v: v}));
  74615. v = (v + modification) % 1;
  74616. }
  74617. return ret;
  74618. }
  74619. // Utility Functions
  74620. // ---------------------
  74621. tinycolor.mix = function(color1, color2, amount) {
  74622. amount = (amount === 0) ? 0 : (amount || 50);
  74623. var rgb1 = tinycolor(color1).toRgb();
  74624. var rgb2 = tinycolor(color2).toRgb();
  74625. var p = amount / 100;
  74626. var rgba = {
  74627. r: ((rgb2.r - rgb1.r) * p) + rgb1.r,
  74628. g: ((rgb2.g - rgb1.g) * p) + rgb1.g,
  74629. b: ((rgb2.b - rgb1.b) * p) + rgb1.b,
  74630. a: ((rgb2.a - rgb1.a) * p) + rgb1.a
  74631. };
  74632. return tinycolor(rgba);
  74633. };
  74634. // Readability Functions
  74635. // ---------------------
  74636. // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
  74637. // `contrast`
  74638. // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
  74639. tinycolor.readability = function(color1, color2) {
  74640. var c1 = tinycolor(color1);
  74641. var c2 = tinycolor(color2);
  74642. return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05);
  74643. };
  74644. // `isReadable`
  74645. // Ensure that foreground and background color combinations meet WCAG2 guidelines.
  74646. // The third argument is an optional Object.
  74647. // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
  74648. // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
  74649. // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
  74650. // *Example*
  74651. // tinycolor.isReadable("#000", "#111") => false
  74652. // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false
  74653. tinycolor.isReadable = function(color1, color2, wcag2) {
  74654. var readability = tinycolor.readability(color1, color2);
  74655. var wcag2Parms, out;
  74656. out = false;
  74657. wcag2Parms = validateWCAG2Parms(wcag2);
  74658. switch (wcag2Parms.level + wcag2Parms.size) {
  74659. case "AAsmall":
  74660. case "AAAlarge":
  74661. out = readability >= 4.5;
  74662. break;
  74663. case "AAlarge":
  74664. out = readability >= 3;
  74665. break;
  74666. case "AAAsmall":
  74667. out = readability >= 7;
  74668. break;
  74669. }
  74670. return out;
  74671. };
  74672. // `mostReadable`
  74673. // Given a base color and a list of possible foreground or background
  74674. // colors for that base, returns the most readable color.
  74675. // Optionally returns Black or White if the most readable color is unreadable.
  74676. // *Example*
  74677. // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255"
  74678. // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff"
  74679. // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3"
  74680. // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff"
  74681. tinycolor.mostReadable = function(baseColor, colorList, args) {
  74682. var bestColor = null;
  74683. var bestScore = 0;
  74684. var readability;
  74685. var includeFallbackColors, level, size ;
  74686. args = args || {};
  74687. includeFallbackColors = args.includeFallbackColors ;
  74688. level = args.level;
  74689. size = args.size;
  74690. for (var i= 0; i < colorList.length ; i++) {
  74691. readability = tinycolor.readability(baseColor, colorList[i]);
  74692. if (readability > bestScore) {
  74693. bestScore = readability;
  74694. bestColor = tinycolor(colorList[i]);
  74695. }
  74696. }
  74697. if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) {
  74698. return bestColor;
  74699. }
  74700. else {
  74701. args.includeFallbackColors=false;
  74702. return tinycolor.mostReadable(baseColor,["#fff", "#000"],args);
  74703. }
  74704. };
  74705. // Big List of Colors
  74706. // ------------------
  74707. // <http://www.w3.org/TR/css3-color/#svg-color>
  74708. var names = tinycolor.names = {
  74709. aliceblue: "f0f8ff",
  74710. antiquewhite: "faebd7",
  74711. aqua: "0ff",
  74712. aquamarine: "7fffd4",
  74713. azure: "f0ffff",
  74714. beige: "f5f5dc",
  74715. bisque: "ffe4c4",
  74716. black: "000",
  74717. blanchedalmond: "ffebcd",
  74718. blue: "00f",
  74719. blueviolet: "8a2be2",
  74720. brown: "a52a2a",
  74721. burlywood: "deb887",
  74722. burntsienna: "ea7e5d",
  74723. cadetblue: "5f9ea0",
  74724. chartreuse: "7fff00",
  74725. chocolate: "d2691e",
  74726. coral: "ff7f50",
  74727. cornflowerblue: "6495ed",
  74728. cornsilk: "fff8dc",
  74729. crimson: "dc143c",
  74730. cyan: "0ff",
  74731. darkblue: "00008b",
  74732. darkcyan: "008b8b",
  74733. darkgoldenrod: "b8860b",
  74734. darkgray: "a9a9a9",
  74735. darkgreen: "006400",
  74736. darkgrey: "a9a9a9",
  74737. darkkhaki: "bdb76b",
  74738. darkmagenta: "8b008b",
  74739. darkolivegreen: "556b2f",
  74740. darkorange: "ff8c00",
  74741. darkorchid: "9932cc",
  74742. darkred: "8b0000",
  74743. darksalmon: "e9967a",
  74744. darkseagreen: "8fbc8f",
  74745. darkslateblue: "483d8b",
  74746. darkslategray: "2f4f4f",
  74747. darkslategrey: "2f4f4f",
  74748. darkturquoise: "00ced1",
  74749. darkviolet: "9400d3",
  74750. deeppink: "ff1493",
  74751. deepskyblue: "00bfff",
  74752. dimgray: "696969",
  74753. dimgrey: "696969",
  74754. dodgerblue: "1e90ff",
  74755. firebrick: "b22222",
  74756. floralwhite: "fffaf0",
  74757. forestgreen: "228b22",
  74758. fuchsia: "f0f",
  74759. gainsboro: "dcdcdc",
  74760. ghostwhite: "f8f8ff",
  74761. gold: "ffd700",
  74762. goldenrod: "daa520",
  74763. gray: "808080",
  74764. green: "008000",
  74765. greenyellow: "adff2f",
  74766. grey: "808080",
  74767. honeydew: "f0fff0",
  74768. hotpink: "ff69b4",
  74769. indianred: "cd5c5c",
  74770. indigo: "4b0082",
  74771. ivory: "fffff0",
  74772. khaki: "f0e68c",
  74773. lavender: "e6e6fa",
  74774. lavenderblush: "fff0f5",
  74775. lawngreen: "7cfc00",
  74776. lemonchiffon: "fffacd",
  74777. lightblue: "add8e6",
  74778. lightcoral: "f08080",
  74779. lightcyan: "e0ffff",
  74780. lightgoldenrodyellow: "fafad2",
  74781. lightgray: "d3d3d3",
  74782. lightgreen: "90ee90",
  74783. lightgrey: "d3d3d3",
  74784. lightpink: "ffb6c1",
  74785. lightsalmon: "ffa07a",
  74786. lightseagreen: "20b2aa",
  74787. lightskyblue: "87cefa",
  74788. lightslategray: "789",
  74789. lightslategrey: "789",
  74790. lightsteelblue: "b0c4de",
  74791. lightyellow: "ffffe0",
  74792. lime: "0f0",
  74793. limegreen: "32cd32",
  74794. linen: "faf0e6",
  74795. magenta: "f0f",
  74796. maroon: "800000",
  74797. mediumaquamarine: "66cdaa",
  74798. mediumblue: "0000cd",
  74799. mediumorchid: "ba55d3",
  74800. mediumpurple: "9370db",
  74801. mediumseagreen: "3cb371",
  74802. mediumslateblue: "7b68ee",
  74803. mediumspringgreen: "00fa9a",
  74804. mediumturquoise: "48d1cc",
  74805. mediumvioletred: "c71585",
  74806. midnightblue: "191970",
  74807. mintcream: "f5fffa",
  74808. mistyrose: "ffe4e1",
  74809. moccasin: "ffe4b5",
  74810. navajowhite: "ffdead",
  74811. navy: "000080",
  74812. oldlace: "fdf5e6",
  74813. olive: "808000",
  74814. olivedrab: "6b8e23",
  74815. orange: "ffa500",
  74816. orangered: "ff4500",
  74817. orchid: "da70d6",
  74818. palegoldenrod: "eee8aa",
  74819. palegreen: "98fb98",
  74820. paleturquoise: "afeeee",
  74821. palevioletred: "db7093",
  74822. papayawhip: "ffefd5",
  74823. peachpuff: "ffdab9",
  74824. peru: "cd853f",
  74825. pink: "ffc0cb",
  74826. plum: "dda0dd",
  74827. powderblue: "b0e0e6",
  74828. purple: "800080",
  74829. rebeccapurple: "663399",
  74830. red: "f00",
  74831. rosybrown: "bc8f8f",
  74832. royalblue: "4169e1",
  74833. saddlebrown: "8b4513",
  74834. salmon: "fa8072",
  74835. sandybrown: "f4a460",
  74836. seagreen: "2e8b57",
  74837. seashell: "fff5ee",
  74838. sienna: "a0522d",
  74839. silver: "c0c0c0",
  74840. skyblue: "87ceeb",
  74841. slateblue: "6a5acd",
  74842. slategray: "708090",
  74843. slategrey: "708090",
  74844. snow: "fffafa",
  74845. springgreen: "00ff7f",
  74846. steelblue: "4682b4",
  74847. tan: "d2b48c",
  74848. teal: "008080",
  74849. thistle: "d8bfd8",
  74850. tomato: "ff6347",
  74851. turquoise: "40e0d0",
  74852. violet: "ee82ee",
  74853. wheat: "f5deb3",
  74854. white: "fff",
  74855. whitesmoke: "f5f5f5",
  74856. yellow: "ff0",
  74857. yellowgreen: "9acd32"
  74858. };
  74859. // Make it easy to access colors via `hexNames[hex]`
  74860. var hexNames = tinycolor.hexNames = flip(names);
  74861. // Utilities
  74862. // ---------
  74863. // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`
  74864. function flip(o) {
  74865. var flipped = { };
  74866. for (var i in o) {
  74867. if (o.hasOwnProperty(i)) {
  74868. flipped[o[i]] = i;
  74869. }
  74870. }
  74871. return flipped;
  74872. }
  74873. // Return a valid alpha value [0,1] with all invalid values being set to 1
  74874. function boundAlpha(a) {
  74875. a = parseFloat(a);
  74876. if (isNaN(a) || a < 0 || a > 1) {
  74877. a = 1;
  74878. }
  74879. return a;
  74880. }
  74881. // Take input from [0, n] and return it as [0, 1]
  74882. function bound01(n, max) {
  74883. if (isOnePointZero(n)) { n = "100%"; }
  74884. var processPercent = isPercentage(n);
  74885. n = mathMin(max, mathMax(0, parseFloat(n)));
  74886. // Automatically convert percentage into number
  74887. if (processPercent) {
  74888. n = parseInt(n * max, 10) / 100;
  74889. }
  74890. // Handle floating point rounding errors
  74891. if ((Math.abs(n - max) < 0.000001)) {
  74892. return 1;
  74893. }
  74894. // Convert into [0, 1] range if it isn't already
  74895. return (n % max) / parseFloat(max);
  74896. }
  74897. // Force a number between 0 and 1
  74898. function clamp01(val) {
  74899. return mathMin(1, mathMax(0, val));
  74900. }
  74901. // Parse a base-16 hex value into a base-10 integer
  74902. function parseIntFromHex(val) {
  74903. return parseInt(val, 16);
  74904. }
  74905. // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  74906. // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  74907. function isOnePointZero(n) {
  74908. return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1;
  74909. }
  74910. // Check to see if string passed in is a percentage
  74911. function isPercentage(n) {
  74912. return typeof n === "string" && n.indexOf('%') != -1;
  74913. }
  74914. // Force a hex value to have 2 characters
  74915. function pad2(c) {
  74916. return c.length == 1 ? '0' + c : '' + c;
  74917. }
  74918. // Replace a decimal with it's percentage value
  74919. function convertToPercentage(n) {
  74920. if (n <= 1) {
  74921. n = (n * 100) + "%";
  74922. }
  74923. return n;
  74924. }
  74925. // Converts a decimal to a hex value
  74926. function convertDecimalToHex(d) {
  74927. return Math.round(parseFloat(d) * 255).toString(16);
  74928. }
  74929. // Converts a hex value to a decimal
  74930. function convertHexToDecimal(h) {
  74931. return (parseIntFromHex(h) / 255);
  74932. }
  74933. var matchers = (function() {
  74934. // <http://www.w3.org/TR/css3-values/#integers>
  74935. var CSS_INTEGER = "[-\\+]?\\d+%?";
  74936. // <http://www.w3.org/TR/css3-values/#number-value>
  74937. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  74938. // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
  74939. var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
  74940. // Actual matching.
  74941. // Parentheses and commas are optional, but not required.
  74942. // Whitespace can take the place of commas or opening paren
  74943. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  74944. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
  74945. return {
  74946. CSS_UNIT: new RegExp(CSS_UNIT),
  74947. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  74948. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  74949. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  74950. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  74951. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  74952. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  74953. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  74954. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  74955. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  74956. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  74957. };
  74958. })();
  74959. // `isValidCSSUnit`
  74960. // Take in a single string / number and check to see if it looks like a CSS unit
  74961. // (see `matchers` above for definition).
  74962. function isValidCSSUnit(color) {
  74963. return !!matchers.CSS_UNIT.exec(color);
  74964. }
  74965. // `stringInputToObject`
  74966. // Permissive string parsing. Take in a number of formats, and output an object
  74967. // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
  74968. function stringInputToObject(color) {
  74969. color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();
  74970. var named = false;
  74971. if (names[color]) {
  74972. color = names[color];
  74973. named = true;
  74974. }
  74975. else if (color == 'transparent') {
  74976. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  74977. }
  74978. // Try to match string input using regular expressions.
  74979. // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
  74980. // Just return an object and let the conversion functions handle that.
  74981. // This way the result will be the same whether the tinycolor is initialized with string or object.
  74982. var match;
  74983. if ((match = matchers.rgb.exec(color))) {
  74984. return { r: match[1], g: match[2], b: match[3] };
  74985. }
  74986. if ((match = matchers.rgba.exec(color))) {
  74987. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  74988. }
  74989. if ((match = matchers.hsl.exec(color))) {
  74990. return { h: match[1], s: match[2], l: match[3] };
  74991. }
  74992. if ((match = matchers.hsla.exec(color))) {
  74993. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  74994. }
  74995. if ((match = matchers.hsv.exec(color))) {
  74996. return { h: match[1], s: match[2], v: match[3] };
  74997. }
  74998. if ((match = matchers.hsva.exec(color))) {
  74999. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  75000. }
  75001. if ((match = matchers.hex8.exec(color))) {
  75002. return {
  75003. r: parseIntFromHex(match[1]),
  75004. g: parseIntFromHex(match[2]),
  75005. b: parseIntFromHex(match[3]),
  75006. a: convertHexToDecimal(match[4]),
  75007. format: named ? "name" : "hex8"
  75008. };
  75009. }
  75010. if ((match = matchers.hex6.exec(color))) {
  75011. return {
  75012. r: parseIntFromHex(match[1]),
  75013. g: parseIntFromHex(match[2]),
  75014. b: parseIntFromHex(match[3]),
  75015. format: named ? "name" : "hex"
  75016. };
  75017. }
  75018. if ((match = matchers.hex4.exec(color))) {
  75019. return {
  75020. r: parseIntFromHex(match[1] + '' + match[1]),
  75021. g: parseIntFromHex(match[2] + '' + match[2]),
  75022. b: parseIntFromHex(match[3] + '' + match[3]),
  75023. a: convertHexToDecimal(match[4] + '' + match[4]),
  75024. format: named ? "name" : "hex8"
  75025. };
  75026. }
  75027. if ((match = matchers.hex3.exec(color))) {
  75028. return {
  75029. r: parseIntFromHex(match[1] + '' + match[1]),
  75030. g: parseIntFromHex(match[2] + '' + match[2]),
  75031. b: parseIntFromHex(match[3] + '' + match[3]),
  75032. format: named ? "name" : "hex"
  75033. };
  75034. }
  75035. return false;
  75036. }
  75037. function validateWCAG2Parms(parms) {
  75038. // return valid WCAG2 parms for isReadable.
  75039. // If input parms are invalid, return {"level":"AA", "size":"small"}
  75040. var level, size;
  75041. parms = parms || {"level":"AA", "size":"small"};
  75042. level = (parms.level || "AA").toUpperCase();
  75043. size = (parms.size || "small").toLowerCase();
  75044. if (level !== "AA" && level !== "AAA") {
  75045. level = "AA";
  75046. }
  75047. if (size !== "small" && size !== "large") {
  75048. size = "small";
  75049. }
  75050. return {"level":level, "size":size};
  75051. }
  75052. // Node: Export function
  75053. if (typeof module !== "undefined" && module.exports) {
  75054. module.exports = tinycolor;
  75055. }
  75056. // AMD/requirejs: Define the module
  75057. else if (true) {
  75058. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),
  75059. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  75060. }
  75061. // Browser: Expose to window
  75062. else {
  75063. window.tinycolor = tinycolor;
  75064. }
  75065. })(Math);
  75066. /***/ }),
  75067. /* 150 */
  75068. /***/ (function(module, exports, __webpack_require__) {
  75069. "use strict";
  75070. Object.defineProperty(exports, "__esModule", {
  75071. value: true
  75072. });
  75073. var _extends2 = __webpack_require__(32);
  75074. var _extends3 = _interopRequireDefault(_extends2);
  75075. var _emitter = __webpack_require__(4);
  75076. var _emitter2 = _interopRequireDefault(_emitter);
  75077. var _handleEscapeMixin = __webpack_require__(151);
  75078. var _handleEscapeMixin2 = _interopRequireDefault(_handleEscapeMixin);
  75079. var _prefixMixin = __webpack_require__(50);
  75080. var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
  75081. var _utils = __webpack_require__(39);
  75082. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75083. exports.default = {
  75084. name: 'RecommendedColors',
  75085. mixins: [_emitter2.default, _handleEscapeMixin2.default, _prefixMixin2.default],
  75086. props: {
  75087. list: {
  75088. type: Array,
  75089. default: undefined
  75090. }
  75091. },
  75092. data: function data() {
  75093. var columns = 12;
  75094. var rows = Math.ceil(this.list.length / columns);
  75095. var normalStep = 1;
  75096. return {
  75097. left: -normalStep,
  75098. right: normalStep,
  75099. up: -normalStep,
  75100. down: normalStep,
  75101. powerKey: 'shiftKey',
  75102. grid: { x: 1, y: 1 },
  75103. rows: rows,
  75104. columns: columns
  75105. };
  75106. },
  75107. computed: {
  75108. hideClass: function hideClass() {
  75109. return String(this.prefixCls) + '-hide';
  75110. },
  75111. linearIndex: function linearIndex() {
  75112. return this.getLinearIndex(this.grid);
  75113. },
  75114. currentCircle: function currentCircle() {
  75115. return this.$refs['color-circle-' + String(this.linearIndex)][0];
  75116. }
  75117. },
  75118. methods: {
  75119. getLinearIndex: function getLinearIndex(grid) {
  75120. return this.columns * (grid.y - 1) + grid.x - 1;
  75121. },
  75122. getMaxLimit: function getMaxLimit(axis) {
  75123. return axis === 'x' ? this.columns : this.rows;
  75124. },
  75125. handleArrow: function handleArrow(e, axis, direction) {
  75126. e.preventDefault();
  75127. e.stopPropagation();
  75128. this.blurColor();
  75129. var grid = (0, _extends3.default)({}, this.grid);
  75130. if (e[this.powerKey]) {
  75131. if (direction < 0) {
  75132. grid[axis] = 1;
  75133. } else {
  75134. grid[axis] = this.getMaxLimit(axis);
  75135. }
  75136. } else {
  75137. grid[axis] += direction;
  75138. }
  75139. var index = this.getLinearIndex(grid);
  75140. if (index >= 0 && index < this.list.length) {
  75141. this.grid[axis] = (0, _utils.clamp)(grid[axis], 1, this.getMaxLimit(axis));
  75142. }
  75143. this.focusColor();
  75144. },
  75145. blurColor: function blurColor() {
  75146. this.currentCircle.classList.add(this.hideClass);
  75147. },
  75148. focusColor: function focusColor() {
  75149. this.currentCircle.classList.remove(this.hideClass);
  75150. },
  75151. handleEnter: function handleEnter(e) {
  75152. this.handleClick(e, this.currentCircle);
  75153. },
  75154. handleClick: function handleClick(e, circle) {
  75155. e.preventDefault();
  75156. e.stopPropagation();
  75157. this.$refs.reference.focus();
  75158. var target = circle || e.target;
  75159. var colorId = target.dataset.colorId || target.parentElement.dataset.colorId;
  75160. if (colorId) {
  75161. this.blurColor();
  75162. var id = Number(colorId) + 1;
  75163. this.grid.x = id % this.columns || this.columns;
  75164. this.grid.y = Math.ceil(id / this.columns);
  75165. this.focusColor();
  75166. this.$emit('picker-color', this.list[colorId]);
  75167. this.$emit('change', { hex: this.list[colorId], source: 'hex' });
  75168. }
  75169. },
  75170. lineBreak: function lineBreak(list, index) {
  75171. if (!index) {
  75172. return false;
  75173. }
  75174. var nextIndex = index + 1;
  75175. return nextIndex < list.length && nextIndex % this.columns === 0;
  75176. }
  75177. }
  75178. };
  75179. /***/ }),
  75180. /* 151 */
  75181. /***/ (function(module, exports, __webpack_require__) {
  75182. "use strict";
  75183. Object.defineProperty(exports, "__esModule", {
  75184. value: true
  75185. });
  75186. exports.default = {
  75187. methods: {
  75188. handleEscape: function handleEscape(e) {
  75189. this.dispatch('ColorPicker', 'on-escape-keydown', e);
  75190. }
  75191. }
  75192. };
  75193. /***/ }),
  75194. /* 152 */
  75195. /***/ (function(module, exports, __webpack_require__) {
  75196. "use strict";
  75197. Object.defineProperty(exports, "__esModule", {
  75198. value: true
  75199. });
  75200. var _hsaMixin = __webpack_require__(84);
  75201. var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
  75202. var _prefixMixin = __webpack_require__(50);
  75203. var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
  75204. var _utils = __webpack_require__(39);
  75205. var _dom = __webpack_require__(12);
  75206. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75207. exports.default = {
  75208. name: 'Saturation',
  75209. mixins: [_hsaMixin2.default, _prefixMixin2.default],
  75210. data: function data() {
  75211. var normalStep = 0.01;
  75212. return {
  75213. left: -normalStep,
  75214. right: normalStep,
  75215. up: normalStep,
  75216. down: -normalStep,
  75217. multiplier: 10,
  75218. powerKey: 'shiftKey'
  75219. };
  75220. },
  75221. computed: {
  75222. bgColorStyle: function bgColorStyle() {
  75223. return { background: 'hsl(' + String(this.value.hsv.h) + ', 100%, 50%)' };
  75224. },
  75225. pointerStyle: function pointerStyle() {
  75226. return { top: -(this.value.hsv.v * 100) + 1 + 100 + '%', left: this.value.hsv.s * 100 + '%' };
  75227. }
  75228. },
  75229. methods: {
  75230. change: function change(h, s, v, a) {
  75231. this.$emit('change', { h: h, s: s, v: v, a: a, source: 'hsva' });
  75232. },
  75233. handleSlide: function handleSlide(e, direction, key) {
  75234. e.preventDefault();
  75235. e.stopPropagation();
  75236. var isPowerKey = e[this.powerKey];
  75237. var increment = isPowerKey ? direction * this.multiplier : direction;
  75238. var _value$hsv = this.value.hsv,
  75239. h = _value$hsv.h,
  75240. s = _value$hsv.s,
  75241. v = _value$hsv.v,
  75242. a = _value$hsv.a;
  75243. var saturation = (0, _utils.clamp)(s + (0, _utils.getIncrement)(key, ['left', 'right'], increment), 0, 1);
  75244. var bright = (0, _utils.clamp)(v + (0, _utils.getIncrement)(key, ['up', 'down'], increment), 0, 1);
  75245. this.change(h, saturation, bright, a);
  75246. },
  75247. handleChange: function handleChange(e) {
  75248. e.preventDefault();
  75249. e.stopPropagation();
  75250. var _$refs$container = this.$refs.container,
  75251. clientWidth = _$refs$container.clientWidth,
  75252. clientHeight = _$refs$container.clientHeight;
  75253. var left = (0, _utils.clamp)(this.getLeft(e), 0, clientWidth);
  75254. var top = (0, _utils.clamp)(this.getTop(e), 0, clientHeight);
  75255. var saturation = left / clientWidth;
  75256. var bright = (0, _utils.clamp)(1 - top / clientHeight, 0, 1);
  75257. this.change(this.value.hsv.h, saturation, bright, this.value.hsv.a);
  75258. },
  75259. handleMouseDown: function handleMouseDown(e) {
  75260. _hsaMixin2.default.methods.handleMouseDown.call(this, e);
  75261. (0, _dom.on)(window, 'mouseup', this.handleChange);
  75262. },
  75263. unbindEventListeners: function unbindEventListeners(e) {
  75264. _hsaMixin2.default.methods.unbindEventListeners.call(this, e);
  75265. (0, _dom.off)(window, 'mouseup', this.handleChange);
  75266. }
  75267. }
  75268. };
  75269. /***/ }),
  75270. /* 153 */
  75271. /***/ (function(module, exports, __webpack_require__) {
  75272. "use strict";
  75273. Object.defineProperty(exports, "__esModule", {
  75274. value: true
  75275. });
  75276. var _hsaMixin = __webpack_require__(84);
  75277. var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
  75278. var _prefixMixin = __webpack_require__(50);
  75279. var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
  75280. var _utils = __webpack_require__(39);
  75281. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75282. exports.default = {
  75283. name: 'Hue',
  75284. mixins: [_hsaMixin2.default, _prefixMixin2.default],
  75285. data: function data() {
  75286. var normalStep = 1 / 360 * 25;
  75287. var jumpStep = 20 * normalStep;
  75288. return {
  75289. left: -normalStep,
  75290. right: normalStep,
  75291. up: jumpStep,
  75292. down: -jumpStep,
  75293. powerKey: 'shiftKey',
  75294. percent: (0, _utils.clamp)(this.value.hsl.h * 100 / 360, 0, 100)
  75295. };
  75296. },
  75297. watch: {
  75298. value: function value() {
  75299. this.percent = (0, _utils.clamp)(this.value.hsl.h * 100 / 360, 0, 100);
  75300. }
  75301. },
  75302. methods: {
  75303. change: function change(percent) {
  75304. this.percent = (0, _utils.clamp)(percent, 0, 100);
  75305. var _value$hsl = this.value.hsl,
  75306. h = _value$hsl.h,
  75307. s = _value$hsl.s,
  75308. l = _value$hsl.l,
  75309. a = _value$hsl.a;
  75310. var newHue = (0, _utils.clamp)(percent / 100 * 360, 0, 360);
  75311. if (h !== newHue) {
  75312. this.$emit('change', { h: newHue, s: s, l: l, a: a, source: 'hsl' });
  75313. }
  75314. },
  75315. handleSlide: function handleSlide(e, direction) {
  75316. e.preventDefault();
  75317. e.stopPropagation();
  75318. if (e[this.powerKey]) {
  75319. this.change(direction < 0 ? 0 : 100);
  75320. return;
  75321. }
  75322. this.change(this.percent + direction);
  75323. },
  75324. handleChange: function handleChange(e) {
  75325. e.preventDefault();
  75326. e.stopPropagation();
  75327. var left = this.getLeft(e);
  75328. if (left < 0) {
  75329. this.change(0);
  75330. return;
  75331. }
  75332. var clientWidth = this.$refs.container.clientWidth;
  75333. if (left > clientWidth) {
  75334. this.change(100);
  75335. return;
  75336. }
  75337. this.change(left * 100 / clientWidth);
  75338. }
  75339. }
  75340. };
  75341. /***/ }),
  75342. /* 154 */
  75343. /***/ (function(module, exports, __webpack_require__) {
  75344. "use strict";
  75345. Object.defineProperty(exports, "__esModule", {
  75346. value: true
  75347. });
  75348. var _hsaMixin = __webpack_require__(84);
  75349. var _hsaMixin2 = _interopRequireDefault(_hsaMixin);
  75350. var _prefixMixin = __webpack_require__(50);
  75351. var _prefixMixin2 = _interopRequireDefault(_prefixMixin);
  75352. var _utils = __webpack_require__(39);
  75353. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75354. exports.default = {
  75355. name: 'Alpha',
  75356. mixins: [_hsaMixin2.default, _prefixMixin2.default],
  75357. data: function data() {
  75358. var normalStep = 1;
  75359. var jumpStep = 10;
  75360. return {
  75361. left: -normalStep,
  75362. right: normalStep,
  75363. up: jumpStep,
  75364. down: -jumpStep,
  75365. powerKey: 'shiftKey'
  75366. };
  75367. },
  75368. computed: {
  75369. gradientStyle: function gradientStyle() {
  75370. var _value$rgba = this.value.rgba,
  75371. r = _value$rgba.r,
  75372. g = _value$rgba.g,
  75373. b = _value$rgba.b;
  75374. var start = (0, _utils.toRGBAString)({ r: r, g: g, b: b, a: 0 });
  75375. var finish = (0, _utils.toRGBAString)({ r: r, g: g, b: b, a: 1 });
  75376. return { background: 'linear-gradient(to right, ' + String(start) + ' 0%, ' + String(finish) + ' 100%)' };
  75377. }
  75378. },
  75379. methods: {
  75380. change: function change(newAlpha) {
  75381. var _value$hsl = this.value.hsl,
  75382. h = _value$hsl.h,
  75383. s = _value$hsl.s,
  75384. l = _value$hsl.l;
  75385. var a = this.value.a;
  75386. if (a !== newAlpha) {
  75387. this.$emit('change', { h: h, s: s, l: l, a: newAlpha, source: 'rgba' });
  75388. }
  75389. },
  75390. handleSlide: function handleSlide(e, direction) {
  75391. e.preventDefault();
  75392. e.stopPropagation();
  75393. this.change((0, _utils.clamp)(e[this.powerKey] ? direction : Math.round(this.value.hsl.a * 100 + direction) / 100, 0, 1));
  75394. },
  75395. handleChange: function handleChange(e) {
  75396. e.preventDefault();
  75397. e.stopPropagation();
  75398. var left = this.getLeft(e);
  75399. if (left < 0) {
  75400. this.change(0);
  75401. return;
  75402. }
  75403. var clientWidth = this.$refs.container.clientWidth;
  75404. if (left > clientWidth) {
  75405. this.change(1);
  75406. return;
  75407. }
  75408. this.change(Math.round(left * 100 / clientWidth) / 100);
  75409. }
  75410. }
  75411. };
  75412. /***/ }),
  75413. /* 155 */
  75414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75415. "use strict";
  75416. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  75417. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__ = __webpack_require__(156);
  75418. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__);
  75419. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  75420. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__ = __webpack_require__(404);
  75421. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__);
  75422. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  75423. /* script */
  75424. /* template */
  75425. /* template functional */
  75426. var __vue_template_functional__ = false
  75427. /* styles */
  75428. var __vue_styles__ = null
  75429. /* scopeId */
  75430. var __vue_scopeId__ = null
  75431. /* moduleIdentifier (server only) */
  75432. var __vue_module_identifier__ = null
  75433. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  75434. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_content_vue___default.a,
  75435. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__["render"],
  75436. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2768100_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_content_vue__["staticRenderFns"],
  75437. __vue_template_functional__,
  75438. __vue_styles__,
  75439. __vue_scopeId__,
  75440. __vue_module_identifier__
  75441. )
  75442. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  75443. /***/ }),
  75444. /* 156 */
  75445. /***/ (function(module, exports, __webpack_require__) {
  75446. "use strict";
  75447. Object.defineProperty(exports, "__esModule", {
  75448. value: true
  75449. });
  75450. var prefixCls = 'ivu-layout';
  75451. exports.default = {
  75452. name: 'Content',
  75453. computed: {
  75454. wrapClasses: function wrapClasses() {
  75455. return prefixCls + '-content';
  75456. }
  75457. }
  75458. };
  75459. /***/ }),
  75460. /* 157 */
  75461. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75462. "use strict";
  75463. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  75464. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__ = __webpack_require__(158);
  75465. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__);
  75466. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  75467. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__ = __webpack_require__(408);
  75468. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__);
  75469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  75470. /* script */
  75471. /* template */
  75472. /* template functional */
  75473. var __vue_template_functional__ = false
  75474. /* styles */
  75475. var __vue_styles__ = null
  75476. /* scopeId */
  75477. var __vue_scopeId__ = null
  75478. /* moduleIdentifier (server only) */
  75479. var __vue_module_identifier__ = null
  75480. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  75481. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_picker_vue___default.a,
  75482. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["render"],
  75483. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4ff2e89a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_picker_vue__["staticRenderFns"],
  75484. __vue_template_functional__,
  75485. __vue_styles__,
  75486. __vue_scopeId__,
  75487. __vue_module_identifier__
  75488. )
  75489. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  75490. /***/ }),
  75491. /* 158 */
  75492. /***/ (function(module, exports, __webpack_require__) {
  75493. "use strict";
  75494. Object.defineProperty(exports, "__esModule", {
  75495. value: true
  75496. });
  75497. var _typeof2 = __webpack_require__(27);
  75498. var _typeof3 = _interopRequireDefault(_typeof2);
  75499. var _stringify = __webpack_require__(57);
  75500. var _stringify2 = _interopRequireDefault(_stringify);
  75501. var _slicedToArray2 = __webpack_require__(26);
  75502. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  75503. var _extends2 = __webpack_require__(32);
  75504. var _extends3 = _interopRequireDefault(_extends2);
  75505. var _toConsumableArray2 = __webpack_require__(17);
  75506. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  75507. var _defineProperty2 = __webpack_require__(2);
  75508. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  75509. var _newArrowCheck2 = __webpack_require__(1);
  75510. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  75511. var _input = __webpack_require__(38);
  75512. var _input2 = _interopRequireDefault(_input);
  75513. var _dropdown = __webpack_require__(36);
  75514. var _dropdown2 = _interopRequireDefault(_dropdown);
  75515. var _icon = __webpack_require__(8);
  75516. var _icon2 = _interopRequireDefault(_icon);
  75517. var _vClickOutsideX = __webpack_require__(76);
  75518. var _transferDom = __webpack_require__(23);
  75519. var _transferDom2 = _interopRequireDefault(_transferDom);
  75520. var _assist = __webpack_require__(3);
  75521. var _util = __webpack_require__(20);
  75522. var _emitter = __webpack_require__(4);
  75523. var _emitter2 = _interopRequireDefault(_emitter);
  75524. var _form = __webpack_require__(11);
  75525. var _form2 = _interopRequireDefault(_form);
  75526. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  75527. var prefixCls = 'ivu-date-picker';
  75528. var pickerPrefixCls = 'ivu-picker';
  75529. var isEmptyArray = function (val) {
  75530. (0, _newArrowCheck3.default)(undefined, undefined);
  75531. return val.reduce(function (isEmpty, str) {
  75532. (0, _newArrowCheck3.default)(undefined, undefined);
  75533. return isEmpty && !str || typeof str === 'string' && str.trim() === '';
  75534. }.bind(undefined), true);
  75535. }.bind(undefined);
  75536. var keyValueMapper = {
  75537. 40: 'up',
  75538. 39: 'right',
  75539. 38: 'down',
  75540. 37: 'left'
  75541. };
  75542. var mapPossibleValues = function (key, horizontal, vertical) {
  75543. (0, _newArrowCheck3.default)(undefined, undefined);
  75544. if (key === 'left') return horizontal * -1;
  75545. if (key === 'right') return horizontal * 1;
  75546. if (key === 'up') return vertical * 1;
  75547. if (key === 'down') return vertical * -1;
  75548. }.bind(undefined);
  75549. var pulseElement = function (el) {
  75550. (0, _newArrowCheck3.default)(undefined, undefined);
  75551. var pulseClass = 'ivu-date-picker-btn-pulse';
  75552. el.classList.add(pulseClass);
  75553. setTimeout(function () {
  75554. (0, _newArrowCheck3.default)(undefined, undefined);
  75555. return el.classList.remove(pulseClass);
  75556. }.bind(undefined), 200);
  75557. }.bind(undefined);
  75558. var extractTime = function (date) {
  75559. (0, _newArrowCheck3.default)(undefined, undefined);
  75560. if (!date) return [0, 0, 0];
  75561. return [date.getHours(), date.getMinutes(), date.getSeconds()];
  75562. }.bind(undefined);
  75563. exports.default = {
  75564. mixins: [_emitter2.default, _form2.default],
  75565. components: { iInput: _input2.default, Drop: _dropdown2.default, Icon: _icon2.default },
  75566. directives: { clickOutside: _vClickOutsideX.directive, TransferDom: _transferDom2.default },
  75567. props: {
  75568. format: {
  75569. type: String
  75570. },
  75571. readonly: {
  75572. type: Boolean,
  75573. default: false
  75574. },
  75575. disabled: {
  75576. type: Boolean,
  75577. default: false
  75578. },
  75579. editable: {
  75580. type: Boolean,
  75581. default: true
  75582. },
  75583. clearable: {
  75584. type: Boolean,
  75585. default: true
  75586. },
  75587. confirm: {
  75588. type: Boolean,
  75589. default: false
  75590. },
  75591. open: {
  75592. type: Boolean,
  75593. default: null
  75594. },
  75595. multiple: {
  75596. type: Boolean,
  75597. default: false
  75598. },
  75599. timePickerOptions: {
  75600. default: function _default() {
  75601. (0, _newArrowCheck3.default)(undefined, undefined);
  75602. return {};
  75603. }.bind(undefined),
  75604. type: Object
  75605. },
  75606. splitPanels: {
  75607. type: Boolean,
  75608. default: false
  75609. },
  75610. showWeekNumbers: {
  75611. type: Boolean,
  75612. default: false
  75613. },
  75614. startDate: {
  75615. type: Date
  75616. },
  75617. size: {
  75618. validator: function validator(value) {
  75619. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  75620. },
  75621. default: function _default() {
  75622. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  75623. }
  75624. },
  75625. placeholder: {
  75626. type: String,
  75627. default: ''
  75628. },
  75629. placement: {
  75630. validator: function validator(value) {
  75631. return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
  75632. },
  75633. default: 'bottom-start'
  75634. },
  75635. transfer: {
  75636. type: Boolean,
  75637. default: function _default() {
  75638. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  75639. }
  75640. },
  75641. name: {
  75642. type: String
  75643. },
  75644. elementId: {
  75645. type: String
  75646. },
  75647. steps: {
  75648. type: Array,
  75649. default: function _default() {
  75650. (0, _newArrowCheck3.default)(undefined, undefined);
  75651. return [];
  75652. }.bind(undefined)
  75653. },
  75654. value: {
  75655. type: [Date, String, Array]
  75656. },
  75657. options: {
  75658. type: Object,
  75659. default: function _default() {
  75660. (0, _newArrowCheck3.default)(undefined, undefined);
  75661. return {};
  75662. }.bind(undefined)
  75663. },
  75664. separator: {
  75665. type: String,
  75666. default: ' - '
  75667. },
  75668. capture: {
  75669. type: Boolean,
  75670. default: function _default() {
  75671. return !this.$IVIEW ? true : this.$IVIEW.capture;
  75672. }
  75673. },
  75674. transferClassName: {
  75675. type: String
  75676. },
  75677. eventsEnabled: {
  75678. type: Boolean,
  75679. default: false
  75680. }
  75681. },
  75682. data: function data() {
  75683. var isRange = this.type.includes('range');
  75684. var emptyArray = isRange ? [null, null] : [null];
  75685. var initialValue = isEmptyArray((isRange ? this.value : [this.value]) || []) ? emptyArray : this.parseDate(this.value);
  75686. var focusedTime = initialValue.map(extractTime);
  75687. return {
  75688. prefixCls: prefixCls,
  75689. showClose: false,
  75690. visible: false,
  75691. internalValue: initialValue,
  75692. disableClickOutSide: false,
  75693. disableCloseUnderTransfer: false,
  75694. selectionMode: this.onSelectionModeChange(this.type),
  75695. forceInputRerender: 1,
  75696. isFocused: false,
  75697. focusedDate: initialValue[0] || this.startDate || new Date(),
  75698. focusedTime: {
  75699. column: 0,
  75700. picker: 0,
  75701. time: focusedTime,
  75702. active: false
  75703. },
  75704. internalFocus: false,
  75705. isValueNull: false };
  75706. },
  75707. computed: {
  75708. wrapperClasses: function wrapperClasses() {
  75709. return [prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-focused', this.isFocused)];
  75710. },
  75711. publicVModelValue: function publicVModelValue() {
  75712. var _this = this;
  75713. if (this.multiple) {
  75714. return this.internalValue.slice();
  75715. } else {
  75716. var isRange = this.type.includes('range');
  75717. var val = this.internalValue.map(function (date) {
  75718. (0, _newArrowCheck3.default)(this, _this);
  75719. return date instanceof Date ? new Date(date) : date || '';
  75720. }.bind(this));
  75721. if (this.type.match(/^time/)) val = val.map(this.formatDate);
  75722. return isRange || this.multiple ? val : val[0];
  75723. }
  75724. },
  75725. publicStringValue: function publicStringValue() {
  75726. var formatDate = this.formatDate,
  75727. publicVModelValue = this.publicVModelValue,
  75728. type = this.type;
  75729. if (type.match(/^time/)) return publicVModelValue;
  75730. if (this.multiple) return formatDate(publicVModelValue);
  75731. return Array.isArray(publicVModelValue) ? publicVModelValue.map(formatDate) : formatDate(publicVModelValue);
  75732. },
  75733. opened: function opened() {
  75734. return this.open === null ? this.visible : this.open;
  75735. },
  75736. transition: function transition() {
  75737. var bottomPlaced = this.placement.match(/^bottom/);
  75738. return bottomPlaced ? 'slide-up' : 'slide-down';
  75739. },
  75740. visualValue: function visualValue() {
  75741. return this.formatDate(this.internalValue);
  75742. },
  75743. isConfirm: function isConfirm() {
  75744. return this.confirm || this.type === 'datetime' || this.type === 'datetimerange' || this.multiple;
  75745. },
  75746. arrowType: function arrowType() {
  75747. var type = '';
  75748. if (this.type === 'time' || this.type === 'timerange') {
  75749. type = 'ios-time-outline';
  75750. if (this.$IVIEW) {
  75751. if (this.$IVIEW.timePicker.customIcon) {
  75752. type = '';
  75753. } else if (this.$IVIEW.timePicker.icon) {
  75754. type = this.$IVIEW.timePicker.icon;
  75755. }
  75756. }
  75757. } else {
  75758. type = 'ios-calendar-outline';
  75759. if (this.$IVIEW) {
  75760. if (this.$IVIEW.datePicker.customIcon) {
  75761. type = '';
  75762. } else if (this.$IVIEW.datePicker.icon) {
  75763. type = this.$IVIEW.datePicker.icon;
  75764. }
  75765. }
  75766. }
  75767. if (this.showClose) type = 'ios-close-circle';
  75768. return type;
  75769. },
  75770. customArrowType: function customArrowType() {
  75771. var type = '';
  75772. if (!this.showClose) {
  75773. if (this.type === 'time' || this.type === 'timerange') {
  75774. if (this.$IVIEW) {
  75775. if (this.$IVIEW.timePicker.customIcon) {
  75776. type = this.$IVIEW.timePicker.customIcon;
  75777. }
  75778. }
  75779. } else {
  75780. if (this.$IVIEW) {
  75781. if (this.$IVIEW.datePicker.customIcon) {
  75782. type = this.$IVIEW.datePicker.customIcon;
  75783. }
  75784. }
  75785. }
  75786. }
  75787. return type;
  75788. },
  75789. arrowSize: function arrowSize() {
  75790. var size = '';
  75791. if (!this.showClose) {
  75792. if (this.type === 'time' || this.type === 'timerange') {
  75793. if (this.$IVIEW) {
  75794. if (this.$IVIEW.timePicker.iconSize) {
  75795. size = this.$IVIEW.timePicker.iconSize;
  75796. }
  75797. }
  75798. } else {
  75799. if (this.$IVIEW) {
  75800. if (this.$IVIEW.datePicker.iconSize) {
  75801. size = this.$IVIEW.datePicker.iconSize;
  75802. }
  75803. }
  75804. }
  75805. }
  75806. return size;
  75807. },
  75808. dropdownCls: function dropdownCls() {
  75809. var _ref2;
  75810. return _ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2;
  75811. }
  75812. },
  75813. methods: {
  75814. onSelectionModeChange: function onSelectionModeChange(type) {
  75815. if (type.match(/^date/)) type = 'date';
  75816. this.selectionMode = (0, _assist.oneOf)(type, ['year', 'month', 'date', 'time']) && type;
  75817. return this.selectionMode;
  75818. },
  75819. handleTransferClick: function handleTransferClick() {
  75820. if (this.transfer) this.disableCloseUnderTransfer = true;
  75821. },
  75822. handleClose: function handleClose(e) {
  75823. if (this.disableCloseUnderTransfer) {
  75824. this.disableCloseUnderTransfer = false;
  75825. return false;
  75826. }
  75827. if (e && e.type === 'mousedown' && this.visible) {
  75828. e.preventDefault();
  75829. e.stopPropagation();
  75830. return;
  75831. }
  75832. if (this.visible) {
  75833. var pickerPanel = this.$refs.pickerPanel && this.$refs.pickerPanel.$el;
  75834. if (e && pickerPanel && pickerPanel.contains(e.target)) return;
  75835. this.visible = false;
  75836. e && e.preventDefault();
  75837. e && e.stopPropagation();
  75838. this.$emit('on-clickoutside', e);
  75839. return;
  75840. }
  75841. this.isFocused = false;
  75842. this.disableClickOutSide = false;
  75843. },
  75844. handleFocus: function handleFocus(e) {
  75845. if (this.readonly) return;
  75846. this.isFocused = true;
  75847. if (e && e.type === 'focus') return;
  75848. if (!this.itemDisabled) {
  75849. this.visible = true;
  75850. }
  75851. },
  75852. handleBlur: function handleBlur(e) {
  75853. if (this.internalFocus) {
  75854. this.internalFocus = false;
  75855. return;
  75856. }
  75857. if (this.visible) {
  75858. e.preventDefault();
  75859. return;
  75860. }
  75861. this.isFocused = false;
  75862. this.onSelectionModeChange(this.type);
  75863. this.internalValue = this.internalValue.slice();
  75864. this.reset();
  75865. this.$refs.pickerPanel.onToggleVisibility(false);
  75866. },
  75867. handleKeydown: function handleKeydown(e) {
  75868. var _this2 = this;
  75869. var keyCode = e.keyCode;
  75870. if (keyCode === 9) {
  75871. if (this.visible) {
  75872. e.stopPropagation();
  75873. e.preventDefault();
  75874. if (this.isConfirm) {
  75875. var selector = '.' + pickerPrefixCls + '-confirm > *';
  75876. var tabbable = this.$refs.drop.$el.querySelectorAll(selector);
  75877. this.internalFocus = true;
  75878. var element = [].concat((0, _toConsumableArray3.default)(tabbable))[e.shiftKey ? 'pop' : 'shift']();
  75879. element.focus();
  75880. } else {
  75881. this.handleClose();
  75882. }
  75883. } else {
  75884. this.focused = false;
  75885. }
  75886. }
  75887. var arrows = [37, 38, 39, 40];
  75888. if (!this.visible && arrows.includes(keyCode)) {
  75889. this.visible = true;
  75890. return;
  75891. }
  75892. if (keyCode === 27) {
  75893. if (this.visible) {
  75894. e.stopPropagation();
  75895. this.handleClose();
  75896. }
  75897. }
  75898. if (keyCode === 13) {
  75899. var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
  75900. if (timePickers.length > 0) {
  75901. var columnsPerPicker = timePickers[0].showSeconds ? 3 : 2;
  75902. var pickerIndex = Math.floor(this.focusedTime.column / columnsPerPicker);
  75903. var value = this.focusedTime.time[pickerIndex];
  75904. timePickers[pickerIndex].chooseValue(value);
  75905. return;
  75906. }
  75907. if (this.type.match(/range/)) {
  75908. this.$refs.pickerPanel.handleRangePick(this.focusedDate, 'date');
  75909. } else {
  75910. var panels = (0, _assist.findComponentsDownward)(this, 'PanelTable');
  75911. var compareDate = function (d) {
  75912. (0, _newArrowCheck3.default)(this, _this2);
  75913. var sliceIndex = ['year', 'month', 'date'].indexOf(this.type) + 1;
  75914. return [d.getFullYear(), d.getMonth(), d.getDate()].slice(0, sliceIndex).join('-');
  75915. }.bind(this);
  75916. var dateIsValid = panels.find(function (_ref3) {
  75917. var cells = _ref3.cells;
  75918. (0, _newArrowCheck3.default)(this, _this2);
  75919. return cells.find(function (_ref4) {
  75920. var date = _ref4.date,
  75921. disabled = _ref4.disabled;
  75922. (0, _newArrowCheck3.default)(this, _this2);
  75923. return compareDate(date) === compareDate(this.focusedDate) && !disabled;
  75924. }.bind(this));
  75925. }.bind(this));
  75926. if (dateIsValid) this.onPick(this.focusedDate, false, 'date');
  75927. }
  75928. }
  75929. if (!arrows.includes(keyCode)) return;
  75930. if (this.focusedTime.active) e.preventDefault();
  75931. this.navigateDatePanel(keyValueMapper[keyCode], e.shiftKey);
  75932. },
  75933. reset: function reset() {
  75934. this.$refs.pickerPanel.reset && this.$refs.pickerPanel.reset();
  75935. },
  75936. navigateTimePanel: function navigateTimePanel(direction) {
  75937. var _this3 = this;
  75938. this.focusedTime.active = true;
  75939. var horizontal = direction.match(/left|right/);
  75940. var vertical = direction.match(/up|down/);
  75941. var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
  75942. var maxNrOfColumns = (timePickers[0].showSeconds ? 3 : 2) * timePickers.length;
  75943. var column = function (currentColumn) {
  75944. (0, _newArrowCheck3.default)(this, _this3);
  75945. var incremented = currentColumn + (horizontal ? direction === 'left' ? -1 : 1 : 0);
  75946. return (incremented + maxNrOfColumns) % maxNrOfColumns;
  75947. }.bind(this)(this.focusedTime.column);
  75948. var columnsPerPicker = maxNrOfColumns / timePickers.length;
  75949. var pickerIndex = Math.floor(column / columnsPerPicker);
  75950. var col = column % columnsPerPicker;
  75951. if (horizontal) {
  75952. var time = this.internalValue.map(extractTime);
  75953. this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
  75954. column: column,
  75955. time: time
  75956. });
  75957. timePickers.forEach(function (instance, i) {
  75958. (0, _newArrowCheck3.default)(this, _this3);
  75959. if (i === pickerIndex) instance.updateFocusedTime(col, time[pickerIndex]);else instance.updateFocusedTime(-1, instance.focusedTime);
  75960. }.bind(this));
  75961. }
  75962. if (vertical) {
  75963. var increment = direction === 'up' ? 1 : -1;
  75964. var timeParts = ['hours', 'minutes', 'seconds'];
  75965. var pickerPossibleValues = timePickers[pickerIndex][String(timeParts[col]) + 'List'];
  75966. var currentIndex = pickerPossibleValues.findIndex(function (_ref5) {
  75967. var text = _ref5.text;
  75968. (0, _newArrowCheck3.default)(this, _this3);
  75969. return this.focusedTime.time[pickerIndex][col] === text;
  75970. }.bind(this));
  75971. var nextIndex = (currentIndex + increment + pickerPossibleValues.length) % pickerPossibleValues.length;
  75972. var nextValue = pickerPossibleValues[nextIndex].text;
  75973. var times = this.focusedTime.time.map(function (time, i) {
  75974. (0, _newArrowCheck3.default)(this, _this3);
  75975. if (i !== pickerIndex) return time;
  75976. time[col] = nextValue;
  75977. return time;
  75978. }.bind(this));
  75979. this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
  75980. time: times
  75981. });
  75982. timePickers.forEach(function (instance, i) {
  75983. (0, _newArrowCheck3.default)(this, _this3);
  75984. if (i === pickerIndex) instance.updateFocusedTime(col, times[i]);else instance.updateFocusedTime(-1, instance.focusedTime);
  75985. }.bind(this));
  75986. }
  75987. },
  75988. navigateDatePanel: function navigateDatePanel(direction, shift) {
  75989. var timePickers = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
  75990. if (timePickers.length > 0) {
  75991. this.navigateTimePanel(direction, shift, timePickers);
  75992. return;
  75993. }
  75994. if (shift) {
  75995. if (this.type === 'year') {
  75996. this.focusedDate = new Date(this.focusedDate.getFullYear() + mapPossibleValues(direction, 0, 10), this.focusedDate.getMonth(), this.focusedDate.getDate());
  75997. } else {
  75998. this.focusedDate = new Date(this.focusedDate.getFullYear() + mapPossibleValues(direction, 0, 1), this.focusedDate.getMonth() + mapPossibleValues(direction, 1, 0), this.focusedDate.getDate());
  75999. }
  76000. var position = direction.match(/left|down/) ? 'prev' : 'next';
  76001. var double = direction.match(/up|down/) ? '-double' : '';
  76002. var button = this.$refs.drop.$el.querySelector('.ivu-date-picker-' + position + '-btn-arrow' + double);
  76003. if (button) pulseElement(button);
  76004. return;
  76005. }
  76006. var initialDate = this.focusedDate || this.internalValue && this.internalValue[0] || new Date();
  76007. var focusedDate = new Date(initialDate);
  76008. if (this.type.match(/^date/)) {
  76009. var lastOfMonth = (0, _util.getDayCountOfMonth)(initialDate.getFullYear(), initialDate.getMonth());
  76010. var startDay = initialDate.getDate();
  76011. var nextDay = focusedDate.getDate() + mapPossibleValues(direction, 1, 7);
  76012. if (nextDay < 1) {
  76013. if (direction.match(/left|right/)) {
  76014. focusedDate.setMonth(focusedDate.getMonth() + 1);
  76015. focusedDate.setDate(nextDay);
  76016. } else {
  76017. focusedDate.setDate(startDay + Math.floor((lastOfMonth - startDay) / 7) * 7);
  76018. }
  76019. } else if (nextDay > lastOfMonth) {
  76020. if (direction.match(/left|right/)) {
  76021. focusedDate.setMonth(focusedDate.getMonth() - 1);
  76022. focusedDate.setDate(nextDay);
  76023. } else {
  76024. focusedDate.setDate(startDay % 7);
  76025. }
  76026. } else {
  76027. focusedDate.setDate(nextDay);
  76028. }
  76029. }
  76030. if (this.type.match(/^month/)) {
  76031. focusedDate.setMonth(focusedDate.getMonth() + mapPossibleValues(direction, 1, 3));
  76032. }
  76033. if (this.type.match(/^year/)) {
  76034. focusedDate.setFullYear(focusedDate.getFullYear() + mapPossibleValues(direction, 1, 3));
  76035. }
  76036. this.focusedDate = focusedDate;
  76037. },
  76038. handleInputChange: function handleInputChange(event) {
  76039. var _this4 = this;
  76040. var isArrayValue = this.type.includes('range') || this.multiple;
  76041. var oldValue = this.visualValue;
  76042. var newValue = event.target.value;
  76043. var newDate = this.parseDate(newValue);
  76044. var disabledDateFn = this.options && typeof this.options.disabledDate === 'function' && this.options.disabledDate;
  76045. var valueToTest = isArrayValue ? newDate : newDate[0];
  76046. var isDisabled = disabledDateFn && disabledDateFn(valueToTest);
  76047. var isValidDate = newDate.reduce(function (valid, date) {
  76048. (0, _newArrowCheck3.default)(this, _this4);
  76049. return valid && date instanceof Date;
  76050. }.bind(this), true);
  76051. if (newValue !== oldValue && !isDisabled && isValidDate) {
  76052. this.emitChange(this.type);
  76053. this.internalValue = newDate;
  76054. } else {
  76055. this.forceInputRerender++;
  76056. }
  76057. },
  76058. handleInputMouseenter: function handleInputMouseenter() {
  76059. if (this.readonly || this.itemDisabled) return;
  76060. if (this.visualValue && this.clearable) {
  76061. this.showClose = true;
  76062. }
  76063. },
  76064. handleInputMouseleave: function handleInputMouseleave() {
  76065. this.showClose = false;
  76066. },
  76067. handleIconClick: function handleIconClick(e) {
  76068. if (this.showClose) {
  76069. if (e) e.stopPropagation();
  76070. this.handleClear();
  76071. } else if (!this.itemDisabled) {
  76072. this.handleFocus();
  76073. }
  76074. },
  76075. handleClear: function handleClear() {
  76076. var _this5 = this;
  76077. this.visible = false;
  76078. this.internalValue = this.internalValue.map(function () {
  76079. (0, _newArrowCheck3.default)(this, _this5);
  76080. return null;
  76081. }.bind(this));
  76082. this.$emit('on-clear');
  76083. this.dispatch('FormItem', 'on-form-change', '');
  76084. this.emitChange(this.type);
  76085. this.reset();
  76086. setTimeout(function () {
  76087. (0, _newArrowCheck3.default)(this, _this5);
  76088. return this.onSelectionModeChange(this.type);
  76089. }.bind(this), 500);
  76090. },
  76091. emitChange: function emitChange(type) {
  76092. var _this6 = this;
  76093. this.$nextTick(function () {
  76094. (0, _newArrowCheck3.default)(this, _this6);
  76095. this.$emit('on-change', this.publicStringValue, type);
  76096. this.dispatch('FormItem', 'on-form-change', this.publicStringValue);
  76097. }.bind(this));
  76098. },
  76099. parseDate: function parseDate(val) {
  76100. var _this7 = this;
  76101. var isRange = this.type.includes('range');
  76102. var type = this.type;
  76103. var parser = (_util.TYPE_VALUE_RESOLVER_MAP[type] || _util.TYPE_VALUE_RESOLVER_MAP['default']).parser;
  76104. var format = this.format || _util.DEFAULT_FORMATS[type];
  76105. var multipleParser = _util.TYPE_VALUE_RESOLVER_MAP['multiple'].parser;
  76106. if (val && type === 'time' && !(val instanceof Date)) {
  76107. val = parser(val, format, this.separator);
  76108. } else if (this.multiple && val) {
  76109. val = multipleParser(val, format, this.separator);
  76110. } else if (isRange) {
  76111. if (!val) {
  76112. val = [null, null];
  76113. } else {
  76114. if (typeof val === 'string') {
  76115. val = parser(val, format, this.separator);
  76116. } else if (type === 'timerange') {
  76117. val = parser(val, format, this.separator).map(function (v) {
  76118. (0, _newArrowCheck3.default)(this, _this7);
  76119. return v || '';
  76120. }.bind(this));
  76121. } else {
  76122. var _val = val,
  76123. _val2 = (0, _slicedToArray3.default)(_val, 2),
  76124. start = _val2[0],
  76125. end = _val2[1];
  76126. if (start instanceof Date && end instanceof Date) {
  76127. val = val.map(function (date) {
  76128. (0, _newArrowCheck3.default)(this, _this7);
  76129. return new Date(date);
  76130. }.bind(this));
  76131. } else if (typeof start === 'string' && typeof end === 'string') {
  76132. val = parser(val.join(this.separator), format, this.separator);
  76133. } else if (!start || !end) {
  76134. val = [null, null];
  76135. }
  76136. }
  76137. }
  76138. } else if (typeof val === 'string' && type.indexOf('time') !== 0) {
  76139. val = parser(val, format) || null;
  76140. }
  76141. return isRange || this.multiple ? val || [] : [val];
  76142. },
  76143. formatDate: function formatDate(value) {
  76144. var format = _util.DEFAULT_FORMATS[this.type];
  76145. if (this.multiple) {
  76146. var formatter = _util.TYPE_VALUE_RESOLVER_MAP.multiple.formatter;
  76147. return formatter(value, this.format || format, this.separator);
  76148. } else {
  76149. var _ref6 = _util.TYPE_VALUE_RESOLVER_MAP[this.type] || _util.TYPE_VALUE_RESOLVER_MAP['default'],
  76150. _formatter = _ref6.formatter;
  76151. return _formatter(value, this.format || format, this.separator);
  76152. }
  76153. },
  76154. onPick: function onPick(dates) {
  76155. var _this8 = this;
  76156. var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  76157. var type = arguments[2];
  76158. if (this.multiple) {
  76159. var pickedTimeStamp = dates.getTime();
  76160. var indexOfPickedDate = this.internalValue.findIndex(function (date) {
  76161. (0, _newArrowCheck3.default)(this, _this8);
  76162. return date && date.getTime() === pickedTimeStamp;
  76163. }.bind(this));
  76164. var allDates = [].concat((0, _toConsumableArray3.default)(this.internalValue), [dates]).filter(Boolean);
  76165. var timeStamps = allDates.map(function (date) {
  76166. (0, _newArrowCheck3.default)(this, _this8);
  76167. return date.getTime();
  76168. }.bind(this)).filter(function (ts, i, arr) {
  76169. (0, _newArrowCheck3.default)(this, _this8);
  76170. return arr.indexOf(ts) === i && i !== indexOfPickedDate;
  76171. }.bind(this));
  76172. this.internalValue = timeStamps.map(function (ts) {
  76173. (0, _newArrowCheck3.default)(this, _this8);
  76174. return new Date(ts);
  76175. }.bind(this));
  76176. } else {
  76177. dates = this.parseDate(dates);
  76178. this.internalValue = Array.isArray(dates) ? dates : [dates];
  76179. }
  76180. if (this.internalValue[0]) this.focusedDate = this.internalValue[0];
  76181. this.focusedTime = (0, _extends3.default)({}, this.focusedTime, {
  76182. time: this.internalValue.map(extractTime)
  76183. });
  76184. if (!this.isConfirm) this.onSelectionModeChange(this.type);
  76185. if (!this.isConfirm) this.visible = visible;
  76186. this.emitChange(type);
  76187. },
  76188. onPickSuccess: function onPickSuccess() {
  76189. this.visible = false;
  76190. this.$emit('on-ok');
  76191. this.focus();
  76192. this.reset();
  76193. },
  76194. focus: function focus() {
  76195. this.$refs.input && this.$refs.input.focus();
  76196. },
  76197. updatePopper: function updatePopper() {
  76198. this.$refs.drop.update();
  76199. }
  76200. },
  76201. watch: {
  76202. visible: function visible(state) {
  76203. if (state === false) {
  76204. this.$refs.drop.destroy();
  76205. }
  76206. if (state) this.$refs.drop.update();
  76207. this.$emit('on-open-change', state);
  76208. },
  76209. value: function value(val) {
  76210. if (val === null) this.isValueNull = true;
  76211. this.internalValue = this.parseDate(val);
  76212. },
  76213. open: function open(val) {
  76214. this.visible = val === true;
  76215. },
  76216. type: function type(_type) {
  76217. this.onSelectionModeChange(_type);
  76218. },
  76219. publicVModelValue: function publicVModelValue(now, before) {
  76220. var newValue = (0, _stringify2.default)(now);
  76221. var oldValue = (0, _stringify2.default)(before);
  76222. var shouldEmitInput = newValue !== oldValue || (typeof now === 'undefined' ? 'undefined' : (0, _typeof3.default)(now)) !== (typeof before === 'undefined' ? 'undefined' : (0, _typeof3.default)(before));
  76223. if (shouldEmitInput) {
  76224. if (this.isValueNull) {
  76225. this.isValueNull = false;
  76226. this.$emit('input', null);
  76227. } else {
  76228. this.$emit('input', now);
  76229. }
  76230. }
  76231. }
  76232. },
  76233. mounted: function mounted() {
  76234. var _this9 = this;
  76235. if (this.open !== null) this.visible = this.open;
  76236. this.$on('focus-input', function () {
  76237. (0, _newArrowCheck3.default)(this, _this9);
  76238. return this.focus();
  76239. }.bind(this));
  76240. this.$on('update-popper', function () {
  76241. (0, _newArrowCheck3.default)(this, _this9);
  76242. return this.updatePopper();
  76243. }.bind(this));
  76244. },
  76245. beforeDestroy: function beforeDestroy() {
  76246. this.$off('focus-input');
  76247. this.$off('update-popper');
  76248. }
  76249. };
  76250. /***/ }),
  76251. /* 159 */
  76252. /***/ (function(module, exports, __webpack_require__) {
  76253. "use strict";
  76254. Object.defineProperty(exports, "__esModule", {
  76255. value: true
  76256. });
  76257. var _newArrowCheck2 = __webpack_require__(1);
  76258. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76259. var _defineProperty2 = __webpack_require__(2);
  76260. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  76261. var _icon = __webpack_require__(8);
  76262. var _icon2 = _interopRequireDefault(_icon);
  76263. var _dateTable = __webpack_require__(160);
  76264. var _dateTable2 = _interopRequireDefault(_dateTable);
  76265. var _yearTable = __webpack_require__(162);
  76266. var _yearTable2 = _interopRequireDefault(_yearTable);
  76267. var _monthTable = __webpack_require__(164);
  76268. var _monthTable2 = _interopRequireDefault(_monthTable);
  76269. var _time = __webpack_require__(166);
  76270. var _time2 = _interopRequireDefault(_time);
  76271. var _confirm = __webpack_require__(59);
  76272. var _confirm2 = _interopRequireDefault(_confirm);
  76273. var _datePanelLabel = __webpack_require__(171);
  76274. var _datePanelLabel2 = _interopRequireDefault(_datePanelLabel);
  76275. var _panelMixin = __webpack_require__(60);
  76276. var _panelMixin2 = _interopRequireDefault(_panelMixin);
  76277. var _datePanelMixin = __webpack_require__(173);
  76278. var _datePanelMixin2 = _interopRequireDefault(_datePanelMixin);
  76279. var _locale = __webpack_require__(6);
  76280. var _locale2 = _interopRequireDefault(_locale);
  76281. var _util = __webpack_require__(20);
  76282. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76283. var prefixCls = 'ivu-picker-panel';
  76284. var datePrefixCls = 'ivu-date-picker';
  76285. exports.default = {
  76286. name: 'DatePickerPanel',
  76287. mixins: [_panelMixin2.default, _locale2.default, _datePanelMixin2.default],
  76288. components: { Icon: _icon2.default, DateTable: _dateTable2.default, YearTable: _yearTable2.default, MonthTable: _monthTable2.default, TimePicker: _time2.default, Confirm: _confirm2.default, datePanelLabel: _datePanelLabel2.default },
  76289. props: {
  76290. multiple: {
  76291. type: Boolean,
  76292. default: false
  76293. }
  76294. },
  76295. data: function data() {
  76296. var selectionMode = this.selectionMode,
  76297. value = this.value;
  76298. var dates = value.slice().sort();
  76299. return {
  76300. prefixCls: prefixCls,
  76301. datePrefixCls: datePrefixCls,
  76302. currentView: selectionMode || 'date',
  76303. pickerTable: this.getTableType(selectionMode),
  76304. dates: dates,
  76305. panelDate: this.startDate || dates[0] || new Date()
  76306. };
  76307. },
  76308. computed: {
  76309. classes: function classes() {
  76310. return [prefixCls + '-body-wrapper', (0, _defineProperty3.default)({}, prefixCls + '-with-sidebar', this.shortcuts.length)];
  76311. },
  76312. panelPickerHandlers: function panelPickerHandlers() {
  76313. return this.pickerTable === String(this.currentView) + '-table' ? this.handlePick : this.handlePreSelection;
  76314. },
  76315. datePanelLabel: function datePanelLabel() {
  76316. var _this = this;
  76317. var locale = this.t('i.locale');
  76318. var datePanelLabel = this.t('i.datepicker.datePanelLabel');
  76319. var date = this.panelDate;
  76320. var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date),
  76321. labels = _formatDateLabels.labels,
  76322. separator = _formatDateLabels.separator;
  76323. var handler = function (type) {
  76324. (0, _newArrowCheck3.default)(this, _this);
  76325. return function () {
  76326. (0, _newArrowCheck3.default)(this, _this);
  76327. return this.pickerTable = this.getTableType(type);
  76328. }.bind(this);
  76329. }.bind(this);
  76330. return {
  76331. separator: separator,
  76332. labels: labels.map(function (obj) {
  76333. (0, _newArrowCheck3.default)(this, _this);
  76334. return obj.handler = handler(obj.type), obj;
  76335. }.bind(this))
  76336. };
  76337. },
  76338. timeDisabled: function timeDisabled() {
  76339. return !this.dates[0];
  76340. }
  76341. },
  76342. watch: {
  76343. value: function value(newVal) {
  76344. this.dates = newVal;
  76345. var panelDate = this.multiple ? this.dates[this.dates.length - 1] : this.startDate || this.dates[0];
  76346. this.panelDate = panelDate || new Date();
  76347. },
  76348. currentView: function currentView(_currentView) {
  76349. var _this2 = this;
  76350. this.$emit('on-selection-mode-change', _currentView);
  76351. if (this.currentView === 'time') {
  76352. this.$nextTick(function () {
  76353. (0, _newArrowCheck3.default)(this, _this2);
  76354. var spinner = this.$refs.timePicker.$refs.timeSpinner;
  76355. spinner.updateScroll();
  76356. }.bind(this));
  76357. }
  76358. },
  76359. selectionMode: function selectionMode(type) {
  76360. this.currentView = type;
  76361. this.pickerTable = this.getTableType(type);
  76362. },
  76363. focusedDate: function focusedDate(date) {
  76364. var isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear();
  76365. var isDifferentMonth = isDifferentYear || date.getMonth() !== this.panelDate.getMonth();
  76366. if (isDifferentYear || isDifferentMonth) {
  76367. if (!this.multiple) this.panelDate = date;
  76368. }
  76369. }
  76370. },
  76371. methods: {
  76372. reset: function reset() {
  76373. this.currentView = this.selectionMode;
  76374. this.pickerTable = this.getTableType(this.currentView);
  76375. },
  76376. changeYear: function changeYear(dir) {
  76377. if (this.selectionMode === 'year' || this.pickerTable === 'year-table') {
  76378. this.panelDate = new Date(this.panelDate.getFullYear() + dir * 10, 0, 1);
  76379. } else {
  76380. this.panelDate = (0, _util.siblingMonth)(this.panelDate, dir * 12);
  76381. }
  76382. },
  76383. getTableType: function getTableType(currentView) {
  76384. return currentView.match(/^time/) ? 'time-picker' : String(currentView) + '-table';
  76385. },
  76386. changeMonth: function changeMonth(dir) {
  76387. this.panelDate = (0, _util.siblingMonth)(this.panelDate, dir);
  76388. },
  76389. handlePreSelection: function handlePreSelection(value) {
  76390. this.panelDate = value;
  76391. if (this.pickerTable === 'year-table') this.pickerTable = 'month-table';else this.pickerTable = this.getTableType(this.currentView);
  76392. },
  76393. handlePick: function handlePick(value, type) {
  76394. var selectionMode = this.selectionMode,
  76395. panelDate = this.panelDate;
  76396. if (selectionMode === 'year') value = new Date(value.getFullYear(), 0, 1);else if (selectionMode === 'month') value = new Date(panelDate.getFullYear(), value.getMonth(), 1);else value = new Date(value);
  76397. this.dates = [value];
  76398. this.$emit('on-pick', value, false, type || selectionMode);
  76399. }
  76400. }
  76401. };
  76402. /***/ }),
  76403. /* 160 */
  76404. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76405. "use strict";
  76406. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  76407. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__ = __webpack_require__(161);
  76408. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__);
  76409. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  76410. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__ = __webpack_require__(414);
  76411. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__);
  76412. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  76413. /* script */
  76414. /* template */
  76415. /* template functional */
  76416. var __vue_template_functional__ = false
  76417. /* styles */
  76418. var __vue_styles__ = null
  76419. /* scopeId */
  76420. var __vue_scopeId__ = null
  76421. /* moduleIdentifier (server only) */
  76422. var __vue_module_identifier__ = null
  76423. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  76424. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_table_vue___default.a,
  76425. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__["render"],
  76426. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0fbb8b99_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_table_vue__["staticRenderFns"],
  76427. __vue_template_functional__,
  76428. __vue_styles__,
  76429. __vue_scopeId__,
  76430. __vue_module_identifier__
  76431. )
  76432. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  76433. /***/ }),
  76434. /* 161 */
  76435. /***/ (function(module, exports, __webpack_require__) {
  76436. "use strict";
  76437. Object.defineProperty(exports, "__esModule", {
  76438. value: true
  76439. });
  76440. var _extends2 = __webpack_require__(32);
  76441. var _extends3 = _interopRequireDefault(_extends2);
  76442. var _slicedToArray2 = __webpack_require__(26);
  76443. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  76444. var _newArrowCheck2 = __webpack_require__(1);
  76445. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76446. var _defineProperty2 = __webpack_require__(2);
  76447. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  76448. var _util = __webpack_require__(20);
  76449. var _locale = __webpack_require__(6);
  76450. var _locale2 = _interopRequireDefault(_locale);
  76451. var _jsCalendar = __webpack_require__(410);
  76452. var _jsCalendar2 = _interopRequireDefault(_jsCalendar);
  76453. var _mixin = __webpack_require__(85);
  76454. var _mixin2 = _interopRequireDefault(_mixin);
  76455. var _prefixCls = __webpack_require__(86);
  76456. var _prefixCls2 = _interopRequireDefault(_prefixCls);
  76457. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76458. exports.default = {
  76459. mixins: [_locale2.default, _mixin2.default],
  76460. props: {
  76461. showWeekNumbers: {
  76462. type: Boolean,
  76463. default: false
  76464. }
  76465. },
  76466. data: function data() {
  76467. return {
  76468. prefixCls: _prefixCls2.default
  76469. };
  76470. },
  76471. computed: {
  76472. classes: function classes() {
  76473. return ['' + String(_prefixCls2.default), (0, _defineProperty3.default)({}, String(_prefixCls2.default) + '-show-week-numbers', this.showWeekNumbers)];
  76474. },
  76475. calendar: function calendar() {
  76476. var weekStartDay = Number(this.t('i.datepicker.weekStartDay'));
  76477. return new _jsCalendar2.default.Generator({ onlyDays: !this.showWeekNumbers, weekStart: weekStartDay });
  76478. },
  76479. headerDays: function headerDays() {
  76480. var _this = this;
  76481. var weekStartDay = Number(this.t('i.datepicker.weekStartDay'));
  76482. var translatedDays = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'].map(function (item) {
  76483. (0, _newArrowCheck3.default)(this, _this);
  76484. return this.t('i.datepicker.weeks.' + item);
  76485. }.bind(this));
  76486. var weekDays = translatedDays.splice(weekStartDay, 7 - weekStartDay).concat(translatedDays.splice(0, weekStartDay));
  76487. return this.showWeekNumbers ? [''].concat(weekDays) : weekDays;
  76488. },
  76489. cells: function cells() {
  76490. var _this2 = this;
  76491. var tableYear = this.tableDate.getFullYear();
  76492. var tableMonth = this.tableDate.getMonth();
  76493. var today = (0, _util.clearHours)(new Date());
  76494. var selectedDays = this.dates.filter(Boolean).map(_util.clearHours);
  76495. var _dates$map = this.dates.map(_util.clearHours),
  76496. _dates$map2 = (0, _slicedToArray3.default)(_dates$map, 2),
  76497. minDay = _dates$map2[0],
  76498. maxDay = _dates$map2[1];
  76499. var rangeStart = this.rangeState.from && (0, _util.clearHours)(this.rangeState.from);
  76500. var rangeEnd = this.rangeState.to && (0, _util.clearHours)(this.rangeState.to);
  76501. var isRange = this.selectionMode === 'range';
  76502. var disabledTestFn = typeof this.disabledDate === 'function' && this.disabledDate;
  76503. return this.calendar(tableYear, tableMonth, function (cell) {
  76504. (0, _newArrowCheck3.default)(this, _this2);
  76505. if (cell.date instanceof Date) cell.date.setTime(cell.date.getTime() + cell.date.getTimezoneOffset() * 60000 + 480 * 60 * 1000);
  76506. var time = cell.date && (0, _util.clearHours)(cell.date);
  76507. var dateIsInCurrentMonth = cell.date && tableMonth === cell.date.getMonth();
  76508. return (0, _extends3.default)({}, cell, {
  76509. type: time === today ? 'today' : cell.type,
  76510. selected: dateIsInCurrentMonth && selectedDays.includes(time),
  76511. disabled: cell.date && disabledTestFn && disabledTestFn(new Date(time)),
  76512. range: dateIsInCurrentMonth && isRange && (0, _util.isInRange)(time, rangeStart, rangeEnd),
  76513. start: dateIsInCurrentMonth && isRange && time === minDay,
  76514. end: dateIsInCurrentMonth && isRange && time === maxDay
  76515. });
  76516. }.bind(this)).cells.slice(this.showWeekNumbers ? 8 : 0);
  76517. }
  76518. },
  76519. methods: {
  76520. getCellCls: function getCellCls(cell) {
  76521. var _ref2;
  76522. return [String(_prefixCls2.default) + '-cell', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-selected', cell.selected || cell.start || cell.end), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-today', cell.type === 'today'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-prev-month', cell.type === 'prevMonth'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-next-month', cell.type === 'nextMonth'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-week-label', cell.type === 'weekLabel'), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), (0, _defineProperty3.default)(_ref2, String(_prefixCls2.default) + '-focused', (0, _util.clearHours)(cell.date) === (0, _util.clearHours)(this.focusedDate)), _ref2)];
  76523. }
  76524. }
  76525. };
  76526. /***/ }),
  76527. /* 162 */
  76528. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76529. "use strict";
  76530. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  76531. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__ = __webpack_require__(163);
  76532. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__);
  76533. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  76534. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__ = __webpack_require__(415);
  76535. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__);
  76536. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  76537. /* script */
  76538. /* template */
  76539. /* template functional */
  76540. var __vue_template_functional__ = false
  76541. /* styles */
  76542. var __vue_styles__ = null
  76543. /* scopeId */
  76544. var __vue_scopeId__ = null
  76545. /* moduleIdentifier (server only) */
  76546. var __vue_module_identifier__ = null
  76547. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  76548. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_year_table_vue___default.a,
  76549. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__["render"],
  76550. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2bfabbb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_year_table_vue__["staticRenderFns"],
  76551. __vue_template_functional__,
  76552. __vue_styles__,
  76553. __vue_scopeId__,
  76554. __vue_module_identifier__
  76555. )
  76556. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  76557. /***/ }),
  76558. /* 163 */
  76559. /***/ (function(module, exports, __webpack_require__) {
  76560. "use strict";
  76561. Object.defineProperty(exports, "__esModule", {
  76562. value: true
  76563. });
  76564. var _defineProperty2 = __webpack_require__(2);
  76565. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  76566. var _newArrowCheck2 = __webpack_require__(1);
  76567. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76568. var _util = __webpack_require__(20);
  76569. var _assist = __webpack_require__(3);
  76570. var _mixin = __webpack_require__(85);
  76571. var _mixin2 = _interopRequireDefault(_mixin);
  76572. var _prefixCls = __webpack_require__(86);
  76573. var _prefixCls2 = _interopRequireDefault(_prefixCls);
  76574. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76575. exports.default = {
  76576. mixins: [_mixin2.default],
  76577. props: {},
  76578. computed: {
  76579. classes: function classes() {
  76580. return ['' + String(_prefixCls2.default), String(_prefixCls2.default) + '-year'];
  76581. },
  76582. startYear: function startYear() {
  76583. return Math.floor(this.tableDate.getFullYear() / 10) * 10;
  76584. },
  76585. cells: function cells() {
  76586. var _this = this;
  76587. var cells = [];
  76588. var cell_tmpl = {
  76589. text: '',
  76590. selected: false,
  76591. disabled: false
  76592. };
  76593. var selectedDays = this.dates.filter(Boolean).map(function (date) {
  76594. (0, _newArrowCheck3.default)(this, _this);
  76595. return (0, _util.clearHours)(new Date(date.getFullYear(), 0, 1));
  76596. }.bind(this));
  76597. var focusedDate = (0, _util.clearHours)(new Date(this.focusedDate.getFullYear(), 0, 1));
  76598. for (var i = 0; i < 10; i++) {
  76599. var cell = (0, _assist.deepCopy)(cell_tmpl);
  76600. cell.date = new Date(this.startYear + i, 0, 1);
  76601. cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'year';
  76602. var day = (0, _util.clearHours)(cell.date);
  76603. cell.selected = selectedDays.includes(day);
  76604. cell.focused = day === focusedDate;
  76605. cells.push(cell);
  76606. }
  76607. return cells;
  76608. }
  76609. },
  76610. methods: {
  76611. getCellCls: function getCellCls(cell) {
  76612. var _ref;
  76613. return [String(_prefixCls2.default) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), _ref)];
  76614. }
  76615. }
  76616. };
  76617. /***/ }),
  76618. /* 164 */
  76619. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76620. "use strict";
  76621. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  76622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__ = __webpack_require__(165);
  76623. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__);
  76624. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  76625. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__ = __webpack_require__(416);
  76626. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__);
  76627. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  76628. /* script */
  76629. /* template */
  76630. /* template functional */
  76631. var __vue_template_functional__ = false
  76632. /* styles */
  76633. var __vue_styles__ = null
  76634. /* scopeId */
  76635. var __vue_scopeId__ = null
  76636. /* moduleIdentifier (server only) */
  76637. var __vue_module_identifier__ = null
  76638. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  76639. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_month_table_vue___default.a,
  76640. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__["render"],
  76641. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ad59b08_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_month_table_vue__["staticRenderFns"],
  76642. __vue_template_functional__,
  76643. __vue_styles__,
  76644. __vue_scopeId__,
  76645. __vue_module_identifier__
  76646. )
  76647. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  76648. /***/ }),
  76649. /* 165 */
  76650. /***/ (function(module, exports, __webpack_require__) {
  76651. "use strict";
  76652. Object.defineProperty(exports, "__esModule", {
  76653. value: true
  76654. });
  76655. var _defineProperty2 = __webpack_require__(2);
  76656. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  76657. var _newArrowCheck2 = __webpack_require__(1);
  76658. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76659. var _util = __webpack_require__(20);
  76660. var _assist = __webpack_require__(3);
  76661. var _locale = __webpack_require__(6);
  76662. var _locale2 = _interopRequireDefault(_locale);
  76663. var _mixin = __webpack_require__(85);
  76664. var _mixin2 = _interopRequireDefault(_mixin);
  76665. var _prefixCls = __webpack_require__(86);
  76666. var _prefixCls2 = _interopRequireDefault(_prefixCls);
  76667. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76668. exports.default = {
  76669. mixins: [_locale2.default, _mixin2.default],
  76670. props: {},
  76671. computed: {
  76672. classes: function classes() {
  76673. return ['' + String(_prefixCls2.default), String(_prefixCls2.default) + '-month'];
  76674. },
  76675. cells: function cells() {
  76676. var _this = this;
  76677. var cells = [];
  76678. var cell_tmpl = {
  76679. text: '',
  76680. selected: false,
  76681. disabled: false
  76682. };
  76683. var tableYear = this.tableDate.getFullYear();
  76684. var selectedDays = this.dates.filter(Boolean).map(function (date) {
  76685. (0, _newArrowCheck3.default)(this, _this);
  76686. return (0, _util.clearHours)(new Date(date.getFullYear(), date.getMonth(), 1));
  76687. }.bind(this));
  76688. var focusedDate = (0, _util.clearHours)(new Date(this.focusedDate.getFullYear(), this.focusedDate.getMonth(), 1));
  76689. for (var i = 0; i < 12; i++) {
  76690. var cell = (0, _assist.deepCopy)(cell_tmpl);
  76691. cell.date = new Date(tableYear, i, 1);
  76692. cell.text = this.tCell(i + 1);
  76693. var day = (0, _util.clearHours)(cell.date);
  76694. cell.disabled = typeof this.disabledDate === 'function' && this.disabledDate(cell.date) && this.selectionMode === 'month';
  76695. cell.selected = selectedDays.includes(day);
  76696. cell.focused = day === focusedDate;
  76697. cells.push(cell);
  76698. }
  76699. return cells;
  76700. }
  76701. },
  76702. methods: {
  76703. getCellCls: function getCellCls(cell) {
  76704. var _ref;
  76705. return [String(_prefixCls2.default) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-disabled', cell.disabled), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref, String(_prefixCls2.default) + '-cell-range', cell.range && !cell.start && !cell.end), _ref)];
  76706. },
  76707. tCell: function tCell(nr) {
  76708. return this.t('i.datepicker.months.m' + String(nr));
  76709. }
  76710. }
  76711. };
  76712. /***/ }),
  76713. /* 166 */
  76714. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76715. "use strict";
  76716. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  76717. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(167);
  76718. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__);
  76719. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  76720. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(419);
  76721. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__);
  76722. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  76723. /* script */
  76724. /* template */
  76725. /* template functional */
  76726. var __vue_template_functional__ = false
  76727. /* styles */
  76728. var __vue_styles__ = null
  76729. /* scopeId */
  76730. var __vue_scopeId__ = null
  76731. /* moduleIdentifier (server only) */
  76732. var __vue_module_identifier__ = null
  76733. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  76734. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a,
  76735. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["render"],
  76736. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6e874f24_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["staticRenderFns"],
  76737. __vue_template_functional__,
  76738. __vue_styles__,
  76739. __vue_scopeId__,
  76740. __vue_module_identifier__
  76741. )
  76742. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  76743. /***/ }),
  76744. /* 167 */
  76745. /***/ (function(module, exports, __webpack_require__) {
  76746. "use strict";
  76747. Object.defineProperty(exports, "__esModule", {
  76748. value: true
  76749. });
  76750. var _keys = __webpack_require__(21);
  76751. var _keys2 = _interopRequireDefault(_keys);
  76752. var _toConsumableArray2 = __webpack_require__(17);
  76753. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  76754. var _newArrowCheck2 = __webpack_require__(1);
  76755. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76756. var _timeSpinner = __webpack_require__(168);
  76757. var _timeSpinner2 = _interopRequireDefault(_timeSpinner);
  76758. var _confirm = __webpack_require__(59);
  76759. var _confirm2 = _interopRequireDefault(_confirm);
  76760. var _timeMixins = __webpack_require__(58);
  76761. var _timeMixins2 = _interopRequireDefault(_timeMixins);
  76762. var _panelMixin = __webpack_require__(60);
  76763. var _panelMixin2 = _interopRequireDefault(_panelMixin);
  76764. var _locale = __webpack_require__(6);
  76765. var _locale2 = _interopRequireDefault(_locale);
  76766. var _util = __webpack_require__(20);
  76767. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76768. var prefixCls = 'ivu-picker-panel';
  76769. var timePrefixCls = 'ivu-time-picker';
  76770. var capitalize = function (str) {
  76771. (0, _newArrowCheck3.default)(undefined, undefined);
  76772. return str[0].toUpperCase() + str.slice(1);
  76773. }.bind(undefined);
  76774. var mergeDateHMS = function (date, hours, minutes, seconds) {
  76775. (0, _newArrowCheck3.default)(undefined, undefined);
  76776. var newDate = new Date(date.getTime());
  76777. newDate.setHours(hours);
  76778. newDate.setMinutes(minutes);
  76779. newDate.setSeconds(seconds);
  76780. return newDate;
  76781. }.bind(undefined);
  76782. var unique = function (el, i, arr) {
  76783. (0, _newArrowCheck3.default)(undefined, undefined);
  76784. return arr.indexOf(el) === i;
  76785. }.bind(undefined);
  76786. var returnFalse = function () {
  76787. (0, _newArrowCheck3.default)(undefined, undefined);
  76788. return false;
  76789. }.bind(undefined);
  76790. exports.default = {
  76791. name: 'TimePickerPanel',
  76792. mixins: [_panelMixin2.default, _locale2.default, _timeMixins2.default],
  76793. components: { TimeSpinner: _timeSpinner2.default, Confirm: _confirm2.default },
  76794. props: {
  76795. disabledDate: {
  76796. type: Function,
  76797. default: returnFalse
  76798. },
  76799. steps: {
  76800. type: Array,
  76801. default: function _default() {
  76802. (0, _newArrowCheck3.default)(undefined, undefined);
  76803. return [];
  76804. }.bind(undefined)
  76805. },
  76806. format: {
  76807. type: String,
  76808. default: 'HH:mm:ss'
  76809. },
  76810. value: {
  76811. type: Array,
  76812. required: true
  76813. }
  76814. },
  76815. data: function data() {
  76816. return {
  76817. prefixCls: prefixCls,
  76818. timePrefixCls: timePrefixCls,
  76819. date: this.value[0] || (0, _util.initTimeDate)(),
  76820. showDate: false
  76821. };
  76822. },
  76823. computed: {
  76824. showSeconds: function showSeconds() {
  76825. return !!(this.format || '').match(/ss/);
  76826. },
  76827. visibleDate: function visibleDate() {
  76828. var date = this.date;
  76829. var month = date.getMonth() + 1;
  76830. var tYear = this.t('i.datepicker.year');
  76831. var tMonth = this.t('i.datepicker.month' + String(month));
  76832. return '' + String(date.getFullYear()) + String(tYear) + ' ' + String(tMonth);
  76833. },
  76834. timeSlots: function timeSlots() {
  76835. var _this = this;
  76836. if (!this.value[0]) return [];
  76837. return ['getHours', 'getMinutes', 'getSeconds'].map(function (slot) {
  76838. (0, _newArrowCheck3.default)(this, _this);
  76839. return this.date[slot]();
  76840. }.bind(this));
  76841. },
  76842. disabledHMS: function disabledHMS() {
  76843. var _this2 = this;
  76844. var disabledTypes = ['disabledHours', 'disabledMinutes', 'disabledSeconds'];
  76845. if (this.disabledDate === returnFalse || !this.value[0]) {
  76846. var disabled = disabledTypes.reduce(function (obj, type) {
  76847. (0, _newArrowCheck3.default)(this, _this2);
  76848. return obj[type] = this[type], obj;
  76849. }.bind(this), {});
  76850. return disabled;
  76851. } else {
  76852. var slots = [24, 60, 60];
  76853. var _disabled = ['Hours', 'Minutes', 'Seconds'].map(function (type) {
  76854. (0, _newArrowCheck3.default)(this, _this2);
  76855. return this['disabled' + String(type)];
  76856. }.bind(this));
  76857. var disabledHMS = _disabled.map(function (preDisabled, j) {
  76858. (0, _newArrowCheck3.default)(this, _this2);
  76859. var slot = slots[j];
  76860. var toDisable = preDisabled;
  76861. var _loop = function _loop(i) {
  76862. var hms = _this2.timeSlots.map(function (slot, x) {
  76863. (0, _newArrowCheck3.default)(this, _this2);
  76864. return x === j ? i : slot;
  76865. }.bind(_this2));
  76866. var testDateTime = mergeDateHMS.apply(undefined, [_this2.date].concat((0, _toConsumableArray3.default)(hms)));
  76867. if (_this2.disabledDate(testDateTime, true)) toDisable.push(i);
  76868. };
  76869. for (var i = 0; i < slot; i += this.steps[j] || 1) {
  76870. _loop(i);
  76871. }
  76872. return toDisable.filter(unique);
  76873. }.bind(this));
  76874. return disabledTypes.reduce(function (obj, type, i) {
  76875. (0, _newArrowCheck3.default)(this, _this2);
  76876. return obj[type] = disabledHMS[i], obj;
  76877. }.bind(this), {});
  76878. }
  76879. }
  76880. },
  76881. watch: {
  76882. value: function value(dates) {
  76883. var newVal = dates[0] || (0, _util.initTimeDate)();
  76884. newVal = new Date(newVal);
  76885. this.date = newVal;
  76886. }
  76887. },
  76888. methods: {
  76889. handleChange: function handleChange(date) {
  76890. var _this3 = this;
  76891. var emit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  76892. var newDate = new Date(this.date);
  76893. (0, _keys2.default)(date).forEach(function (type) {
  76894. (0, _newArrowCheck3.default)(this, _this3);
  76895. return newDate['set' + String(capitalize(type))](date[type]);
  76896. }.bind(this));
  76897. if (emit) this.$emit('on-pick', newDate, 'time');
  76898. }
  76899. },
  76900. mounted: function mounted() {
  76901. if (this.$parent && this.$parent.$options.name === 'DatePicker') this.showDate = true;
  76902. }
  76903. };
  76904. /***/ }),
  76905. /* 168 */
  76906. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  76907. "use strict";
  76908. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  76909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__ = __webpack_require__(169);
  76910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__);
  76911. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  76912. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__ = __webpack_require__(417);
  76913. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__);
  76914. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  76915. /* script */
  76916. /* template */
  76917. /* template functional */
  76918. var __vue_template_functional__ = false
  76919. /* styles */
  76920. var __vue_styles__ = null
  76921. /* scopeId */
  76922. var __vue_scopeId__ = null
  76923. /* moduleIdentifier (server only) */
  76924. var __vue_module_identifier__ = null
  76925. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  76926. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_spinner_vue___default.a,
  76927. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["render"],
  76928. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_496899f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_spinner_vue__["staticRenderFns"],
  76929. __vue_template_functional__,
  76930. __vue_styles__,
  76931. __vue_scopeId__,
  76932. __vue_module_identifier__
  76933. )
  76934. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  76935. /***/ }),
  76936. /* 169 */
  76937. /***/ (function(module, exports, __webpack_require__) {
  76938. "use strict";
  76939. Object.defineProperty(exports, "__esModule", {
  76940. value: true
  76941. });
  76942. var _keys = __webpack_require__(21);
  76943. var _keys2 = _interopRequireDefault(_keys);
  76944. var _extends3 = __webpack_require__(32);
  76945. var _extends4 = _interopRequireDefault(_extends3);
  76946. var _defineProperty2 = __webpack_require__(2);
  76947. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  76948. var _newArrowCheck2 = __webpack_require__(1);
  76949. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  76950. var _timeMixins = __webpack_require__(58);
  76951. var _timeMixins2 = _interopRequireDefault(_timeMixins);
  76952. var _assist = __webpack_require__(3);
  76953. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  76954. var prefixCls = 'ivu-time-picker-cells';
  76955. var timeParts = ['hours', 'minutes', 'seconds'];
  76956. exports.default = {
  76957. name: 'TimeSpinner',
  76958. mixins: [_timeMixins2.default],
  76959. props: {
  76960. hours: {
  76961. type: [Number, String],
  76962. default: NaN
  76963. },
  76964. minutes: {
  76965. type: [Number, String],
  76966. default: NaN
  76967. },
  76968. seconds: {
  76969. type: [Number, String],
  76970. default: NaN
  76971. },
  76972. showSeconds: {
  76973. type: Boolean,
  76974. default: true
  76975. },
  76976. steps: {
  76977. type: Array,
  76978. default: function _default() {
  76979. (0, _newArrowCheck3.default)(undefined, undefined);
  76980. return [];
  76981. }.bind(undefined)
  76982. }
  76983. },
  76984. data: function data() {
  76985. var _this = this;
  76986. return {
  76987. spinerSteps: [1, 1, 1].map(function (one, i) {
  76988. (0, _newArrowCheck3.default)(this, _this);
  76989. return Math.abs(this.steps[i]) || one;
  76990. }.bind(this)),
  76991. prefixCls: prefixCls,
  76992. compiled: false,
  76993. focusedColumn: -1,
  76994. focusedTime: [0, 0, 0] };
  76995. },
  76996. computed: {
  76997. classes: function classes() {
  76998. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-with-seconds', this.showSeconds)];
  76999. },
  77000. hoursList: function hoursList() {
  77001. var hours = [];
  77002. var step = this.spinerSteps[0];
  77003. var focusedHour = this.focusedColumn === 0 && this.focusedTime[0];
  77004. var hour_tmpl = {
  77005. text: 0,
  77006. selected: false,
  77007. disabled: false,
  77008. hide: false
  77009. };
  77010. for (var i = 0; i < 24; i += step) {
  77011. var hour = (0, _assist.deepCopy)(hour_tmpl);
  77012. hour.text = i;
  77013. hour.focused = i === focusedHour;
  77014. if (this.disabledHours.length && this.disabledHours.indexOf(i) > -1) {
  77015. hour.disabled = true;
  77016. if (this.hideDisabledOptions) hour.hide = true;
  77017. }
  77018. if (this.hours === i) hour.selected = true;
  77019. hours.push(hour);
  77020. }
  77021. return hours;
  77022. },
  77023. minutesList: function minutesList() {
  77024. var minutes = [];
  77025. var step = this.spinerSteps[1];
  77026. var focusedMinute = this.focusedColumn === 1 && this.focusedTime[1];
  77027. var minute_tmpl = {
  77028. text: 0,
  77029. selected: false,
  77030. disabled: false,
  77031. hide: false
  77032. };
  77033. for (var i = 0; i < 60; i += step) {
  77034. var minute = (0, _assist.deepCopy)(minute_tmpl);
  77035. minute.text = i;
  77036. minute.focused = i === focusedMinute;
  77037. if (this.disabledMinutes.length && this.disabledMinutes.indexOf(i) > -1) {
  77038. minute.disabled = true;
  77039. if (this.hideDisabledOptions) minute.hide = true;
  77040. }
  77041. if (this.minutes === i) minute.selected = true;
  77042. minutes.push(minute);
  77043. }
  77044. return minutes;
  77045. },
  77046. secondsList: function secondsList() {
  77047. var seconds = [];
  77048. var step = this.spinerSteps[2];
  77049. var focusedMinute = this.focusedColumn === 2 && this.focusedTime[2];
  77050. var second_tmpl = {
  77051. text: 0,
  77052. selected: false,
  77053. disabled: false,
  77054. hide: false
  77055. };
  77056. for (var i = 0; i < 60; i += step) {
  77057. var second = (0, _assist.deepCopy)(second_tmpl);
  77058. second.text = i;
  77059. second.focused = i === focusedMinute;
  77060. if (this.disabledSeconds.length && this.disabledSeconds.indexOf(i) > -1) {
  77061. second.disabled = true;
  77062. if (this.hideDisabledOptions) second.hide = true;
  77063. }
  77064. if (this.seconds === i) second.selected = true;
  77065. seconds.push(second);
  77066. }
  77067. return seconds;
  77068. }
  77069. },
  77070. methods: {
  77071. getCellCls: function getCellCls(cell) {
  77072. var _ref2;
  77073. return [prefixCls + '-cell', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-selected', cell.selected), (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-focused', cell.focused), (0, _defineProperty3.default)(_ref2, prefixCls + '-cell-disabled', cell.disabled), _ref2)];
  77074. },
  77075. chooseValue: function chooseValue(values) {
  77076. var _this2 = this;
  77077. var changes = timeParts.reduce(function (obj, part, i) {
  77078. (0, _newArrowCheck3.default)(this, _this2);
  77079. var value = values[i];
  77080. if (this[part] === value) return obj;
  77081. return (0, _extends4.default)({}, obj, (0, _defineProperty3.default)({}, part, value));
  77082. }.bind(this), {});
  77083. if ((0, _keys2.default)(changes).length > 0) {
  77084. this.emitChange(changes);
  77085. }
  77086. },
  77087. handleClick: function handleClick(type, cell) {
  77088. if (cell.disabled) return;
  77089. var data = (0, _defineProperty3.default)({}, type, cell.text);
  77090. this.emitChange(data);
  77091. },
  77092. emitChange: function emitChange(changes) {
  77093. this.$emit('on-change', changes);
  77094. this.$emit('on-pick-click');
  77095. },
  77096. scroll: function scroll(type, index) {
  77097. var from = this.$refs[type].scrollTop;
  77098. var to = 24 * this.getScrollIndex(type, index);
  77099. (0, _assist.scrollTop)(this.$refs[type], from, to, 500);
  77100. },
  77101. getScrollIndex: function getScrollIndex(type, index) {
  77102. var _this3 = this;
  77103. var Type = (0, _assist.firstUpperCase)(type);
  77104. var disabled = this['disabled' + String(Type)];
  77105. if (disabled.length && this.hideDisabledOptions) {
  77106. var _count = 0;
  77107. disabled.forEach(function (item) {
  77108. (0, _newArrowCheck3.default)(this, _this3);
  77109. return item <= index ? _count++ : '';
  77110. }.bind(this));
  77111. index -= _count;
  77112. }
  77113. return index;
  77114. },
  77115. updateScroll: function updateScroll() {
  77116. var _this4 = this;
  77117. this.$nextTick(function () {
  77118. (0, _newArrowCheck3.default)(this, _this4);
  77119. timeParts.forEach(function (type) {
  77120. (0, _newArrowCheck3.default)(this, _this4);
  77121. this.$refs[type].scrollTop = 24 * this[String(type) + 'List'].findIndex(function (obj) {
  77122. (0, _newArrowCheck3.default)(this, _this4);
  77123. return obj.text == this[type];
  77124. }.bind(this));
  77125. }.bind(this));
  77126. }.bind(this));
  77127. },
  77128. formatTime: function formatTime(text) {
  77129. return text < 10 ? '0' + text : text;
  77130. },
  77131. updateFocusedTime: function updateFocusedTime(col, time) {
  77132. this.focusedColumn = col;
  77133. this.focusedTime = time.slice();
  77134. }
  77135. },
  77136. watch: {
  77137. hours: function hours(val) {
  77138. var _this5 = this;
  77139. if (!this.compiled) return;
  77140. this.scroll('hours', this.hoursList.findIndex(function (obj) {
  77141. (0, _newArrowCheck3.default)(this, _this5);
  77142. return obj.text == val;
  77143. }.bind(this)));
  77144. },
  77145. minutes: function minutes(val) {
  77146. var _this6 = this;
  77147. if (!this.compiled) return;
  77148. this.scroll('minutes', this.minutesList.findIndex(function (obj) {
  77149. (0, _newArrowCheck3.default)(this, _this6);
  77150. return obj.text == val;
  77151. }.bind(this)));
  77152. },
  77153. seconds: function seconds(val) {
  77154. var _this7 = this;
  77155. if (!this.compiled) return;
  77156. this.scroll('seconds', this.secondsList.findIndex(function (obj) {
  77157. (0, _newArrowCheck3.default)(this, _this7);
  77158. return obj.text == val;
  77159. }.bind(this)));
  77160. },
  77161. focusedTime: function focusedTime(updated, old) {
  77162. var _this8 = this;
  77163. timeParts.forEach(function (part, i) {
  77164. (0, _newArrowCheck3.default)(this, _this8);
  77165. if (updated[i] === old[i] || typeof updated[i] === 'undefined') return;
  77166. var valueIndex = this[String(part) + 'List'].findIndex(function (obj) {
  77167. (0, _newArrowCheck3.default)(this, _this8);
  77168. return obj.text === updated[i];
  77169. }.bind(this));
  77170. this.scroll(part, valueIndex);
  77171. }.bind(this));
  77172. }
  77173. },
  77174. mounted: function mounted() {
  77175. var _this9 = this;
  77176. this.$nextTick(function () {
  77177. (0, _newArrowCheck3.default)(this, _this9);
  77178. return this.compiled = true;
  77179. }.bind(this));
  77180. }
  77181. };
  77182. /***/ }),
  77183. /* 170 */
  77184. /***/ (function(module, exports, __webpack_require__) {
  77185. "use strict";
  77186. Object.defineProperty(exports, "__esModule", {
  77187. value: true
  77188. });
  77189. var _toConsumableArray2 = __webpack_require__(17);
  77190. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  77191. var _newArrowCheck2 = __webpack_require__(1);
  77192. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  77193. var _button = __webpack_require__(28);
  77194. var _button2 = _interopRequireDefault(_button);
  77195. var _locale = __webpack_require__(6);
  77196. var _locale2 = _interopRequireDefault(_locale);
  77197. var _emitter = __webpack_require__(4);
  77198. var _emitter2 = _interopRequireDefault(_emitter);
  77199. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77200. var prefixCls = 'ivu-picker';
  77201. exports.default = {
  77202. mixins: [_locale2.default, _emitter2.default],
  77203. components: { iButton: _button2.default },
  77204. props: {
  77205. showTime: false,
  77206. isTime: false,
  77207. timeDisabled: false
  77208. },
  77209. data: function data() {
  77210. return {
  77211. prefixCls: prefixCls
  77212. };
  77213. },
  77214. computed: {
  77215. timeClasses: function timeClasses() {
  77216. return prefixCls + '-confirm-time';
  77217. },
  77218. labels: function labels() {
  77219. var _this = this;
  77220. var labels = ['time', 'clear', 'ok'];
  77221. var values = [this.isTime ? 'selectDate' : 'selectTime', 'clear', 'ok'];
  77222. return labels.reduce(function (obj, key, i) {
  77223. (0, _newArrowCheck3.default)(this, _this);
  77224. obj[key] = this.t('i.datepicker.' + values[i]);
  77225. return obj;
  77226. }.bind(this), {});
  77227. }
  77228. },
  77229. methods: {
  77230. handleClear: function handleClear() {
  77231. this.$emit('on-pick-clear');
  77232. },
  77233. handleSuccess: function handleSuccess() {
  77234. this.$emit('on-pick-success');
  77235. },
  77236. handleToggleTime: function handleToggleTime() {
  77237. if (this.timeDisabled) return;
  77238. this.$emit('on-pick-toggle-time');
  77239. this.dispatch('CalendarPicker', 'focus-input');
  77240. this.dispatch('CalendarPicker', 'update-popper');
  77241. },
  77242. handleTab: function handleTab(e) {
  77243. var tabbables = [].concat((0, _toConsumableArray3.default)(this.$el.children));
  77244. var expectedFocus = tabbables[e.shiftKey ? 'shift' : 'pop']();
  77245. if (document.activeElement === expectedFocus) {
  77246. e.preventDefault();
  77247. e.stopPropagation();
  77248. this.dispatch('CalendarPicker', 'focus-input');
  77249. }
  77250. }
  77251. }
  77252. };
  77253. /***/ }),
  77254. /* 171 */
  77255. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77256. "use strict";
  77257. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  77258. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__ = __webpack_require__(172);
  77259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__);
  77260. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  77261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__ = __webpack_require__(420);
  77262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__);
  77263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  77264. /* script */
  77265. /* template */
  77266. /* template functional */
  77267. var __vue_template_functional__ = false
  77268. /* styles */
  77269. var __vue_styles__ = null
  77270. /* scopeId */
  77271. var __vue_scopeId__ = null
  77272. /* moduleIdentifier (server only) */
  77273. var __vue_module_identifier__ = null
  77274. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  77275. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_panel_label_vue___default.a,
  77276. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__["render"],
  77277. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a6bf5e7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_panel_label_vue__["staticRenderFns"],
  77278. __vue_template_functional__,
  77279. __vue_styles__,
  77280. __vue_scopeId__,
  77281. __vue_module_identifier__
  77282. )
  77283. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  77284. /***/ }),
  77285. /* 172 */
  77286. /***/ (function(module, exports, __webpack_require__) {
  77287. "use strict";
  77288. Object.defineProperty(exports, "__esModule", {
  77289. value: true
  77290. });
  77291. exports.default = {
  77292. props: {
  77293. datePanelLabel: Object,
  77294. currentView: String,
  77295. datePrefixCls: String
  77296. }
  77297. };
  77298. /***/ }),
  77299. /* 173 */
  77300. /***/ (function(module, exports, __webpack_require__) {
  77301. "use strict";
  77302. Object.defineProperty(exports, "__esModule", {
  77303. value: true
  77304. });
  77305. var _newArrowCheck2 = __webpack_require__(1);
  77306. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  77307. var _assist = __webpack_require__(3);
  77308. var _util = __webpack_require__(20);
  77309. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77310. exports.default = {
  77311. props: {
  77312. showTime: {
  77313. type: Boolean,
  77314. default: false
  77315. },
  77316. format: {
  77317. type: String,
  77318. default: 'yyyy-MM-dd'
  77319. },
  77320. selectionMode: {
  77321. type: String,
  77322. validator: function validator(value) {
  77323. return (0, _assist.oneOf)(value, ['year', 'month', 'date', 'time']);
  77324. },
  77325. default: 'date'
  77326. },
  77327. shortcuts: {
  77328. type: Array,
  77329. default: function _default() {
  77330. (0, _newArrowCheck3.default)(undefined, undefined);
  77331. return [];
  77332. }.bind(undefined)
  77333. },
  77334. disabledDate: {
  77335. type: Function,
  77336. default: function _default() {
  77337. (0, _newArrowCheck3.default)(undefined, undefined);
  77338. return false;
  77339. }.bind(undefined)
  77340. },
  77341. value: {
  77342. type: Array,
  77343. default: function _default() {
  77344. (0, _newArrowCheck3.default)(undefined, undefined);
  77345. return [(0, _util.initTimeDate)(), (0, _util.initTimeDate)()];
  77346. }.bind(undefined)
  77347. },
  77348. timePickerOptions: {
  77349. default: function _default() {
  77350. (0, _newArrowCheck3.default)(undefined, undefined);
  77351. return {};
  77352. }.bind(undefined),
  77353. type: Object
  77354. },
  77355. showWeekNumbers: {
  77356. type: Boolean,
  77357. default: false
  77358. },
  77359. startDate: {
  77360. type: Date
  77361. },
  77362. pickerType: {
  77363. type: String,
  77364. require: true
  77365. },
  77366. focusedDate: {
  77367. type: Date,
  77368. required: true
  77369. }
  77370. },
  77371. computed: {
  77372. isTime: function isTime() {
  77373. return this.currentView === 'time';
  77374. }
  77375. },
  77376. methods: {
  77377. handleToggleTime: function handleToggleTime() {
  77378. this.currentView = this.currentView === 'time' ? 'date' : 'time';
  77379. }
  77380. }
  77381. };
  77382. /***/ }),
  77383. /* 174 */
  77384. /***/ (function(module, exports, __webpack_require__) {
  77385. "use strict";
  77386. Object.defineProperty(exports, "__esModule", {
  77387. value: true
  77388. });
  77389. var _defineProperty2 = __webpack_require__(2);
  77390. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  77391. var _slicedToArray2 = __webpack_require__(26);
  77392. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  77393. var _newArrowCheck2 = __webpack_require__(1);
  77394. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  77395. var _icon = __webpack_require__(8);
  77396. var _icon2 = _interopRequireDefault(_icon);
  77397. var _dateTable = __webpack_require__(160);
  77398. var _dateTable2 = _interopRequireDefault(_dateTable);
  77399. var _yearTable = __webpack_require__(162);
  77400. var _yearTable2 = _interopRequireDefault(_yearTable);
  77401. var _monthTable = __webpack_require__(164);
  77402. var _monthTable2 = _interopRequireDefault(_monthTable);
  77403. var _timeRange = __webpack_require__(175);
  77404. var _timeRange2 = _interopRequireDefault(_timeRange);
  77405. var _confirm = __webpack_require__(59);
  77406. var _confirm2 = _interopRequireDefault(_confirm);
  77407. var _util = __webpack_require__(20);
  77408. var _datePanelLabel = __webpack_require__(171);
  77409. var _datePanelLabel2 = _interopRequireDefault(_datePanelLabel);
  77410. var _panelMixin = __webpack_require__(60);
  77411. var _panelMixin2 = _interopRequireDefault(_panelMixin);
  77412. var _datePanelMixin = __webpack_require__(173);
  77413. var _datePanelMixin2 = _interopRequireDefault(_datePanelMixin);
  77414. var _locale = __webpack_require__(6);
  77415. var _locale2 = _interopRequireDefault(_locale);
  77416. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77417. var prefixCls = 'ivu-picker-panel';
  77418. var datePrefixCls = 'ivu-date-picker';
  77419. var dateSorter = function (a, b) {
  77420. (0, _newArrowCheck3.default)(undefined, undefined);
  77421. if (!a || !b) return 0;
  77422. return a.getTime() - b.getTime();
  77423. }.bind(undefined);
  77424. exports.default = {
  77425. name: 'RangeDatePickerPanel',
  77426. mixins: [_panelMixin2.default, _locale2.default, _datePanelMixin2.default],
  77427. components: { Icon: _icon2.default, DateTable: _dateTable2.default, YearTable: _yearTable2.default, MonthTable: _monthTable2.default, TimePicker: _timeRange2.default, Confirm: _confirm2.default, datePanelLabel: _datePanelLabel2.default },
  77428. props: {
  77429. splitPanels: {
  77430. type: Boolean,
  77431. default: false
  77432. }
  77433. },
  77434. data: function data() {
  77435. var _this = this;
  77436. var _value$map = this.value.map(function (date) {
  77437. (0, _newArrowCheck3.default)(this, _this);
  77438. return date || (0, _util.initTimeDate)();
  77439. }.bind(this)),
  77440. _value$map2 = (0, _slicedToArray3.default)(_value$map, 2),
  77441. minDate = _value$map2[0],
  77442. maxDate = _value$map2[1];
  77443. var leftPanelDate = this.startDate ? this.startDate : minDate;
  77444. return {
  77445. prefixCls: prefixCls,
  77446. datePrefixCls: datePrefixCls,
  77447. dates: this.value,
  77448. rangeState: { from: this.value[0], to: this.value[1], selecting: minDate && !maxDate },
  77449. currentView: this.selectionMode || 'range',
  77450. leftPickerTable: String(this.selectionMode) + '-table',
  77451. rightPickerTable: String(this.selectionMode) + '-table',
  77452. leftPanelDate: leftPanelDate,
  77453. rightPanelDate: new Date(leftPanelDate.getFullYear(), leftPanelDate.getMonth() + 1, 1)
  77454. };
  77455. },
  77456. computed: {
  77457. classes: function classes() {
  77458. var _ref;
  77459. return [prefixCls + '-body-wrapper', datePrefixCls + '-with-range', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-sidebar', this.shortcuts.length), (0, _defineProperty3.default)(_ref, datePrefixCls + '-with-week-numbers', this.showWeekNumbers), _ref)];
  77460. },
  77461. panelBodyClasses: function panelBodyClasses() {
  77462. var _ref2;
  77463. return [prefixCls + '-body', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-body-time', this.showTime), (0, _defineProperty3.default)(_ref2, prefixCls + '-body-date', !this.showTime), _ref2)];
  77464. },
  77465. leftDatePanelLabel: function leftDatePanelLabel() {
  77466. return this.panelLabelConfig('left');
  77467. },
  77468. rightDatePanelLabel: function rightDatePanelLabel() {
  77469. return this.panelLabelConfig('right');
  77470. },
  77471. leftDatePanelView: function leftDatePanelView() {
  77472. return this.leftPickerTable.split('-').shift();
  77473. },
  77474. rightDatePanelView: function rightDatePanelView() {
  77475. return this.rightPickerTable.split('-').shift();
  77476. },
  77477. timeDisabled: function timeDisabled() {
  77478. return !(this.dates[0] && this.dates[1]);
  77479. },
  77480. preSelecting: function preSelecting() {
  77481. var tableType = String(this.currentView) + '-table';
  77482. return {
  77483. left: this.leftPickerTable !== tableType,
  77484. right: this.rightPickerTable !== tableType
  77485. };
  77486. },
  77487. panelPickerHandlers: function panelPickerHandlers() {
  77488. return {
  77489. left: this.preSelecting.left ? this.handlePreSelection.bind(this, 'left') : this.handleRangePick,
  77490. right: this.preSelecting.right ? this.handlePreSelection.bind(this, 'right') : this.handleRangePick
  77491. };
  77492. }
  77493. },
  77494. watch: {
  77495. value: function value(newVal) {
  77496. var minDate = newVal[0] ? (0, _util.toDate)(newVal[0]) : null;
  77497. var maxDate = newVal[1] ? (0, _util.toDate)(newVal[1]) : null;
  77498. this.dates = [minDate, maxDate].sort(dateSorter);
  77499. this.rangeState = {
  77500. from: this.dates[0],
  77501. to: this.dates[1],
  77502. selecting: false
  77503. };
  77504. this.setPanelDates(this.startDate || this.dates[0] || new Date());
  77505. },
  77506. currentView: function currentView(_currentView) {
  77507. var leftMonth = this.leftPanelDate.getMonth();
  77508. var rightMonth = this.rightPanelDate.getMonth();
  77509. var isSameYear = this.leftPanelDate.getFullYear() === this.rightPanelDate.getFullYear();
  77510. if (_currentView === 'date' && isSameYear && leftMonth === rightMonth) {
  77511. this.changePanelDate('right', 'Month', 1);
  77512. }
  77513. if (_currentView === 'month' && isSameYear) {
  77514. this.changePanelDate('right', 'FullYear', 1);
  77515. }
  77516. if (_currentView === 'year' && isSameYear) {
  77517. this.changePanelDate('right', 'FullYear', 10);
  77518. }
  77519. },
  77520. selectionMode: function selectionMode(type) {
  77521. this.currentView = type || 'range';
  77522. },
  77523. focusedDate: function focusedDate(date) {
  77524. this.setPanelDates(date || new Date());
  77525. }
  77526. },
  77527. methods: {
  77528. reset: function reset() {
  77529. this.currentView = this.selectionMode;
  77530. this.leftPickerTable = String(this.currentView) + '-table';
  77531. this.rightPickerTable = String(this.currentView) + '-table';
  77532. },
  77533. setPanelDates: function setPanelDates(leftPanelDate) {
  77534. this.leftPanelDate = leftPanelDate;
  77535. var rightPanelDate = new Date(leftPanelDate.getFullYear(), leftPanelDate.getMonth() + 1, 1);
  77536. var splitRightPanelDate = this.dates[1] ? this.dates[1].getTime() : this.dates[1];
  77537. this.rightPanelDate = this.splitPanels ? new Date(Math.max(splitRightPanelDate, rightPanelDate.getTime())) : rightPanelDate;
  77538. },
  77539. panelLabelConfig: function panelLabelConfig(direction) {
  77540. var _this2 = this;
  77541. var locale = this.t('i.locale');
  77542. var datePanelLabel = this.t('i.datepicker.datePanelLabel');
  77543. var handler = function (type) {
  77544. (0, _newArrowCheck3.default)(this, _this2);
  77545. var fn = type == 'month' ? this.showMonthPicker : this.showYearPicker;
  77546. return function () {
  77547. (0, _newArrowCheck3.default)(this, _this2);
  77548. return fn(direction);
  77549. }.bind(this);
  77550. }.bind(this);
  77551. var date = this[String(direction) + 'PanelDate'];
  77552. var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date),
  77553. labels = _formatDateLabels.labels,
  77554. separator = _formatDateLabels.separator;
  77555. return {
  77556. separator: separator,
  77557. labels: labels.map(function (obj) {
  77558. (0, _newArrowCheck3.default)(this, _this2);
  77559. return obj.handler = handler(obj.type), obj;
  77560. }.bind(this))
  77561. };
  77562. },
  77563. prevYear: function prevYear(panel) {
  77564. var increment = this.currentView === 'year' ? -10 : -1;
  77565. this.changePanelDate(panel, 'FullYear', increment);
  77566. },
  77567. nextYear: function nextYear(panel) {
  77568. var increment = this.currentView === 'year' ? 10 : 1;
  77569. this.changePanelDate(panel, 'FullYear', increment);
  77570. },
  77571. prevMonth: function prevMonth(panel) {
  77572. this.changePanelDate(panel, 'Month', -1);
  77573. },
  77574. nextMonth: function nextMonth(panel) {
  77575. this.changePanelDate(panel, 'Month', 1);
  77576. },
  77577. changePanelDate: function changePanelDate(panel, type, increment) {
  77578. var updateOtherPanel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
  77579. var current = new Date(this[String(panel) + 'PanelDate']);
  77580. if (type === 'FullYear') current['set' + type](current['get' + type]() + increment);else current['set' + type](current['get' + type]() + increment, 1);
  77581. this[String(panel) + 'PanelDate'] = current;
  77582. if (!updateOtherPanel) return;
  77583. if (this.splitPanels) {
  77584. var otherPanel = panel === 'left' ? 'right' : 'left';
  77585. if (panel === 'left' && this.leftPanelDate >= this.rightPanelDate) {
  77586. this.changePanelDate(otherPanel, type, 1);
  77587. }
  77588. if (panel === 'right' && this.rightPanelDate <= this.leftPanelDate) {
  77589. this.changePanelDate(otherPanel, type, -1);
  77590. }
  77591. } else {
  77592. var _otherPanel = panel === 'left' ? 'right' : 'left';
  77593. var currentDate = this[_otherPanel + 'PanelDate'];
  77594. var temp = new Date(currentDate);
  77595. if (type === 'Month') {
  77596. var nextMonthLastDate = new Date(temp.getFullYear(), temp.getMonth() + increment + 1, 0).getDate();
  77597. temp.setDate(Math.min(nextMonthLastDate, temp.getDate()));
  77598. }
  77599. temp['set' + String(type)](temp['get' + String(type)]() + increment);
  77600. this[_otherPanel + 'PanelDate'] = temp;
  77601. }
  77602. },
  77603. showYearPicker: function showYearPicker(panel) {
  77604. this[String(panel) + 'PickerTable'] = 'year-table';
  77605. },
  77606. showMonthPicker: function showMonthPicker(panel) {
  77607. this[String(panel) + 'PickerTable'] = 'month-table';
  77608. },
  77609. handlePreSelection: function handlePreSelection(panel, value) {
  77610. this[String(panel) + 'PanelDate'] = value;
  77611. var currentViewType = this[String(panel) + 'PickerTable'];
  77612. if (currentViewType === 'year-table') this[String(panel) + 'PickerTable'] = 'month-table';else this[String(panel) + 'PickerTable'] = String(this.currentView) + '-table';
  77613. if (!this.splitPanels) {
  77614. var otherPanel = panel === 'left' ? 'right' : 'left';
  77615. this[otherPanel + 'PanelDate'] = value;
  77616. var increment = otherPanel === 'left' ? -1 : 1;
  77617. this.changePanelDate(otherPanel, 'Month', increment, false);
  77618. }
  77619. },
  77620. handleRangePick: function handleRangePick(val, type) {
  77621. if (this.rangeState.selecting || this.currentView === 'time') {
  77622. if (this.currentView === 'time') {
  77623. this.dates = val;
  77624. } else {
  77625. var _sort = [this.rangeState.from, val].sort(dateSorter),
  77626. _sort2 = (0, _slicedToArray3.default)(_sort, 2),
  77627. minDate = _sort2[0],
  77628. maxDate = _sort2[1];
  77629. this.dates = [minDate, maxDate];
  77630. this.rangeState = {
  77631. from: minDate,
  77632. to: maxDate,
  77633. selecting: false
  77634. };
  77635. }
  77636. this.handleConfirm(false, type || 'date');
  77637. } else {
  77638. this.rangeState = {
  77639. from: val,
  77640. to: null,
  77641. selecting: true
  77642. };
  77643. }
  77644. },
  77645. handleChangeRange: function handleChangeRange(val) {
  77646. this.rangeState.to = val;
  77647. }
  77648. }
  77649. };
  77650. /***/ }),
  77651. /* 175 */
  77652. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  77653. "use strict";
  77654. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  77655. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__ = __webpack_require__(176);
  77656. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__);
  77657. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  77658. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__ = __webpack_require__(423);
  77659. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__);
  77660. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  77661. /* script */
  77662. /* template */
  77663. /* template functional */
  77664. var __vue_template_functional__ = false
  77665. /* styles */
  77666. var __vue_styles__ = null
  77667. /* scopeId */
  77668. var __vue_scopeId__ = null
  77669. /* moduleIdentifier (server only) */
  77670. var __vue_module_identifier__ = null
  77671. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  77672. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_range_vue___default.a,
  77673. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__["render"],
  77674. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0a21dfb4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_range_vue__["staticRenderFns"],
  77675. __vue_template_functional__,
  77676. __vue_styles__,
  77677. __vue_scopeId__,
  77678. __vue_module_identifier__
  77679. )
  77680. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  77681. /***/ }),
  77682. /* 176 */
  77683. /***/ (function(module, exports, __webpack_require__) {
  77684. "use strict";
  77685. Object.defineProperty(exports, "__esModule", {
  77686. value: true
  77687. });
  77688. var _keys = __webpack_require__(21);
  77689. var _keys2 = _interopRequireDefault(_keys);
  77690. var _defineProperty2 = __webpack_require__(2);
  77691. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  77692. var _slicedToArray2 = __webpack_require__(26);
  77693. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  77694. var _newArrowCheck2 = __webpack_require__(1);
  77695. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  77696. var _timeSpinner = __webpack_require__(168);
  77697. var _timeSpinner2 = _interopRequireDefault(_timeSpinner);
  77698. var _confirm = __webpack_require__(59);
  77699. var _confirm2 = _interopRequireDefault(_confirm);
  77700. var _timeMixins = __webpack_require__(58);
  77701. var _timeMixins2 = _interopRequireDefault(_timeMixins);
  77702. var _panelMixin = __webpack_require__(60);
  77703. var _panelMixin2 = _interopRequireDefault(_panelMixin);
  77704. var _locale = __webpack_require__(6);
  77705. var _locale2 = _interopRequireDefault(_locale);
  77706. var _util = __webpack_require__(20);
  77707. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77708. var prefixCls = 'ivu-picker-panel';
  77709. var timePrefixCls = 'ivu-time-picker';
  77710. var capitalize = function (str) {
  77711. (0, _newArrowCheck3.default)(undefined, undefined);
  77712. return str[0].toUpperCase() + str.slice(1);
  77713. }.bind(undefined);
  77714. exports.default = {
  77715. name: 'RangeTimePickerPanel',
  77716. mixins: [_panelMixin2.default, _locale2.default, _timeMixins2.default],
  77717. components: { TimeSpinner: _timeSpinner2.default, Confirm: _confirm2.default },
  77718. props: {
  77719. steps: {
  77720. type: Array,
  77721. default: function _default() {
  77722. (0, _newArrowCheck3.default)(undefined, undefined);
  77723. return [];
  77724. }.bind(undefined)
  77725. },
  77726. format: {
  77727. type: String,
  77728. default: 'HH:mm:ss'
  77729. },
  77730. value: {
  77731. type: Array,
  77732. required: true
  77733. }
  77734. },
  77735. data: function data() {
  77736. var _value$slice = this.value.slice(),
  77737. _value$slice2 = (0, _slicedToArray3.default)(_value$slice, 2),
  77738. dateStart = _value$slice2[0],
  77739. dateEnd = _value$slice2[1];
  77740. return {
  77741. prefixCls: prefixCls,
  77742. timePrefixCls: timePrefixCls,
  77743. showDate: false,
  77744. dateStart: dateStart || (0, _util.initTimeDate)(),
  77745. dateEnd: dateEnd || (0, _util.initTimeDate)()
  77746. };
  77747. },
  77748. computed: {
  77749. classes: function classes() {
  77750. return [prefixCls + '-body-wrapper', timePrefixCls + '-with-range', (0, _defineProperty3.default)({}, timePrefixCls + '-with-seconds', this.showSeconds)];
  77751. },
  77752. showSeconds: function showSeconds() {
  77753. return !!(this.format || '').match(/ss/);
  77754. },
  77755. leftDatePanelLabel: function leftDatePanelLabel() {
  77756. return this.panelLabelConfig(this.date);
  77757. },
  77758. rightDatePanelLabel: function rightDatePanelLabel() {
  77759. return this.panelLabelConfig(this.dateEnd);
  77760. }
  77761. },
  77762. watch: {
  77763. value: function value(dates) {
  77764. var _dates$slice = dates.slice(),
  77765. _dates$slice2 = (0, _slicedToArray3.default)(_dates$slice, 2),
  77766. dateStart = _dates$slice2[0],
  77767. dateEnd = _dates$slice2[1];
  77768. this.dateStart = dateStart || (0, _util.initTimeDate)();
  77769. this.dateEnd = dateEnd || (0, _util.initTimeDate)();
  77770. }
  77771. },
  77772. methods: {
  77773. panelLabelConfig: function panelLabelConfig(date) {
  77774. var locale = this.t('i.locale');
  77775. var datePanelLabel = this.t('i.datepicker.datePanelLabel');
  77776. var _formatDateLabels = (0, _util.formatDateLabels)(locale, datePanelLabel, date || (0, _util.initTimeDate)()),
  77777. labels = _formatDateLabels.labels,
  77778. separator = _formatDateLabels.separator;
  77779. return [labels[0].label, separator, labels[1].label].join('');
  77780. },
  77781. handleChange: function handleChange(start, end) {
  77782. var _this = this;
  77783. var emit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  77784. var dateStart = new Date(this.dateStart);
  77785. var dateEnd = new Date(this.dateEnd);
  77786. (0, _keys2.default)(start).forEach(function (type) {
  77787. (0, _newArrowCheck3.default)(this, _this);
  77788. dateStart['set' + String(capitalize(type))](start[type]);
  77789. }.bind(this));
  77790. (0, _keys2.default)(end).forEach(function (type) {
  77791. (0, _newArrowCheck3.default)(this, _this);
  77792. dateEnd['set' + String(capitalize(type))](end[type]);
  77793. }.bind(this));
  77794. if (dateEnd < dateStart) dateEnd = dateStart;
  77795. if (emit) this.$emit('on-pick', [dateStart, dateEnd], 'time');
  77796. },
  77797. handleStartChange: function handleStartChange(date) {
  77798. this.handleChange(date, {});
  77799. },
  77800. handleEndChange: function handleEndChange(date) {
  77801. this.handleChange({}, date);
  77802. },
  77803. updateScroll: function updateScroll() {
  77804. this.$refs.timeSpinner.updateScroll();
  77805. this.$refs.timeSpinnerEnd.updateScroll();
  77806. }
  77807. },
  77808. mounted: function mounted() {
  77809. if (this.$parent && this.$parent.$options.name === 'DatePicker') this.showDate = true;
  77810. }
  77811. };
  77812. /***/ }),
  77813. /* 177 */
  77814. /***/ (function(module, exports, __webpack_require__) {
  77815. "use strict";
  77816. Object.defineProperty(exports, "__esModule", {
  77817. value: true
  77818. });
  77819. var _defineProperty2 = __webpack_require__(2);
  77820. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  77821. var _assist = __webpack_require__(3);
  77822. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77823. var prefixCls = 'ivu-divider';
  77824. exports.default = {
  77825. name: 'Divider',
  77826. props: {
  77827. type: {
  77828. type: String,
  77829. default: 'horizontal',
  77830. validator: function validator(value) {
  77831. return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
  77832. }
  77833. },
  77834. orientation: {
  77835. type: String,
  77836. default: 'center',
  77837. validator: function validator(value) {
  77838. return (0, _assist.oneOf)(value, ['left', 'right', 'center']);
  77839. }
  77840. },
  77841. dashed: {
  77842. type: Boolean,
  77843. default: false
  77844. },
  77845. size: {
  77846. validator: function validator(value) {
  77847. return (0, _assist.oneOf)(value, ['small', 'default']);
  77848. },
  77849. default: 'default'
  77850. },
  77851. plain: {
  77852. type: Boolean,
  77853. default: false
  77854. }
  77855. },
  77856. computed: {
  77857. hasSlot: function hasSlot() {
  77858. return !!this.$slots.default;
  77859. },
  77860. classes: function classes() {
  77861. var _ref;
  77862. return ['' + prefixCls, prefixCls + '-' + String(this.type), prefixCls + '-' + String(this.size), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-with-text', this.hasSlot && this.orientation === 'center'), (0, _defineProperty3.default)(_ref, prefixCls + '-with-text-' + String(this.orientation), this.hasSlot), (0, _defineProperty3.default)(_ref, prefixCls + '-dashed', !!this.dashed), (0, _defineProperty3.default)(_ref, prefixCls + '-plain', this.plain), _ref)];
  77863. },
  77864. slotClasses: function slotClasses() {
  77865. return [prefixCls + '-inner-text'];
  77866. }
  77867. }
  77868. };
  77869. /***/ }),
  77870. /* 178 */
  77871. /***/ (function(module, exports, __webpack_require__) {
  77872. "use strict";
  77873. Object.defineProperty(exports, "__esModule", {
  77874. value: true
  77875. });
  77876. var _newArrowCheck2 = __webpack_require__(1);
  77877. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  77878. var _assign = __webpack_require__(15);
  77879. var _assign2 = _interopRequireDefault(_assign);
  77880. var _defineProperty2 = __webpack_require__(2);
  77881. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  77882. var _icon = __webpack_require__(19);
  77883. var _icon2 = _interopRequireDefault(_icon);
  77884. var _assist = __webpack_require__(3);
  77885. var _transferDom = __webpack_require__(23);
  77886. var _transferDom2 = _interopRequireDefault(_transferDom);
  77887. var _emitter = __webpack_require__(4);
  77888. var _emitter2 = _interopRequireDefault(_emitter);
  77889. var _mixinsScrollbar = __webpack_require__(87);
  77890. var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
  77891. var _dom = __webpack_require__(12);
  77892. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  77893. var prefixCls = 'ivu-drawer';
  77894. exports.default = {
  77895. name: 'Drawer',
  77896. mixins: [_emitter2.default, _mixinsScrollbar2.default],
  77897. components: { Icon: _icon2.default },
  77898. directives: { TransferDom: _transferDom2.default },
  77899. props: {
  77900. value: {
  77901. type: Boolean,
  77902. default: false
  77903. },
  77904. title: {
  77905. type: String
  77906. },
  77907. width: {
  77908. type: [Number, String],
  77909. default: 256
  77910. },
  77911. height: {
  77912. type: [Number, String],
  77913. default: 256
  77914. },
  77915. closable: {
  77916. type: Boolean,
  77917. default: true
  77918. },
  77919. maskClosable: {
  77920. type: Boolean,
  77921. default: true
  77922. },
  77923. mask: {
  77924. type: Boolean,
  77925. default: true
  77926. },
  77927. maskStyle: {
  77928. type: Object
  77929. },
  77930. styles: {
  77931. type: Object
  77932. },
  77933. scrollable: {
  77934. type: Boolean,
  77935. default: false
  77936. },
  77937. placement: {
  77938. validator: function validator(value) {
  77939. return (0, _assist.oneOf)(value, ['left', 'right', 'top', 'bottom']);
  77940. },
  77941. default: 'right'
  77942. },
  77943. zIndex: {
  77944. type: Number,
  77945. default: 1000
  77946. },
  77947. transfer: {
  77948. type: Boolean,
  77949. default: function _default() {
  77950. return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
  77951. }
  77952. },
  77953. className: {
  77954. type: String
  77955. },
  77956. inner: {
  77957. type: Boolean,
  77958. default: false
  77959. },
  77960. draggable: {
  77961. type: Boolean,
  77962. default: false
  77963. },
  77964. beforeClose: Function
  77965. },
  77966. data: function data() {
  77967. return {
  77968. prefixCls: prefixCls,
  77969. visible: this.value,
  77970. wrapShow: false,
  77971. showHead: true,
  77972. canMove: false,
  77973. dragWidth: this.width,
  77974. dragHeight: this.height,
  77975. wrapperWidth: this.width,
  77976. wrapperHeight: this.height,
  77977. wrapperLeft: 0,
  77978. minWidth: 256,
  77979. minHeight: 256
  77980. };
  77981. },
  77982. computed: {
  77983. wrapClasses: function wrapClasses() {
  77984. var _ref;
  77985. return [prefixCls + '-wrap', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hidden', !this.wrapShow), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-mask', !this.mask), (0, _defineProperty3.default)(_ref, prefixCls + '-wrap-inner', this.inner), (0, _defineProperty3.default)(_ref, prefixCls + '-wrap-dragging', this.canMove), _ref)];
  77986. },
  77987. mainStyles: function mainStyles() {
  77988. var style = {};
  77989. if (this.placement === 'left' || this.placement === 'right') {
  77990. var width = parseInt(this.dragWidth);
  77991. var styleWidth = {
  77992. width: width <= 100 ? String(width) + '%' : String(width) + 'px'
  77993. };
  77994. (0, _assign2.default)(style, styleWidth);
  77995. } else {
  77996. var height = parseInt(this.dragHeight);
  77997. var styleHeight = {
  77998. height: height <= 100 ? String(height) + '%' : String(height) + 'px'
  77999. };
  78000. (0, _assign2.default)(style, styleHeight);
  78001. }
  78002. return style;
  78003. },
  78004. contentClasses: function contentClasses() {
  78005. return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-no-mask', !this.mask)];
  78006. },
  78007. classes: function classes() {
  78008. var _ref3;
  78009. return ['' + prefixCls, prefixCls + '-' + String(this.placement), (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-no-header', !this.showHead), (0, _defineProperty3.default)(_ref3, prefixCls + '-inner', this.inner), _ref3)];
  78010. },
  78011. maskClasses: function maskClasses() {
  78012. return [prefixCls + '-mask', (0, _defineProperty3.default)({}, prefixCls + '-mask-inner', this.inner)];
  78013. },
  78014. transitionName: function transitionName() {
  78015. if (this.placement === 'left' || this.placement === 'right') return 'move-' + String(this.placement);else if (this.placement === 'top') return 'move-up';else return 'move-down';
  78016. }
  78017. },
  78018. methods: {
  78019. close: function close() {
  78020. var _this = this;
  78021. if (!this.beforeClose) {
  78022. return this.handleClose();
  78023. }
  78024. var before = this.beforeClose();
  78025. if (before && before.then) {
  78026. before.then(function () {
  78027. (0, _newArrowCheck3.default)(this, _this);
  78028. this.handleClose();
  78029. }.bind(this));
  78030. } else {
  78031. this.handleClose();
  78032. }
  78033. },
  78034. handleClose: function handleClose() {
  78035. this.visible = false;
  78036. this.$emit('input', false);
  78037. this.$emit('on-close');
  78038. },
  78039. handleMask: function handleMask() {
  78040. if (this.maskClosable && this.mask) {
  78041. this.close();
  78042. }
  78043. },
  78044. handleWrapClick: function handleWrapClick(event) {
  78045. var className = event.target.getAttribute('class');
  78046. if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
  78047. },
  78048. handleMousemove: function handleMousemove(event) {
  78049. if (!this.canMove || !this.draggable) return;
  78050. this.handleSetWrapperWidth();
  78051. var left = event.pageX - this.wrapperLeft;
  78052. var width = this.placement === 'right' ? this.wrapperWidth - left : left;
  78053. width = Math.max(width, parseFloat(this.minWidth));
  78054. event.atMin = width === parseFloat(this.minWidth);
  78055. if (width <= 100) width = width / this.wrapperWidth * 100;
  78056. this.dragWidth = width;
  78057. this.$emit('on-resize-width', parseInt(this.dragWidth));
  78058. },
  78059. handleSetWrapperWidth: function handleSetWrapperWidth() {
  78060. var _$el$getBoundingClien = this.$el.getBoundingClientRect(),
  78061. width = _$el$getBoundingClien.width,
  78062. left = _$el$getBoundingClien.left;
  78063. this.wrapperWidth = width;
  78064. this.wrapperLeft = left;
  78065. },
  78066. handleMouseup: function handleMouseup() {
  78067. if (!this.draggable) return;
  78068. this.canMove = false;
  78069. },
  78070. handleTriggerMousedown: function handleTriggerMousedown() {
  78071. this.canMove = true;
  78072. window.getSelection().removeAllRanges();
  78073. }
  78074. },
  78075. mounted: function mounted() {
  78076. if (this.visible) {
  78077. this.wrapShow = true;
  78078. }
  78079. var showHead = true;
  78080. if (this.$slots.header === undefined && !this.title) {
  78081. showHead = false;
  78082. }
  78083. this.showHead = showHead;
  78084. (0, _dom.on)(document, 'mousemove', this.handleMousemove);
  78085. (0, _dom.on)(document, 'mouseup', this.handleMouseup);
  78086. this.handleSetWrapperWidth();
  78087. },
  78088. beforeDestroy: function beforeDestroy() {
  78089. (0, _dom.off)(document, 'mousemove', this.handleMousemove);
  78090. (0, _dom.off)(document, 'mouseup', this.handleMouseup);
  78091. this.removeScrollEffect();
  78092. },
  78093. watch: {
  78094. value: function value(val) {
  78095. this.visible = val;
  78096. },
  78097. visible: function visible(val) {
  78098. var _this2 = this;
  78099. if (val === false) {
  78100. this.timer = setTimeout(function () {
  78101. (0, _newArrowCheck3.default)(this, _this2);
  78102. this.wrapShow = false;
  78103. var brotherDrawers = (0, _assist.findBrothersComponents)(this, 'Drawer') || [];
  78104. var parentDrawers = (0, _assist.findComponentsUpward)(this, 'Drawer') || [];
  78105. var otherDrawers = [].concat(brotherDrawers).concat(parentDrawers);
  78106. var isScrollDrawer = otherDrawers.some(function (item) {
  78107. (0, _newArrowCheck3.default)(this, _this2);
  78108. return item.visible && !item.scrollable;
  78109. }.bind(this));
  78110. if (!isScrollDrawer) {
  78111. this.removeScrollEffect();
  78112. }
  78113. }.bind(this), 300);
  78114. } else {
  78115. if (this.timer) clearTimeout(this.timer);
  78116. this.wrapShow = true;
  78117. if (!this.scrollable) {
  78118. this.addScrollEffect();
  78119. }
  78120. }
  78121. this.broadcast('Table', 'on-visible-change', val);
  78122. this.broadcast('Slider', 'on-visible-change', val);
  78123. this.$emit('on-visible-change', val);
  78124. },
  78125. scrollable: function scrollable(val) {
  78126. if (!val) {
  78127. this.addScrollEffect();
  78128. } else {
  78129. this.removeScrollEffect();
  78130. }
  78131. },
  78132. title: function title(val) {
  78133. if (this.$slots.header === undefined) {
  78134. this.showHead = !!val;
  78135. }
  78136. },
  78137. width: function width(val) {
  78138. this.dragWidth = val;
  78139. },
  78140. height: function height(val) {
  78141. this.dragHeight = val;
  78142. }
  78143. }
  78144. };
  78145. /***/ }),
  78146. /* 179 */
  78147. /***/ (function(module, exports, __webpack_require__) {
  78148. "use strict";
  78149. Object.defineProperty(exports, "__esModule", {
  78150. value: true
  78151. });
  78152. var _newArrowCheck2 = __webpack_require__(1);
  78153. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  78154. var _defineProperty2 = __webpack_require__(2);
  78155. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  78156. var _dropdown = __webpack_require__(36);
  78157. var _dropdown2 = _interopRequireDefault(_dropdown);
  78158. var _clickoutside = __webpack_require__(82);
  78159. var _clickoutside2 = _interopRequireDefault(_clickoutside);
  78160. var _transferDom = __webpack_require__(23);
  78161. var _transferDom2 = _interopRequireDefault(_transferDom);
  78162. var _assist = __webpack_require__(3);
  78163. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78164. var prefixCls = 'ivu-dropdown';
  78165. exports.default = {
  78166. name: 'Dropdown',
  78167. directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
  78168. components: { Drop: _dropdown2.default },
  78169. props: {
  78170. trigger: {
  78171. validator: function validator(value) {
  78172. return (0, _assist.oneOf)(value, ['click', 'hover', 'custom', 'contextMenu']);
  78173. },
  78174. default: 'hover'
  78175. },
  78176. placement: {
  78177. validator: function validator(value) {
  78178. return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
  78179. },
  78180. default: 'bottom'
  78181. },
  78182. visible: {
  78183. type: Boolean,
  78184. default: false
  78185. },
  78186. transfer: {
  78187. type: Boolean,
  78188. default: function _default() {
  78189. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  78190. }
  78191. },
  78192. transferClassName: {
  78193. type: String
  78194. },
  78195. stopPropagation: {
  78196. type: Boolean,
  78197. default: false
  78198. },
  78199. capture: {
  78200. type: Boolean,
  78201. default: function _default() {
  78202. return !this.$IVIEW ? true : this.$IVIEW.capture;
  78203. }
  78204. },
  78205. eventsEnabled: {
  78206. type: Boolean,
  78207. default: false
  78208. }
  78209. },
  78210. computed: {
  78211. transition: function transition() {
  78212. return ['bottom-start', 'bottom', 'bottom-end'].indexOf(this.placement) > -1 ? 'slide-up' : 'fade';
  78213. },
  78214. dropdownCls: function dropdownCls() {
  78215. var _ref;
  78216. return _ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref, this.transferClassName, this.transferClassName), _ref;
  78217. },
  78218. relClasses: function relClasses() {
  78219. return [prefixCls + '-rel', (0, _defineProperty3.default)({}, prefixCls + '-rel-user-select-none', this.trigger === 'contextMenu')];
  78220. }
  78221. },
  78222. data: function data() {
  78223. return {
  78224. prefixCls: prefixCls,
  78225. currentVisible: this.visible
  78226. };
  78227. },
  78228. watch: {
  78229. visible: function visible(val) {
  78230. this.currentVisible = val;
  78231. },
  78232. currentVisible: function currentVisible(val) {
  78233. if (val) {
  78234. this.$refs.drop.update();
  78235. } else {
  78236. this.$refs.drop.destroy();
  78237. }
  78238. this.$emit('on-visible-change', val);
  78239. }
  78240. },
  78241. methods: {
  78242. handleClick: function handleClick() {
  78243. if (this.trigger === 'custom') return false;
  78244. if (this.trigger !== 'click') {
  78245. return false;
  78246. }
  78247. var $parent = this.hasParent();
  78248. if (!$parent) this.currentVisible = !this.currentVisible;
  78249. },
  78250. handleRightClick: function handleRightClick() {
  78251. if (this.trigger === 'custom') return false;
  78252. if (this.trigger !== 'contextMenu') {
  78253. return false;
  78254. }
  78255. this.currentVisible = !this.currentVisible;
  78256. },
  78257. handleMouseenter: function handleMouseenter() {
  78258. var _this = this;
  78259. if (this.trigger === 'custom') return false;
  78260. if (this.trigger !== 'hover') {
  78261. return false;
  78262. }
  78263. if (this.timeout) clearTimeout(this.timeout);
  78264. this.timeout = setTimeout(function () {
  78265. (0, _newArrowCheck3.default)(this, _this);
  78266. this.currentVisible = true;
  78267. }.bind(this), 250);
  78268. },
  78269. handleMouseleave: function handleMouseleave() {
  78270. var _this2 = this;
  78271. if (this.trigger === 'custom') return false;
  78272. if (this.trigger !== 'hover') {
  78273. return false;
  78274. }
  78275. if (this.timeout) {
  78276. clearTimeout(this.timeout);
  78277. this.timeout = setTimeout(function () {
  78278. (0, _newArrowCheck3.default)(this, _this2);
  78279. this.currentVisible = false;
  78280. }.bind(this), 150);
  78281. }
  78282. },
  78283. onClickoutside: function onClickoutside(e) {
  78284. this.handleClose();
  78285. this.handleRightClose();
  78286. if (this.currentVisible) this.$emit('on-clickoutside', e);
  78287. },
  78288. handleClose: function handleClose() {
  78289. if (this.trigger === 'custom') return false;
  78290. if (this.trigger !== 'click') {
  78291. return false;
  78292. }
  78293. this.currentVisible = false;
  78294. },
  78295. handleRightClose: function handleRightClose() {
  78296. if (this.trigger === 'custom') return false;
  78297. if (this.trigger !== 'contextMenu') {
  78298. return false;
  78299. }
  78300. this.currentVisible = false;
  78301. },
  78302. hasParent: function hasParent() {
  78303. var $parent = (0, _assist.findComponentUpward)(this, 'Dropdown');
  78304. if ($parent) {
  78305. return $parent;
  78306. } else {
  78307. return false;
  78308. }
  78309. }
  78310. },
  78311. mounted: function mounted() {
  78312. var _this3 = this;
  78313. this.$on('on-click', function (key) {
  78314. (0, _newArrowCheck3.default)(this, _this3);
  78315. if (this.stopPropagation) return;
  78316. var $parent = this.hasParent();
  78317. if ($parent) $parent.$emit('on-click', key);
  78318. }.bind(this));
  78319. this.$on('on-hover-click', function () {
  78320. (0, _newArrowCheck3.default)(this, _this3);
  78321. var $parent = this.hasParent();
  78322. if ($parent) {
  78323. this.$nextTick(function () {
  78324. (0, _newArrowCheck3.default)(this, _this3);
  78325. if (this.trigger === 'custom') return false;
  78326. this.currentVisible = false;
  78327. }.bind(this));
  78328. $parent.$emit('on-hover-click');
  78329. } else {
  78330. this.$nextTick(function () {
  78331. (0, _newArrowCheck3.default)(this, _this3);
  78332. if (this.trigger === 'custom') return false;
  78333. this.currentVisible = false;
  78334. }.bind(this));
  78335. }
  78336. }.bind(this));
  78337. this.$on('on-haschild-click', function () {
  78338. (0, _newArrowCheck3.default)(this, _this3);
  78339. this.$nextTick(function () {
  78340. (0, _newArrowCheck3.default)(this, _this3);
  78341. if (this.trigger === 'custom') return false;
  78342. this.currentVisible = true;
  78343. }.bind(this));
  78344. var $parent = this.hasParent();
  78345. if ($parent) $parent.$emit('on-haschild-click');
  78346. }.bind(this));
  78347. }
  78348. };
  78349. /***/ }),
  78350. /* 180 */
  78351. /***/ (function(module, exports, __webpack_require__) {
  78352. "use strict";
  78353. Object.defineProperty(exports, "__esModule", {
  78354. value: true
  78355. });
  78356. exports.default = {
  78357. name: 'DropdownMenu'
  78358. };
  78359. /***/ }),
  78360. /* 181 */
  78361. /***/ (function(module, exports, __webpack_require__) {
  78362. "use strict";
  78363. Object.defineProperty(exports, "__esModule", {
  78364. value: true
  78365. });
  78366. var _defineProperty2 = __webpack_require__(2);
  78367. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  78368. var _assist = __webpack_require__(3);
  78369. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78370. var prefixCls = 'ivu-dropdown-item';
  78371. exports.default = {
  78372. name: 'DropdownItem',
  78373. props: {
  78374. name: {
  78375. type: [String, Number]
  78376. },
  78377. disabled: {
  78378. type: Boolean,
  78379. default: false
  78380. },
  78381. selected: {
  78382. type: Boolean,
  78383. default: false
  78384. },
  78385. divided: {
  78386. type: Boolean,
  78387. default: false
  78388. }
  78389. },
  78390. computed: {
  78391. classes: function classes() {
  78392. var _ref;
  78393. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-selected', this.selected), (0, _defineProperty3.default)(_ref, prefixCls + '-divided', this.divided), _ref)];
  78394. }
  78395. },
  78396. methods: {
  78397. handleClick: function handleClick() {
  78398. if (this.disabled) return;
  78399. var $parent = (0, _assist.findComponentUpward)(this, 'Dropdown');
  78400. var hasChildren = this.$parent && this.$parent.$options.name === 'Dropdown';
  78401. if (hasChildren) {
  78402. this.$parent.$emit('on-haschild-click');
  78403. } else {
  78404. if ($parent && $parent.$options.name === 'Dropdown') {
  78405. $parent.$emit('on-hover-click');
  78406. }
  78407. }
  78408. $parent.$emit('on-click', this.name);
  78409. }
  78410. }
  78411. };
  78412. /***/ }),
  78413. /* 182 */
  78414. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78415. "use strict";
  78416. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  78417. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__ = __webpack_require__(183);
  78418. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__);
  78419. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  78420. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__ = __webpack_require__(437);
  78421. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__);
  78422. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  78423. /* script */
  78424. /* template */
  78425. /* template functional */
  78426. var __vue_template_functional__ = false
  78427. /* styles */
  78428. var __vue_styles__ = null
  78429. /* scopeId */
  78430. var __vue_scopeId__ = null
  78431. /* moduleIdentifier (server only) */
  78432. var __vue_module_identifier__ = null
  78433. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  78434. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_footer_vue___default.a,
  78435. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__["render"],
  78436. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_fccdaa0c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_footer_vue__["staticRenderFns"],
  78437. __vue_template_functional__,
  78438. __vue_styles__,
  78439. __vue_scopeId__,
  78440. __vue_module_identifier__
  78441. )
  78442. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  78443. /***/ }),
  78444. /* 183 */
  78445. /***/ (function(module, exports, __webpack_require__) {
  78446. "use strict";
  78447. Object.defineProperty(exports, "__esModule", {
  78448. value: true
  78449. });
  78450. var prefixCls = 'ivu-layout';
  78451. exports.default = {
  78452. name: 'Footer',
  78453. computed: {
  78454. wrapClasses: function wrapClasses() {
  78455. return prefixCls + '-footer';
  78456. }
  78457. }
  78458. };
  78459. /***/ }),
  78460. /* 184 */
  78461. /***/ (function(module, exports, __webpack_require__) {
  78462. "use strict";
  78463. Object.defineProperty(exports, "__esModule", {
  78464. value: true
  78465. });
  78466. var _promise = __webpack_require__(185);
  78467. var _promise2 = _interopRequireDefault(_promise);
  78468. var _newArrowCheck2 = __webpack_require__(1);
  78469. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  78470. var _defineProperty2 = __webpack_require__(2);
  78471. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  78472. var _assist = __webpack_require__(3);
  78473. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78474. var prefixCls = 'ivu-form';
  78475. exports.default = {
  78476. name: 'iForm',
  78477. props: {
  78478. model: {
  78479. type: Object
  78480. },
  78481. rules: {
  78482. type: Object
  78483. },
  78484. labelWidth: {
  78485. type: Number
  78486. },
  78487. labelPosition: {
  78488. validator: function validator(value) {
  78489. return (0, _assist.oneOf)(value, ['left', 'right', 'top']);
  78490. },
  78491. default: 'right'
  78492. },
  78493. inline: {
  78494. type: Boolean,
  78495. default: false
  78496. },
  78497. showMessage: {
  78498. type: Boolean,
  78499. default: true
  78500. },
  78501. autocomplete: {
  78502. validator: function validator(value) {
  78503. return (0, _assist.oneOf)(value, ['on', 'off']);
  78504. },
  78505. default: 'off'
  78506. },
  78507. hideRequiredMark: {
  78508. type: Boolean,
  78509. default: false
  78510. },
  78511. labelColon: {
  78512. type: [Boolean, String],
  78513. default: false
  78514. },
  78515. disabled: {
  78516. type: Boolean,
  78517. default: false
  78518. }
  78519. },
  78520. provide: function provide() {
  78521. return { FormInstance: this };
  78522. },
  78523. data: function data() {
  78524. return {
  78525. fields: []
  78526. };
  78527. },
  78528. computed: {
  78529. classes: function classes() {
  78530. var _ref;
  78531. return ['' + prefixCls, prefixCls + '-label-' + String(this.labelPosition), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-inline', this.inline), (0, _defineProperty3.default)(_ref, prefixCls + '-hide-required-mark', this.hideRequiredMark), _ref)];
  78532. },
  78533. colon: function colon() {
  78534. var colon = '';
  78535. if (this.labelColon) {
  78536. colon = typeof this.labelColon === 'boolean' ? ':' : this.labelColon;
  78537. }
  78538. return colon;
  78539. }
  78540. },
  78541. methods: {
  78542. resetFields: function resetFields() {
  78543. var _this = this;
  78544. this.fields.forEach(function (field) {
  78545. (0, _newArrowCheck3.default)(this, _this);
  78546. field.resetField();
  78547. }.bind(this));
  78548. },
  78549. validate: function validate(callback) {
  78550. var _this2 = this;
  78551. return new _promise2.default(function (resolve) {
  78552. (0, _newArrowCheck3.default)(this, _this2);
  78553. var valid = true;
  78554. var count = 0;
  78555. if (this.fields.length === 0) {
  78556. resolve(valid);
  78557. if (typeof callback === 'function') {
  78558. callback(valid);
  78559. }
  78560. }
  78561. this.fields.forEach(function (field) {
  78562. (0, _newArrowCheck3.default)(this, _this2);
  78563. field.validate('', function (errors) {
  78564. (0, _newArrowCheck3.default)(this, _this2);
  78565. if (errors) {
  78566. valid = false;
  78567. }
  78568. if (++count === this.fields.length) {
  78569. resolve(valid);
  78570. if (typeof callback === 'function') {
  78571. callback(valid);
  78572. }
  78573. }
  78574. }.bind(this));
  78575. }.bind(this));
  78576. }.bind(this));
  78577. },
  78578. validateField: function validateField(prop, cb) {
  78579. var _this3 = this;
  78580. var field = this.fields.filter(function (field) {
  78581. (0, _newArrowCheck3.default)(this, _this3);
  78582. return field.prop === prop;
  78583. }.bind(this))[0];
  78584. if (!field) {
  78585. throw new Error('[iView warn]: must call validateField with valid prop string!');
  78586. }
  78587. field.validate('', cb);
  78588. }
  78589. },
  78590. watch: {
  78591. rules: function rules() {
  78592. this.validate();
  78593. }
  78594. },
  78595. created: function created() {
  78596. var _this4 = this;
  78597. this.$on('on-form-item-add', function (field) {
  78598. (0, _newArrowCheck3.default)(this, _this4);
  78599. if (field) this.fields.push(field);
  78600. return false;
  78601. }.bind(this));
  78602. this.$on('on-form-item-remove', function (field) {
  78603. (0, _newArrowCheck3.default)(this, _this4);
  78604. if (field.prop) this.fields.splice(this.fields.indexOf(field), 1);
  78605. return false;
  78606. }.bind(this));
  78607. }
  78608. };
  78609. /***/ }),
  78610. /* 185 */
  78611. /***/ (function(module, exports, __webpack_require__) {
  78612. module.exports = { "default": __webpack_require__(440), __esModule: true };
  78613. /***/ }),
  78614. /* 186 */
  78615. /***/ (function(module, exports, __webpack_require__) {
  78616. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  78617. var anObject = __webpack_require__(22);
  78618. var aFunction = __webpack_require__(43);
  78619. var SPECIES = __webpack_require__(10)('species');
  78620. module.exports = function (O, D) {
  78621. var C = anObject(O).constructor;
  78622. var S;
  78623. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  78624. };
  78625. /***/ }),
  78626. /* 187 */
  78627. /***/ (function(module, exports, __webpack_require__) {
  78628. var ctx = __webpack_require__(24);
  78629. var invoke = __webpack_require__(442);
  78630. var html = __webpack_require__(105);
  78631. var cel = __webpack_require__(69);
  78632. var global = __webpack_require__(9);
  78633. var process = global.process;
  78634. var setTask = global.setImmediate;
  78635. var clearTask = global.clearImmediate;
  78636. var MessageChannel = global.MessageChannel;
  78637. var Dispatch = global.Dispatch;
  78638. var counter = 0;
  78639. var queue = {};
  78640. var ONREADYSTATECHANGE = 'onreadystatechange';
  78641. var defer, channel, port;
  78642. var run = function () {
  78643. var id = +this;
  78644. // eslint-disable-next-line no-prototype-builtins
  78645. if (queue.hasOwnProperty(id)) {
  78646. var fn = queue[id];
  78647. delete queue[id];
  78648. fn();
  78649. }
  78650. };
  78651. var listener = function (event) {
  78652. run.call(event.data);
  78653. };
  78654. // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  78655. if (!setTask || !clearTask) {
  78656. setTask = function setImmediate(fn) {
  78657. var args = [];
  78658. var i = 1;
  78659. while (arguments.length > i) args.push(arguments[i++]);
  78660. queue[++counter] = function () {
  78661. // eslint-disable-next-line no-new-func
  78662. invoke(typeof fn == 'function' ? fn : Function(fn), args);
  78663. };
  78664. defer(counter);
  78665. return counter;
  78666. };
  78667. clearTask = function clearImmediate(id) {
  78668. delete queue[id];
  78669. };
  78670. // Node.js 0.8-
  78671. if (__webpack_require__(41)(process) == 'process') {
  78672. defer = function (id) {
  78673. process.nextTick(ctx(run, id, 1));
  78674. };
  78675. // Sphere (JS game engine) Dispatch API
  78676. } else if (Dispatch && Dispatch.now) {
  78677. defer = function (id) {
  78678. Dispatch.now(ctx(run, id, 1));
  78679. };
  78680. // Browsers with MessageChannel, includes WebWorkers
  78681. } else if (MessageChannel) {
  78682. channel = new MessageChannel();
  78683. port = channel.port2;
  78684. channel.port1.onmessage = listener;
  78685. defer = ctx(port.postMessage, port, 1);
  78686. // Browsers with postMessage, skip WebWorkers
  78687. // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  78688. } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
  78689. defer = function (id) {
  78690. global.postMessage(id + '', '*');
  78691. };
  78692. global.addEventListener('message', listener, false);
  78693. // IE8-
  78694. } else if (ONREADYSTATECHANGE in cel('script')) {
  78695. defer = function (id) {
  78696. html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
  78697. html.removeChild(this);
  78698. run.call(id);
  78699. };
  78700. };
  78701. // Rest old browsers
  78702. } else {
  78703. defer = function (id) {
  78704. setTimeout(ctx(run, id, 1), 0);
  78705. };
  78706. }
  78707. }
  78708. module.exports = {
  78709. set: setTask,
  78710. clear: clearTask
  78711. };
  78712. /***/ }),
  78713. /* 188 */
  78714. /***/ (function(module, exports) {
  78715. module.exports = function (exec) {
  78716. try {
  78717. return { e: false, v: exec() };
  78718. } catch (e) {
  78719. return { e: true, v: e };
  78720. }
  78721. };
  78722. /***/ }),
  78723. /* 189 */
  78724. /***/ (function(module, exports, __webpack_require__) {
  78725. var anObject = __webpack_require__(22);
  78726. var isObject = __webpack_require__(18);
  78727. var newPromiseCapability = __webpack_require__(89);
  78728. module.exports = function (C, x) {
  78729. anObject(C);
  78730. if (isObject(x) && x.constructor === C) return x;
  78731. var promiseCapability = newPromiseCapability.f(C);
  78732. var resolve = promiseCapability.resolve;
  78733. resolve(x);
  78734. return promiseCapability.promise;
  78735. };
  78736. /***/ }),
  78737. /* 190 */
  78738. /***/ (function(module, exports, __webpack_require__) {
  78739. "use strict";
  78740. var global = __webpack_require__(9);
  78741. var core = __webpack_require__(5);
  78742. var dP = __webpack_require__(14);
  78743. var DESCRIPTORS = __webpack_require__(13);
  78744. var SPECIES = __webpack_require__(10)('species');
  78745. module.exports = function (KEY) {
  78746. var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  78747. if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
  78748. configurable: true,
  78749. get: function () { return this; }
  78750. });
  78751. };
  78752. /***/ }),
  78753. /* 191 */
  78754. /***/ (function(module, exports, __webpack_require__) {
  78755. "use strict";
  78756. Object.defineProperty(exports, "__esModule", {
  78757. value: true
  78758. });
  78759. var _newArrowCheck2 = __webpack_require__(1);
  78760. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  78761. var _defineProperty2 = __webpack_require__(2);
  78762. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  78763. var _asyncValidator = __webpack_require__(449);
  78764. var _asyncValidator2 = _interopRequireDefault(_asyncValidator);
  78765. var _emitter = __webpack_require__(4);
  78766. var _emitter2 = _interopRequireDefault(_emitter);
  78767. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  78768. var prefixCls = 'ivu-form-item';
  78769. function getPropByPath(obj, path) {
  78770. var tempObj = obj;
  78771. path = path.replace(/\[(\w+)\]/g, '.$1');
  78772. path = path.replace(/^\./, '');
  78773. var keyArr = path.split('.');
  78774. var i = 0;
  78775. for (var len = keyArr.length; i < len - 1; ++i) {
  78776. var key = keyArr[i];
  78777. if (key in tempObj) {
  78778. tempObj = tempObj[key];
  78779. } else {
  78780. throw new Error('[iView warn]: please transfer a valid prop path to form item!');
  78781. }
  78782. }
  78783. return {
  78784. o: tempObj,
  78785. k: keyArr[i],
  78786. v: tempObj[keyArr[i]]
  78787. };
  78788. }
  78789. exports.default = {
  78790. name: 'FormItem',
  78791. mixins: [_emitter2.default],
  78792. props: {
  78793. label: {
  78794. type: String,
  78795. default: ''
  78796. },
  78797. labelWidth: {
  78798. type: Number
  78799. },
  78800. prop: {
  78801. type: String
  78802. },
  78803. required: {
  78804. type: Boolean,
  78805. default: false
  78806. },
  78807. rules: {
  78808. type: [Object, Array]
  78809. },
  78810. error: {
  78811. type: String
  78812. },
  78813. validateStatus: {
  78814. type: Boolean
  78815. },
  78816. showMessage: {
  78817. type: Boolean,
  78818. default: true
  78819. },
  78820. labelFor: {
  78821. type: String
  78822. }
  78823. },
  78824. data: function data() {
  78825. return {
  78826. prefixCls: prefixCls,
  78827. isRequired: false,
  78828. validateState: '',
  78829. validateMessage: '',
  78830. validateDisabled: false,
  78831. validator: {}
  78832. };
  78833. },
  78834. watch: {
  78835. error: {
  78836. handler: function handler(val) {
  78837. this.validateMessage = val;
  78838. this.validateState = val ? 'error' : '';
  78839. },
  78840. immediate: true
  78841. },
  78842. validateStatus: function validateStatus(val) {
  78843. this.validateState = val;
  78844. },
  78845. rules: function rules() {
  78846. this.setRules();
  78847. },
  78848. required: function required(n, o) {
  78849. this.isRequired = n;
  78850. if (o && !n) {
  78851. this.resetField();
  78852. }
  78853. }
  78854. },
  78855. inject: ['FormInstance'],
  78856. computed: {
  78857. classes: function classes() {
  78858. var _ref;
  78859. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-required', this.required || this.isRequired), (0, _defineProperty3.default)(_ref, prefixCls + '-error', this.validateState === 'error'), (0, _defineProperty3.default)(_ref, prefixCls + '-validating', this.validateState === 'validating'), _ref)];
  78860. },
  78861. fieldValue: function fieldValue() {
  78862. var model = this.FormInstance.model;
  78863. if (!model || !this.prop) {
  78864. return;
  78865. }
  78866. var path = this.prop;
  78867. if (path.indexOf(':') !== -1) {
  78868. path = path.replace(/:/, '.');
  78869. }
  78870. return getPropByPath(model, path).v;
  78871. },
  78872. labelStyles: function labelStyles() {
  78873. var style = {};
  78874. var labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.FormInstance.labelWidth;
  78875. if (labelWidth || labelWidth === 0) {
  78876. style.width = String(labelWidth) + 'px';
  78877. }
  78878. return style;
  78879. },
  78880. contentStyles: function contentStyles() {
  78881. var style = {};
  78882. var labelWidth = this.labelWidth === 0 || this.labelWidth ? this.labelWidth : this.FormInstance.labelWidth;
  78883. if (labelWidth || labelWidth === 0) {
  78884. style.marginLeft = String(labelWidth) + 'px';
  78885. }
  78886. return style;
  78887. }
  78888. },
  78889. methods: {
  78890. setRules: function setRules() {
  78891. var _this = this;
  78892. var rules = this.getRules();
  78893. if (rules.length && this.required) {
  78894. return;
  78895. } else if (rules.length) {
  78896. rules.every(function (rule) {
  78897. (0, _newArrowCheck3.default)(this, _this);
  78898. this.isRequired = rule.required;
  78899. }.bind(this));
  78900. } else if (this.required) {
  78901. this.isRequired = this.required;
  78902. }
  78903. this.$off('on-form-blur', this.onFieldBlur);
  78904. this.$off('on-form-change', this.onFieldChange);
  78905. this.$on('on-form-blur', this.onFieldBlur);
  78906. this.$on('on-form-change', this.onFieldChange);
  78907. },
  78908. getRules: function getRules() {
  78909. var formRules = this.FormInstance.rules;
  78910. var selfRules = this.rules;
  78911. formRules = formRules ? formRules[this.prop] : [];
  78912. return [].concat(selfRules || formRules || []);
  78913. },
  78914. getFilteredRule: function getFilteredRule(trigger) {
  78915. var _this2 = this;
  78916. var rules = this.getRules();
  78917. return rules.filter(function (rule) {
  78918. (0, _newArrowCheck3.default)(this, _this2);
  78919. return !rule.trigger || rule.trigger.indexOf(trigger) !== -1;
  78920. }.bind(this));
  78921. },
  78922. validate: function validate(trigger) {
  78923. var _this3 = this;
  78924. var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
  78925. var rules = this.getFilteredRule(trigger);
  78926. if (!rules || rules.length === 0) {
  78927. if (!this.required) {
  78928. callback();
  78929. return true;
  78930. } else {
  78931. rules = [{ required: true }];
  78932. }
  78933. }
  78934. this.validateState = 'validating';
  78935. var descriptor = {};
  78936. descriptor[this.prop] = rules;
  78937. var validator = new _asyncValidator2.default(descriptor);
  78938. var model = {};
  78939. model[this.prop] = this.fieldValue;
  78940. validator.validate(model, { firstFields: true }, function (errors) {
  78941. (0, _newArrowCheck3.default)(this, _this3);
  78942. this.validateState = !errors ? 'success' : 'error';
  78943. this.validateMessage = errors ? errors[0].message : '';
  78944. callback(this.validateMessage);
  78945. this.FormInstance && this.FormInstance.$emit('on-validate', this.prop, !errors, this.validateMessage || null);
  78946. }.bind(this));
  78947. this.validateDisabled = false;
  78948. },
  78949. resetField: function resetField() {
  78950. this.validateState = '';
  78951. this.validateMessage = '';
  78952. var model = this.FormInstance.model;
  78953. var value = this.fieldValue;
  78954. var path = this.prop;
  78955. if (path.indexOf(':') !== -1) {
  78956. path = path.replace(/:/, '.');
  78957. }
  78958. var prop = getPropByPath(model, path);
  78959. if (Array.isArray(value) && this.initialValue !== null) {
  78960. this.validateDisabled = true;
  78961. prop.o[prop.k] = [].concat(this.initialValue);
  78962. } else {
  78963. this.validateDisabled = true;
  78964. prop.o[prop.k] = this.initialValue;
  78965. }
  78966. },
  78967. onFieldBlur: function onFieldBlur() {
  78968. this.validate('blur');
  78969. },
  78970. onFieldChange: function onFieldChange() {
  78971. if (this.validateDisabled) {
  78972. this.validateDisabled = false;
  78973. return;
  78974. }
  78975. this.validate('change');
  78976. }
  78977. },
  78978. mounted: function mounted() {
  78979. if (this.prop) {
  78980. this.dispatch('iForm', 'on-form-item-add', this);
  78981. Object.defineProperty(this, 'initialValue', {
  78982. value: this.fieldValue
  78983. });
  78984. this.setRules();
  78985. }
  78986. },
  78987. beforeDestroy: function beforeDestroy() {
  78988. this.dispatch('iForm', 'on-form-item-remove', this);
  78989. }
  78990. };
  78991. /***/ }),
  78992. /* 192 */
  78993. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  78994. "use strict";
  78995. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  78996. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__ = __webpack_require__(193);
  78997. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__);
  78998. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  78999. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__ = __webpack_require__(453);
  79000. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__);
  79001. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  79002. /* script */
  79003. /* template */
  79004. /* template functional */
  79005. var __vue_template_functional__ = false
  79006. /* styles */
  79007. var __vue_styles__ = null
  79008. /* scopeId */
  79009. var __vue_scopeId__ = null
  79010. /* moduleIdentifier (server only) */
  79011. var __vue_module_identifier__ = null
  79012. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  79013. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_header_vue___default.a,
  79014. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__["render"],
  79015. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8cd48bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_header_vue__["staticRenderFns"],
  79016. __vue_template_functional__,
  79017. __vue_styles__,
  79018. __vue_scopeId__,
  79019. __vue_module_identifier__
  79020. )
  79021. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  79022. /***/ }),
  79023. /* 193 */
  79024. /***/ (function(module, exports, __webpack_require__) {
  79025. "use strict";
  79026. Object.defineProperty(exports, "__esModule", {
  79027. value: true
  79028. });
  79029. var prefixCls = 'ivu-layout';
  79030. exports.default = {
  79031. name: 'Header',
  79032. computed: {
  79033. wrapClasses: function wrapClasses() {
  79034. return prefixCls + '-header';
  79035. }
  79036. }
  79037. };
  79038. /***/ }),
  79039. /* 194 */
  79040. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79041. "use strict";
  79042. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  79043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__ = __webpack_require__(195);
  79044. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__);
  79045. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  79046. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__ = __webpack_require__(456);
  79047. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__);
  79048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  79049. /* script */
  79050. /* template */
  79051. /* template functional */
  79052. var __vue_template_functional__ = false
  79053. /* styles */
  79054. var __vue_styles__ = null
  79055. /* scopeId */
  79056. var __vue_scopeId__ = null
  79057. /* moduleIdentifier (server only) */
  79058. var __vue_module_identifier__ = null
  79059. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  79060. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_input_number_vue___default.a,
  79061. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__["render"],
  79062. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_213643b9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_input_number_vue__["staticRenderFns"],
  79063. __vue_template_functional__,
  79064. __vue_styles__,
  79065. __vue_scopeId__,
  79066. __vue_module_identifier__
  79067. )
  79068. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  79069. /***/ }),
  79070. /* 195 */
  79071. /***/ (function(module, exports, __webpack_require__) {
  79072. "use strict";
  79073. Object.defineProperty(exports, "__esModule", {
  79074. value: true
  79075. });
  79076. var _newArrowCheck2 = __webpack_require__(1);
  79077. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  79078. var _defineProperty2 = __webpack_require__(2);
  79079. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79080. var _assist = __webpack_require__(3);
  79081. var _emitter = __webpack_require__(4);
  79082. var _emitter2 = _interopRequireDefault(_emitter);
  79083. var _form = __webpack_require__(11);
  79084. var _form2 = _interopRequireDefault(_form);
  79085. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79086. var prefixCls = 'ivu-input-number';
  79087. var iconPrefixCls = 'ivu-icon';
  79088. function addNum(num1, num2) {
  79089. var sq1 = void 0,
  79090. sq2 = void 0,
  79091. m = void 0;
  79092. try {
  79093. sq1 = num1.toString().split('.')[1].length;
  79094. } catch (e) {
  79095. sq1 = 0;
  79096. }
  79097. try {
  79098. sq2 = num2.toString().split('.')[1].length;
  79099. } catch (e) {
  79100. sq2 = 0;
  79101. }
  79102. m = Math.pow(10, Math.max(sq1, sq2));
  79103. return (Math.round(num1 * m) + Math.round(num2 * m)) / m;
  79104. }
  79105. exports.default = {
  79106. name: 'InputNumber',
  79107. mixins: [_emitter2.default, _form2.default],
  79108. props: {
  79109. max: {
  79110. type: Number,
  79111. default: Infinity
  79112. },
  79113. min: {
  79114. type: Number,
  79115. default: -Infinity
  79116. },
  79117. step: {
  79118. type: Number,
  79119. default: 1
  79120. },
  79121. activeChange: {
  79122. type: Boolean,
  79123. default: true
  79124. },
  79125. value: {
  79126. type: Number,
  79127. default: 1
  79128. },
  79129. size: {
  79130. validator: function validator(value) {
  79131. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  79132. },
  79133. default: function _default() {
  79134. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  79135. }
  79136. },
  79137. disabled: {
  79138. type: Boolean,
  79139. default: false
  79140. },
  79141. autofocus: {
  79142. type: Boolean,
  79143. default: false
  79144. },
  79145. readonly: {
  79146. type: Boolean,
  79147. default: false
  79148. },
  79149. editable: {
  79150. type: Boolean,
  79151. default: true
  79152. },
  79153. name: {
  79154. type: String
  79155. },
  79156. precision: {
  79157. type: Number
  79158. },
  79159. elementId: {
  79160. type: String
  79161. },
  79162. formatter: {
  79163. type: Function
  79164. },
  79165. parser: {
  79166. type: Function
  79167. },
  79168. placeholder: {
  79169. type: String,
  79170. default: ''
  79171. },
  79172. controlsOutside: {
  79173. type: Boolean,
  79174. default: false
  79175. }
  79176. },
  79177. data: function data() {
  79178. return {
  79179. focused: false,
  79180. upDisabled: false,
  79181. downDisabled: false,
  79182. currentValue: this.value
  79183. };
  79184. },
  79185. computed: {
  79186. wrapClasses: function wrapClasses() {
  79187. var _ref;
  79188. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-focused', this.focused), (0, _defineProperty3.default)(_ref, prefixCls + '-controls-outside', this.controlsOutside), _ref)];
  79189. },
  79190. handlerClasses: function handlerClasses() {
  79191. return prefixCls + '-handler-wrap';
  79192. },
  79193. upClasses: function upClasses() {
  79194. return [prefixCls + '-handler', prefixCls + '-handler-up', (0, _defineProperty3.default)({}, prefixCls + '-handler-up-disabled', this.upDisabled)];
  79195. },
  79196. innerUpClasses: function innerUpClasses() {
  79197. return prefixCls + '-handler-up-inner ' + iconPrefixCls + ' ' + iconPrefixCls + '-ios-arrow-up';
  79198. },
  79199. downClasses: function downClasses() {
  79200. return [prefixCls + '-handler', prefixCls + '-handler-down', (0, _defineProperty3.default)({}, prefixCls + '-handler-down-disabled', this.downDisabled)];
  79201. },
  79202. innerDownClasses: function innerDownClasses() {
  79203. return prefixCls + '-handler-down-inner ' + iconPrefixCls + ' ' + iconPrefixCls + '-ios-arrow-down';
  79204. },
  79205. inputWrapClasses: function inputWrapClasses() {
  79206. return prefixCls + '-input-wrap';
  79207. },
  79208. inputClasses: function inputClasses() {
  79209. return prefixCls + '-input';
  79210. },
  79211. precisionValue: function precisionValue() {
  79212. if (!this.currentValue) return this.currentValue;
  79213. return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
  79214. },
  79215. formatterValue: function formatterValue() {
  79216. if (this.formatter && this.precisionValue !== null) {
  79217. return this.formatter(this.precisionValue);
  79218. } else {
  79219. return this.precisionValue;
  79220. }
  79221. }
  79222. },
  79223. methods: {
  79224. preventDefault: function preventDefault(e) {
  79225. e.preventDefault();
  79226. },
  79227. up: function up(e) {
  79228. var targetVal = Number(e.target.value);
  79229. if (this.upDisabled && isNaN(targetVal)) {
  79230. return false;
  79231. }
  79232. this.changeStep('up', e);
  79233. },
  79234. down: function down(e) {
  79235. var targetVal = Number(e.target.value);
  79236. if (this.downDisabled && isNaN(targetVal)) {
  79237. return false;
  79238. }
  79239. this.changeStep('down', e);
  79240. },
  79241. changeStep: function changeStep(type, e) {
  79242. if (this.itemDisabled || this.readonly) {
  79243. return false;
  79244. }
  79245. var targetVal = Number(e.target.value);
  79246. var val = Number(this.currentValue);
  79247. var step = Number(this.step);
  79248. if (isNaN(val)) {
  79249. return false;
  79250. }
  79251. if (!isNaN(targetVal)) {
  79252. if (type === 'up') {
  79253. if (addNum(targetVal, step) <= this.max) {
  79254. val = targetVal;
  79255. } else {
  79256. return false;
  79257. }
  79258. } else if (type === 'down') {
  79259. if (addNum(targetVal, -step) >= this.min) {
  79260. val = targetVal;
  79261. } else {
  79262. return false;
  79263. }
  79264. }
  79265. }
  79266. if (type === 'up') {
  79267. val = addNum(val, step);
  79268. } else if (type === 'down') {
  79269. val = addNum(val, -step);
  79270. }
  79271. this.setValue(val);
  79272. },
  79273. setValue: function setValue(val) {
  79274. var _this = this;
  79275. if (val && !isNaN(this.precision)) val = Number(Number(val).toFixed(this.precision));
  79276. var min = this.min,
  79277. max = this.max;
  79278. if (val !== null) {
  79279. if (val > max) {
  79280. val = max;
  79281. } else if (val < min) {
  79282. val = min;
  79283. }
  79284. }
  79285. this.$nextTick(function () {
  79286. (0, _newArrowCheck3.default)(this, _this);
  79287. this.currentValue = val;
  79288. this.$emit('input', val);
  79289. this.$emit('on-change', val);
  79290. this.dispatch('FormItem', 'on-form-change', val);
  79291. }.bind(this));
  79292. },
  79293. focus: function focus(event) {
  79294. this.focused = true;
  79295. this.$emit('on-focus', event);
  79296. },
  79297. blur: function blur() {
  79298. this.focused = false;
  79299. this.$emit('on-blur');
  79300. if (!(0, _assist.findComponentUpward)(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
  79301. this.dispatch('FormItem', 'on-form-blur', this.currentValue);
  79302. }
  79303. },
  79304. keyDown: function keyDown(e) {
  79305. if (e.keyCode === 38) {
  79306. e.preventDefault();
  79307. this.up(e);
  79308. } else if (e.keyCode === 40) {
  79309. e.preventDefault();
  79310. this.down(e);
  79311. }
  79312. },
  79313. change: function change(event) {
  79314. if (event.type == 'change' && this.activeChange) return;
  79315. if (event.type == 'input' && !this.activeChange) return;
  79316. var val = event.target.value.trim();
  79317. if (this.parser) {
  79318. val = this.parser(val);
  79319. }
  79320. var isEmptyString = val.length === 0;
  79321. if (isEmptyString) {
  79322. this.setValue(null);
  79323. return;
  79324. }
  79325. if (event.type == 'input' && val.match(/^\-?\.?$|\.$/)) return;
  79326. val = Number(val);
  79327. if (!isNaN(val)) {
  79328. this.currentValue = val;
  79329. this.setValue(val);
  79330. } else {
  79331. event.target.value = this.currentValue;
  79332. }
  79333. },
  79334. changeVal: function changeVal(val) {
  79335. val = Number(val);
  79336. if (!isNaN(val)) {
  79337. var step = this.step;
  79338. this.upDisabled = val + step > this.max;
  79339. this.downDisabled = val - step < this.min;
  79340. } else {
  79341. this.upDisabled = true;
  79342. this.downDisabled = true;
  79343. }
  79344. }
  79345. },
  79346. mounted: function mounted() {
  79347. this.changeVal(this.currentValue);
  79348. },
  79349. watch: {
  79350. value: function value(val) {
  79351. this.currentValue = val;
  79352. },
  79353. currentValue: function currentValue(val) {
  79354. this.changeVal(val);
  79355. },
  79356. min: function min() {
  79357. this.changeVal(this.currentValue);
  79358. },
  79359. max: function max() {
  79360. this.changeVal(this.currentValue);
  79361. }
  79362. }
  79363. };
  79364. /***/ }),
  79365. /* 196 */
  79366. /***/ (function(module, exports, __webpack_require__) {
  79367. "use strict";
  79368. Object.defineProperty(exports, "__esModule", {
  79369. value: true
  79370. });
  79371. var _sign = __webpack_require__(459);
  79372. var _sign2 = _interopRequireDefault(_sign);
  79373. var _defineProperty2 = __webpack_require__(2);
  79374. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79375. var _promise = __webpack_require__(185);
  79376. var _promise2 = _interopRequireDefault(_promise);
  79377. var _newArrowCheck2 = __webpack_require__(1);
  79378. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  79379. var _lodash = __webpack_require__(463);
  79380. var _lodash2 = _interopRequireDefault(_lodash);
  79381. var _loadingComponent = __webpack_require__(464);
  79382. var _loadingComponent2 = _interopRequireDefault(_loadingComponent);
  79383. var _dom = __webpack_require__(12);
  79384. var _locale = __webpack_require__(6);
  79385. var _locale2 = _interopRequireDefault(_locale);
  79386. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79387. var prefixCls = 'ivu-scroll';
  79388. var dragConfig = {
  79389. sensitivity: 10,
  79390. minimumStartDragOffset: 5 };
  79391. var noop = function () {
  79392. (0, _newArrowCheck3.default)(undefined, undefined);
  79393. return _promise2.default.resolve();
  79394. }.bind(undefined);
  79395. exports.default = {
  79396. name: 'Scroll',
  79397. mixins: [_locale2.default],
  79398. components: { loader: _loadingComponent2.default },
  79399. props: {
  79400. height: {
  79401. type: [Number, String],
  79402. default: 300
  79403. },
  79404. onReachTop: {
  79405. type: Function
  79406. },
  79407. onReachBottom: {
  79408. type: Function
  79409. },
  79410. onReachEdge: {
  79411. type: Function
  79412. },
  79413. loadingText: {
  79414. type: String
  79415. },
  79416. distanceToEdge: [Number, Array],
  79417. stopSlide: {
  79418. type: Boolean,
  79419. default: false
  79420. }
  79421. },
  79422. data: function data() {
  79423. var _this = this;
  79424. var distanceToEdge = this.calculateProximityThreshold();
  79425. return {
  79426. showTopLoader: false,
  79427. showBottomLoader: false,
  79428. showBodyLoader: false,
  79429. lastScroll: 0,
  79430. reachedTopScrollLimit: true,
  79431. reachedBottomScrollLimit: false,
  79432. topRubberPadding: 0,
  79433. bottomRubberPadding: 0,
  79434. rubberRollBackTimeout: false,
  79435. isLoading: false,
  79436. pointerTouchDown: null,
  79437. touchScroll: false,
  79438. handleScroll: function handleScroll() {
  79439. (0, _newArrowCheck3.default)(this, _this);
  79440. }.bind(this),
  79441. pointerUpHandler: function pointerUpHandler() {
  79442. (0, _newArrowCheck3.default)(this, _this);
  79443. }.bind(this),
  79444. pointerMoveHandler: function pointerMoveHandler() {
  79445. (0, _newArrowCheck3.default)(this, _this);
  79446. }.bind(this),
  79447. topProximityThreshold: distanceToEdge[0],
  79448. bottomProximityThreshold: distanceToEdge[1]
  79449. };
  79450. },
  79451. computed: {
  79452. wrapClasses: function wrapClasses() {
  79453. return prefixCls + '-wrapper';
  79454. },
  79455. scrollContainerClasses: function scrollContainerClasses() {
  79456. return [prefixCls + '-container', (0, _defineProperty3.default)({}, prefixCls + '-container-loading', this.showBodyLoader && this.stopSlide)];
  79457. },
  79458. slotContainerClasses: function slotContainerClasses() {
  79459. return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-loading', this.showBodyLoader)];
  79460. },
  79461. loaderClasses: function loaderClasses() {
  79462. return prefixCls + '-loader';
  79463. },
  79464. wrapperPadding: function wrapperPadding() {
  79465. return {
  79466. paddingTop: this.topRubberPadding + 'px',
  79467. paddingBottom: this.bottomRubberPadding + 'px'
  79468. };
  79469. },
  79470. localeLoadingText: function localeLoadingText() {
  79471. if (this.loadingText === undefined) {
  79472. return this.t('i.select.loading');
  79473. } else {
  79474. return this.loadingText;
  79475. }
  79476. }
  79477. },
  79478. methods: {
  79479. waitOneSecond: function waitOneSecond() {
  79480. var _this2 = this;
  79481. return new _promise2.default(function (resolve) {
  79482. (0, _newArrowCheck3.default)(this, _this2);
  79483. setTimeout(resolve, 1000);
  79484. }.bind(this));
  79485. },
  79486. calculateProximityThreshold: function calculateProximityThreshold() {
  79487. var dte = this.distanceToEdge;
  79488. if (typeof dte == 'undefined') return [20, 20];
  79489. return Array.isArray(dte) ? dte : [dte, dte];
  79490. },
  79491. onCallback: function onCallback(dir) {
  79492. var _this3 = this;
  79493. this.isLoading = true;
  79494. this.showBodyLoader = true;
  79495. if (dir > 0) {
  79496. this.showTopLoader = true;
  79497. this.topRubberPadding = 20;
  79498. } else {
  79499. (function () {
  79500. _this3.showBottomLoader = true;
  79501. _this3.bottomRubberPadding = 20;
  79502. var bottomLoaderHeight = 0;
  79503. var container = _this3.$refs.scrollContainer;
  79504. var initialScrollTop = container.scrollTop;
  79505. for (var i = 0; i < 20; i++) {
  79506. setTimeout(function () {
  79507. (0, _newArrowCheck3.default)(this, _this3);
  79508. bottomLoaderHeight = Math.max(bottomLoaderHeight, this.$refs.bottomLoader.getBoundingClientRect().height);
  79509. container.scrollTop = initialScrollTop + bottomLoaderHeight;
  79510. }.bind(_this3), i * 50);
  79511. }
  79512. })();
  79513. }
  79514. var callbacks = [this.waitOneSecond(), this.onReachEdge ? this.onReachEdge(dir) : noop()];
  79515. callbacks.push(dir > 0 ? this.onReachTop ? this.onReachTop() : noop() : this.onReachBottom ? this.onReachBottom() : noop());
  79516. var tooSlow = setTimeout(function () {
  79517. (0, _newArrowCheck3.default)(this, _this3);
  79518. this.reset();
  79519. }.bind(this), 5000);
  79520. _promise2.default.all(callbacks).then(function () {
  79521. (0, _newArrowCheck3.default)(this, _this3);
  79522. clearTimeout(tooSlow);
  79523. this.reset();
  79524. }.bind(this));
  79525. },
  79526. reset: function reset() {
  79527. var _this4 = this;
  79528. ['showTopLoader', 'showBottomLoader', 'showBodyLoader', 'isLoading', 'reachedTopScrollLimit', 'reachedBottomScrollLimit'].forEach(function (prop) {
  79529. (0, _newArrowCheck3.default)(this, _this4);
  79530. return this[prop] = false;
  79531. }.bind(this));
  79532. this.lastScroll = 0;
  79533. this.topRubberPadding = 0;
  79534. this.bottomRubberPadding = 0;
  79535. clearInterval(this.rubberRollBackTimeout);
  79536. if (this.touchScroll) {
  79537. setTimeout(function () {
  79538. (0, _newArrowCheck3.default)(this, _this4);
  79539. (0, _dom.off)(window, 'touchend', this.pointerUpHandler);
  79540. this.$refs.scrollContainer.removeEventListener('touchmove', this.pointerMoveHandler);
  79541. this.touchScroll = false;
  79542. }.bind(this), 500);
  79543. }
  79544. },
  79545. onWheel: function onWheel(event) {
  79546. if (this.isLoading) return;
  79547. var wheelDelta = event.wheelDelta ? event.wheelDelta : -(event.detail || event.deltaY);
  79548. this.stretchEdge(wheelDelta);
  79549. },
  79550. stretchEdge: function stretchEdge(direction) {
  79551. var _this5 = this;
  79552. clearTimeout(this.rubberRollBackTimeout);
  79553. if (!this.onReachEdge) {
  79554. if (direction > 0) {
  79555. if (!this.onReachTop) return;
  79556. } else {
  79557. if (!this.onReachBottom) return;
  79558. }
  79559. }
  79560. this.rubberRollBackTimeout = setTimeout(function () {
  79561. (0, _newArrowCheck3.default)(this, _this5);
  79562. if (!this.isLoading) this.reset();
  79563. }.bind(this), 250);
  79564. if (direction > 0 && this.reachedTopScrollLimit) {
  79565. this.topRubberPadding += 5 - this.topRubberPadding / 5;
  79566. if (this.topRubberPadding > this.topProximityThreshold) this.onCallback(1);
  79567. } else if (direction < 0 && this.reachedBottomScrollLimit) {
  79568. this.bottomRubberPadding += 6 - this.bottomRubberPadding / 4;
  79569. if (this.bottomRubberPadding > this.bottomProximityThreshold) this.onCallback(-1);
  79570. } else {
  79571. this.onScroll();
  79572. }
  79573. },
  79574. onScroll: function onScroll() {
  79575. var el = this.$refs.scrollContainer;
  79576. if (this.isLoading || !el) return;
  79577. var scrollDirection = (0, _sign2.default)(this.lastScroll - el.scrollTop);
  79578. var displacement = el.scrollHeight - el.clientHeight - el.scrollTop;
  79579. var topNegativeProximity = this.topProximityThreshold < 0 ? this.topProximityThreshold : 0;
  79580. var bottomNegativeProximity = this.bottomProximityThreshold < 0 ? this.bottomProximityThreshold : 0;
  79581. if (scrollDirection == -1 && displacement + bottomNegativeProximity <= dragConfig.sensitivity) {
  79582. this.reachedBottomScrollLimit = true;
  79583. } else if (scrollDirection >= 0 && el.scrollTop + topNegativeProximity <= 0) {
  79584. this.reachedTopScrollLimit = true;
  79585. } else {
  79586. this.reachedTopScrollLimit = false;
  79587. this.reachedBottomScrollLimit = false;
  79588. this.lastScroll = el.scrollTop;
  79589. }
  79590. },
  79591. getTouchCoordinates: function getTouchCoordinates(e) {
  79592. return {
  79593. x: e.touches[0].pageX,
  79594. y: e.touches[0].pageY
  79595. };
  79596. },
  79597. onPointerDown: function onPointerDown(e) {
  79598. var _this6 = this;
  79599. if (this.isLoading) return;
  79600. if (e.type == 'touchstart') {
  79601. var container = this.$refs.scrollContainer;
  79602. if (this.reachedTopScrollLimit) container.scrollTop = 5;else if (this.reachedBottomScrollLimit) container.scrollTop -= 5;
  79603. }
  79604. if (e.type == 'touchstart' && this.$refs.scrollContainer.scrollTop == 0) this.$refs.scrollContainer.scrollTop = 5;
  79605. this.pointerTouchDown = this.getTouchCoordinates(e);
  79606. (0, _dom.on)(window, 'touchend', this.pointerUpHandler);
  79607. this.$refs.scrollContainer.parentElement.addEventListener('touchmove', function (e) {
  79608. (0, _newArrowCheck3.default)(this, _this6);
  79609. e.stopPropagation();
  79610. this.pointerMoveHandler(e);
  79611. }.bind(this), { passive: false, useCapture: true });
  79612. },
  79613. onPointerMove: function onPointerMove(e) {
  79614. if (!this.pointerTouchDown) return;
  79615. if (this.isLoading) return;
  79616. var pointerPosition = this.getTouchCoordinates(e);
  79617. var yDiff = pointerPosition.y - this.pointerTouchDown.y;
  79618. this.stretchEdge(yDiff);
  79619. if (!this.touchScroll) {
  79620. var wasDragged = Math.abs(yDiff) > dragConfig.minimumStartDragOffset;
  79621. if (wasDragged) this.touchScroll = true;
  79622. }
  79623. },
  79624. onPointerUp: function onPointerUp() {
  79625. this.pointerTouchDown = null;
  79626. }
  79627. },
  79628. created: function created() {
  79629. this.handleScroll = (0, _lodash2.default)(this.onScroll, 150, { leading: false });
  79630. this.pointerUpHandler = this.onPointerUp.bind(this);
  79631. this.pointerMoveHandler = (0, _lodash2.default)(this.onPointerMove, 50, { leading: false });
  79632. }
  79633. };
  79634. /***/ }),
  79635. /* 197 */
  79636. /***/ (function(module, exports, __webpack_require__) {
  79637. "use strict";
  79638. Object.defineProperty(exports, "__esModule", {
  79639. value: true
  79640. });
  79641. var _defineProperty2 = __webpack_require__(2);
  79642. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79643. var _spin = __webpack_require__(91);
  79644. var _spin2 = _interopRequireDefault(_spin);
  79645. var _icon = __webpack_require__(8);
  79646. var _icon2 = _interopRequireDefault(_icon);
  79647. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79648. var prefixCls = 'ivu-scroll';
  79649. exports.default = {
  79650. props: ['text', 'active', 'spinnerHeight'],
  79651. components: { Spin: _spin2.default, Icon: _icon2.default },
  79652. computed: {
  79653. wrapperClasses: function wrapperClasses() {
  79654. return [prefixCls + '-loader-wrapper', (0, _defineProperty3.default)({}, prefixCls + '-loader-wrapper-active', this.active)];
  79655. },
  79656. spinnerClasses: function spinnerClasses() {
  79657. return prefixCls + '-spinner';
  79658. },
  79659. iconClasses: function iconClasses() {
  79660. return prefixCls + '-spinner-icon';
  79661. },
  79662. textClasses: function textClasses() {
  79663. return prefixCls + '-loader-text';
  79664. }
  79665. }
  79666. };
  79667. /***/ }),
  79668. /* 198 */
  79669. /***/ (function(module, exports, __webpack_require__) {
  79670. "use strict";
  79671. Object.defineProperty(exports, "__esModule", {
  79672. value: true
  79673. });
  79674. var _defineProperty2 = __webpack_require__(2);
  79675. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79676. var _assist = __webpack_require__(3);
  79677. var _mixinsScrollbar = __webpack_require__(87);
  79678. var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
  79679. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79680. var prefixCls = 'ivu-spin';
  79681. exports.default = {
  79682. name: 'Spin',
  79683. mixins: [_mixinsScrollbar2.default],
  79684. props: {
  79685. size: {
  79686. validator: function validator(value) {
  79687. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  79688. },
  79689. default: function _default() {
  79690. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  79691. }
  79692. },
  79693. fix: {
  79694. type: Boolean,
  79695. default: false
  79696. },
  79697. fullscreen: {
  79698. type: Boolean,
  79699. default: false
  79700. }
  79701. },
  79702. data: function data() {
  79703. return {
  79704. showText: false,
  79705. visible: false
  79706. };
  79707. },
  79708. computed: {
  79709. classes: function classes() {
  79710. var _ref;
  79711. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-fix', this.fix), (0, _defineProperty3.default)(_ref, prefixCls + '-show-text', this.showText), (0, _defineProperty3.default)(_ref, prefixCls + '-fullscreen', this.fullscreen), _ref)];
  79712. },
  79713. mainClasses: function mainClasses() {
  79714. return prefixCls + '-main';
  79715. },
  79716. dotClasses: function dotClasses() {
  79717. return prefixCls + '-dot';
  79718. },
  79719. textClasses: function textClasses() {
  79720. return prefixCls + '-text';
  79721. },
  79722. fullscreenVisible: function fullscreenVisible() {
  79723. if (this.fullscreen) {
  79724. return this.visible;
  79725. } else {
  79726. return true;
  79727. }
  79728. }
  79729. },
  79730. watch: {
  79731. visible: function visible(val) {
  79732. if (val) {
  79733. this.addScrollEffect();
  79734. } else {
  79735. this.removeScrollEffect();
  79736. }
  79737. }
  79738. },
  79739. mounted: function mounted() {
  79740. this.showText = this.$slots.default !== undefined;
  79741. }
  79742. };
  79743. /***/ }),
  79744. /* 199 */
  79745. /***/ (function(module, exports, __webpack_require__) {
  79746. "use strict";
  79747. Object.defineProperty(exports, "__esModule", {
  79748. value: true
  79749. });
  79750. var _newArrowCheck2 = __webpack_require__(1);
  79751. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  79752. var _defineProperty2 = __webpack_require__(2);
  79753. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79754. var _assist = __webpack_require__(3);
  79755. var _dom = __webpack_require__(12);
  79756. var _trigger = __webpack_require__(470);
  79757. var _trigger2 = _interopRequireDefault(_trigger);
  79758. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79759. exports.default = {
  79760. name: 'Split',
  79761. components: {
  79762. Trigger: _trigger2.default
  79763. },
  79764. props: {
  79765. value: {
  79766. type: [Number, String],
  79767. default: 0.5
  79768. },
  79769. mode: {
  79770. validator: function validator(value) {
  79771. return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
  79772. },
  79773. default: 'horizontal'
  79774. },
  79775. min: {
  79776. type: [Number, String],
  79777. default: '40px'
  79778. },
  79779. max: {
  79780. type: [Number, String],
  79781. default: '40px'
  79782. }
  79783. },
  79784. data: function data() {
  79785. return {
  79786. prefix: 'ivu-split',
  79787. offset: 0,
  79788. oldOffset: 0,
  79789. isMoving: false,
  79790. computedMin: 0,
  79791. computedMax: 0,
  79792. currentValue: 0.5
  79793. };
  79794. },
  79795. computed: {
  79796. wrapperClasses: function wrapperClasses() {
  79797. return [String(this.prefix) + '-wrapper', this.isMoving ? 'no-select' : ''];
  79798. },
  79799. paneClasses: function paneClasses() {
  79800. return [String(this.prefix) + '-pane', (0, _defineProperty3.default)({}, String(this.prefix) + '-pane-moving', this.isMoving)];
  79801. },
  79802. isHorizontal: function isHorizontal() {
  79803. return this.mode === 'horizontal';
  79804. },
  79805. anotherOffset: function anotherOffset() {
  79806. return 100 - this.offset;
  79807. },
  79808. valueIsPx: function valueIsPx() {
  79809. return typeof this.value === 'string';
  79810. },
  79811. offsetSize: function offsetSize() {
  79812. return this.isHorizontal ? 'offsetWidth' : 'offsetHeight';
  79813. }
  79814. },
  79815. methods: {
  79816. px2percent: function px2percent(numerator, denominator) {
  79817. return parseFloat(numerator) / parseFloat(denominator);
  79818. },
  79819. getComputedThresholdValue: function getComputedThresholdValue(type) {
  79820. var size = this.$refs.outerWrapper[this.offsetSize];
  79821. if (this.valueIsPx) return typeof this[type] === 'string' ? this[type] : size * this[type];else return typeof this[type] === 'string' ? this.px2percent(this[type], size) : this[type];
  79822. },
  79823. getMin: function getMin(value1, value2) {
  79824. if (this.valueIsPx) return String(Math.min(parseFloat(value1), parseFloat(value2))) + 'px';else return Math.min(value1, value2);
  79825. },
  79826. getMax: function getMax(value1, value2) {
  79827. if (this.valueIsPx) return String(Math.max(parseFloat(value1), parseFloat(value2))) + 'px';else return Math.max(value1, value2);
  79828. },
  79829. getAnotherOffset: function getAnotherOffset(value) {
  79830. var res = 0;
  79831. if (this.valueIsPx) res = this.$refs.outerWrapper[this.offsetSize] - parseFloat(value) + 'px';else res = 1 - value;
  79832. return res;
  79833. },
  79834. handleMove: function handleMove(e) {
  79835. var pageOffset = this.isHorizontal ? e.pageX : e.pageY;
  79836. var offset = pageOffset - this.initOffset;
  79837. var outerWidth = this.$refs.outerWrapper[this.offsetSize];
  79838. var value = this.valueIsPx ? String(parseFloat(this.oldOffset) + offset) + 'px' : this.px2percent(outerWidth * this.oldOffset + offset, outerWidth);
  79839. var anotherValue = this.getAnotherOffset(value);
  79840. if (parseFloat(value) <= parseFloat(this.computedMin)) value = this.getMax(value, this.computedMin);
  79841. if (parseFloat(anotherValue) <= parseFloat(this.computedMax)) value = this.getAnotherOffset(this.getMax(anotherValue, this.computedMax));
  79842. e.atMin = this.value === this.computedMin;
  79843. e.atMax = this.valueIsPx ? this.getAnotherOffset(this.value) === this.computedMax : this.getAnotherOffset(this.value).toFixed(5) === this.computedMax.toFixed(5);
  79844. this.$emit('input', value);
  79845. this.$emit('on-moving', e);
  79846. },
  79847. handleUp: function handleUp() {
  79848. this.isMoving = false;
  79849. (0, _dom.off)(document, 'mousemove', this.handleMove);
  79850. (0, _dom.off)(document, 'mouseup', this.handleUp);
  79851. this.$emit('on-move-end');
  79852. },
  79853. handleMousedown: function handleMousedown(e) {
  79854. this.initOffset = this.isHorizontal ? e.pageX : e.pageY;
  79855. this.oldOffset = this.value;
  79856. this.isMoving = true;
  79857. (0, _dom.on)(document, 'mousemove', this.handleMove);
  79858. (0, _dom.on)(document, 'mouseup', this.handleUp);
  79859. this.$emit('on-move-start');
  79860. },
  79861. computeOffset: function computeOffset() {
  79862. var _this = this;
  79863. this.$nextTick(function () {
  79864. (0, _newArrowCheck3.default)(this, _this);
  79865. this.computedMin = this.getComputedThresholdValue('min');
  79866. this.computedMax = this.getComputedThresholdValue('max');
  79867. this.offset = (this.valueIsPx ? this.px2percent(this.value, this.$refs.outerWrapper[this.offsetSize]) : this.value) * 10000 / 100;
  79868. }.bind(this));
  79869. }
  79870. },
  79871. watch: {
  79872. value: function value(val) {
  79873. if (val !== this.currentValue) {
  79874. this.currentValue = val;
  79875. this.computeOffset();
  79876. }
  79877. }
  79878. },
  79879. mounted: function mounted() {
  79880. var _this2 = this;
  79881. this.$nextTick(function () {
  79882. (0, _newArrowCheck3.default)(this, _this2);
  79883. this.computeOffset();
  79884. }.bind(this));
  79885. (0, _dom.on)(window, 'resize', this.computeOffset);
  79886. },
  79887. beforeDestroy: function beforeDestroy() {
  79888. (0, _dom.off)(window, 'resize', this.computeOffset);
  79889. }
  79890. };
  79891. /***/ }),
  79892. /* 200 */
  79893. /***/ (function(module, exports, __webpack_require__) {
  79894. "use strict";
  79895. Object.defineProperty(exports, "__esModule", {
  79896. value: true
  79897. });
  79898. exports.default = {
  79899. name: 'Trigger',
  79900. props: {
  79901. mode: String
  79902. },
  79903. data: function data() {
  79904. return {
  79905. prefix: 'ivu-split-trigger',
  79906. initOffset: 0
  79907. };
  79908. },
  79909. computed: {
  79910. isVertical: function isVertical() {
  79911. return this.mode === 'vertical';
  79912. },
  79913. classes: function classes() {
  79914. return [this.prefix, this.isVertical ? String(this.prefix) + '-vertical' : String(this.prefix) + '-horizontal'];
  79915. },
  79916. barConClasses: function barConClasses() {
  79917. return [String(this.prefix) + '-bar-con', this.isVertical ? 'vertical' : 'horizontal'];
  79918. }
  79919. }
  79920. };
  79921. /***/ }),
  79922. /* 201 */
  79923. /***/ (function(module, exports, __webpack_require__) {
  79924. "use strict";
  79925. Object.defineProperty(exports, "__esModule", {
  79926. value: true
  79927. });
  79928. var _newArrowCheck2 = __webpack_require__(1);
  79929. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  79930. var _defineProperty2 = __webpack_require__(2);
  79931. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  79932. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  79933. var prefixCls = 'ivu-layout';
  79934. exports.default = {
  79935. name: 'Layout',
  79936. data: function data() {
  79937. return {
  79938. hasSider: false
  79939. };
  79940. },
  79941. computed: {
  79942. wrapClasses: function wrapClasses() {
  79943. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-has-sider', this.hasSider)];
  79944. }
  79945. },
  79946. methods: {
  79947. findSider: function findSider() {
  79948. var _this = this;
  79949. return this.$children.some(function (child) {
  79950. (0, _newArrowCheck3.default)(this, _this);
  79951. return child.$options.name === 'Sider';
  79952. }.bind(this));
  79953. }
  79954. },
  79955. mounted: function mounted() {
  79956. this.hasSider = this.findSider();
  79957. }
  79958. };
  79959. /***/ }),
  79960. /* 202 */
  79961. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  79962. "use strict";
  79963. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  79964. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__ = __webpack_require__(203);
  79965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__);
  79966. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  79967. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__ = __webpack_require__(476);
  79968. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__);
  79969. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  79970. /* script */
  79971. /* template */
  79972. /* template functional */
  79973. var __vue_template_functional__ = false
  79974. /* styles */
  79975. var __vue_styles__ = null
  79976. /* scopeId */
  79977. var __vue_scopeId__ = null
  79978. /* moduleIdentifier (server only) */
  79979. var __vue_module_identifier__ = null
  79980. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  79981. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_sider_vue___default.a,
  79982. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__["render"],
  79983. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c013752_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_sider_vue__["staticRenderFns"],
  79984. __vue_template_functional__,
  79985. __vue_styles__,
  79986. __vue_scopeId__,
  79987. __vue_module_identifier__
  79988. )
  79989. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  79990. /***/ }),
  79991. /* 203 */
  79992. /***/ (function(module, exports, __webpack_require__) {
  79993. "use strict";
  79994. Object.defineProperty(exports, "__esModule", {
  79995. value: true
  79996. });
  79997. var _dom = __webpack_require__(12);
  79998. var _assist = __webpack_require__(3);
  79999. var prefixCls = 'ivu-layout-sider';
  80000. (0, _assist.setMatchMedia)();
  80001. exports.default = {
  80002. name: 'Sider',
  80003. props: {
  80004. value: {
  80005. type: Boolean,
  80006. default: false
  80007. },
  80008. width: {
  80009. type: [Number, String],
  80010. default: 200
  80011. },
  80012. collapsedWidth: {
  80013. type: [Number, String],
  80014. default: 64
  80015. },
  80016. hideTrigger: {
  80017. type: Boolean,
  80018. default: false
  80019. },
  80020. breakpoint: {
  80021. type: String,
  80022. validator: function validator(val) {
  80023. return (0, _assist.oneOf)(val, ['xs', 'sm', 'md', 'lg', 'xl', 'xxl']);
  80024. }
  80025. },
  80026. collapsible: {
  80027. type: Boolean,
  80028. default: false
  80029. },
  80030. defaultCollapsed: {
  80031. type: Boolean,
  80032. default: false
  80033. },
  80034. reverseArrow: {
  80035. type: Boolean,
  80036. default: false
  80037. }
  80038. },
  80039. data: function data() {
  80040. return {
  80041. prefixCls: prefixCls,
  80042. mediaMatched: false
  80043. };
  80044. },
  80045. computed: {
  80046. wrapClasses: function wrapClasses() {
  80047. return ['' + prefixCls, this.siderWidth ? '' : prefixCls + '-zero-width', this.value ? prefixCls + '-collapsed' : ''];
  80048. },
  80049. wrapStyles: function wrapStyles() {
  80050. return {
  80051. width: String(this.siderWidth) + 'px',
  80052. minWidth: String(this.siderWidth) + 'px',
  80053. maxWidth: String(this.siderWidth) + 'px',
  80054. flex: '0 0 ' + String(this.siderWidth) + 'px'
  80055. };
  80056. },
  80057. triggerClasses: function triggerClasses() {
  80058. return [prefixCls + '-trigger', this.value ? prefixCls + '-trigger-collapsed' : ''];
  80059. },
  80060. childClasses: function childClasses() {
  80061. return String(this.prefixCls) + '-children';
  80062. },
  80063. zeroWidthTriggerClasses: function zeroWidthTriggerClasses() {
  80064. return [prefixCls + '-zero-width-trigger', this.reverseArrow ? prefixCls + '-zero-width-trigger-left' : ''];
  80065. },
  80066. triggerIconClasses: function triggerIconClasses() {
  80067. return ['ivu-icon', 'ivu-icon-ios-arrow-' + (this.reverseArrow ? 'forward' : 'back'), prefixCls + '-trigger-icon'];
  80068. },
  80069. siderWidth: function siderWidth() {
  80070. return this.collapsible ? this.value ? this.mediaMatched ? 0 : parseInt(this.collapsedWidth) : parseInt(this.width) : this.width;
  80071. },
  80072. showZeroTrigger: function showZeroTrigger() {
  80073. return this.collapsible ? this.mediaMatched && !this.hideTrigger || parseInt(this.collapsedWidth) === 0 && this.value && !this.hideTrigger : false;
  80074. },
  80075. showBottomTrigger: function showBottomTrigger() {
  80076. return this.collapsible ? !this.mediaMatched && !this.hideTrigger : false;
  80077. }
  80078. },
  80079. methods: {
  80080. toggleCollapse: function toggleCollapse() {
  80081. var value = this.collapsible ? !this.value : false;
  80082. this.$emit('input', value);
  80083. },
  80084. matchMedia: function matchMedia() {
  80085. var matchMedia = void 0;
  80086. if (window.matchMedia) {
  80087. matchMedia = window.matchMedia;
  80088. }
  80089. var mediaMatched = this.mediaMatched;
  80090. this.mediaMatched = matchMedia('(max-width: ' + String(_assist.dimensionMap[this.breakpoint]) + ')').matches;
  80091. if (this.mediaMatched !== mediaMatched) {
  80092. this.$emit('input', this.mediaMatched);
  80093. }
  80094. },
  80095. onWindowResize: function onWindowResize() {
  80096. this.matchMedia();
  80097. }
  80098. },
  80099. watch: {
  80100. value: function value(stat) {
  80101. this.$emit('on-collapse', stat);
  80102. }
  80103. },
  80104. mounted: function mounted() {
  80105. if (this.defaultCollapsed) {
  80106. this.$emit('input', this.defaultCollapsed);
  80107. }
  80108. if (this.breakpoint !== undefined) {
  80109. (0, _dom.on)(window, 'resize', this.onWindowResize);
  80110. this.matchMedia();
  80111. }
  80112. },
  80113. beforeDestroy: function beforeDestroy() {
  80114. if (this.breakpoint !== undefined) {
  80115. (0, _dom.off)(window, 'resize', this.onWindowResize);
  80116. }
  80117. }
  80118. };
  80119. /***/ }),
  80120. /* 204 */
  80121. /***/ (function(module, exports, __webpack_require__) {
  80122. "use strict";
  80123. Object.defineProperty(exports, "__esModule", {
  80124. value: true
  80125. });
  80126. var _defineProperty2 = __webpack_require__(2);
  80127. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80128. var _assist = __webpack_require__(3);
  80129. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80130. var prefixCls = 'ivu-list';
  80131. exports.default = {
  80132. name: 'List',
  80133. provide: function provide() {
  80134. return {
  80135. ListInstance: this
  80136. };
  80137. },
  80138. props: {
  80139. border: {
  80140. type: Boolean,
  80141. default: false
  80142. },
  80143. itemLayout: {
  80144. validator: function validator(value) {
  80145. return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
  80146. },
  80147. default: 'horizontal'
  80148. },
  80149. header: {
  80150. type: String,
  80151. default: ''
  80152. },
  80153. footer: {
  80154. type: String,
  80155. default: ''
  80156. },
  80157. loading: {
  80158. type: Boolean,
  80159. default: false
  80160. },
  80161. size: {
  80162. validator: function validator(value) {
  80163. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  80164. },
  80165. default: function _default() {
  80166. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  80167. }
  80168. },
  80169. split: {
  80170. type: Boolean,
  80171. default: true
  80172. }
  80173. },
  80174. data: function data() {
  80175. return {};
  80176. },
  80177. computed: {
  80178. classes: function classes() {
  80179. var _ref;
  80180. return ['' + prefixCls, prefixCls + '-' + String(this.size), prefixCls + '-' + String(this.itemLayout), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-bordered', this.border), (0, _defineProperty3.default)(_ref, prefixCls + '-split', this.split), _ref)];
  80181. }
  80182. },
  80183. methods: {}
  80184. };
  80185. /***/ }),
  80186. /* 205 */
  80187. /***/ (function(module, exports, __webpack_require__) {
  80188. "use strict";
  80189. Object.defineProperty(exports, "__esModule", {
  80190. value: true
  80191. });
  80192. var _newArrowCheck2 = __webpack_require__(1);
  80193. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80194. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80195. exports.default = {
  80196. name: 'ListItem',
  80197. inject: ['ListInstance'],
  80198. props: {},
  80199. computed: {
  80200. itemLayout: function itemLayout() {
  80201. return this.ListInstance.itemLayout;
  80202. },
  80203. isItemContainsTextNode: function isItemContainsTextNode() {
  80204. var _this = this;
  80205. var result = void 0;
  80206. this.$slots.default.forEach(function (item) {
  80207. (0, _newArrowCheck3.default)(this, _this);
  80208. if (typeof item === 'string') {
  80209. result = true;
  80210. }
  80211. }.bind(this));
  80212. return result;
  80213. },
  80214. isFlexMode: function isFlexMode() {
  80215. var extra = this.$slots.extra;
  80216. if (this.itemLayout === 'vertical') {
  80217. return !!extra;
  80218. }
  80219. return !this.isItemContainsTextNode;
  80220. },
  80221. classes: function classes() {
  80222. return [{
  80223. 'ivu-list-item-no-flex': !this.isFlexMode
  80224. }];
  80225. }
  80226. }
  80227. };
  80228. /***/ }),
  80229. /* 206 */
  80230. /***/ (function(module, exports, __webpack_require__) {
  80231. "use strict";
  80232. Object.defineProperty(exports, "__esModule", {
  80233. value: true
  80234. });
  80235. var _avatar = __webpack_require__(125);
  80236. var _avatar2 = _interopRequireDefault(_avatar);
  80237. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80238. exports.default = {
  80239. name: 'ListItemMeta',
  80240. components: { Avatar: _avatar2.default },
  80241. props: {
  80242. avatar: {
  80243. type: String,
  80244. default: ''
  80245. },
  80246. title: {
  80247. type: String,
  80248. default: ''
  80249. },
  80250. description: {
  80251. type: String,
  80252. default: ''
  80253. }
  80254. }
  80255. };
  80256. /***/ }),
  80257. /* 207 */
  80258. /***/ (function(module, exports, __webpack_require__) {
  80259. "use strict";
  80260. Object.defineProperty(exports, "__esModule", {
  80261. value: true
  80262. });
  80263. var _defineProperty2 = __webpack_require__(2);
  80264. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80265. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80266. var prefixCls = 'ivu-loading-bar';
  80267. exports.default = {
  80268. name: 'LoadingBar',
  80269. props: {
  80270. color: {
  80271. type: String,
  80272. default: 'primary'
  80273. },
  80274. failedColor: {
  80275. type: String,
  80276. default: 'error'
  80277. },
  80278. height: {
  80279. type: Number,
  80280. default: 2
  80281. }
  80282. },
  80283. data: function data() {
  80284. return {
  80285. percent: 0,
  80286. status: 'success',
  80287. show: false
  80288. };
  80289. },
  80290. computed: {
  80291. classes: function classes() {
  80292. return '' + prefixCls;
  80293. },
  80294. innerClasses: function innerClasses() {
  80295. var _ref;
  80296. return [prefixCls + '-inner', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-inner-color-primary', this.color === 'primary' && this.status === 'success'), (0, _defineProperty3.default)(_ref, prefixCls + '-inner-failed-color-error', this.failedColor === 'error' && this.status === 'error'), _ref)];
  80297. },
  80298. outerStyles: function outerStyles() {
  80299. return {
  80300. height: String(this.height) + 'px'
  80301. };
  80302. },
  80303. styles: function styles() {
  80304. var style = {
  80305. width: String(this.percent) + '%',
  80306. height: String(this.height) + 'px'
  80307. };
  80308. if (this.color !== 'primary' && this.status === 'success') {
  80309. style.backgroundColor = this.color;
  80310. }
  80311. if (this.failedColor !== 'error' && this.status === 'error') {
  80312. style.backgroundColor = this.failedColor;
  80313. }
  80314. return style;
  80315. }
  80316. }
  80317. };
  80318. /***/ }),
  80319. /* 208 */
  80320. /***/ (function(module, exports, __webpack_require__) {
  80321. "use strict";
  80322. Object.defineProperty(exports, "__esModule", {
  80323. value: true
  80324. });
  80325. var _newArrowCheck2 = __webpack_require__(1);
  80326. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80327. var _toConsumableArray2 = __webpack_require__(17);
  80328. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  80329. var _defineProperty2 = __webpack_require__(2);
  80330. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80331. var _assist = __webpack_require__(3);
  80332. var _emitter = __webpack_require__(4);
  80333. var _emitter2 = _interopRequireDefault(_emitter);
  80334. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80335. var prefixCls = 'ivu-menu';
  80336. exports.default = {
  80337. name: 'Menu',
  80338. mixins: [_emitter2.default],
  80339. props: {
  80340. mode: {
  80341. validator: function validator(value) {
  80342. return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
  80343. },
  80344. default: 'vertical'
  80345. },
  80346. theme: {
  80347. validator: function validator(value) {
  80348. return (0, _assist.oneOf)(value, ['light', 'dark', 'primary']);
  80349. },
  80350. default: 'light'
  80351. },
  80352. activeName: {
  80353. type: [String, Number]
  80354. },
  80355. openNames: {
  80356. type: Array,
  80357. default: function _default() {
  80358. return [];
  80359. }
  80360. },
  80361. accordion: {
  80362. type: Boolean,
  80363. default: false
  80364. },
  80365. width: {
  80366. type: String,
  80367. default: '240px'
  80368. }
  80369. },
  80370. data: function data() {
  80371. return {
  80372. currentActiveName: this.activeName,
  80373. openedNames: []
  80374. };
  80375. },
  80376. computed: {
  80377. classes: function classes() {
  80378. var theme = this.theme;
  80379. if (this.mode === 'vertical' && this.theme === 'primary') theme = 'light';
  80380. return ['' + prefixCls, prefixCls + '-' + String(theme), (0, _defineProperty3.default)({}, prefixCls + '-' + String(this.mode), this.mode)];
  80381. },
  80382. styles: function styles() {
  80383. var style = {};
  80384. if (this.mode === 'vertical') style.width = this.width;
  80385. return style;
  80386. }
  80387. },
  80388. methods: {
  80389. updateActiveName: function updateActiveName() {
  80390. if (this.currentActiveName === undefined) {
  80391. this.currentActiveName = -1;
  80392. }
  80393. this.broadcast('Submenu', 'on-update-active-name', false);
  80394. this.broadcast('MenuItem', 'on-update-active-name', this.currentActiveName);
  80395. },
  80396. updateOpenKeys: function updateOpenKeys(name) {
  80397. var _this = this;
  80398. var names = [].concat((0, _toConsumableArray3.default)(this.openedNames));
  80399. var index = names.indexOf(name);
  80400. if (this.accordion) (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
  80401. (0, _newArrowCheck3.default)(this, _this);
  80402. item.opened = false;
  80403. }.bind(this));
  80404. if (index >= 0) {
  80405. var currentSubmenu = null;
  80406. (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
  80407. (0, _newArrowCheck3.default)(this, _this);
  80408. if (item.name === name) {
  80409. currentSubmenu = item;
  80410. item.opened = false;
  80411. }
  80412. }.bind(this));
  80413. (0, _assist.findComponentsUpward)(currentSubmenu, 'Submenu').forEach(function (item) {
  80414. (0, _newArrowCheck3.default)(this, _this);
  80415. item.opened = true;
  80416. }.bind(this));
  80417. (0, _assist.findComponentsDownward)(currentSubmenu, 'Submenu').forEach(function (item) {
  80418. (0, _newArrowCheck3.default)(this, _this);
  80419. item.opened = false;
  80420. }.bind(this));
  80421. } else {
  80422. if (this.accordion) {
  80423. var _currentSubmenu = null;
  80424. (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
  80425. (0, _newArrowCheck3.default)(this, _this);
  80426. if (item.name === name) {
  80427. _currentSubmenu = item;
  80428. item.opened = true;
  80429. }
  80430. }.bind(this));
  80431. (0, _assist.findComponentsUpward)(_currentSubmenu, 'Submenu').forEach(function (item) {
  80432. (0, _newArrowCheck3.default)(this, _this);
  80433. item.opened = true;
  80434. }.bind(this));
  80435. } else {
  80436. (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
  80437. (0, _newArrowCheck3.default)(this, _this);
  80438. if (item.name === name) item.opened = true;
  80439. }.bind(this));
  80440. }
  80441. }
  80442. var openedNames = (0, _assist.findComponentsDownward)(this, 'Submenu').filter(function (item) {
  80443. (0, _newArrowCheck3.default)(this, _this);
  80444. return item.opened;
  80445. }.bind(this)).map(function (item) {
  80446. (0, _newArrowCheck3.default)(this, _this);
  80447. return item.name;
  80448. }.bind(this));
  80449. this.openedNames = [].concat((0, _toConsumableArray3.default)(openedNames));
  80450. this.$emit('on-open-change', openedNames);
  80451. },
  80452. updateOpened: function updateOpened() {
  80453. var _this2 = this;
  80454. var items = (0, _assist.findComponentsDownward)(this, 'Submenu');
  80455. if (items.length) {
  80456. items.forEach(function (item) {
  80457. (0, _newArrowCheck3.default)(this, _this2);
  80458. if (this.openedNames.indexOf(item.name) > -1) item.opened = true;else item.opened = false;
  80459. }.bind(this));
  80460. }
  80461. },
  80462. handleEmitSelectEvent: function handleEmitSelectEvent(name) {
  80463. this.$emit('on-select', name);
  80464. }
  80465. },
  80466. mounted: function mounted() {
  80467. var _this3 = this;
  80468. this.openedNames = [].concat((0, _toConsumableArray3.default)(this.openNames));
  80469. this.updateOpened();
  80470. this.$nextTick(function () {
  80471. (0, _newArrowCheck3.default)(this, _this3);
  80472. return this.updateActiveName();
  80473. }.bind(this));
  80474. this.$on('on-menu-item-select', function (name) {
  80475. (0, _newArrowCheck3.default)(this, _this3);
  80476. this.currentActiveName = name;
  80477. this.$emit('on-select', name);
  80478. }.bind(this));
  80479. },
  80480. watch: {
  80481. openNames: function openNames(names) {
  80482. this.openedNames = names;
  80483. },
  80484. activeName: function activeName(val) {
  80485. this.currentActiveName = val;
  80486. },
  80487. currentActiveName: function currentActiveName() {
  80488. this.updateActiveName();
  80489. }
  80490. }
  80491. };
  80492. /***/ }),
  80493. /* 209 */
  80494. /***/ (function(module, exports, __webpack_require__) {
  80495. "use strict";
  80496. Object.defineProperty(exports, "__esModule", {
  80497. value: true
  80498. });
  80499. var _mixin = __webpack_require__(92);
  80500. var _mixin2 = _interopRequireDefault(_mixin);
  80501. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80502. var prefixCls = 'ivu-menu';
  80503. exports.default = {
  80504. name: 'MenuGroup',
  80505. mixins: [_mixin2.default],
  80506. props: {
  80507. title: {
  80508. type: String,
  80509. default: ''
  80510. }
  80511. },
  80512. data: function data() {
  80513. return {
  80514. prefixCls: prefixCls
  80515. };
  80516. },
  80517. computed: {
  80518. groupStyle: function groupStyle() {
  80519. return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
  80520. paddingLeft: 43 + (this.parentSubmenuNum - 1) * 28 + 'px'
  80521. } : {};
  80522. }
  80523. }
  80524. };
  80525. /***/ }),
  80526. /* 210 */
  80527. /***/ (function(module, exports, __webpack_require__) {
  80528. "use strict";
  80529. Object.defineProperty(exports, "__esModule", {
  80530. value: true
  80531. });
  80532. var _newArrowCheck2 = __webpack_require__(1);
  80533. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80534. var _defineProperty2 = __webpack_require__(2);
  80535. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80536. var _emitter = __webpack_require__(4);
  80537. var _emitter2 = _interopRequireDefault(_emitter);
  80538. var _assist = __webpack_require__(3);
  80539. var _mixin = __webpack_require__(92);
  80540. var _mixin2 = _interopRequireDefault(_mixin);
  80541. var _link = __webpack_require__(48);
  80542. var _link2 = _interopRequireDefault(_link);
  80543. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80544. var prefixCls = 'ivu-menu';
  80545. exports.default = {
  80546. name: 'MenuItem',
  80547. mixins: [_emitter2.default, _mixin2.default, _link2.default],
  80548. props: {
  80549. name: {
  80550. type: [String, Number],
  80551. required: true
  80552. },
  80553. disabled: {
  80554. type: Boolean,
  80555. default: false
  80556. }
  80557. },
  80558. data: function data() {
  80559. return {
  80560. active: false
  80561. };
  80562. },
  80563. computed: {
  80564. classes: function classes() {
  80565. var _ref;
  80566. return [prefixCls + '-item', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-active', this.active), (0, _defineProperty3.default)(_ref, prefixCls + '-item-selected', this.active), (0, _defineProperty3.default)(_ref, prefixCls + '-item-disabled', this.disabled), _ref)];
  80567. },
  80568. itemStyle: function itemStyle() {
  80569. return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
  80570. paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
  80571. } : {};
  80572. }
  80573. },
  80574. methods: {
  80575. handleClickItem: function handleClickItem(event) {
  80576. var new_window = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  80577. if (this.disabled) return;
  80578. if (new_window || this.target === '_blank') {
  80579. this.handleCheckClick(event, new_window);
  80580. var parentMenu = (0, _assist.findComponentUpward)(this, 'Menu');
  80581. if (parentMenu) parentMenu.handleEmitSelectEvent(this.name);
  80582. } else {
  80583. var parent = (0, _assist.findComponentUpward)(this, 'Submenu');
  80584. if (parent) {
  80585. this.dispatch('Submenu', 'on-menu-item-select', this.name);
  80586. } else {
  80587. this.dispatch('Menu', 'on-menu-item-select', this.name);
  80588. }
  80589. this.handleCheckClick(event, new_window);
  80590. }
  80591. }
  80592. },
  80593. mounted: function mounted() {
  80594. var _this = this;
  80595. this.$on('on-update-active-name', function (name) {
  80596. (0, _newArrowCheck3.default)(this, _this);
  80597. if (this.name === name) {
  80598. this.active = true;
  80599. this.dispatch('Submenu', 'on-update-active-name', name);
  80600. } else {
  80601. this.active = false;
  80602. }
  80603. }.bind(this));
  80604. }
  80605. };
  80606. /***/ }),
  80607. /* 211 */
  80608. /***/ (function(module, exports, __webpack_require__) {
  80609. "use strict";
  80610. Object.defineProperty(exports, "__esModule", {
  80611. value: true
  80612. });
  80613. var _newArrowCheck2 = __webpack_require__(1);
  80614. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80615. var _defineProperty2 = __webpack_require__(2);
  80616. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80617. var _dropdown = __webpack_require__(36);
  80618. var _dropdown2 = _interopRequireDefault(_dropdown);
  80619. var _icon = __webpack_require__(8);
  80620. var _icon2 = _interopRequireDefault(_icon);
  80621. var _collapseTransition = __webpack_require__(83);
  80622. var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
  80623. var _assist = __webpack_require__(3);
  80624. var _emitter = __webpack_require__(4);
  80625. var _emitter2 = _interopRequireDefault(_emitter);
  80626. var _mixin = __webpack_require__(92);
  80627. var _mixin2 = _interopRequireDefault(_mixin);
  80628. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80629. var prefixCls = 'ivu-menu';
  80630. exports.default = {
  80631. name: 'Submenu',
  80632. mixins: [_emitter2.default, _mixin2.default],
  80633. components: { Icon: _icon2.default, Drop: _dropdown2.default, CollapseTransition: _collapseTransition2.default },
  80634. props: {
  80635. name: {
  80636. type: [String, Number],
  80637. required: true
  80638. },
  80639. disabled: {
  80640. type: Boolean,
  80641. default: false
  80642. }
  80643. },
  80644. data: function data() {
  80645. return {
  80646. prefixCls: prefixCls,
  80647. active: false,
  80648. opened: false,
  80649. dropWidth: parseFloat((0, _assist.getStyle)(this.$el, 'width'))
  80650. };
  80651. },
  80652. computed: {
  80653. classes: function classes() {
  80654. var _ref;
  80655. return [prefixCls + '-submenu', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-active', this.active && !this.hasParentSubmenu), (0, _defineProperty3.default)(_ref, prefixCls + '-opened', this.opened), (0, _defineProperty3.default)(_ref, prefixCls + '-submenu-disabled', this.disabled), (0, _defineProperty3.default)(_ref, prefixCls + '-submenu-has-parent-submenu', this.hasParentSubmenu), (0, _defineProperty3.default)(_ref, prefixCls + '-child-item-active', this.active), _ref)];
  80656. },
  80657. accordion: function accordion() {
  80658. return this.menu.accordion;
  80659. },
  80660. dropStyle: function dropStyle() {
  80661. var style = {};
  80662. if (this.dropWidth) style.minWidth = String(this.dropWidth) + 'px';
  80663. return style;
  80664. },
  80665. titleStyle: function titleStyle() {
  80666. return this.hasParentSubmenu && this.mode !== 'horizontal' ? {
  80667. paddingLeft: 43 + (this.parentSubmenuNum - 1) * 24 + 'px'
  80668. } : {};
  80669. },
  80670. arrowType: function arrowType() {
  80671. var type = 'ios-arrow-down';
  80672. if (this.$IVIEW) {
  80673. if (this.$IVIEW.menu.customArrow) {
  80674. type = '';
  80675. } else if (this.$IVIEW.menu.arrow) {
  80676. type = this.$IVIEW.menu.arrow;
  80677. }
  80678. }
  80679. return type;
  80680. },
  80681. customArrowType: function customArrowType() {
  80682. var type = '';
  80683. if (this.$IVIEW) {
  80684. if (this.$IVIEW.menu.customArrow) {
  80685. type = this.$IVIEW.menu.customArrow;
  80686. }
  80687. }
  80688. return type;
  80689. },
  80690. arrowSize: function arrowSize() {
  80691. var size = '';
  80692. if (this.$IVIEW) {
  80693. if (this.$IVIEW.menu.arrowSize) {
  80694. size = this.$IVIEW.menu.arrowSize;
  80695. }
  80696. }
  80697. return size;
  80698. }
  80699. },
  80700. methods: {
  80701. handleMouseenter: function handleMouseenter() {
  80702. var _this = this;
  80703. if (this.disabled) return;
  80704. if (this.mode === 'vertical') return;
  80705. clearTimeout(this.timeout);
  80706. this.timeout = setTimeout(function () {
  80707. (0, _newArrowCheck3.default)(this, _this);
  80708. this.menu.updateOpenKeys(this.name);
  80709. this.opened = true;
  80710. }.bind(this), 250);
  80711. },
  80712. handleMouseleave: function handleMouseleave() {
  80713. var _this2 = this;
  80714. if (this.disabled) return;
  80715. if (this.mode === 'vertical') return;
  80716. clearTimeout(this.timeout);
  80717. this.timeout = setTimeout(function () {
  80718. (0, _newArrowCheck3.default)(this, _this2);
  80719. this.menu.updateOpenKeys(this.name);
  80720. this.opened = false;
  80721. }.bind(this), 150);
  80722. },
  80723. handleClick: function handleClick() {
  80724. var _this3 = this;
  80725. if (this.disabled) return;
  80726. if (this.mode === 'horizontal') return;
  80727. var opened = this.opened;
  80728. if (this.accordion) {
  80729. this.$parent.$children.forEach(function (item) {
  80730. (0, _newArrowCheck3.default)(this, _this3);
  80731. if (item.$options.name === 'Submenu') item.opened = false;
  80732. }.bind(this));
  80733. }
  80734. this.opened = !opened;
  80735. this.menu.updateOpenKeys(this.name);
  80736. }
  80737. },
  80738. watch: {
  80739. mode: function mode(val) {
  80740. if (val === 'horizontal') {
  80741. this.$refs.drop.update();
  80742. }
  80743. },
  80744. opened: function opened(val) {
  80745. if (this.mode === 'vertical') return;
  80746. if (val) {
  80747. this.dropWidth = parseFloat((0, _assist.getStyle)(this.$el, 'width'));
  80748. this.$refs.drop.update();
  80749. } else {
  80750. this.$refs.drop.destroy();
  80751. }
  80752. }
  80753. },
  80754. mounted: function mounted() {
  80755. var _this4 = this;
  80756. this.$on('on-menu-item-select', function (name) {
  80757. (0, _newArrowCheck3.default)(this, _this4);
  80758. if (this.mode === 'horizontal') this.opened = false;
  80759. this.dispatch('Menu', 'on-menu-item-select', name);
  80760. return true;
  80761. }.bind(this));
  80762. this.$on('on-update-active-name', function (status) {
  80763. (0, _newArrowCheck3.default)(this, _this4);
  80764. if ((0, _assist.findComponentUpward)(this, 'Submenu')) this.dispatch('Submenu', 'on-update-active-name', status);
  80765. if ((0, _assist.findComponentsDownward)(this, 'Submenu')) (0, _assist.findComponentsDownward)(this, 'Submenu').forEach(function (item) {
  80766. (0, _newArrowCheck3.default)(this, _this4);
  80767. item.active = false;
  80768. }.bind(this));
  80769. this.active = status;
  80770. }.bind(this));
  80771. }
  80772. };
  80773. /***/ }),
  80774. /* 212 */
  80775. /***/ (function(module, exports, __webpack_require__) {
  80776. "use strict";
  80777. Object.defineProperty(exports, "__esModule", {
  80778. value: true
  80779. });
  80780. var _newArrowCheck2 = __webpack_require__(1);
  80781. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80782. var _notification = __webpack_require__(498);
  80783. var _notification2 = _interopRequireDefault(_notification);
  80784. var _vue = __webpack_require__(16);
  80785. var _vue2 = _interopRequireDefault(_vue);
  80786. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80787. _notification2.default.newInstance = function (properties) {
  80788. (0, _newArrowCheck3.default)(undefined, undefined);
  80789. var _props = properties || {};
  80790. var Instance = new _vue2.default({
  80791. render: function render(h) {
  80792. return h(_notification2.default, {
  80793. props: _props
  80794. });
  80795. }
  80796. });
  80797. var component = Instance.$mount();
  80798. document.body.appendChild(component.$el);
  80799. var notification = Instance.$children[0];
  80800. return {
  80801. notice: function notice(noticeProps) {
  80802. notification.add(noticeProps);
  80803. },
  80804. remove: function remove(name) {
  80805. notification.close(name);
  80806. },
  80807. component: notification,
  80808. destroy: function destroy(element) {
  80809. notification.closeAll();
  80810. setTimeout(function () {
  80811. document.body.removeChild(document.getElementsByClassName(element)[0]);
  80812. }, 500);
  80813. }
  80814. };
  80815. }.bind(undefined);
  80816. exports.default = _notification2.default;
  80817. /***/ }),
  80818. /* 213 */
  80819. /***/ (function(module, exports, __webpack_require__) {
  80820. "use strict";
  80821. Object.defineProperty(exports, "__esModule", {
  80822. value: true
  80823. });
  80824. var _assign = __webpack_require__(15);
  80825. var _assign2 = _interopRequireDefault(_assign);
  80826. var _defineProperty2 = __webpack_require__(2);
  80827. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80828. var _notice2 = __webpack_require__(499);
  80829. var _notice3 = _interopRequireDefault(_notice2);
  80830. var _transferQueue = __webpack_require__(37);
  80831. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80832. var prefixCls = 'ivu-notification';
  80833. var seed = 0;
  80834. var now = Date.now();
  80835. function getUuid() {
  80836. return 'ivuNotification_' + now + '_' + seed++;
  80837. }
  80838. exports.default = {
  80839. components: { Notice: _notice3.default },
  80840. props: {
  80841. prefixCls: {
  80842. type: String,
  80843. default: prefixCls
  80844. },
  80845. styles: {
  80846. type: Object,
  80847. default: function _default() {
  80848. return {
  80849. top: '65px',
  80850. left: '50%'
  80851. };
  80852. }
  80853. },
  80854. content: {
  80855. type: String
  80856. },
  80857. className: {
  80858. type: String
  80859. }
  80860. },
  80861. data: function data() {
  80862. return {
  80863. notices: [],
  80864. tIndex: this.handleGetIndex()
  80865. };
  80866. },
  80867. computed: {
  80868. classes: function classes() {
  80869. return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
  80870. },
  80871. wrapStyles: function wrapStyles() {
  80872. var styles = (0, _assign2.default)({}, this.styles);
  80873. styles['z-index'] = 1010 + this.tIndex;
  80874. return styles;
  80875. }
  80876. },
  80877. methods: {
  80878. add: function add(notice) {
  80879. var name = notice.name || getUuid();
  80880. var _notice = (0, _assign2.default)({
  80881. styles: {
  80882. right: '50%'
  80883. },
  80884. content: '',
  80885. duration: 1.5,
  80886. closable: false,
  80887. name: name
  80888. }, notice);
  80889. this.notices.push(_notice);
  80890. this.tIndex = this.handleGetIndex();
  80891. },
  80892. close: function close(name) {
  80893. var notices = this.notices;
  80894. for (var i = 0; i < notices.length; i++) {
  80895. if (notices[i].name === name) {
  80896. this.notices.splice(i, 1);
  80897. break;
  80898. }
  80899. }
  80900. },
  80901. closeAll: function closeAll() {
  80902. this.notices = [];
  80903. },
  80904. handleGetIndex: function handleGetIndex() {
  80905. (0, _transferQueue.transferIncrease)();
  80906. return _transferQueue.transferIndex;
  80907. }
  80908. }
  80909. };
  80910. /***/ }),
  80911. /* 214 */
  80912. /***/ (function(module, exports, __webpack_require__) {
  80913. "use strict";
  80914. Object.defineProperty(exports, "__esModule", {
  80915. value: true
  80916. });
  80917. var _newArrowCheck2 = __webpack_require__(1);
  80918. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  80919. var _defineProperty2 = __webpack_require__(2);
  80920. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  80921. var _render = __webpack_require__(215);
  80922. var _render2 = _interopRequireDefault(_render);
  80923. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  80924. exports.default = {
  80925. components: {
  80926. RenderCell: _render2.default
  80927. },
  80928. props: {
  80929. prefixCls: {
  80930. type: String,
  80931. default: ''
  80932. },
  80933. duration: {
  80934. type: Number,
  80935. default: 1.5
  80936. },
  80937. type: {
  80938. type: String
  80939. },
  80940. content: {
  80941. type: String,
  80942. default: ''
  80943. },
  80944. withIcon: Boolean,
  80945. render: {
  80946. type: Function
  80947. },
  80948. hasTitle: Boolean,
  80949. styles: {
  80950. type: Object,
  80951. default: function _default() {
  80952. return {
  80953. right: '50%'
  80954. };
  80955. }
  80956. },
  80957. closable: {
  80958. type: Boolean,
  80959. default: false
  80960. },
  80961. className: {
  80962. type: String
  80963. },
  80964. name: {
  80965. type: String,
  80966. required: true
  80967. },
  80968. onClose: {
  80969. type: Function
  80970. },
  80971. transitionName: {
  80972. type: String
  80973. },
  80974. background: {
  80975. type: Boolean,
  80976. default: false
  80977. },
  80978. msgType: {
  80979. type: String
  80980. }
  80981. },
  80982. data: function data() {
  80983. return {
  80984. withDesc: false
  80985. };
  80986. },
  80987. computed: {
  80988. baseClass: function baseClass() {
  80989. return String(this.prefixCls) + '-notice';
  80990. },
  80991. renderFunc: function renderFunc() {
  80992. return this.render || function () {};
  80993. },
  80994. classes: function classes() {
  80995. var _ref;
  80996. return [this.baseClass, (_ref = {}, (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-closable', this.closable), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-with-desc', this.withDesc), (0, _defineProperty3.default)(_ref, String(this.baseClass) + '-with-background', this.background), _ref)];
  80997. },
  80998. contentClasses: function contentClasses() {
  80999. return [String(this.baseClass) + '-content', this.render !== undefined ? String(this.baseClass) + '-content-with-render' : ''];
  81000. },
  81001. messageContentClasses: function messageContentClasses() {
  81002. var _ref2;
  81003. return [String(this.baseClass) + '-content', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(this.baseClass) + '-content-' + String(this.msgType), this.msgType), (0, _defineProperty3.default)(_ref2, String(this.baseClass) + '-content-background', this.background), _ref2)];
  81004. },
  81005. contentWithIcon: function contentWithIcon() {
  81006. return [this.withIcon ? String(this.prefixCls) + '-content-with-icon' : '', !this.hasTitle && this.withIcon ? String(this.prefixCls) + '-content-with-render-notitle' : ''];
  81007. },
  81008. messageClasses: function messageClasses() {
  81009. return [String(this.baseClass) + '-content', this.render !== undefined ? String(this.baseClass) + '-content-with-render' : ''];
  81010. }
  81011. },
  81012. methods: {
  81013. clearCloseTimer: function clearCloseTimer() {
  81014. if (this.closeTimer) {
  81015. clearTimeout(this.closeTimer);
  81016. this.closeTimer = null;
  81017. }
  81018. },
  81019. close: function close() {
  81020. this.clearCloseTimer();
  81021. this.onClose();
  81022. this.$parent.close(this.name);
  81023. },
  81024. handleEnter: function handleEnter(el) {
  81025. if (this.type === 'message') {
  81026. el.style.height = el.scrollHeight + 'px';
  81027. }
  81028. },
  81029. handleLeave: function handleLeave(el) {
  81030. if (this.type === 'message') {
  81031. if (document.getElementsByClassName('ivu-message-notice').length !== 1) {
  81032. el.style.height = 0;
  81033. el.style.paddingTop = 0;
  81034. el.style.paddingBottom = 0;
  81035. }
  81036. }
  81037. }
  81038. },
  81039. mounted: function mounted() {
  81040. var _this = this;
  81041. this.clearCloseTimer();
  81042. if (this.duration !== 0) {
  81043. this.closeTimer = setTimeout(function () {
  81044. (0, _newArrowCheck3.default)(this, _this);
  81045. this.close();
  81046. }.bind(this), this.duration * 1000);
  81047. }
  81048. if (this.prefixCls === 'ivu-notice') {
  81049. var desc = this.$refs.content.querySelectorAll('.' + String(this.prefixCls) + '-desc')[0];
  81050. this.withDesc = this.render ? true : desc ? desc.innerHTML !== '' : false;
  81051. }
  81052. },
  81053. beforeDestroy: function beforeDestroy() {
  81054. this.clearCloseTimer();
  81055. }
  81056. };
  81057. /***/ }),
  81058. /* 215 */
  81059. /***/ (function(module, exports, __webpack_require__) {
  81060. "use strict";
  81061. Object.defineProperty(exports, "__esModule", {
  81062. value: true
  81063. });
  81064. var _newArrowCheck2 = __webpack_require__(1);
  81065. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  81066. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81067. exports.default = {
  81068. name: 'RenderCell',
  81069. functional: true,
  81070. props: {
  81071. render: Function
  81072. },
  81073. render: function render(h, ctx) {
  81074. (0, _newArrowCheck3.default)(undefined, undefined);
  81075. return ctx.props.render(h);
  81076. }.bind(undefined)
  81077. };
  81078. /***/ }),
  81079. /* 216 */
  81080. /***/ (function(module, exports, __webpack_require__) {
  81081. "use strict";
  81082. Object.defineProperty(exports, "__esModule", {
  81083. value: true
  81084. });
  81085. var _newArrowCheck2 = __webpack_require__(1);
  81086. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  81087. var _assign = __webpack_require__(15);
  81088. var _assign2 = _interopRequireDefault(_assign);
  81089. var _defineProperty2 = __webpack_require__(2);
  81090. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  81091. var _icon = __webpack_require__(19);
  81092. var _icon2 = _interopRequireDefault(_icon);
  81093. var _button = __webpack_require__(28);
  81094. var _button2 = _interopRequireDefault(_button);
  81095. var _transferDom = __webpack_require__(23);
  81096. var _transferDom2 = _interopRequireDefault(_transferDom);
  81097. var _locale = __webpack_require__(6);
  81098. var _locale2 = _interopRequireDefault(_locale);
  81099. var _emitter = __webpack_require__(4);
  81100. var _emitter2 = _interopRequireDefault(_emitter);
  81101. var _mixinsScrollbar = __webpack_require__(87);
  81102. var _mixinsScrollbar2 = _interopRequireDefault(_mixinsScrollbar);
  81103. var _dom = __webpack_require__(12);
  81104. var _assist = __webpack_require__(3);
  81105. var _transferQueue = __webpack_require__(37);
  81106. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81107. var prefixCls = 'ivu-modal';
  81108. var dragData = {
  81109. x: null,
  81110. y: null,
  81111. dragX: null,
  81112. dragY: null,
  81113. dragging: false,
  81114. rect: null
  81115. };
  81116. exports.default = {
  81117. name: 'Modal',
  81118. mixins: [_locale2.default, _emitter2.default, _mixinsScrollbar2.default],
  81119. components: { Icon: _icon2.default, iButton: _button2.default },
  81120. directives: { TransferDom: _transferDom2.default },
  81121. props: {
  81122. value: {
  81123. type: Boolean,
  81124. default: false
  81125. },
  81126. closable: {
  81127. type: Boolean,
  81128. default: true
  81129. },
  81130. maskClosable: {
  81131. type: Boolean,
  81132. default: function _default() {
  81133. return !this.$IVIEW || this.$IVIEW.modal.maskClosable === '' ? true : this.$IVIEW.modal.maskClosable;
  81134. }
  81135. },
  81136. title: {
  81137. type: String
  81138. },
  81139. width: {
  81140. type: [Number, String],
  81141. default: 520
  81142. },
  81143. okText: {
  81144. type: String
  81145. },
  81146. cancelText: {
  81147. type: String
  81148. },
  81149. loading: {
  81150. type: Boolean,
  81151. default: false
  81152. },
  81153. styles: {
  81154. type: Object,
  81155. default: function _default() {
  81156. return {};
  81157. }
  81158. },
  81159. className: {
  81160. type: String
  81161. },
  81162. footerHide: {
  81163. type: Boolean,
  81164. default: false
  81165. },
  81166. scrollable: {
  81167. type: Boolean,
  81168. default: false
  81169. },
  81170. transitionNames: {
  81171. type: Array,
  81172. default: function _default() {
  81173. return ['ease', 'fade'];
  81174. }
  81175. },
  81176. transfer: {
  81177. type: Boolean,
  81178. default: function _default() {
  81179. return !this.$IVIEW || this.$IVIEW.transfer === '' ? true : this.$IVIEW.transfer;
  81180. }
  81181. },
  81182. fullscreen: {
  81183. type: Boolean,
  81184. default: false
  81185. },
  81186. mask: {
  81187. type: Boolean,
  81188. default: true
  81189. },
  81190. draggable: {
  81191. type: Boolean,
  81192. default: false
  81193. },
  81194. sticky: {
  81195. type: Boolean,
  81196. default: false
  81197. },
  81198. stickyDistance: {
  81199. type: Number,
  81200. default: 10
  81201. },
  81202. resetDragPosition: {
  81203. type: Boolean,
  81204. default: false
  81205. },
  81206. zIndex: {
  81207. type: Number,
  81208. default: 1000
  81209. },
  81210. beforeClose: Function
  81211. },
  81212. data: function data() {
  81213. return {
  81214. prefixCls: prefixCls,
  81215. wrapShow: false,
  81216. showHead: true,
  81217. buttonLoading: false,
  81218. visible: this.value,
  81219. dragData: (0, _assist.deepCopy)(dragData),
  81220. modalIndex: this.handleGetModalIndex(),
  81221. isMouseTriggerIn: false };
  81222. },
  81223. computed: {
  81224. wrapClasses: function wrapClasses() {
  81225. var _ref;
  81226. return [prefixCls + '-wrap', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hidden', !this.wrapShow), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-mask', !this.showMask), _ref)];
  81227. },
  81228. wrapStyles: function wrapStyles() {
  81229. return {
  81230. zIndex: this.modalIndex + this.zIndex
  81231. };
  81232. },
  81233. maskClasses: function maskClasses() {
  81234. return prefixCls + '-mask';
  81235. },
  81236. classes: function classes() {
  81237. var _ref2;
  81238. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen', this.fullscreen), (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen-no-header', this.fullscreen && !this.showHead), (0, _defineProperty3.default)(_ref2, prefixCls + '-fullscreen-no-footer', this.fullscreen && this.footerHide), _ref2)];
  81239. },
  81240. contentClasses: function contentClasses() {
  81241. var _ref3;
  81242. return [prefixCls + '-content', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-content-no-mask', !this.showMask), (0, _defineProperty3.default)(_ref3, prefixCls + '-content-drag', this.draggable && !this.fullscreen), (0, _defineProperty3.default)(_ref3, prefixCls + '-content-dragging', this.draggable && this.dragData.dragging), _ref3)];
  81243. },
  81244. mainStyles: function mainStyles() {
  81245. var style = {};
  81246. var width = parseInt(this.width);
  81247. var styleWidth = this.dragData.x !== null ? {
  81248. top: 0
  81249. } : {
  81250. width: width <= 100 ? String(width) + '%' : String(width) + 'px'
  81251. };
  81252. var customStyle = this.styles ? this.styles : {};
  81253. (0, _assign2.default)(style, styleWidth, customStyle);
  81254. return style;
  81255. },
  81256. contentStyles: function contentStyles() {
  81257. var style = {};
  81258. if (this.draggable && !this.fullscreen) {
  81259. var customTop = this.styles.top ? parseFloat(this.styles.top) : 0;
  81260. var customLeft = this.styles.left ? parseFloat(this.styles.left) : 0;
  81261. if (this.dragData.x !== null) style.left = this.dragData.x - customLeft + 'px';
  81262. if (this.dragData.y !== null) style.top = String(this.dragData.y) + 'px';
  81263. if (this.dragData.y !== null) style.top = this.dragData.y - customTop + 'px';
  81264. var width = parseInt(this.width);
  81265. var styleWidth = {
  81266. width: width <= 100 ? String(width) + '%' : String(width) + 'px'
  81267. };
  81268. (0, _assign2.default)(style, styleWidth);
  81269. }
  81270. return style;
  81271. },
  81272. localeOkText: function localeOkText() {
  81273. if (this.okText === undefined) {
  81274. return this.t('i.modal.okText');
  81275. } else {
  81276. return this.okText;
  81277. }
  81278. },
  81279. localeCancelText: function localeCancelText() {
  81280. if (this.cancelText === undefined) {
  81281. return this.t('i.modal.cancelText');
  81282. } else {
  81283. return this.cancelText;
  81284. }
  81285. },
  81286. showMask: function showMask() {
  81287. return this.mask;
  81288. }
  81289. },
  81290. methods: {
  81291. close: function close() {
  81292. var _this = this;
  81293. if (!this.beforeClose) {
  81294. return this.handleClose();
  81295. }
  81296. var before = this.beforeClose();
  81297. if (before && before.then) {
  81298. before.then(function () {
  81299. (0, _newArrowCheck3.default)(this, _this);
  81300. this.handleClose();
  81301. }.bind(this));
  81302. } else {
  81303. this.handleClose();
  81304. }
  81305. },
  81306. handleClose: function handleClose() {
  81307. this.visible = false;
  81308. this.$emit('input', false);
  81309. this.$emit('on-cancel');
  81310. },
  81311. handleMask: function handleMask() {
  81312. if (this.maskClosable && this.showMask) {
  81313. this.close();
  81314. }
  81315. },
  81316. handleWrapClick: function handleWrapClick(event) {
  81317. if (this.isMouseTriggerIn) {
  81318. this.isMouseTriggerIn = false;
  81319. return;
  81320. }
  81321. var className = event.target.getAttribute('class');
  81322. if (className && className.indexOf(prefixCls + '-wrap') > -1) this.handleMask();
  81323. },
  81324. handleMousedown: function handleMousedown() {
  81325. this.isMouseTriggerIn = true;
  81326. },
  81327. cancel: function cancel() {
  81328. this.close();
  81329. },
  81330. ok: function ok() {
  81331. if (this.loading) {
  81332. this.buttonLoading = true;
  81333. } else {
  81334. this.visible = false;
  81335. this.$emit('input', false);
  81336. }
  81337. this.$emit('on-ok');
  81338. },
  81339. EscClose: function EscClose(e) {
  81340. var _this2 = this;
  81341. if (this.visible && this.closable) {
  81342. if (e.keyCode === 27) {
  81343. var $Modals = (0, _assist.findComponentsDownward)(this.$root, 'Modal').filter(function (item) {
  81344. (0, _newArrowCheck3.default)(this, _this2);
  81345. return item.$data.visible && item.$props.closable;
  81346. }.bind(this));
  81347. var $TopModal = $Modals.sort(function (a, b) {
  81348. (0, _newArrowCheck3.default)(this, _this2);
  81349. return a.$data.modalIndex < b.$data.modalIndex ? 1 : -1;
  81350. }.bind(this))[0];
  81351. setTimeout(function () {
  81352. (0, _newArrowCheck3.default)(this, _this2);
  81353. $TopModal.close();
  81354. }.bind(this), 0);
  81355. }
  81356. }
  81357. },
  81358. animationFinish: function animationFinish() {
  81359. this.$emit('on-hidden');
  81360. },
  81361. handleMoveStart: function handleMoveStart(event) {
  81362. if (!this.draggable || this.fullscreen) return false;
  81363. var $content = this.$refs.content;
  81364. var rect = $content.getBoundingClientRect();
  81365. this.dragData.rect = rect;
  81366. this.dragData.x = rect.x || rect.left;
  81367. this.dragData.y = rect.y || rect.top;
  81368. var distance = {
  81369. x: event.clientX,
  81370. y: event.clientY
  81371. };
  81372. this.dragData.dragX = distance.x;
  81373. this.dragData.dragY = distance.y;
  81374. this.dragData.dragging = true;
  81375. (0, _dom.on)(window, 'mousemove', this.handleMoveMove);
  81376. (0, _dom.on)(window, 'mouseup', this.handleMoveEnd);
  81377. },
  81378. handleMoveMove: function handleMoveMove(event) {
  81379. if (!this.dragData.dragging || this.fullscreen) return false;
  81380. var distance = {
  81381. x: event.clientX,
  81382. y: event.clientY
  81383. };
  81384. var diff_distance = {
  81385. x: distance.x - this.dragData.dragX,
  81386. y: distance.y - this.dragData.dragY
  81387. };
  81388. if (this.sticky) {
  81389. var clientWidth = document.documentElement.clientWidth;
  81390. var clientHeight = document.documentElement.clientHeight;
  81391. if (this.dragData.x + diff_distance.x <= this.stickyDistance && diff_distance.x < 0) {
  81392. this.dragData.x = 0;
  81393. } else if (this.dragData.x + this.dragData.rect.width - clientWidth > -this.stickyDistance && diff_distance.x > 0) {
  81394. this.dragData.x = clientWidth - this.dragData.rect.width;
  81395. } else {
  81396. this.dragData.x += diff_distance.x;
  81397. }
  81398. if (this.dragData.y + diff_distance.y <= this.stickyDistance && diff_distance.y < 0) {
  81399. this.dragData.y = 0;
  81400. } else if (this.dragData.y + this.dragData.rect.height - clientHeight > -this.stickyDistance && diff_distance.y > 0) {
  81401. this.dragData.y = clientHeight - this.dragData.rect.height;
  81402. } else {
  81403. this.dragData.y += diff_distance.y;
  81404. }
  81405. } else {
  81406. this.dragData.x += diff_distance.x;
  81407. this.dragData.y += diff_distance.y;
  81408. }
  81409. this.dragData.dragX = distance.x;
  81410. this.dragData.dragY = distance.y;
  81411. },
  81412. handleMoveEnd: function handleMoveEnd() {
  81413. this.dragData.dragging = false;
  81414. (0, _dom.off)(window, 'mousemove', this.handleMoveMove);
  81415. (0, _dom.off)(window, 'mouseup', this.handleMoveEnd);
  81416. },
  81417. handleGetModalIndex: function handleGetModalIndex() {
  81418. (0, _transferQueue.transferIncrease)();
  81419. return _transferQueue.transferIndex;
  81420. },
  81421. handleClickModal: function handleClickModal() {
  81422. if (this.draggable) {
  81423. if (_transferQueue.lastVisibleIndex !== this.lastVisibleIndex) {
  81424. this.lastVisibleIndex = _transferQueue.lastVisibleIndex;
  81425. return;
  81426. }
  81427. this.modalIndex = this.handleGetModalIndex();
  81428. }
  81429. }
  81430. },
  81431. mounted: function mounted() {
  81432. if (this.visible) {
  81433. this.wrapShow = true;
  81434. }
  81435. var showHead = true;
  81436. if (this.$slots.header === undefined && !this.title) {
  81437. showHead = false;
  81438. }
  81439. this.showHead = showHead;
  81440. document.addEventListener('keydown', this.EscClose);
  81441. },
  81442. beforeDestroy: function beforeDestroy() {
  81443. document.removeEventListener('keydown', this.EscClose);
  81444. this.removeScrollEffect();
  81445. },
  81446. watch: {
  81447. value: function value(val) {
  81448. this.visible = val;
  81449. },
  81450. visible: function visible(val) {
  81451. var _this3 = this;
  81452. if (val === false) {
  81453. this.buttonLoading = false;
  81454. this.timer = setTimeout(function () {
  81455. (0, _newArrowCheck3.default)(this, _this3);
  81456. this.wrapShow = false;
  81457. this.removeScrollEffect();
  81458. }.bind(this), 300);
  81459. } else {
  81460. if (this.lastVisible !== val) {
  81461. this.modalIndex = this.handleGetModalIndex();
  81462. (0, _transferQueue.lastVisibleIncrease)();
  81463. }
  81464. if (this.timer) clearTimeout(this.timer);
  81465. this.wrapShow = true;
  81466. if (!this.scrollable) {
  81467. this.addScrollEffect();
  81468. }
  81469. }
  81470. this.broadcast('Table', 'on-visible-change', val);
  81471. this.broadcast('Slider', 'on-visible-change', val);
  81472. this.$emit('on-visible-change', val);
  81473. this.lastVisible = val;
  81474. this.lastVisibleIndex = _transferQueue.lastVisibleIndex;
  81475. if (val && this.resetDragPosition) {
  81476. this.dragData = (0, _assist.deepCopy)(dragData);
  81477. }
  81478. },
  81479. loading: function loading(val) {
  81480. if (!val) {
  81481. this.buttonLoading = false;
  81482. }
  81483. },
  81484. scrollable: function scrollable(val) {
  81485. if (!val) {
  81486. this.addScrollEffect();
  81487. } else {
  81488. this.removeScrollEffect();
  81489. }
  81490. },
  81491. title: function title(val) {
  81492. if (this.$slots.header === undefined) {
  81493. this.showHead = !!val;
  81494. }
  81495. }
  81496. }
  81497. };
  81498. /***/ }),
  81499. /* 217 */
  81500. /***/ (function(module, exports, __webpack_require__) {
  81501. "use strict";
  81502. Object.defineProperty(exports, "__esModule", {
  81503. value: true
  81504. });
  81505. var _defineProperty2 = __webpack_require__(2);
  81506. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  81507. var _assist = __webpack_require__(3);
  81508. var _options = __webpack_require__(509);
  81509. var _options2 = _interopRequireDefault(_options);
  81510. var _locale = __webpack_require__(6);
  81511. var _locale2 = _interopRequireDefault(_locale);
  81512. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81513. var prefixCls = 'ivu-page';
  81514. exports.default = {
  81515. name: 'Page',
  81516. mixins: [_locale2.default],
  81517. components: { Options: _options2.default },
  81518. props: {
  81519. current: {
  81520. type: Number,
  81521. default: 1
  81522. },
  81523. total: {
  81524. type: Number,
  81525. default: 0
  81526. },
  81527. pageSize: {
  81528. type: Number,
  81529. default: 10
  81530. },
  81531. pageSizeOpts: {
  81532. type: Array,
  81533. default: function _default() {
  81534. return [10, 20, 30, 40];
  81535. }
  81536. },
  81537. placement: {
  81538. validator: function validator(value) {
  81539. return (0, _assist.oneOf)(value, ['top', 'bottom']);
  81540. },
  81541. default: 'bottom'
  81542. },
  81543. transfer: {
  81544. type: Boolean,
  81545. default: function _default() {
  81546. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  81547. }
  81548. },
  81549. size: {
  81550. validator: function validator(value) {
  81551. return (0, _assist.oneOf)(value, ['small', 'default']);
  81552. }
  81553. },
  81554. simple: {
  81555. type: Boolean,
  81556. default: false
  81557. },
  81558. showTotal: {
  81559. type: Boolean,
  81560. default: false
  81561. },
  81562. showElevator: {
  81563. type: Boolean,
  81564. default: false
  81565. },
  81566. showSizer: {
  81567. type: Boolean,
  81568. default: false
  81569. },
  81570. className: {
  81571. type: String
  81572. },
  81573. styles: {
  81574. type: Object
  81575. },
  81576. prevText: {
  81577. type: String,
  81578. default: ''
  81579. },
  81580. nextText: {
  81581. type: String,
  81582. default: ''
  81583. },
  81584. disabled: {
  81585. type: Boolean,
  81586. default: false
  81587. },
  81588. eventsEnabled: {
  81589. type: Boolean,
  81590. default: false
  81591. }
  81592. },
  81593. data: function data() {
  81594. return {
  81595. prefixCls: prefixCls,
  81596. currentPage: this.current,
  81597. currentPageSize: this.pageSize
  81598. };
  81599. },
  81600. watch: {
  81601. total: function total(val) {
  81602. var maxPage = Math.ceil(val / this.currentPageSize);
  81603. if (maxPage < this.currentPage) {
  81604. this.currentPage = maxPage === 0 ? 1 : maxPage;
  81605. }
  81606. },
  81607. current: function current(val) {
  81608. this.currentPage = val;
  81609. },
  81610. pageSize: function pageSize(val) {
  81611. this.currentPageSize = val;
  81612. }
  81613. },
  81614. computed: {
  81615. isSmall: function isSmall() {
  81616. return this.size === 'small';
  81617. },
  81618. allPages: function allPages() {
  81619. var allPage = Math.ceil(this.total / this.currentPageSize);
  81620. return allPage === 0 ? 1 : allPage;
  81621. },
  81622. simpleWrapClasses: function simpleWrapClasses() {
  81623. return ['' + prefixCls, prefixCls + '-simple', (0, _defineProperty3.default)({}, '' + String(this.className), !!this.className)];
  81624. },
  81625. simplePagerClasses: function simplePagerClasses() {
  81626. return prefixCls + '-simple-pager';
  81627. },
  81628. wrapClasses: function wrapClasses() {
  81629. var _ref2;
  81630. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-disabled', this.disabled), (0, _defineProperty3.default)(_ref2, 'mini', this.size === 'small'), _ref2)];
  81631. },
  81632. prevClasses: function prevClasses() {
  81633. var _ref3;
  81634. return [prefixCls + '-prev', (_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-disabled', this.currentPage === 1 || this.disabled), (0, _defineProperty3.default)(_ref3, prefixCls + '-custom-text', this.prevText !== ''), _ref3)];
  81635. },
  81636. nextClasses: function nextClasses() {
  81637. var _ref4;
  81638. return [prefixCls + '-next', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, prefixCls + '-disabled', this.currentPage === this.allPages || this.disabled), (0, _defineProperty3.default)(_ref4, prefixCls + '-custom-text', this.nextText !== ''), _ref4)];
  81639. },
  81640. firstPageClasses: function firstPageClasses() {
  81641. return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.currentPage === 1)];
  81642. },
  81643. lastPageClasses: function lastPageClasses() {
  81644. return [prefixCls + '-item', (0, _defineProperty3.default)({}, prefixCls + '-item-active', this.currentPage === this.allPages)];
  81645. }
  81646. },
  81647. methods: {
  81648. changePage: function changePage(page) {
  81649. if (this.disabled) return;
  81650. if (this.currentPage != page) {
  81651. this.currentPage = page;
  81652. this.$emit('update:current', page);
  81653. this.$emit('on-change', page);
  81654. }
  81655. },
  81656. prev: function prev() {
  81657. if (this.disabled) return;
  81658. var current = this.currentPage;
  81659. if (current <= 1) {
  81660. return false;
  81661. }
  81662. this.changePage(current - 1);
  81663. this.$emit('on-prev', current - 1);
  81664. },
  81665. next: function next() {
  81666. if (this.disabled) return;
  81667. var current = this.currentPage;
  81668. if (current >= this.allPages) {
  81669. return false;
  81670. }
  81671. this.changePage(current + 1);
  81672. this.$emit('on-next', current + 1);
  81673. },
  81674. fastPrev: function fastPrev() {
  81675. if (this.disabled) return;
  81676. var page = this.currentPage - 5;
  81677. if (page > 0) {
  81678. this.changePage(page);
  81679. } else {
  81680. this.changePage(1);
  81681. }
  81682. },
  81683. fastNext: function fastNext() {
  81684. if (this.disabled) return;
  81685. var page = this.currentPage + 5;
  81686. if (page > this.allPages) {
  81687. this.changePage(this.allPages);
  81688. } else {
  81689. this.changePage(page);
  81690. }
  81691. },
  81692. onSize: function onSize(pageSize) {
  81693. if (this.disabled) return;
  81694. this.currentPageSize = pageSize;
  81695. this.$emit('on-page-size-change', pageSize);
  81696. this.changePage(1);
  81697. },
  81698. onPage: function onPage(page) {
  81699. if (this.disabled) return;
  81700. this.changePage(page);
  81701. },
  81702. keyDown: function keyDown(e) {
  81703. var key = e.keyCode;
  81704. var condition = key >= 48 && key <= 57 || key >= 96 && key <= 105 || key === 8 || key === 37 || key === 39;
  81705. if (!condition) {
  81706. e.preventDefault();
  81707. }
  81708. },
  81709. keyUp: function keyUp(e) {
  81710. var key = e.keyCode;
  81711. var val = parseInt(e.target.value);
  81712. if (key === 38) {
  81713. this.prev();
  81714. } else if (key === 40) {
  81715. this.next();
  81716. } else if (key === 13) {
  81717. var page = 1;
  81718. if (val > this.allPages) {
  81719. page = this.allPages;
  81720. } else if (val <= 0 || !val) {
  81721. page = 1;
  81722. } else {
  81723. page = val;
  81724. }
  81725. e.target.value = page;
  81726. this.changePage(page);
  81727. }
  81728. }
  81729. }
  81730. };
  81731. /***/ }),
  81732. /* 218 */
  81733. /***/ (function(module, exports, __webpack_require__) {
  81734. "use strict";
  81735. Object.defineProperty(exports, "__esModule", {
  81736. value: true
  81737. });
  81738. var _select = __webpack_require__(74);
  81739. var _select2 = _interopRequireDefault(_select);
  81740. var _option = __webpack_require__(81);
  81741. var _option2 = _interopRequireDefault(_option);
  81742. var _locale = __webpack_require__(6);
  81743. var _locale2 = _interopRequireDefault(_locale);
  81744. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81745. var prefixCls = 'ivu-page';
  81746. function isValueNumber(value) {
  81747. return (/^[1-9][0-9]*$/.test(value + '')
  81748. );
  81749. }
  81750. exports.default = {
  81751. name: 'PageOption',
  81752. mixins: [_locale2.default],
  81753. components: { iSelect: _select2.default, iOption: _option2.default },
  81754. props: {
  81755. pageSizeOpts: Array,
  81756. showSizer: Boolean,
  81757. showElevator: Boolean,
  81758. current: Number,
  81759. _current: Number,
  81760. pageSize: Number,
  81761. allPages: Number,
  81762. isSmall: Boolean,
  81763. placement: String,
  81764. transfer: Boolean,
  81765. disabled: Boolean,
  81766. eventsEnabled: Boolean
  81767. },
  81768. data: function data() {
  81769. return {
  81770. currentPageSize: this.pageSize
  81771. };
  81772. },
  81773. watch: {
  81774. pageSize: function pageSize(val) {
  81775. this.currentPageSize = val;
  81776. }
  81777. },
  81778. computed: {
  81779. size: function size() {
  81780. return this.isSmall ? 'small' : 'default';
  81781. },
  81782. optsClasses: function optsClasses() {
  81783. return [prefixCls + '-options'];
  81784. },
  81785. sizerClasses: function sizerClasses() {
  81786. return [prefixCls + '-options-sizer'];
  81787. },
  81788. ElevatorClasses: function ElevatorClasses() {
  81789. return [prefixCls + '-options-elevator'];
  81790. }
  81791. },
  81792. methods: {
  81793. changeSize: function changeSize() {
  81794. this.$emit('on-size', this.currentPageSize);
  81795. },
  81796. changePage: function changePage(event) {
  81797. var val = event.target.value.trim();
  81798. var page = 0;
  81799. if (isValueNumber(val)) {
  81800. val = Number(val);
  81801. if (val != this.current) {
  81802. var allPages = this.allPages;
  81803. if (val > allPages) {
  81804. page = allPages;
  81805. } else {
  81806. page = val;
  81807. }
  81808. }
  81809. } else {
  81810. page = 1;
  81811. }
  81812. if (page) {
  81813. this.$emit('on-page', page);
  81814. event.target.value = page;
  81815. }
  81816. }
  81817. }
  81818. };
  81819. /***/ }),
  81820. /* 219 */
  81821. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  81822. "use strict";
  81823. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  81824. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__ = __webpack_require__(220);
  81825. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__);
  81826. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  81827. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__ = __webpack_require__(513);
  81828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__);
  81829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  81830. /* script */
  81831. /* template */
  81832. /* template functional */
  81833. var __vue_template_functional__ = false
  81834. /* styles */
  81835. var __vue_styles__ = null
  81836. /* scopeId */
  81837. var __vue_scopeId__ = null
  81838. /* moduleIdentifier (server only) */
  81839. var __vue_module_identifier__ = null
  81840. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  81841. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_poptip_vue___default.a,
  81842. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__["render"],
  81843. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4f9e410e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_poptip_vue__["staticRenderFns"],
  81844. __vue_template_functional__,
  81845. __vue_styles__,
  81846. __vue_scopeId__,
  81847. __vue_module_identifier__
  81848. )
  81849. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  81850. /***/ }),
  81851. /* 220 */
  81852. /***/ (function(module, exports, __webpack_require__) {
  81853. "use strict";
  81854. Object.defineProperty(exports, "__esModule", {
  81855. value: true
  81856. });
  81857. var _newArrowCheck2 = __webpack_require__(1);
  81858. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  81859. var _defineProperty2 = __webpack_require__(2);
  81860. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  81861. var _popper = __webpack_require__(221);
  81862. var _popper2 = _interopRequireDefault(_popper);
  81863. var _button = __webpack_require__(28);
  81864. var _button2 = _interopRequireDefault(_button);
  81865. var _clickoutside = __webpack_require__(82);
  81866. var _clickoutside2 = _interopRequireDefault(_clickoutside);
  81867. var _transferDom = __webpack_require__(23);
  81868. var _transferDom2 = _interopRequireDefault(_transferDom);
  81869. var _assist = __webpack_require__(3);
  81870. var _transferQueue = __webpack_require__(37);
  81871. var _locale = __webpack_require__(6);
  81872. var _locale2 = _interopRequireDefault(_locale);
  81873. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  81874. var prefixCls = 'ivu-poptip';
  81875. exports.default = {
  81876. name: 'Poptip',
  81877. mixins: [_popper2.default, _locale2.default],
  81878. directives: { clickOutside: _clickoutside2.default, TransferDom: _transferDom2.default },
  81879. components: { iButton: _button2.default },
  81880. props: {
  81881. trigger: {
  81882. validator: function validator(value) {
  81883. return (0, _assist.oneOf)(value, ['click', 'focus', 'hover']);
  81884. },
  81885. default: 'click'
  81886. },
  81887. placement: {
  81888. validator: function validator(value) {
  81889. return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
  81890. },
  81891. default: 'top'
  81892. },
  81893. title: {
  81894. type: [String, Number]
  81895. },
  81896. content: {
  81897. type: [String, Number],
  81898. default: ''
  81899. },
  81900. width: {
  81901. type: [String, Number]
  81902. },
  81903. confirm: {
  81904. type: Boolean,
  81905. default: false
  81906. },
  81907. okText: {
  81908. type: String
  81909. },
  81910. cancelText: {
  81911. type: String
  81912. },
  81913. transfer: {
  81914. type: Boolean,
  81915. default: function _default() {
  81916. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  81917. }
  81918. },
  81919. popperClass: {
  81920. type: String
  81921. },
  81922. wordWrap: {
  81923. type: Boolean,
  81924. default: false
  81925. },
  81926. padding: {
  81927. type: String
  81928. },
  81929. disabled: {
  81930. type: Boolean,
  81931. default: false
  81932. },
  81933. capture: {
  81934. type: Boolean,
  81935. default: function _default() {
  81936. return !this.$IVIEW ? false : this.$IVIEW.capture;
  81937. }
  81938. },
  81939. transferClassName: {
  81940. type: String
  81941. }
  81942. },
  81943. data: function data() {
  81944. return {
  81945. prefixCls: prefixCls,
  81946. showTitle: true,
  81947. isInput: false,
  81948. disableCloseUnderTransfer: false,
  81949. tIndex: this.handleGetIndex()
  81950. };
  81951. },
  81952. computed: {
  81953. classes: function classes() {
  81954. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-confirm', this.confirm)];
  81955. },
  81956. popperClasses: function popperClasses() {
  81957. var _ref2;
  81958. return [prefixCls + '-popper', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-confirm', this.transfer && this.confirm), (0, _defineProperty3.default)(_ref2, '' + String(this.popperClass), !!this.popperClass), (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2)];
  81959. },
  81960. styles: function styles() {
  81961. var style = {};
  81962. if (this.width) {
  81963. style.width = String(this.width) + 'px';
  81964. }
  81965. if (this.transfer) style['z-index'] = 1060 + this.tIndex;
  81966. return style;
  81967. },
  81968. localeOkText: function localeOkText() {
  81969. if (this.okText === undefined) {
  81970. return this.t('i.poptip.okText');
  81971. } else {
  81972. return this.okText;
  81973. }
  81974. },
  81975. localeCancelText: function localeCancelText() {
  81976. if (this.cancelText === undefined) {
  81977. return this.t('i.poptip.cancelText');
  81978. } else {
  81979. return this.cancelText;
  81980. }
  81981. },
  81982. contentClasses: function contentClasses() {
  81983. return [prefixCls + '-body-content', (0, _defineProperty3.default)({}, prefixCls + '-body-content-word-wrap', this.wordWrap)];
  81984. },
  81985. contentPaddingStyle: function contentPaddingStyle() {
  81986. var styles = {};
  81987. if (this.padding !== '') styles['padding'] = this.padding;
  81988. return styles;
  81989. }
  81990. },
  81991. methods: {
  81992. handleClick: function handleClick() {
  81993. if (this.disabled) return;
  81994. if (this.confirm) {
  81995. this.visible = !this.visible;
  81996. return true;
  81997. }
  81998. if (this.trigger !== 'click') {
  81999. return false;
  82000. }
  82001. this.visible = !this.visible;
  82002. },
  82003. handleTransferClick: function handleTransferClick() {
  82004. if (this.transfer) this.disableCloseUnderTransfer = true;
  82005. },
  82006. handleClose: function handleClose() {
  82007. if (this.disableCloseUnderTransfer) {
  82008. this.disableCloseUnderTransfer = false;
  82009. return false;
  82010. }
  82011. if (this.confirm) {
  82012. this.visible = false;
  82013. return true;
  82014. }
  82015. if (this.trigger !== 'click') {
  82016. return false;
  82017. }
  82018. this.visible = false;
  82019. },
  82020. handleFocus: function handleFocus() {
  82021. var fromInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  82022. if (this.disabled) return;
  82023. if (this.trigger !== 'focus' || this.confirm || this.isInput && !fromInput) {
  82024. return false;
  82025. }
  82026. this.visible = true;
  82027. },
  82028. handleBlur: function handleBlur() {
  82029. var fromInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  82030. if (this.trigger !== 'focus' || this.confirm || this.isInput && !fromInput) {
  82031. return false;
  82032. }
  82033. this.visible = false;
  82034. },
  82035. handleMouseenter: function handleMouseenter() {
  82036. var _this = this;
  82037. if (this.disabled) return;
  82038. if (this.trigger !== 'hover' || this.confirm) {
  82039. return false;
  82040. }
  82041. if (this.enterTimer) clearTimeout(this.enterTimer);
  82042. this.enterTimer = setTimeout(function () {
  82043. (0, _newArrowCheck3.default)(this, _this);
  82044. this.visible = true;
  82045. }.bind(this), 100);
  82046. },
  82047. handleMouseleave: function handleMouseleave() {
  82048. var _this2 = this;
  82049. if (this.trigger !== 'hover' || this.confirm) {
  82050. return false;
  82051. }
  82052. if (this.enterTimer) {
  82053. clearTimeout(this.enterTimer);
  82054. this.enterTimer = setTimeout(function () {
  82055. (0, _newArrowCheck3.default)(this, _this2);
  82056. this.visible = false;
  82057. }.bind(this), 100);
  82058. }
  82059. },
  82060. cancel: function cancel() {
  82061. this.visible = false;
  82062. this.$emit('on-cancel');
  82063. },
  82064. ok: function ok() {
  82065. this.visible = false;
  82066. this.$emit('on-ok');
  82067. },
  82068. getInputChildren: function getInputChildren() {
  82069. var $input = this.$refs.reference.querySelectorAll('input');
  82070. var $textarea = this.$refs.reference.querySelectorAll('textarea');
  82071. var $children = null;
  82072. if ($input.length) {
  82073. $children = $input[0];
  82074. } else if ($textarea.length) {
  82075. $children = $textarea[0];
  82076. }
  82077. return $children;
  82078. },
  82079. handleGetIndex: function handleGetIndex() {
  82080. (0, _transferQueue.transferIncrease)();
  82081. return _transferQueue.transferIndex;
  82082. },
  82083. handleIndexIncrease: function handleIndexIncrease() {
  82084. this.tIndex = this.handleGetIndex();
  82085. }
  82086. },
  82087. mounted: function mounted() {
  82088. var _this3 = this;
  82089. if (!this.confirm) {
  82090. this.showTitle = this.$slots.title !== undefined || this.title;
  82091. }
  82092. if (this.trigger === 'focus') {
  82093. this.$nextTick(function () {
  82094. (0, _newArrowCheck3.default)(this, _this3);
  82095. var $children = this.getInputChildren();
  82096. if ($children) {
  82097. this.isInput = true;
  82098. $children.addEventListener('focus', this.handleFocus, false);
  82099. $children.addEventListener('blur', this.handleBlur, false);
  82100. }
  82101. }.bind(this));
  82102. }
  82103. },
  82104. beforeDestroy: function beforeDestroy() {
  82105. var $children = this.getInputChildren();
  82106. if ($children) {
  82107. $children.removeEventListener('focus', this.handleFocus, false);
  82108. $children.removeEventListener('blur', this.handleBlur, false);
  82109. }
  82110. }
  82111. };
  82112. /***/ }),
  82113. /* 221 */
  82114. /***/ (function(module, exports, __webpack_require__) {
  82115. "use strict";
  82116. Object.defineProperty(exports, "__esModule", {
  82117. value: true
  82118. });
  82119. var _newArrowCheck2 = __webpack_require__(1);
  82120. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  82121. var _vue = __webpack_require__(16);
  82122. var _vue2 = _interopRequireDefault(_vue);
  82123. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82124. var isServer = _vue2.default.prototype.$isServer;
  82125. var Popper = isServer ? function () {} : __webpack_require__(116);exports.default = {
  82126. props: {
  82127. eventsEnabled: {
  82128. type: Boolean,
  82129. default: false
  82130. },
  82131. placement: {
  82132. type: String,
  82133. default: 'bottom'
  82134. },
  82135. boundariesPadding: {
  82136. type: Number,
  82137. default: 5
  82138. },
  82139. reference: Object,
  82140. popper: Object,
  82141. offset: {
  82142. default: 0
  82143. },
  82144. value: {
  82145. type: Boolean,
  82146. default: false
  82147. },
  82148. transition: String,
  82149. options: {
  82150. type: Object,
  82151. default: function _default() {
  82152. return {
  82153. modifiers: {
  82154. computeStyle: {
  82155. gpuAcceleration: false
  82156. },
  82157. preventOverflow: {
  82158. boundariesElement: 'window'
  82159. }
  82160. }
  82161. };
  82162. }
  82163. }
  82164. },
  82165. data: function data() {
  82166. return {
  82167. visible: this.value
  82168. };
  82169. },
  82170. watch: {
  82171. value: {
  82172. immediate: true,
  82173. handler: function handler(val) {
  82174. this.visible = val;
  82175. this.$emit('input', val);
  82176. }
  82177. },
  82178. visible: function visible(val) {
  82179. if (val) {
  82180. if (this.handleIndexIncrease) this.handleIndexIncrease();
  82181. this.updatePopper();
  82182. this.$emit('on-popper-show');
  82183. } else {
  82184. this.$emit('on-popper-hide');
  82185. }
  82186. this.$emit('input', val);
  82187. }
  82188. },
  82189. methods: {
  82190. createPopper: function createPopper() {
  82191. var _this = this;
  82192. if (isServer) return;
  82193. if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) {
  82194. return;
  82195. }
  82196. var options = this.options;
  82197. var popper = this.popper || this.$refs.popper;
  82198. var reference = this.reference || this.$refs.reference;
  82199. if (!popper || !reference) return;
  82200. if (this.popperJS && this.popperJS.hasOwnProperty('destroy')) {
  82201. this.popperJS.destroy();
  82202. }
  82203. options.eventsEnabled = this.eventsEnabled;
  82204. options.placement = this.placement;
  82205. if (!options.modifiers.offset) {
  82206. options.modifiers.offset = {};
  82207. }
  82208. options.modifiers.offset.offset = this.offset;
  82209. options.onCreate = function () {
  82210. (0, _newArrowCheck3.default)(this, _this);
  82211. this.$nextTick(this.updatePopper);
  82212. this.$emit('created', this);
  82213. }.bind(this);
  82214. this.popperJS = new Popper(reference, popper, options);
  82215. },
  82216. updatePopper: function updatePopper() {
  82217. if (isServer) return;
  82218. this.popperJS ? this.popperJS.update() : this.createPopper();
  82219. },
  82220. doDestroy: function doDestroy() {
  82221. if (isServer) return;
  82222. if (this.visible) return;
  82223. this.popperJS.destroy();
  82224. this.popperJS = null;
  82225. }
  82226. },
  82227. updated: function updated() {
  82228. var _this2 = this;
  82229. this.$nextTick(function () {
  82230. (0, _newArrowCheck3.default)(this, _this2);
  82231. return this.updatePopper();
  82232. }.bind(this));
  82233. },
  82234. beforeDestroy: function beforeDestroy() {
  82235. if (isServer) return;
  82236. if (this.popperJS) {
  82237. this.popperJS.destroy();
  82238. }
  82239. }
  82240. };
  82241. /***/ }),
  82242. /* 222 */
  82243. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  82244. "use strict";
  82245. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  82246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__ = __webpack_require__(223);
  82247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__);
  82248. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  82249. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__ = __webpack_require__(515);
  82250. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__);
  82251. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  82252. /* script */
  82253. /* template */
  82254. /* template functional */
  82255. var __vue_template_functional__ = false
  82256. /* styles */
  82257. var __vue_styles__ = null
  82258. /* scopeId */
  82259. var __vue_scopeId__ = null
  82260. /* moduleIdentifier (server only) */
  82261. var __vue_module_identifier__ = null
  82262. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  82263. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_progress_vue___default.a,
  82264. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__["render"],
  82265. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_664cfb15_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_progress_vue__["staticRenderFns"],
  82266. __vue_template_functional__,
  82267. __vue_styles__,
  82268. __vue_scopeId__,
  82269. __vue_module_identifier__
  82270. )
  82271. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  82272. /***/ }),
  82273. /* 223 */
  82274. /***/ (function(module, exports, __webpack_require__) {
  82275. "use strict";
  82276. Object.defineProperty(exports, "__esModule", {
  82277. value: true
  82278. });
  82279. var _defineProperty2 = __webpack_require__(2);
  82280. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  82281. var _icon = __webpack_require__(19);
  82282. var _icon2 = _interopRequireDefault(_icon);
  82283. var _assist = __webpack_require__(3);
  82284. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82285. var prefixCls = 'ivu-progress';
  82286. exports.default = {
  82287. name: 'Progress',
  82288. components: { Icon: _icon2.default },
  82289. props: {
  82290. percent: {
  82291. type: Number,
  82292. default: 0
  82293. },
  82294. successPercent: {
  82295. type: Number,
  82296. default: 0
  82297. },
  82298. status: {
  82299. validator: function validator(value) {
  82300. return (0, _assist.oneOf)(value, ['normal', 'active', 'wrong', 'success']);
  82301. },
  82302. default: 'normal'
  82303. },
  82304. hideInfo: {
  82305. type: Boolean,
  82306. default: false
  82307. },
  82308. strokeWidth: {
  82309. type: Number,
  82310. default: 10
  82311. },
  82312. vertical: {
  82313. type: Boolean,
  82314. default: false
  82315. },
  82316. strokeColor: {
  82317. type: [String, Array]
  82318. },
  82319. textInside: {
  82320. type: Boolean,
  82321. default: false
  82322. }
  82323. },
  82324. data: function data() {
  82325. return {
  82326. currentStatus: this.status
  82327. };
  82328. },
  82329. computed: {
  82330. isStatus: function isStatus() {
  82331. return this.currentStatus == 'wrong' || this.currentStatus == 'success';
  82332. },
  82333. statusIcon: function statusIcon() {
  82334. var type = '';
  82335. switch (this.currentStatus) {
  82336. case 'wrong':
  82337. type = 'ios-close-circle';
  82338. break;
  82339. case 'success':
  82340. type = 'ios-checkmark-circle';
  82341. break;
  82342. }
  82343. return type;
  82344. },
  82345. bgStyle: function bgStyle() {
  82346. var style = this.vertical ? {
  82347. height: String(this.percent) + '%',
  82348. width: String(this.strokeWidth) + 'px'
  82349. } : {
  82350. width: String(this.percent) + '%',
  82351. height: String(this.strokeWidth) + 'px'
  82352. };
  82353. if (this.strokeColor) {
  82354. if (typeof this.strokeColor === 'string') {
  82355. style['background-color'] = this.strokeColor;
  82356. } else {
  82357. style['background-image'] = 'linear-gradient(to right, ' + String(this.strokeColor[0]) + ' 0%, ' + String(this.strokeColor[1]) + ' 100%)';
  82358. }
  82359. }
  82360. return style;
  82361. },
  82362. successBgStyle: function successBgStyle() {
  82363. return this.vertical ? {
  82364. height: String(this.successPercent) + '%',
  82365. width: String(this.strokeWidth) + 'px'
  82366. } : {
  82367. width: String(this.successPercent) + '%',
  82368. height: String(this.strokeWidth) + 'px'
  82369. };
  82370. },
  82371. wrapClasses: function wrapClasses() {
  82372. var _ref;
  82373. return ['' + prefixCls, prefixCls + '-' + String(this.currentStatus), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-show-info', !this.hideInfo && !this.textInside), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
  82374. },
  82375. textClasses: function textClasses() {
  82376. return prefixCls + '-text';
  82377. },
  82378. textInnerClasses: function textInnerClasses() {
  82379. return prefixCls + '-text-inner';
  82380. },
  82381. outerClasses: function outerClasses() {
  82382. return prefixCls + '-outer';
  82383. },
  82384. innerClasses: function innerClasses() {
  82385. return prefixCls + '-inner';
  82386. },
  82387. bgClasses: function bgClasses() {
  82388. return prefixCls + '-bg';
  82389. },
  82390. successBgClasses: function successBgClasses() {
  82391. return prefixCls + '-success-bg';
  82392. }
  82393. },
  82394. created: function created() {
  82395. this.handleStatus();
  82396. },
  82397. methods: {
  82398. handleStatus: function handleStatus(isDown) {
  82399. if (isDown) {
  82400. this.currentStatus = 'normal';
  82401. this.$emit('on-status-change', 'normal');
  82402. } else {
  82403. if (parseInt(this.percent, 10) == 100) {
  82404. this.currentStatus = 'success';
  82405. this.$emit('on-status-change', 'success');
  82406. }
  82407. }
  82408. }
  82409. },
  82410. watch: {
  82411. percent: function percent(val, oldVal) {
  82412. if (val < oldVal) {
  82413. this.handleStatus(true);
  82414. } else {
  82415. this.handleStatus();
  82416. }
  82417. },
  82418. status: function status(val) {
  82419. this.currentStatus = val;
  82420. }
  82421. }
  82422. };
  82423. /***/ }),
  82424. /* 224 */
  82425. /***/ (function(module, exports, __webpack_require__) {
  82426. "use strict";
  82427. Object.defineProperty(exports, "__esModule", {
  82428. value: true
  82429. });
  82430. var _defineProperty2 = __webpack_require__(2);
  82431. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  82432. var _assist = __webpack_require__(3);
  82433. var _emitter = __webpack_require__(4);
  82434. var _emitter2 = _interopRequireDefault(_emitter);
  82435. var _form = __webpack_require__(11);
  82436. var _form2 = _interopRequireDefault(_form);
  82437. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82438. var prefixCls = 'ivu-radio';
  82439. exports.default = {
  82440. name: 'Radio',
  82441. mixins: [_emitter2.default, _form2.default],
  82442. props: {
  82443. value: {
  82444. type: [String, Number, Boolean],
  82445. default: false
  82446. },
  82447. trueValue: {
  82448. type: [String, Number, Boolean],
  82449. default: true
  82450. },
  82451. falseValue: {
  82452. type: [String, Number, Boolean],
  82453. default: false
  82454. },
  82455. label: {
  82456. type: [String, Number]
  82457. },
  82458. disabled: {
  82459. type: Boolean,
  82460. default: false
  82461. },
  82462. size: {
  82463. validator: function validator(value) {
  82464. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  82465. },
  82466. default: function _default() {
  82467. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  82468. }
  82469. },
  82470. name: {
  82471. type: String
  82472. },
  82473. border: {
  82474. type: Boolean,
  82475. default: false
  82476. }
  82477. },
  82478. data: function data() {
  82479. return {
  82480. currentValue: this.value,
  82481. group: false,
  82482. groupName: this.name,
  82483. parent: (0, _assist.findComponentUpward)(this, 'RadioGroup'),
  82484. focusWrapper: false,
  82485. focusInner: false
  82486. };
  82487. },
  82488. computed: {
  82489. wrapClasses: function wrapClasses() {
  82490. var _ref;
  82491. return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-group-item', this.group), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-checked', this.currentValue), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-focus', this.focusWrapper), (0, _defineProperty3.default)(_ref, prefixCls + '-border', this.border), _ref)];
  82492. },
  82493. radioClasses: function radioClasses() {
  82494. var _ref2;
  82495. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-checked', this.currentValue), (0, _defineProperty3.default)(_ref2, prefixCls + '-disabled', this.itemDisabled), _ref2)];
  82496. },
  82497. innerClasses: function innerClasses() {
  82498. return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-focus', this.focusInner)];
  82499. },
  82500. inputClasses: function inputClasses() {
  82501. return prefixCls + '-input';
  82502. }
  82503. },
  82504. mounted: function mounted() {
  82505. if (this.parent) {
  82506. this.group = true;
  82507. if (this.name && this.name !== this.parent.name) {
  82508. if (console.warn) {
  82509. console.warn('[iview] Name does not match Radio Group name.');
  82510. }
  82511. } else {
  82512. this.groupName = this.parent.name;
  82513. }
  82514. }
  82515. if (this.group) {
  82516. this.parent.updateValue();
  82517. } else {
  82518. this.updateValue();
  82519. }
  82520. },
  82521. methods: {
  82522. change: function change(event) {
  82523. if (this.itemDisabled) {
  82524. return false;
  82525. }
  82526. var checked = event.target.checked;
  82527. this.currentValue = checked;
  82528. var value = checked ? this.trueValue : this.falseValue;
  82529. this.$emit('input', value);
  82530. if (this.group) {
  82531. if (this.label !== undefined) {
  82532. this.parent.change({
  82533. value: this.label,
  82534. checked: this.value
  82535. });
  82536. }
  82537. } else {
  82538. this.$emit('on-change', value);
  82539. this.dispatch('FormItem', 'on-form-change', value);
  82540. }
  82541. },
  82542. updateValue: function updateValue() {
  82543. this.currentValue = this.value === this.trueValue;
  82544. },
  82545. onBlur: function onBlur() {
  82546. this.focusWrapper = false;
  82547. this.focusInner = false;
  82548. },
  82549. onFocus: function onFocus() {
  82550. if (this.group && this.parent.type === 'button') {
  82551. this.focusWrapper = true;
  82552. } else {
  82553. this.focusInner = true;
  82554. }
  82555. }
  82556. },
  82557. watch: {
  82558. value: function value(val) {
  82559. if (val === this.trueValue || val === this.falseValue) {
  82560. this.updateValue();
  82561. } else {
  82562. throw 'Value should be trueValue or falseValue.';
  82563. }
  82564. }
  82565. }
  82566. };
  82567. /***/ }),
  82568. /* 225 */
  82569. /***/ (function(module, exports, __webpack_require__) {
  82570. "use strict";
  82571. Object.defineProperty(exports, "__esModule", {
  82572. value: true
  82573. });
  82574. var _defineProperty2 = __webpack_require__(2);
  82575. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  82576. var _newArrowCheck2 = __webpack_require__(1);
  82577. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  82578. var _assist = __webpack_require__(3);
  82579. var _emitter = __webpack_require__(4);
  82580. var _emitter2 = _interopRequireDefault(_emitter);
  82581. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82582. var prefixCls = 'ivu-radio-group';
  82583. var seed = 0;
  82584. var now = Date.now();
  82585. var getUuid = function () {
  82586. (0, _newArrowCheck3.default)(undefined, undefined);
  82587. return 'ivuRadioGroup_' + String(now) + '_' + seed++;
  82588. }.bind(undefined);
  82589. exports.default = {
  82590. name: 'RadioGroup',
  82591. mixins: [_emitter2.default],
  82592. props: {
  82593. value: {
  82594. type: [String, Number],
  82595. default: ''
  82596. },
  82597. size: {
  82598. validator: function validator(value) {
  82599. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  82600. },
  82601. default: function _default() {
  82602. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  82603. }
  82604. },
  82605. type: {
  82606. validator: function validator(value) {
  82607. return (0, _assist.oneOf)(value, ['button']);
  82608. }
  82609. },
  82610. vertical: {
  82611. type: Boolean,
  82612. default: false
  82613. },
  82614. name: {
  82615. type: String,
  82616. default: getUuid
  82617. },
  82618. buttonStyle: {
  82619. validator: function validator(value) {
  82620. return (0, _assist.oneOf)(value, ['default', 'solid']);
  82621. },
  82622. default: 'default'
  82623. }
  82624. },
  82625. data: function data() {
  82626. return {
  82627. currentValue: this.value,
  82628. children: []
  82629. };
  82630. },
  82631. computed: {
  82632. classes: function classes() {
  82633. var _ref;
  82634. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, 'ivu-radio-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-button-' + String(this.buttonStyle), this.type === 'button' && this.buttonStyle !== 'default'), (0, _defineProperty3.default)(_ref, prefixCls + '-vertical', this.vertical), _ref)];
  82635. }
  82636. },
  82637. mounted: function mounted() {
  82638. this.updateValue();
  82639. },
  82640. methods: {
  82641. updateValue: function updateValue() {
  82642. var _this = this;
  82643. this.children = (0, _assist.findComponentsDownward)(this, 'Radio');
  82644. if (this.children) {
  82645. this.children.forEach(function (child) {
  82646. (0, _newArrowCheck3.default)(this, _this);
  82647. child.currentValue = this.currentValue === child.label;
  82648. child.group = true;
  82649. }.bind(this));
  82650. }
  82651. },
  82652. change: function change(data) {
  82653. this.currentValue = data.value;
  82654. this.updateValue();
  82655. this.$emit('input', data.value);
  82656. this.$emit('on-change', data.value);
  82657. this.dispatch('FormItem', 'on-form-change', data.value);
  82658. }
  82659. },
  82660. watch: {
  82661. value: function value() {
  82662. var _this2 = this;
  82663. if (this.currentValue !== this.value) {
  82664. this.currentValue = this.value;
  82665. this.$nextTick(function () {
  82666. (0, _newArrowCheck3.default)(this, _this2);
  82667. this.updateValue();
  82668. }.bind(this));
  82669. }
  82670. }
  82671. }
  82672. };
  82673. /***/ }),
  82674. /* 226 */
  82675. /***/ (function(module, exports, __webpack_require__) {
  82676. "use strict";
  82677. Object.defineProperty(exports, "__esModule", {
  82678. value: true
  82679. });
  82680. var _defineProperty2 = __webpack_require__(2);
  82681. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  82682. var _locale = __webpack_require__(6);
  82683. var _locale2 = _interopRequireDefault(_locale);
  82684. var _emitter = __webpack_require__(4);
  82685. var _emitter2 = _interopRequireDefault(_emitter);
  82686. var _form = __webpack_require__(11);
  82687. var _form2 = _interopRequireDefault(_form);
  82688. var _icon = __webpack_require__(8);
  82689. var _icon2 = _interopRequireDefault(_icon);
  82690. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82691. var prefixCls = 'ivu-rate';
  82692. exports.default = {
  82693. name: 'Rate',
  82694. mixins: [_locale2.default, _emitter2.default, _form2.default],
  82695. components: { Icon: _icon2.default },
  82696. props: {
  82697. count: {
  82698. type: Number,
  82699. default: 5
  82700. },
  82701. value: {
  82702. type: Number,
  82703. default: 0
  82704. },
  82705. allowHalf: {
  82706. type: Boolean,
  82707. default: false
  82708. },
  82709. disabled: {
  82710. type: Boolean,
  82711. default: false
  82712. },
  82713. showText: {
  82714. type: Boolean,
  82715. default: false
  82716. },
  82717. name: {
  82718. type: String
  82719. },
  82720. clearable: {
  82721. type: Boolean,
  82722. default: false
  82723. },
  82724. character: {
  82725. type: String,
  82726. default: ''
  82727. },
  82728. icon: {
  82729. type: String,
  82730. default: ''
  82731. },
  82732. customIcon: {
  82733. type: String,
  82734. default: ''
  82735. }
  82736. },
  82737. data: function data() {
  82738. var value = this.value || 0;
  82739. return {
  82740. prefixCls: prefixCls,
  82741. hoverIndex: -1,
  82742. isHover: false,
  82743. isHalf: this.allowHalf && value.toString().indexOf('.') >= 0,
  82744. currentValue: value
  82745. };
  82746. },
  82747. computed: {
  82748. classes: function classes() {
  82749. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-disabled', this.itemDisabled)];
  82750. },
  82751. iconClasses: function iconClasses() {
  82752. var _ref2;
  82753. return ['ivu-icon', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, 'ivu-icon-' + String(this.icon), this.icon !== ''), (0, _defineProperty3.default)(_ref2, '' + String(this.customIcon), this.customIcon !== ''), _ref2)];
  82754. },
  82755. showCharacter: function showCharacter() {
  82756. return this.character !== '' || this.icon !== '' || this.customIcon !== '';
  82757. }
  82758. },
  82759. watch: {
  82760. value: function value(val) {
  82761. this.currentValue = val || 0;
  82762. },
  82763. currentValue: function currentValue(val) {
  82764. this.setHalf(val);
  82765. }
  82766. },
  82767. methods: {
  82768. starCls: function starCls(value) {
  82769. var _ref3;
  82770. var hoverIndex = this.hoverIndex;
  82771. var currentIndex = this.isHover ? hoverIndex : this.currentValue;
  82772. var full = false;
  82773. var isLast = false;
  82774. if (currentIndex >= value) full = true;
  82775. if (this.isHover) {
  82776. isLast = currentIndex === value;
  82777. } else {
  82778. isLast = Math.ceil(this.currentValue) === value;
  82779. }
  82780. return [(_ref3 = {}, (0, _defineProperty3.default)(_ref3, prefixCls + '-star', !this.showCharacter), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-chart', this.showCharacter), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-full', !isLast && full || isLast && !this.isHalf), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-half', isLast && this.isHalf), (0, _defineProperty3.default)(_ref3, prefixCls + '-star-zero', !full), _ref3)];
  82781. },
  82782. handleMousemove: function handleMousemove(value, event) {
  82783. if (this.itemDisabled) return;
  82784. this.isHover = true;
  82785. if (this.allowHalf) {
  82786. var type = event.target.getAttribute('type') || false;
  82787. this.isHalf = type === 'half';
  82788. } else {
  82789. this.isHalf = false;
  82790. }
  82791. this.hoverIndex = value;
  82792. },
  82793. handleMouseleave: function handleMouseleave() {
  82794. if (this.itemDisabled) return;
  82795. this.isHover = false;
  82796. this.setHalf(this.currentValue);
  82797. this.hoverIndex = -1;
  82798. },
  82799. setHalf: function setHalf(val) {
  82800. this.isHalf = this.allowHalf && val.toString().indexOf('.') >= 0;
  82801. },
  82802. handleClick: function handleClick(value) {
  82803. if (this.itemDisabled) return;
  82804. if (this.isHalf) value -= 0.5;
  82805. if (this.clearable && Math.abs(value - this.currentValue) < 0.01) {
  82806. value = 0;
  82807. }
  82808. this.currentValue = value;
  82809. this.$emit('input', value);
  82810. this.$emit('on-change', value);
  82811. this.dispatch('FormItem', 'on-form-change', value);
  82812. }
  82813. }
  82814. };
  82815. /***/ }),
  82816. /* 227 */
  82817. /***/ (function(module, exports, __webpack_require__) {
  82818. "use strict";
  82819. Object.defineProperty(exports, "__esModule", {
  82820. value: true
  82821. });
  82822. var _isFinite = __webpack_require__(75);
  82823. var _isFinite2 = _interopRequireDefault(_isFinite);
  82824. var _slicedToArray2 = __webpack_require__(26);
  82825. var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
  82826. var _keys = __webpack_require__(21);
  82827. var _keys2 = _interopRequireDefault(_keys);
  82828. var _defineProperty2 = __webpack_require__(2);
  82829. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  82830. var _newArrowCheck2 = __webpack_require__(1);
  82831. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  82832. var _toConsumableArray2 = __webpack_require__(17);
  82833. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  82834. var _inputNumber = __webpack_require__(194);
  82835. var _inputNumber2 = _interopRequireDefault(_inputNumber);
  82836. var _tooltip = __webpack_require__(93);
  82837. var _tooltip2 = _interopRequireDefault(_tooltip);
  82838. var _marker = __webpack_require__(528);
  82839. var _marker2 = _interopRequireDefault(_marker);
  82840. var _assist = __webpack_require__(3);
  82841. var _dom = __webpack_require__(12);
  82842. var _emitter = __webpack_require__(4);
  82843. var _emitter2 = _interopRequireDefault(_emitter);
  82844. var _form = __webpack_require__(11);
  82845. var _form2 = _interopRequireDefault(_form);
  82846. var _elementResizeDetector = __webpack_require__(94);
  82847. var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
  82848. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  82849. var prefixCls = 'ivu-slider';
  82850. exports.default = {
  82851. name: 'Slider',
  82852. mixins: [_emitter2.default, _form2.default],
  82853. components: { InputNumber: _inputNumber2.default, Tooltip: _tooltip2.default, SliderMarker: _marker2.default },
  82854. props: {
  82855. min: {
  82856. type: Number,
  82857. default: 0
  82858. },
  82859. max: {
  82860. type: Number,
  82861. default: 100
  82862. },
  82863. step: {
  82864. type: Number,
  82865. default: 1
  82866. },
  82867. range: {
  82868. type: Boolean,
  82869. default: false
  82870. },
  82871. value: {
  82872. type: [Number, Array],
  82873. default: 0
  82874. },
  82875. disabled: {
  82876. type: Boolean,
  82877. default: false
  82878. },
  82879. showInput: {
  82880. type: Boolean,
  82881. default: false
  82882. },
  82883. inputSize: {
  82884. type: String,
  82885. default: 'default',
  82886. validator: function validator(value) {
  82887. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  82888. }
  82889. },
  82890. showStops: {
  82891. type: Boolean,
  82892. default: false
  82893. },
  82894. tipFormat: {
  82895. type: Function,
  82896. default: function _default(val) {
  82897. return val;
  82898. }
  82899. },
  82900. showTip: {
  82901. type: String,
  82902. default: 'hover',
  82903. validator: function validator(value) {
  82904. return (0, _assist.oneOf)(value, ['hover', 'always', 'never']);
  82905. }
  82906. },
  82907. name: {
  82908. type: String
  82909. },
  82910. activeChange: {
  82911. type: Boolean,
  82912. default: true
  82913. },
  82914. marks: {
  82915. type: Object
  82916. }
  82917. },
  82918. data: function data() {
  82919. var val = this.checkLimits(Array.isArray(this.value) ? this.value : [this.value]);
  82920. if (this.range && this.value === null) val = [0, 0];
  82921. return {
  82922. prefixCls: prefixCls,
  82923. currentValue: val,
  82924. dragging: false,
  82925. pointerDown: '',
  82926. startX: 0,
  82927. currentX: 0,
  82928. startPos: 0,
  82929. oldValue: [].concat((0, _toConsumableArray3.default)(val)),
  82930. valueIndex: {
  82931. min: 0,
  82932. max: 1
  82933. },
  82934. sliderWidth: 0,
  82935. isValueNull: false };
  82936. },
  82937. watch: {
  82938. value: function value(val) {
  82939. if (val === null) this.isValueNull = true;
  82940. val = this.checkLimits(Array.isArray(val) ? val : [val]);
  82941. if (!this.dragging && (val[0] !== this.currentValue[0] || val[1] !== this.currentValue[1])) {
  82942. if (this.isValueNull && this.range) this.currentValue = [0, 0];else this.currentValue = val;
  82943. }
  82944. },
  82945. exportValue: function exportValue(values) {
  82946. var _this = this;
  82947. this.$nextTick(function () {
  82948. (0, _newArrowCheck3.default)(this, _this);
  82949. this.$refs.minTooltip.updatePopper();
  82950. if (this.range) {
  82951. this.$refs.maxTooltip.updatePopper();
  82952. }
  82953. }.bind(this));
  82954. var value = this.range ? values : values[0];
  82955. if (this.isValueNull) {
  82956. this.isValueNull = false;
  82957. this.$emit('input', null);
  82958. } else {
  82959. this.$emit('input', value);
  82960. }
  82961. this.$emit('on-input', value);
  82962. }
  82963. },
  82964. computed: {
  82965. classes: function classes() {
  82966. var _ref;
  82967. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-input', this.showInput && !this.range), (0, _defineProperty3.default)(_ref, prefixCls + '-range', this.range), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), _ref)];
  82968. },
  82969. minButtonClasses: function minButtonClasses() {
  82970. return [prefixCls + '-button', (0, _defineProperty3.default)({}, prefixCls + '-button-dragging', this.pointerDown === 'min')];
  82971. },
  82972. maxButtonClasses: function maxButtonClasses() {
  82973. return [prefixCls + '-button', (0, _defineProperty3.default)({}, prefixCls + '-button-dragging', this.pointerDown === 'max')];
  82974. },
  82975. exportValue: function exportValue() {
  82976. var _this2 = this;
  82977. var decimalCases = (String(this.step).split('.')[1] || '').length;
  82978. return this.currentValue.map(function (nr) {
  82979. (0, _newArrowCheck3.default)(this, _this2);
  82980. return Number(nr.toFixed(decimalCases));
  82981. }.bind(this));
  82982. },
  82983. minPosition: function minPosition() {
  82984. var val = this.currentValue;
  82985. return (val[0] - this.min) / this.valueRange * 100;
  82986. },
  82987. maxPosition: function maxPosition() {
  82988. var val = this.currentValue;
  82989. return (val[1] - this.min) / this.valueRange * 100;
  82990. },
  82991. barStyle: function barStyle() {
  82992. var style = {
  82993. width: (this.currentValue[0] - this.min) / this.valueRange * 100 + '%'
  82994. };
  82995. if (this.range) {
  82996. style.left = (this.currentValue[0] - this.min) / this.valueRange * 100 + '%';
  82997. style.width = (this.currentValue[1] - this.currentValue[0]) / this.valueRange * 100 + '%';
  82998. }
  82999. return style;
  83000. },
  83001. stops: function stops() {
  83002. var stopCount = this.valueRange / this.step;
  83003. var result = [];
  83004. var stepWidth = 100 * this.step / this.valueRange;
  83005. for (var i = 1; i < stopCount; i++) {
  83006. result.push(i * stepWidth);
  83007. }
  83008. return result;
  83009. },
  83010. markList: function markList() {
  83011. var _this3 = this;
  83012. if (!this.marks) return [];
  83013. var marksKeys = (0, _keys2.default)(this.marks);
  83014. return marksKeys.map(parseFloat).sort(function (a, b) {
  83015. (0, _newArrowCheck3.default)(this, _this3);
  83016. return a - b;
  83017. }.bind(this)).filter(function (point) {
  83018. (0, _newArrowCheck3.default)(this, _this3);
  83019. return point <= this.max && point >= this.min;
  83020. }.bind(this)).map(function (point) {
  83021. (0, _newArrowCheck3.default)(this, _this3);
  83022. return {
  83023. point: point,
  83024. position: (point - this.min) * 100 / (this.max - this.min),
  83025. mark: this.marks[point]
  83026. };
  83027. }.bind(this));
  83028. },
  83029. tipDisabled: function tipDisabled() {
  83030. return this.tipFormat(this.currentValue[0]) === null || this.showTip === 'never';
  83031. },
  83032. valueRange: function valueRange() {
  83033. return this.max - this.min;
  83034. },
  83035. firstPosition: function firstPosition() {
  83036. return this.currentValue[0];
  83037. },
  83038. secondPosition: function secondPosition() {
  83039. return this.currentValue[1];
  83040. }
  83041. },
  83042. methods: {
  83043. getPointerX: function getPointerX(e) {
  83044. return e.type.indexOf('touch') !== -1 ? e.touches[0].clientX : e.clientX;
  83045. },
  83046. checkLimits: function checkLimits(_ref4) {
  83047. var _ref5 = (0, _slicedToArray3.default)(_ref4, 2),
  83048. min = _ref5[0],
  83049. max = _ref5[1];
  83050. min = Math.max(this.min, min);
  83051. min = Math.min(this.max, min);
  83052. max = Math.max(this.min, min, max);
  83053. max = Math.min(this.max, max);
  83054. return [min, max];
  83055. },
  83056. getCurrentValue: function getCurrentValue(event, type) {
  83057. if (this.itemDisabled) {
  83058. return;
  83059. }
  83060. var index = this.valueIndex[type];
  83061. if (typeof index === 'undefined') {
  83062. return;
  83063. }
  83064. return this.currentValue[index];
  83065. },
  83066. onKeyLeft: function onKeyLeft(event, type) {
  83067. var value = this.getCurrentValue(event, type);
  83068. if ((0, _isFinite2.default)(value)) {
  83069. this.changeButtonPosition(value - this.step, type);
  83070. }
  83071. },
  83072. onKeyRight: function onKeyRight(event, type) {
  83073. var value = this.getCurrentValue(event, type);
  83074. if ((0, _isFinite2.default)(value)) {
  83075. this.changeButtonPosition(value + this.step, type);
  83076. }
  83077. },
  83078. onPointerDown: function onPointerDown(event, type) {
  83079. if (this.itemDisabled) return;
  83080. event.preventDefault();
  83081. this.pointerDown = type;
  83082. this.onPointerDragStart(event);
  83083. (0, _dom.on)(window, 'mousemove', this.onPointerDrag);
  83084. (0, _dom.on)(window, 'touchmove', this.onPointerDrag);
  83085. (0, _dom.on)(window, 'mouseup', this.onPointerDragEnd);
  83086. (0, _dom.on)(window, 'touchend', this.onPointerDragEnd);
  83087. },
  83088. onPointerDragStart: function onPointerDragStart(event) {
  83089. this.dragging = false;
  83090. this.startX = this.getPointerX(event);
  83091. this.startPos = this[String(this.pointerDown) + 'Position'] * this.valueRange / 100 + this.min;
  83092. },
  83093. onPointerDrag: function onPointerDrag(event) {
  83094. this.dragging = true;
  83095. this.$refs[String(this.pointerDown) + 'Tooltip'].visible = true;
  83096. this.currentX = this.getPointerX(event);
  83097. var diff = (this.currentX - this.startX) / this.sliderWidth * this.valueRange;
  83098. this.changeButtonPosition(this.startPos + diff);
  83099. },
  83100. onPointerDragEnd: function onPointerDragEnd() {
  83101. if (this.dragging) {
  83102. this.dragging = false;
  83103. this.$refs[String(this.pointerDown) + 'Tooltip'].visible = false;
  83104. this.emitChange();
  83105. }
  83106. this.pointerDown = '';
  83107. (0, _dom.off)(window, 'mousemove', this.onPointerDrag);
  83108. (0, _dom.off)(window, 'touchmove', this.onPointerDrag);
  83109. (0, _dom.off)(window, 'mouseup', this.onPointerDragEnd);
  83110. (0, _dom.off)(window, 'touchend', this.onPointerDragEnd);
  83111. },
  83112. changeButtonPosition: function changeButtonPosition(newPos, forceType) {
  83113. var type = forceType || this.pointerDown;
  83114. var index = type === 'min' ? 0 : 1;
  83115. if (type === 'min') newPos = this.checkLimits([newPos, this.max])[0];else newPos = this.checkLimits([this.min, newPos])[1];
  83116. var modulus = this.handleDecimal(newPos, this.step);
  83117. var value = this.currentValue;
  83118. value[index] = newPos - modulus;
  83119. if (this.range) {
  83120. if (type === 'min' && value[0] > value[1]) value[1] = value[0];
  83121. if (type === 'max' && value[0] > value[1]) value[0] = value[1];
  83122. }
  83123. this.currentValue = [].concat((0, _toConsumableArray3.default)(value));
  83124. if (!this.dragging) {
  83125. if (this.currentValue[index] !== this.oldValue[index]) {
  83126. this.emitChange();
  83127. this.oldValue[index] = this.currentValue[index];
  83128. }
  83129. }
  83130. },
  83131. handleDecimal: function handleDecimal(pos, step) {
  83132. if (step < 1) {
  83133. var sl = step.toString(),
  83134. multiple = 1,
  83135. m = void 0;
  83136. try {
  83137. m = sl.split('.')[1].length;
  83138. } catch (e) {
  83139. m = 0;
  83140. }
  83141. multiple = Math.pow(10, m);
  83142. return pos * multiple % (step * multiple) / multiple;
  83143. } else return pos % step;
  83144. },
  83145. emitChange: function emitChange() {
  83146. var value = this.range ? this.exportValue : this.exportValue[0];
  83147. this.$emit('on-change', value);
  83148. this.dispatch('FormItem', 'on-form-change', value);
  83149. },
  83150. sliderClick: function sliderClick(event) {
  83151. if (this.itemDisabled) return;
  83152. var currentX = this.getPointerX(event);
  83153. var sliderOffsetLeft = this.$refs.slider.getBoundingClientRect().left;
  83154. var newPos = (currentX - sliderOffsetLeft) / this.sliderWidth * this.valueRange + this.min;
  83155. var regularNewPos = newPos / this.valueRange * 100;
  83156. if (!this.range || regularNewPos <= this.minPosition) this.changeButtonPosition(newPos, 'min');else if (regularNewPos >= this.maxPosition) this.changeButtonPosition(newPos, 'max');else this.changeButtonPosition(newPos, newPos - this.firstPosition <= this.secondPosition - newPos ? 'min' : 'max');
  83157. },
  83158. handleInputChange: function handleInputChange(val) {
  83159. this.currentValue = [val === 0 ? 0 : val || this.min, this.currentValue[1]];
  83160. this.emitChange();
  83161. },
  83162. handleFocus: function handleFocus(type) {
  83163. this.$refs[String(type) + 'Tooltip'].handleShowPopper();
  83164. },
  83165. handleBlur: function handleBlur(type) {
  83166. this.$refs[String(type) + 'Tooltip'].handleClosePopper();
  83167. },
  83168. handleSetSliderWidth: function handleSetSliderWidth() {
  83169. this.sliderWidth = parseInt((0, _assist.getStyle)(this.$refs.slider, 'width'), 10);
  83170. }
  83171. },
  83172. mounted: function mounted() {
  83173. var _this4 = this;
  83174. this.$on('on-visible-change', function (val) {
  83175. (0, _newArrowCheck3.default)(this, _this4);
  83176. if (val && this.showTip === 'always') {
  83177. this.$refs.minTooltip.doDestroy();
  83178. if (this.range) {
  83179. this.$refs.maxTooltip.doDestroy();
  83180. }
  83181. this.$nextTick(function () {
  83182. (0, _newArrowCheck3.default)(this, _this4);
  83183. this.$refs.minTooltip.updatePopper();
  83184. if (this.range) {
  83185. this.$refs.maxTooltip.updatePopper();
  83186. }
  83187. }.bind(this));
  83188. }
  83189. }.bind(this));
  83190. this.observer = (0, _elementResizeDetector2.default)();
  83191. this.observer.listenTo(this.$refs.slider, this.handleSetSliderWidth);
  83192. },
  83193. beforeDestroy: function beforeDestroy() {
  83194. this.observer.removeListener(this.$refs.slider, this.handleSetSliderWidth);
  83195. }
  83196. };
  83197. /***/ }),
  83198. /* 228 */
  83199. /***/ (function(module, exports, __webpack_require__) {
  83200. "use strict";
  83201. Object.defineProperty(exports, "__esModule", {
  83202. value: true
  83203. });
  83204. var _newArrowCheck2 = __webpack_require__(1);
  83205. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  83206. var _defineProperty2 = __webpack_require__(2);
  83207. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  83208. var _popper = __webpack_require__(221);
  83209. var _popper2 = _interopRequireDefault(_popper);
  83210. var _transferDom = __webpack_require__(23);
  83211. var _transferDom2 = _interopRequireDefault(_transferDom);
  83212. var _assist = __webpack_require__(3);
  83213. var _transferQueue = __webpack_require__(37);
  83214. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  83215. var prefixCls = 'ivu-tooltip';
  83216. exports.default = {
  83217. name: 'Tooltip',
  83218. directives: { TransferDom: _transferDom2.default },
  83219. mixins: [_popper2.default],
  83220. props: {
  83221. placement: {
  83222. validator: function validator(value) {
  83223. return (0, _assist.oneOf)(value, ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end']);
  83224. },
  83225. default: 'bottom'
  83226. },
  83227. content: {
  83228. type: [String, Number],
  83229. default: ''
  83230. },
  83231. delay: {
  83232. type: Number,
  83233. default: 100
  83234. },
  83235. disabled: {
  83236. type: Boolean,
  83237. default: false
  83238. },
  83239. controlled: {
  83240. type: Boolean,
  83241. default: false
  83242. },
  83243. always: {
  83244. type: Boolean,
  83245. default: false
  83246. },
  83247. transfer: {
  83248. type: Boolean,
  83249. default: function _default() {
  83250. return !this.$IVIEW || this.$IVIEW.transfer === '' ? false : this.$IVIEW.transfer;
  83251. }
  83252. },
  83253. theme: {
  83254. validator: function validator(value) {
  83255. return (0, _assist.oneOf)(value, ['dark', 'light']);
  83256. },
  83257. default: 'dark'
  83258. },
  83259. maxWidth: {
  83260. type: [String, Number]
  83261. },
  83262. transferClassName: {
  83263. type: String
  83264. }
  83265. },
  83266. data: function data() {
  83267. return {
  83268. prefixCls: prefixCls,
  83269. tIndex: this.handleGetIndex()
  83270. };
  83271. },
  83272. computed: {
  83273. innerStyles: function innerStyles() {
  83274. var styles = {};
  83275. if (this.maxWidth) styles['max-width'] = String(this.maxWidth) + 'px';
  83276. return styles;
  83277. },
  83278. innerClasses: function innerClasses() {
  83279. return [prefixCls + '-inner', (0, _defineProperty3.default)({}, prefixCls + '-inner-with-width', !!this.maxWidth)];
  83280. },
  83281. dropStyles: function dropStyles() {
  83282. var styles = {};
  83283. if (this.transfer) styles['z-index'] = 1060 + this.tIndex;
  83284. return styles;
  83285. },
  83286. dropdownCls: function dropdownCls() {
  83287. var _ref2;
  83288. return [prefixCls + '-popper', prefixCls + '-' + String(this.theme), (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-transfer', this.transfer), (0, _defineProperty3.default)(_ref2, this.transferClassName, this.transferClassName), _ref2)];
  83289. }
  83290. },
  83291. watch: {
  83292. content: function content() {
  83293. this.updatePopper();
  83294. }
  83295. },
  83296. methods: {
  83297. handleShowPopper: function handleShowPopper() {
  83298. var _this = this;
  83299. if (this.timeout) clearTimeout(this.timeout);
  83300. this.timeout = setTimeout(function () {
  83301. (0, _newArrowCheck3.default)(this, _this);
  83302. this.visible = true;
  83303. }.bind(this), this.delay);
  83304. this.tIndex = this.handleGetIndex();
  83305. },
  83306. handleClosePopper: function handleClosePopper() {
  83307. var _this2 = this;
  83308. if (this.timeout) {
  83309. clearTimeout(this.timeout);
  83310. if (!this.controlled) {
  83311. this.timeout = setTimeout(function () {
  83312. (0, _newArrowCheck3.default)(this, _this2);
  83313. this.visible = false;
  83314. }.bind(this), 100);
  83315. }
  83316. }
  83317. },
  83318. handleGetIndex: function handleGetIndex() {
  83319. (0, _transferQueue.transferIncrease)();
  83320. return _transferQueue.transferIndex;
  83321. }
  83322. },
  83323. mounted: function mounted() {
  83324. if (this.always) {
  83325. this.updatePopper();
  83326. }
  83327. }
  83328. };
  83329. /***/ }),
  83330. /* 229 */
  83331. /***/ (function(module, exports, __webpack_require__) {
  83332. "use strict";
  83333. var utils = module.exports = {};
  83334. /**
  83335. * Loops through the collection and calls the callback for each element. if the callback returns truthy, the loop is broken and returns the same value.
  83336. * @public
  83337. * @param {*} collection The collection to loop through. Needs to have a length property set and have indices set from 0 to length - 1.
  83338. * @param {function} callback The callback to be called for each element. The element will be given as a parameter to the callback. If this callback returns truthy, the loop is broken and the same value is returned.
  83339. * @returns {*} The value that a callback has returned (if truthy). Otherwise nothing.
  83340. */
  83341. utils.forEach = function(collection, callback) {
  83342. for(var i = 0; i < collection.length; i++) {
  83343. var result = callback(collection[i]);
  83344. if(result) {
  83345. return result;
  83346. }
  83347. }
  83348. };
  83349. /***/ }),
  83350. /* 230 */
  83351. /***/ (function(module, exports, __webpack_require__) {
  83352. "use strict";
  83353. var detector = module.exports = {};
  83354. detector.isIE = function(version) {
  83355. function isAnyIeVersion() {
  83356. var agent = navigator.userAgent.toLowerCase();
  83357. return agent.indexOf("msie") !== -1 || agent.indexOf("trident") !== -1 || agent.indexOf(" edge/") !== -1;
  83358. }
  83359. if(!isAnyIeVersion()) {
  83360. return false;
  83361. }
  83362. if(!version) {
  83363. return true;
  83364. }
  83365. //Shamelessly stolen from https://gist.github.com/padolsey/527683
  83366. var ieVersion = (function(){
  83367. var undef,
  83368. v = 3,
  83369. div = document.createElement("div"),
  83370. all = div.getElementsByTagName("i");
  83371. do {
  83372. div.innerHTML = "<!--[if gt IE " + (++v) + "]><i></i><![endif]-->";
  83373. }
  83374. while (all[0]);
  83375. return v > 4 ? v : undef;
  83376. }());
  83377. return version === ieVersion;
  83378. };
  83379. detector.isLegacyOpera = function() {
  83380. return !!window.opera;
  83381. };
  83382. /***/ }),
  83383. /* 231 */
  83384. /***/ (function(module, exports, __webpack_require__) {
  83385. "use strict";
  83386. Object.defineProperty(exports, "__esModule", {
  83387. value: true
  83388. });
  83389. var _newArrowCheck2 = __webpack_require__(1);
  83390. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  83391. var _defineProperty2 = __webpack_require__(2);
  83392. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  83393. var _assist = __webpack_require__(3);
  83394. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  83395. var prefixCls = 'ivu-steps';
  83396. function debounce(fn) {
  83397. var waiting = void 0;
  83398. return function () {
  83399. if (waiting) return;
  83400. waiting = true;
  83401. var context = this,
  83402. args = arguments;
  83403. var later = function later() {
  83404. waiting = false;
  83405. fn.apply(context, args);
  83406. };
  83407. this.$nextTick(later);
  83408. };
  83409. }
  83410. exports.default = {
  83411. name: 'Steps',
  83412. props: {
  83413. current: {
  83414. type: Number,
  83415. default: 0
  83416. },
  83417. status: {
  83418. validator: function validator(value) {
  83419. return (0, _assist.oneOf)(value, ['wait', 'process', 'finish', 'error']);
  83420. },
  83421. default: 'process'
  83422. },
  83423. size: {
  83424. validator: function validator(value) {
  83425. return (0, _assist.oneOf)(value, ['small']);
  83426. }
  83427. },
  83428. direction: {
  83429. validator: function validator(value) {
  83430. return (0, _assist.oneOf)(value, ['horizontal', 'vertical']);
  83431. },
  83432. default: 'horizontal'
  83433. }
  83434. },
  83435. computed: {
  83436. classes: function classes() {
  83437. return ['' + prefixCls, prefixCls + '-' + String(this.direction), (0, _defineProperty3.default)({}, prefixCls + '-' + String(this.size), !!this.size)];
  83438. }
  83439. },
  83440. methods: {
  83441. updateChildProps: function updateChildProps(isInit) {
  83442. var _this = this;
  83443. var total = this.$children.length;
  83444. this.$children.forEach(function (child, index) {
  83445. (0, _newArrowCheck3.default)(this, _this);
  83446. child.stepNumber = index + 1;
  83447. if (this.direction === 'horizontal') {
  83448. child.total = total;
  83449. }
  83450. if (!(isInit && child.currentStatus)) {
  83451. if (index === this.current) {
  83452. if (this.status !== 'error') {
  83453. child.currentStatus = 'process';
  83454. }
  83455. } else if (index < this.current) {
  83456. child.currentStatus = 'finish';
  83457. } else {
  83458. child.currentStatus = 'wait';
  83459. }
  83460. }
  83461. if (child.currentStatus !== 'error' && index !== 0) {
  83462. this.$children[index - 1].nextError = false;
  83463. }
  83464. }.bind(this));
  83465. },
  83466. setNextError: function setNextError() {
  83467. var _this2 = this;
  83468. this.$children.forEach(function (child, index) {
  83469. (0, _newArrowCheck3.default)(this, _this2);
  83470. if (child.currentStatus === 'error' && index !== 0) {
  83471. this.$children[index - 1].nextError = true;
  83472. }
  83473. }.bind(this));
  83474. },
  83475. updateCurrent: function updateCurrent(isInit) {
  83476. if (this.current < 0 || this.current >= this.$children.length) {
  83477. return;
  83478. }
  83479. if (isInit) {
  83480. var current_status = this.$children[this.current].currentStatus;
  83481. if (!current_status) {
  83482. this.$children[this.current].currentStatus = this.status;
  83483. }
  83484. } else {
  83485. this.$children[this.current].currentStatus = this.status;
  83486. }
  83487. },
  83488. debouncedAppendRemove: function debouncedAppendRemove() {
  83489. return debounce(function () {
  83490. this.updateSteps();
  83491. });
  83492. },
  83493. updateSteps: function updateSteps() {
  83494. this.updateChildProps(true);
  83495. this.setNextError();
  83496. this.updateCurrent(true);
  83497. }
  83498. },
  83499. mounted: function mounted() {
  83500. this.updateSteps();
  83501. this.$on('append', this.debouncedAppendRemove());
  83502. this.$on('remove', this.debouncedAppendRemove());
  83503. },
  83504. watch: {
  83505. current: function current() {
  83506. this.updateChildProps();
  83507. },
  83508. status: function status() {
  83509. this.updateCurrent();
  83510. }
  83511. }
  83512. };
  83513. /***/ }),
  83514. /* 232 */
  83515. /***/ (function(module, exports, __webpack_require__) {
  83516. "use strict";
  83517. Object.defineProperty(exports, "__esModule", {
  83518. value: true
  83519. });
  83520. var _defineProperty2 = __webpack_require__(2);
  83521. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  83522. var _emitter = __webpack_require__(4);
  83523. var _emitter2 = _interopRequireDefault(_emitter);
  83524. var _assist = __webpack_require__(3);
  83525. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  83526. var prefixCls = 'ivu-steps';
  83527. var iconPrefixCls = 'ivu-icon';
  83528. exports.default = {
  83529. name: 'Step',
  83530. mixins: [_emitter2.default],
  83531. props: {
  83532. status: {
  83533. validator: function validator(value) {
  83534. return (0, _assist.oneOf)(value, ['wait', 'process', 'finish', 'error']);
  83535. }
  83536. },
  83537. title: {
  83538. type: String,
  83539. default: ''
  83540. },
  83541. content: {
  83542. type: String
  83543. },
  83544. icon: {
  83545. type: String
  83546. }
  83547. },
  83548. data: function data() {
  83549. return {
  83550. prefixCls: prefixCls,
  83551. stepNumber: '',
  83552. nextError: false,
  83553. total: 1,
  83554. currentStatus: ''
  83555. };
  83556. },
  83557. computed: {
  83558. wrapClasses: function wrapClasses() {
  83559. var _ref;
  83560. return [prefixCls + '-item', prefixCls + '-status-' + String(this.currentStatus), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-custom', !!this.icon || !!this.$slots.icon), (0, _defineProperty3.default)(_ref, prefixCls + '-next-error', this.nextError), _ref)];
  83561. },
  83562. iconClasses: function iconClasses() {
  83563. var icon = '';
  83564. if (this.icon) {
  83565. icon = this.icon;
  83566. } else {
  83567. if (this.currentStatus === 'finish') {
  83568. icon = 'ios-checkmark';
  83569. } else if (this.currentStatus === 'error') {
  83570. icon = 'ios-close';
  83571. }
  83572. }
  83573. return [prefixCls + '-icon', '' + iconPrefixCls, (0, _defineProperty3.default)({}, iconPrefixCls + '-' + String(icon), icon !== '')];
  83574. }
  83575. },
  83576. watch: {
  83577. status: function status(val) {
  83578. this.currentStatus = val;
  83579. if (this.currentStatus === 'error') {
  83580. this.$parent.setNextError();
  83581. }
  83582. }
  83583. },
  83584. created: function created() {
  83585. this.currentStatus = this.status;
  83586. },
  83587. mounted: function mounted() {
  83588. this.dispatch('Steps', 'append');
  83589. },
  83590. beforeDestroy: function beforeDestroy() {
  83591. this.dispatch('Steps', 'remove');
  83592. }
  83593. };
  83594. /***/ }),
  83595. /* 233 */
  83596. /***/ (function(module, exports, __webpack_require__) {
  83597. "use strict";
  83598. Object.defineProperty(exports, "__esModule", {
  83599. value: true
  83600. });
  83601. var _newArrowCheck2 = __webpack_require__(1);
  83602. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  83603. var _defineProperty2 = __webpack_require__(2);
  83604. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  83605. var _assist = __webpack_require__(3);
  83606. var _emitter = __webpack_require__(4);
  83607. var _emitter2 = _interopRequireDefault(_emitter);
  83608. var _form = __webpack_require__(11);
  83609. var _form2 = _interopRequireDefault(_form);
  83610. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  83611. var prefixCls = 'ivu-switch';
  83612. exports.default = {
  83613. name: 'iSwitch',
  83614. mixins: [_emitter2.default, _form2.default],
  83615. props: {
  83616. value: {
  83617. type: [String, Number, Boolean],
  83618. default: false
  83619. },
  83620. trueValue: {
  83621. type: [String, Number, Boolean],
  83622. default: true
  83623. },
  83624. falseValue: {
  83625. type: [String, Number, Boolean],
  83626. default: false
  83627. },
  83628. disabled: {
  83629. type: Boolean,
  83630. default: false
  83631. },
  83632. size: {
  83633. validator: function validator(value) {
  83634. return (0, _assist.oneOf)(value, ['large', 'small', 'default']);
  83635. },
  83636. default: function _default() {
  83637. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  83638. }
  83639. },
  83640. name: {
  83641. type: String
  83642. },
  83643. loading: {
  83644. type: Boolean,
  83645. default: false
  83646. },
  83647. trueColor: {
  83648. type: String
  83649. },
  83650. falseColor: {
  83651. type: String
  83652. },
  83653. beforeChange: Function
  83654. },
  83655. data: function data() {
  83656. return {
  83657. currentValue: this.value
  83658. };
  83659. },
  83660. computed: {
  83661. wrapClasses: function wrapClasses() {
  83662. var _ref;
  83663. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-checked', this.currentValue === this.trueValue), (0, _defineProperty3.default)(_ref, prefixCls + '-disabled', this.itemDisabled), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref, prefixCls + '-loading', this.loading), _ref)];
  83664. },
  83665. wrapStyles: function wrapStyles() {
  83666. var style = {};
  83667. if (this.trueColor && this.currentValue === this.trueValue) {
  83668. style['border-color'] = this.trueColor;
  83669. style['background-color'] = this.trueColor;
  83670. } else if (this.falseColor && this.currentValue === this.falseValue) {
  83671. style['border-color'] = this.falseColor;
  83672. style['background-color'] = this.falseColor;
  83673. }
  83674. return style;
  83675. },
  83676. innerClasses: function innerClasses() {
  83677. return prefixCls + '-inner';
  83678. }
  83679. },
  83680. methods: {
  83681. handleToggle: function handleToggle() {
  83682. var checked = this.currentValue === this.trueValue ? this.falseValue : this.trueValue;
  83683. this.currentValue = checked;
  83684. this.$emit('input', checked);
  83685. this.$emit('on-change', checked);
  83686. this.dispatch('FormItem', 'on-form-change', checked);
  83687. },
  83688. toggle: function toggle(event) {
  83689. var _this = this;
  83690. event.preventDefault();
  83691. if (this.itemDisabled || this.loading) {
  83692. return false;
  83693. }
  83694. if (!this.beforeChange) {
  83695. return this.handleToggle();
  83696. }
  83697. var before = this.beforeChange();
  83698. if (before && before.then) {
  83699. before.then(function () {
  83700. (0, _newArrowCheck3.default)(this, _this);
  83701. this.handleToggle();
  83702. }.bind(this));
  83703. } else {
  83704. this.handleToggle();
  83705. }
  83706. }
  83707. },
  83708. watch: {
  83709. value: function value(val) {
  83710. if (val !== this.trueValue && val !== this.falseValue && val !== null) {
  83711. throw 'Value should be trueValue or falseValue.';
  83712. }
  83713. this.currentValue = val;
  83714. }
  83715. }
  83716. };
  83717. /***/ }),
  83718. /* 234 */
  83719. /***/ (function(module, exports, __webpack_require__) {
  83720. "use strict";
  83721. Object.defineProperty(exports, "__esModule", {
  83722. value: true
  83723. });
  83724. var _getIterator2 = __webpack_require__(45);
  83725. var _getIterator3 = _interopRequireDefault(_getIterator2);
  83726. var _set = __webpack_require__(552);
  83727. var _set2 = _interopRequireDefault(_set);
  83728. var _toConsumableArray2 = __webpack_require__(17);
  83729. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  83730. var _stringify = __webpack_require__(57);
  83731. var _stringify2 = _interopRequireDefault(_stringify);
  83732. var _newArrowCheck2 = __webpack_require__(1);
  83733. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  83734. var _defineProperty2 = __webpack_require__(2);
  83735. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  83736. var _tableHead = __webpack_require__(567);
  83737. var _tableHead2 = _interopRequireDefault(_tableHead);
  83738. var _tableBody = __webpack_require__(570);
  83739. var _tableBody2 = _interopRequireDefault(_tableBody);
  83740. var _summary = __webpack_require__(576);
  83741. var _summary2 = _interopRequireDefault(_summary);
  83742. var _dropdown = __webpack_require__(61);
  83743. var _dropdown2 = _interopRequireDefault(_dropdown);
  83744. var _dropdownMenu = __webpack_require__(62);
  83745. var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
  83746. var _spin = __webpack_require__(91);
  83747. var _spin2 = _interopRequireDefault(_spin);
  83748. var _assist = __webpack_require__(3);
  83749. var _dom = __webpack_require__(12);
  83750. var _csv = __webpack_require__(578);
  83751. var _csv2 = _interopRequireDefault(_csv);
  83752. var _exportCsv = __webpack_require__(579);
  83753. var _exportCsv2 = _interopRequireDefault(_exportCsv);
  83754. var _locale = __webpack_require__(6);
  83755. var _locale2 = _interopRequireDefault(_locale);
  83756. var _elementResizeDetector = __webpack_require__(94);
  83757. var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
  83758. var _util = __webpack_require__(580);
  83759. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  83760. var prefixCls = 'ivu-table';
  83761. var rowKey = 1;
  83762. var columnKey = 1;
  83763. exports.default = {
  83764. name: 'Table',
  83765. mixins: [_locale2.default],
  83766. components: { tableHead: _tableHead2.default, tableBody: _tableBody2.default, tableSummary: _summary2.default, Spin: _spin2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
  83767. provide: function provide() {
  83768. return {
  83769. tableRoot: this
  83770. };
  83771. },
  83772. props: {
  83773. data: {
  83774. type: Array,
  83775. default: function _default() {
  83776. return [];
  83777. }
  83778. },
  83779. columns: {
  83780. type: Array,
  83781. default: function _default() {
  83782. return [];
  83783. }
  83784. },
  83785. size: {
  83786. validator: function validator(value) {
  83787. return (0, _assist.oneOf)(value, ['small', 'large', 'default']);
  83788. },
  83789. default: function _default() {
  83790. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  83791. }
  83792. },
  83793. width: {
  83794. type: [Number, String]
  83795. },
  83796. height: {
  83797. type: [Number, String]
  83798. },
  83799. maxHeight: {
  83800. type: [Number, String]
  83801. },
  83802. stripe: {
  83803. type: Boolean,
  83804. default: false
  83805. },
  83806. border: {
  83807. type: Boolean,
  83808. default: false
  83809. },
  83810. showHeader: {
  83811. type: Boolean,
  83812. default: true
  83813. },
  83814. highlightRow: {
  83815. type: Boolean,
  83816. default: false
  83817. },
  83818. rowClassName: {
  83819. type: Function,
  83820. default: function _default() {
  83821. return '';
  83822. }
  83823. },
  83824. context: {
  83825. type: Object
  83826. },
  83827. noDataText: {
  83828. type: String
  83829. },
  83830. noFilteredDataText: {
  83831. type: String
  83832. },
  83833. disabledHover: {
  83834. type: Boolean
  83835. },
  83836. loading: {
  83837. type: Boolean,
  83838. default: false
  83839. },
  83840. draggable: {
  83841. type: Boolean,
  83842. default: false
  83843. },
  83844. tooltipTheme: {
  83845. validator: function validator(value) {
  83846. return (0, _assist.oneOf)(value, ['dark', 'light']);
  83847. },
  83848. default: 'dark'
  83849. },
  83850. tooltipMaxWidth: {
  83851. type: Number,
  83852. default: 300
  83853. },
  83854. rowKey: {
  83855. type: [Boolean, String],
  83856. default: false
  83857. },
  83858. spanMethod: {
  83859. type: Function
  83860. },
  83861. showSummary: {
  83862. type: Boolean,
  83863. default: false
  83864. },
  83865. summaryMethod: {
  83866. type: Function
  83867. },
  83868. sumText: {
  83869. type: String
  83870. },
  83871. indentSize: {
  83872. type: Number,
  83873. default: 16
  83874. },
  83875. loadData: {
  83876. type: Function
  83877. },
  83878. updateShowChildren: {
  83879. type: Boolean,
  83880. default: false
  83881. },
  83882. contextMenu: {
  83883. type: Boolean,
  83884. default: false
  83885. },
  83886. showContextMenu: {
  83887. type: Boolean,
  83888. default: false
  83889. },
  83890. fixedShadow: {
  83891. validator: function validator(value) {
  83892. return (0, _assist.oneOf)(value, ['auto', 'show', 'hide']);
  83893. },
  83894. default: 'show'
  83895. }
  83896. },
  83897. data: function data() {
  83898. var colsWithId = this.makeColumnsId(this.columns);
  83899. return {
  83900. ready: false,
  83901. tableWidth: 0,
  83902. columnsWidth: {},
  83903. prefixCls: prefixCls,
  83904. compiledUids: [],
  83905. objData: this.makeObjData(),
  83906. rebuildData: [],
  83907. cloneColumns: this.makeColumns(colsWithId),
  83908. columnRows: this.makeColumnRows(false, colsWithId),
  83909. leftFixedColumnRows: this.makeColumnRows('left', colsWithId),
  83910. rightFixedColumnRows: this.makeColumnRows('right', colsWithId),
  83911. allColumns: (0, _util.getAllColumns)(colsWithId),
  83912. showSlotHeader: true,
  83913. showSlotFooter: true,
  83914. bodyHeight: 0,
  83915. scrollBarWidth: (0, _assist.getScrollBarSize)(),
  83916. currentContext: this.context,
  83917. cloneData: (0, _assist.deepCopy)(this.data),
  83918. showVerticalScrollBar: false,
  83919. showHorizontalScrollBar: false,
  83920. headerWidth: 0,
  83921. headerHeight: 0,
  83922. showResizeLine: false,
  83923. contextMenuVisible: false,
  83924. contextMenuStyles: {
  83925. top: 0,
  83926. left: 0
  83927. },
  83928. scrollOnTheLeft: false,
  83929. scrollOnTheRight: false
  83930. };
  83931. },
  83932. computed: {
  83933. localeNoDataText: function localeNoDataText() {
  83934. if (this.noDataText === undefined) {
  83935. return this.t('i.table.noDataText');
  83936. } else {
  83937. return this.noDataText;
  83938. }
  83939. },
  83940. localeNoFilteredDataText: function localeNoFilteredDataText() {
  83941. if (this.noFilteredDataText === undefined) {
  83942. return this.t('i.table.noFilteredDataText');
  83943. } else {
  83944. return this.noFilteredDataText;
  83945. }
  83946. },
  83947. localeSumText: function localeSumText() {
  83948. if (this.sumText === undefined) {
  83949. return this.t('i.table.sumText');
  83950. } else {
  83951. return this.sumText;
  83952. }
  83953. },
  83954. wrapClasses: function wrapClasses() {
  83955. var _ref;
  83956. return [prefixCls + '-wrapper', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-hide', !this.ready), (0, _defineProperty3.default)(_ref, prefixCls + '-with-header', this.showSlotHeader), (0, _defineProperty3.default)(_ref, prefixCls + '-with-footer', this.showSlotFooter), (0, _defineProperty3.default)(_ref, prefixCls + '-with-summary', this.showSummary), (0, _defineProperty3.default)(_ref, prefixCls + '-wrapper-with-border', this.border), _ref)];
  83957. },
  83958. classes: function classes() {
  83959. var _ref2;
  83960. return ['' + prefixCls, (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-' + String(this.size), !!this.size), (0, _defineProperty3.default)(_ref2, prefixCls + '-border', this.border), (0, _defineProperty3.default)(_ref2, prefixCls + '-stripe', this.stripe), (0, _defineProperty3.default)(_ref2, prefixCls + '-with-fixed-top', !!this.height), _ref2)];
  83961. },
  83962. fixedTableClasses: function fixedTableClasses() {
  83963. return [prefixCls + '-fixed', (0, _defineProperty3.default)({}, prefixCls + '-fixed-shadow', this.fixedShadow === 'show' || this.fixedShadow === 'auto' && !this.scrollOnTheLeft)];
  83964. },
  83965. fixedRightTableClasses: function fixedRightTableClasses() {
  83966. return [prefixCls + '-fixed-right', (0, _defineProperty3.default)({}, prefixCls + '-fixed-shadow', this.fixedShadow === 'show' || this.fixedShadow === 'auto' && !this.scrollOnTheRight)];
  83967. },
  83968. fixedHeaderClasses: function fixedHeaderClasses() {
  83969. return [prefixCls + '-fixed-header', (0, _defineProperty3.default)({}, prefixCls + '-fixed-header-with-empty', !this.rebuildData.length)];
  83970. },
  83971. styles: function styles() {
  83972. var style = {};
  83973. var summaryHeight = 0;
  83974. if (this.showSummary) {
  83975. if (this.size === 'small') summaryHeight = 40;else if (this.size === 'large') summaryHeight = 60;else summaryHeight = 48;
  83976. }
  83977. if (this.height) {
  83978. var height = parseInt(this.height) + summaryHeight;
  83979. style.height = String(height) + 'px';
  83980. }
  83981. if (this.maxHeight) {
  83982. var maxHeight = parseInt(this.maxHeight) + summaryHeight;
  83983. style.maxHeight = String(maxHeight) + 'px';
  83984. }
  83985. if (this.width) style.width = String(this.width) + 'px';
  83986. return style;
  83987. },
  83988. tableStyle: function tableStyle() {
  83989. var style = {};
  83990. if (this.tableWidth !== 0) {
  83991. var width = '';
  83992. if (this.bodyHeight === 0) {
  83993. width = this.tableWidth;
  83994. } else {
  83995. width = this.tableWidth - (this.showVerticalScrollBar ? this.scrollBarWidth : 0);
  83996. }
  83997. style.width = String(width) + 'px';
  83998. }
  83999. return style;
  84000. },
  84001. tableHeaderStyle: function tableHeaderStyle() {
  84002. var style = {};
  84003. if (this.tableWidth !== 0) {
  84004. var width = '';
  84005. width = this.tableWidth;
  84006. style.width = String(width) + 'px';
  84007. }
  84008. return style;
  84009. },
  84010. fixedTableStyle: function fixedTableStyle() {
  84011. var _this = this;
  84012. var style = {};
  84013. var width = 0;
  84014. this.leftFixedColumns.forEach(function (col) {
  84015. (0, _newArrowCheck3.default)(this, _this);
  84016. if (col.fixed && col.fixed === 'left') width += col._width;
  84017. }.bind(this));
  84018. style.width = String(width) + 'px';
  84019. return style;
  84020. },
  84021. fixedRightTableStyle: function fixedRightTableStyle() {
  84022. var _this2 = this;
  84023. var style = {};
  84024. var width = 0;
  84025. this.rightFixedColumns.forEach(function (col) {
  84026. (0, _newArrowCheck3.default)(this, _this2);
  84027. if (col.fixed && col.fixed === 'right') width += col._width;
  84028. }.bind(this));
  84029. style.width = String(width) + 'px';
  84030. style.right = String(this.showVerticalScrollBar ? this.scrollBarWidth : 0) + 'px';
  84031. return style;
  84032. },
  84033. fixedRightHeaderStyle: function fixedRightHeaderStyle() {
  84034. var style = {};
  84035. var width = 0;
  84036. var height = this.headerHeight + 1;
  84037. if (this.showVerticalScrollBar) {
  84038. width = this.scrollBarWidth;
  84039. }
  84040. style.width = String(width) + 'px';
  84041. style.height = String(height) + 'px';
  84042. return style;
  84043. },
  84044. bodyStyle: function bodyStyle() {
  84045. var style = {};
  84046. if (this.bodyHeight !== 0) {
  84047. var height = this.bodyHeight;
  84048. if (this.height) {
  84049. style.height = String(height) + 'px';
  84050. } else if (this.maxHeight) {
  84051. style.maxHeight = String(height) + 'px';
  84052. }
  84053. }
  84054. return style;
  84055. },
  84056. fixedBodyStyle: function fixedBodyStyle() {
  84057. var style = {};
  84058. if (this.bodyHeight !== 0) {
  84059. var height = this.bodyHeight - (this.showHorizontalScrollBar ? this.scrollBarWidth : 0);
  84060. var bodyHeight = this.showHorizontalScrollBar ? height + 'px' : height - 1 + 'px';
  84061. if (this.height) style.height = bodyHeight;else if (this.maxHeight) style.maxHeight = bodyHeight;
  84062. }
  84063. return style;
  84064. },
  84065. leftFixedColumns: function leftFixedColumns() {
  84066. return (0, _util.convertColumnOrder)(this.cloneColumns, 'left');
  84067. },
  84068. rightFixedColumns: function rightFixedColumns() {
  84069. return (0, _util.convertColumnOrder)(this.cloneColumns, 'right');
  84070. },
  84071. isLeftFixed: function isLeftFixed() {
  84072. var _this3 = this;
  84073. return this.columns.some(function (col) {
  84074. (0, _newArrowCheck3.default)(this, _this3);
  84075. return col.fixed && col.fixed === 'left';
  84076. }.bind(this));
  84077. },
  84078. isRightFixed: function isRightFixed() {
  84079. var _this4 = this;
  84080. return this.columns.some(function (col) {
  84081. (0, _newArrowCheck3.default)(this, _this4);
  84082. return col.fixed && col.fixed === 'right';
  84083. }.bind(this));
  84084. },
  84085. summaryData: function summaryData() {
  84086. var _this5 = this;
  84087. if (!this.showSummary) return {};
  84088. var sums = {};
  84089. if (this.summaryMethod) {
  84090. sums = this.summaryMethod({ columns: this.cloneColumns, data: this.rebuildData });
  84091. } else {
  84092. this.cloneColumns.forEach(function (column, index) {
  84093. (0, _newArrowCheck3.default)(this, _this5);
  84094. var key = column.key;
  84095. if (index === 0) {
  84096. sums[key] = {
  84097. key: column.key,
  84098. value: this.localeSumText
  84099. };
  84100. return;
  84101. }
  84102. var values = this.rebuildData.map(function (item) {
  84103. (0, _newArrowCheck3.default)(this, _this5);
  84104. return Number(item[column.key]);
  84105. }.bind(this));
  84106. var precisions = [];
  84107. var notNumber = true;
  84108. values.forEach(function (value) {
  84109. (0, _newArrowCheck3.default)(this, _this5);
  84110. if (!isNaN(value)) {
  84111. notNumber = false;
  84112. var decimal = ('' + value).split('.')[1];
  84113. precisions.push(decimal ? decimal.length : 0);
  84114. }
  84115. }.bind(this));
  84116. var precision = Math.max.apply(null, precisions);
  84117. if (!notNumber) {
  84118. var currentValue = values.reduce(function (prev, curr) {
  84119. (0, _newArrowCheck3.default)(this, _this5);
  84120. var value = Number(curr);
  84121. if (!isNaN(value)) {
  84122. return parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  84123. } else {
  84124. return prev;
  84125. }
  84126. }.bind(this), 0);
  84127. sums[key] = {
  84128. key: column.key,
  84129. value: currentValue
  84130. };
  84131. } else {
  84132. sums[key] = {
  84133. key: column.key,
  84134. value: ''
  84135. };
  84136. }
  84137. }.bind(this));
  84138. }
  84139. return sums;
  84140. }
  84141. },
  84142. methods: {
  84143. rowClsName: function rowClsName(index) {
  84144. return this.rowClassName(this.data[index], index);
  84145. },
  84146. handleResize: function handleResize() {
  84147. var _this6 = this;
  84148. var tableWidth = this.$el.offsetWidth - 1;
  84149. var columnsWidth = {};
  84150. var sumMinWidth = 0;
  84151. var hasWidthColumns = [];
  84152. var noWidthColumns = [];
  84153. var maxWidthColumns = [];
  84154. var noMaxWidthColumns = [];
  84155. this.cloneColumns.forEach(function (col) {
  84156. (0, _newArrowCheck3.default)(this, _this6);
  84157. if (col.width) {
  84158. hasWidthColumns.push(col);
  84159. } else {
  84160. noWidthColumns.push(col);
  84161. if (col.minWidth) {
  84162. sumMinWidth += col.minWidth;
  84163. }
  84164. if (col.maxWidth) {
  84165. maxWidthColumns.push(col);
  84166. } else {
  84167. noMaxWidthColumns.push(col);
  84168. }
  84169. }
  84170. col._width = null;
  84171. }.bind(this));
  84172. var unUsableWidth = hasWidthColumns.map(function (cell) {
  84173. (0, _newArrowCheck3.default)(this, _this6);
  84174. return cell.width;
  84175. }.bind(this)).reduce(function (a, b) {
  84176. (0, _newArrowCheck3.default)(this, _this6);
  84177. return a + b;
  84178. }.bind(this), 0);
  84179. var usableWidth = tableWidth - unUsableWidth - sumMinWidth - (this.showVerticalScrollBar ? this.scrollBarWidth : 0) - 1;
  84180. var usableLength = noWidthColumns.length;
  84181. var columnWidth = 0;
  84182. if (usableWidth > 0 && usableLength > 0) {
  84183. columnWidth = parseInt(usableWidth / usableLength);
  84184. }
  84185. for (var i = 0; i < this.cloneColumns.length; i++) {
  84186. var column = this.cloneColumns[i];
  84187. var width = columnWidth + (column.minWidth ? column.minWidth : 0);
  84188. if (column.width) {
  84189. width = column.width;
  84190. } else {
  84191. if (column._width) {
  84192. width = column._width;
  84193. } else {
  84194. if (column.minWidth > width) {
  84195. width = column.minWidth;
  84196. } else if (column.maxWidth < width) {
  84197. width = column.maxWidth;
  84198. }
  84199. if (usableWidth > 0) {
  84200. usableWidth -= width - (column.minWidth ? column.minWidth : 0);
  84201. usableLength--;
  84202. if (usableLength > 0) {
  84203. columnWidth = parseInt(usableWidth / usableLength);
  84204. } else {
  84205. columnWidth = 0;
  84206. }
  84207. } else {
  84208. columnWidth = 0;
  84209. }
  84210. }
  84211. }
  84212. column._width = width;
  84213. columnsWidth[column._index] = {
  84214. width: width
  84215. };
  84216. }
  84217. if (usableWidth > 0) {
  84218. usableLength = noMaxWidthColumns.length;
  84219. columnWidth = parseInt(usableWidth / usableLength);
  84220. for (var _i = 0; _i < noMaxWidthColumns.length; _i++) {
  84221. var _column = noMaxWidthColumns[_i];
  84222. var _width = _column._width + columnWidth;
  84223. if (usableLength > 1) {
  84224. usableLength--;
  84225. usableWidth -= columnWidth;
  84226. columnWidth = parseInt(usableWidth / usableLength);
  84227. } else {
  84228. columnWidth = 0;
  84229. }
  84230. _column._width = _width;
  84231. columnsWidth[_column._index] = {
  84232. width: _width
  84233. };
  84234. }
  84235. }
  84236. this.tableWidth = this.cloneColumns.map(function (cell) {
  84237. (0, _newArrowCheck3.default)(this, _this6);
  84238. return cell._width;
  84239. }.bind(this)).reduce(function (a, b) {
  84240. (0, _newArrowCheck3.default)(this, _this6);
  84241. return a + b;
  84242. }.bind(this), 0) + (this.showVerticalScrollBar ? this.scrollBarWidth : 0) + 1;
  84243. this.columnsWidth = columnsWidth;
  84244. this.fixedHeader();
  84245. if (this.fixedShadow === 'auto') {
  84246. this.$nextTick(function () {
  84247. (0, _newArrowCheck3.default)(this, _this6);
  84248. var $body = this.$refs.body;
  84249. this.scrollOnTheLeft = $body.scrollLeft === 0;
  84250. this.scrollOnTheRight = $body.scrollWidth === $body.scrollLeft + $body.clientWidth;
  84251. }.bind(this));
  84252. }
  84253. },
  84254. handleMouseIn: function handleMouseIn(_index, rowKey) {
  84255. if (this.disabledHover) return;
  84256. var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
  84257. if (objData._isHover) return;
  84258. objData._isHover = true;
  84259. },
  84260. handleMouseOut: function handleMouseOut(_index, rowKey) {
  84261. if (this.disabledHover) return;
  84262. var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
  84263. objData._isHover = false;
  84264. },
  84265. handleCurrentRow: function handleCurrentRow(type, _index, rowKey) {
  84266. var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
  84267. var oldData = null;
  84268. var oldIndex = -1;
  84269. for (var i in this.objData) {
  84270. if (this.objData[i]._isHighlight) {
  84271. oldIndex = parseInt(i);
  84272. this.objData[i]._isHighlight = false;
  84273. break;
  84274. } else if (this.objData[i].children && this.objData[i].children.length) {
  84275. var resetData = this.handleResetChildrenRow(this.objData[i]);
  84276. if (resetData) oldData = JSON.parse((0, _stringify2.default)(resetData));
  84277. }
  84278. }
  84279. if (type === 'highlight') objData._isHighlight = true;
  84280. if (oldIndex >= 0) {
  84281. oldData = JSON.parse((0, _stringify2.default)(this.cloneData[oldIndex]));
  84282. }
  84283. var newData = type === 'highlight' ? rowKey ? JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))) : JSON.parse((0, _stringify2.default)(this.cloneData[_index])) : null;
  84284. this.$emit('on-current-change', newData, oldData);
  84285. },
  84286. handleResetChildrenRow: function handleResetChildrenRow(objData) {
  84287. var data = null;
  84288. if (objData.children && objData.children.length) {
  84289. for (var i = 0; i < objData.children.length; i++) {
  84290. var item = objData.children[i];
  84291. if (item._isHighlight) {
  84292. item._isHighlight = false;
  84293. data = item;
  84294. break;
  84295. } else if (item.children && item.children.length) {
  84296. data = this.handleResetChildrenRow(item);
  84297. }
  84298. }
  84299. }
  84300. return data;
  84301. },
  84302. highlightCurrentRow: function highlightCurrentRow(_index, rowKey) {
  84303. var objData = rowKey ? this.getDataByRowKey(rowKey) : this.objData[_index];
  84304. if (!this.highlightRow || objData._isHighlight) return;
  84305. this.handleCurrentRow('highlight', _index, rowKey);
  84306. },
  84307. clearCurrentRow: function clearCurrentRow() {
  84308. if (!this.highlightRow) return;
  84309. this.handleCurrentRow('clear');
  84310. },
  84311. clickCurrentRow: function clickCurrentRow(_index, rowKey) {
  84312. this.highlightCurrentRow(_index, rowKey);
  84313. if (rowKey) {
  84314. this.$emit('on-row-click', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))));
  84315. } else {
  84316. this.$emit('on-row-click', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), _index);
  84317. }
  84318. },
  84319. dblclickCurrentRow: function dblclickCurrentRow(_index, rowKey) {
  84320. this.highlightCurrentRow(_index, rowKey);
  84321. if (rowKey) {
  84322. this.$emit('on-row-dblclick', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))));
  84323. } else {
  84324. this.$emit('on-row-dblclick', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), _index);
  84325. }
  84326. },
  84327. contextmenuCurrentRow: function contextmenuCurrentRow(_index, rowKey, event) {
  84328. var _this7 = this;
  84329. if (this.contextMenuVisible) this.handleClickContextMenuOutside();
  84330. this.$nextTick(function () {
  84331. (0, _newArrowCheck3.default)(this, _this7);
  84332. var $TableWrap = this.$refs.tableWrap;
  84333. var TableBounding = $TableWrap.getBoundingClientRect();
  84334. var position = {
  84335. left: event.clientX - TableBounding.left + 'px',
  84336. top: event.clientY - TableBounding.top + 'px'
  84337. };
  84338. this.contextMenuStyles = position;
  84339. this.contextMenuVisible = true;
  84340. if (rowKey) {
  84341. this.$emit('on-contextmenu', JSON.parse((0, _stringify2.default)(this.getBaseDataByRowKey(rowKey))), event, position);
  84342. } else {
  84343. this.$emit('on-contextmenu', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), event, position);
  84344. }
  84345. }.bind(this));
  84346. },
  84347. getSelection: function getSelection() {
  84348. var _this8 = this;
  84349. var selectionIndexes = [];
  84350. var selectionRowKeys = [];
  84351. for (var i in this.objData) {
  84352. var objData = this.objData[i];
  84353. if (objData._isChecked) selectionIndexes.push(parseInt(i));
  84354. if (objData.children && objData.children.length) {
  84355. selectionRowKeys = selectionRowKeys.concat(this.getSelectionChildrenRowKeys(objData, selectionRowKeys));
  84356. }
  84357. }
  84358. selectionRowKeys = [].concat((0, _toConsumableArray3.default)(new _set2.default(selectionRowKeys)));
  84359. var selection = [];
  84360. this.data.forEach(function (item, index) {
  84361. (0, _newArrowCheck3.default)(this, _this8);
  84362. if (selectionIndexes.indexOf(index) > -1) {
  84363. selection = selection.concat(item);
  84364. }
  84365. if (item.children && item.children.length && selectionRowKeys.length) {
  84366. selection = selection.concat(this.getSelectionChildren(item, selection, selectionRowKeys));
  84367. }
  84368. }.bind(this));
  84369. selection = [].concat((0, _toConsumableArray3.default)(new _set2.default(selection)));
  84370. return JSON.parse((0, _stringify2.default)(selection));
  84371. },
  84372. getSelectionChildrenRowKeys: function getSelectionChildrenRowKeys(objData, selectionRowKeys) {
  84373. var _this9 = this;
  84374. if (objData.children && objData.children.length) {
  84375. objData.children.forEach(function (item) {
  84376. (0, _newArrowCheck3.default)(this, _this9);
  84377. if (item._isChecked) selectionRowKeys.push(item._rowKey);
  84378. if (item.children && item.children.length) {
  84379. selectionRowKeys = selectionRowKeys.concat(this.getSelectionChildrenRowKeys(item, selectionRowKeys));
  84380. }
  84381. }.bind(this));
  84382. }
  84383. return selectionRowKeys;
  84384. },
  84385. getSelectionChildren: function getSelectionChildren(data, selection, selectionRowKeys) {
  84386. var _this10 = this;
  84387. if (data.children && data.children.length) {
  84388. data.children.forEach(function (item) {
  84389. (0, _newArrowCheck3.default)(this, _this10);
  84390. if (selectionRowKeys.indexOf(item[this.rowKey]) > -1) {
  84391. selection = selection.concat(item);
  84392. }
  84393. if (item.children && item.children.length) {
  84394. selection = selection.concat(this.getSelectionChildren(item, selection, selectionRowKeys));
  84395. }
  84396. }.bind(this));
  84397. }
  84398. return selection;
  84399. },
  84400. toggleSelect: function toggleSelect(_index, rowKey) {
  84401. var data = {};
  84402. if (rowKey) {
  84403. data = this.getDataByRowKey(rowKey);
  84404. } else {
  84405. for (var i in this.objData) {
  84406. if (parseInt(i) === _index) {
  84407. data = this.objData[i];
  84408. break;
  84409. }
  84410. }
  84411. }
  84412. var status = !data._isChecked;
  84413. data._isChecked = status;
  84414. var selection = this.getSelection();
  84415. var selectedData = rowKey ? this.getBaseDataByRowKey(rowKey, this.data) : this.data[_index];
  84416. this.$emit(status ? 'on-select' : 'on-select-cancel', selection, JSON.parse((0, _stringify2.default)(selectedData)));
  84417. this.$emit('on-selection-change', selection);
  84418. },
  84419. toggleExpand: function toggleExpand(_index) {
  84420. var _this11 = this;
  84421. var data = {};
  84422. for (var i in this.objData) {
  84423. if (parseInt(i) === _index) {
  84424. data = this.objData[i];
  84425. break;
  84426. }
  84427. }
  84428. var status = !data._isExpanded;
  84429. this.objData[_index]._isExpanded = status;
  84430. this.$emit('on-expand', JSON.parse((0, _stringify2.default)(this.cloneData[_index])), status);
  84431. if (this.height || this.maxHeight) {
  84432. this.$nextTick(function () {
  84433. (0, _newArrowCheck3.default)(this, _this11);
  84434. return this.fixedBody();
  84435. }.bind(this));
  84436. }
  84437. },
  84438. toggleTree: function toggleTree(rowKey) {
  84439. var _this12 = this;
  84440. var data = this.getDataByRowKey(rowKey);
  84441. if ('_loading' in data && data._loading) return;
  84442. if ('_loading' in data && !data._loading && data.children.length === 0) {
  84443. var sourceData = this.getBaseDataByRowKey(rowKey, this.data);
  84444. this.$set(sourceData, '_loading', true);
  84445. this.loadData(sourceData, function (children) {
  84446. (0, _newArrowCheck3.default)(this, _this12);
  84447. this.$set(sourceData, '_loading', false);
  84448. if (children.length) {
  84449. this.$set(sourceData, 'children', children);
  84450. this.$nextTick(function () {
  84451. (0, _newArrowCheck3.default)(this, _this12);
  84452. var newData = this.getDataByRowKey(rowKey);
  84453. newData._isShowChildren = !newData._isShowChildren;
  84454. this.updateDataStatus(rowKey, '_showChildren', newData._isShowChildren);
  84455. }.bind(this));
  84456. }
  84457. }.bind(this));
  84458. return;
  84459. }
  84460. data._isShowChildren = !data._isShowChildren;
  84461. if (this.updateShowChildren) this.updateDataStatus(rowKey, '_showChildren', data._isShowChildren);
  84462. this.$emit('on-expand-tree', rowKey, data._isShowChildren);
  84463. },
  84464. updateDataStatus: function updateDataStatus(rowKey, key, value) {
  84465. var data = this.getBaseDataByRowKey(rowKey, this.data);
  84466. this.$set(data, key, value);
  84467. },
  84468. getDataByRowKey: function getDataByRowKey(rowKey) {
  84469. var objData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.objData;
  84470. var data = null;
  84471. for (var i in objData) {
  84472. var thisData = objData[i];
  84473. if (thisData._rowKey === rowKey) {
  84474. data = thisData;
  84475. break;
  84476. } else if (thisData.children && thisData.children.length) {
  84477. data = this.getChildrenByRowKey(rowKey, thisData);
  84478. if (data) {
  84479. break;
  84480. }
  84481. }
  84482. }
  84483. return data;
  84484. },
  84485. getChildrenByRowKey: function getChildrenByRowKey(rowKey, objData) {
  84486. var data = null;
  84487. if (objData.children && objData.children.length) {
  84488. for (var i = 0; i < objData.children.length; i++) {
  84489. var item = objData.children[i];
  84490. if (item._rowKey === rowKey) {
  84491. data = item;
  84492. break;
  84493. } else if (item.children && item.children.length) {
  84494. data = this.getChildrenByRowKey(rowKey, item);
  84495. if (data) {
  84496. break;
  84497. }
  84498. }
  84499. }
  84500. }
  84501. return data;
  84502. },
  84503. getBaseDataByRowKey: function getBaseDataByRowKey(rowKey) {
  84504. var sourceData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.cloneData;
  84505. var data = null;
  84506. for (var i = 0; i < sourceData.length; i++) {
  84507. var thisData = sourceData[i];
  84508. if (thisData[this.rowKey] === rowKey) {
  84509. data = thisData;
  84510. break;
  84511. } else if (thisData.children && thisData.children.length) {
  84512. data = this.getChildrenDataByRowKey(rowKey, thisData);
  84513. if (data && data[this.rowKey] === rowKey) return data;
  84514. }
  84515. }
  84516. return data;
  84517. },
  84518. getChildrenDataByRowKey: function getChildrenDataByRowKey(rowKey, cloneData) {
  84519. var data = null;
  84520. if (cloneData.children && cloneData.children.length) {
  84521. for (var i = 0; i < cloneData.children.length; i++) {
  84522. var item = cloneData.children[i];
  84523. if (item[this.rowKey] === rowKey) {
  84524. data = item;
  84525. break;
  84526. } else if (item.children && item.children.length) {
  84527. data = this.getChildrenDataByRowKey(rowKey, item);
  84528. if (data) {
  84529. break;
  84530. }
  84531. }
  84532. }
  84533. }
  84534. return data;
  84535. },
  84536. selectAll: function selectAll(status) {
  84537. var _iteratorNormalCompletion = true;
  84538. var _didIteratorError = false;
  84539. var _iteratorError = undefined;
  84540. try {
  84541. for (var _iterator = (0, _getIterator3.default)(this.rebuildData), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  84542. var data = _step.value;
  84543. var objData = this.objData[data._index];
  84544. if (!objData._isDisabled) {
  84545. objData._isChecked = status;
  84546. }
  84547. if (data.children && data.children.length) {
  84548. this.selectAllChildren(objData, status);
  84549. }
  84550. }
  84551. } catch (err) {
  84552. _didIteratorError = true;
  84553. _iteratorError = err;
  84554. } finally {
  84555. try {
  84556. if (!_iteratorNormalCompletion && _iterator.return) {
  84557. _iterator.return();
  84558. }
  84559. } finally {
  84560. if (_didIteratorError) {
  84561. throw _iteratorError;
  84562. }
  84563. }
  84564. }
  84565. var selection = this.getSelection();
  84566. if (status) {
  84567. this.$emit('on-select-all', selection);
  84568. } else {
  84569. this.$emit('on-select-all-cancel', selection);
  84570. }
  84571. this.$emit('on-selection-change', selection);
  84572. },
  84573. selectAllChildren: function selectAllChildren(data, status) {
  84574. var _this13 = this;
  84575. if (data.children && data.children.length) {
  84576. data.children.map(function (item) {
  84577. (0, _newArrowCheck3.default)(this, _this13);
  84578. if (!item._isDisabled) {
  84579. item._isChecked = status;
  84580. }
  84581. if (item.children && item.children.length) {
  84582. this.selectAllChildren(item, status);
  84583. }
  84584. }.bind(this));
  84585. }
  84586. },
  84587. fixedHeader: function fixedHeader() {
  84588. var _this14 = this;
  84589. if (this.height || this.maxHeight) {
  84590. this.$nextTick(function () {
  84591. (0, _newArrowCheck3.default)(this, _this14);
  84592. var titleHeight = parseInt((0, _assist.getStyle)(this.$refs.title, 'height')) || 0;
  84593. var headerHeight = parseInt((0, _assist.getStyle)(this.$refs.header, 'height')) || 0;
  84594. var footerHeight = parseInt((0, _assist.getStyle)(this.$refs.footer, 'height')) || 0;
  84595. if (this.height) {
  84596. this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight;
  84597. } else if (this.maxHeight) {
  84598. this.bodyHeight = this.maxHeight - titleHeight - headerHeight - footerHeight;
  84599. }
  84600. this.$nextTick(function () {
  84601. (0, _newArrowCheck3.default)(this, _this14);
  84602. return this.fixedBody();
  84603. }.bind(this));
  84604. }.bind(this));
  84605. } else {
  84606. this.bodyHeight = 0;
  84607. this.$nextTick(function () {
  84608. (0, _newArrowCheck3.default)(this, _this14);
  84609. return this.fixedBody();
  84610. }.bind(this));
  84611. }
  84612. },
  84613. fixedBody: function fixedBody() {
  84614. if (this.$refs.header) {
  84615. this.headerWidth = this.$refs.header.children[0].offsetWidth;
  84616. this.headerHeight = this.$refs.header.children[0].offsetHeight;
  84617. }
  84618. if (!this.$refs.tbody || !this.data || this.data.length === 0) {
  84619. this.showVerticalScrollBar = false;
  84620. } else {
  84621. var bodyContentEl = this.$refs.tbody.$el;
  84622. var bodyEl = bodyContentEl.parentElement;
  84623. var bodyContentHeight = bodyContentEl.offsetHeight;
  84624. var bodyHeight = bodyEl.offsetHeight;
  84625. this.showHorizontalScrollBar = bodyEl.offsetWidth < bodyContentEl.offsetWidth + (this.showVerticalScrollBar ? this.scrollBarWidth : 0);
  84626. this.showVerticalScrollBar = this.bodyHeight ? bodyHeight - (this.showHorizontalScrollBar ? this.scrollBarWidth : 0) < bodyContentHeight : false;
  84627. if (this.showVerticalScrollBar) {
  84628. bodyEl.classList.add(this.prefixCls + '-overflowY');
  84629. } else {
  84630. bodyEl.classList.remove(this.prefixCls + '-overflowY');
  84631. }
  84632. if (this.showHorizontalScrollBar) {
  84633. bodyEl.classList.add(this.prefixCls + '-overflowX');
  84634. } else {
  84635. bodyEl.classList.remove(this.prefixCls + '-overflowX');
  84636. }
  84637. }
  84638. },
  84639. hideColumnFilter: function hideColumnFilter() {
  84640. var _this15 = this;
  84641. this.cloneColumns.forEach(function (col) {
  84642. (0, _newArrowCheck3.default)(this, _this15);
  84643. return col._filterVisible = false;
  84644. }.bind(this));
  84645. },
  84646. handleBodyScroll: function handleBodyScroll(event) {
  84647. this.scrollOnTheLeft = event.target.scrollLeft === 0;
  84648. this.scrollOnTheRight = event.target.scrollWidth === event.target.scrollLeft + event.target.clientWidth;
  84649. if (this.showHeader) this.$refs.header.scrollLeft = event.target.scrollLeft;
  84650. if (this.isLeftFixed) this.$refs.fixedBody.scrollTop = event.target.scrollTop;
  84651. if (this.isRightFixed) this.$refs.fixedRightBody.scrollTop = event.target.scrollTop;
  84652. if (this.showSummary && this.$refs.summary) this.$refs.summary.$el.scrollLeft = event.target.scrollLeft;
  84653. this.hideColumnFilter();
  84654. },
  84655. handleFixedMousewheel: function handleFixedMousewheel(event) {
  84656. var _this16 = this;
  84657. var deltaY = event.deltaY;
  84658. if (!deltaY && event.detail) {
  84659. deltaY = event.detail * 40;
  84660. }
  84661. if (!deltaY && event.wheelDeltaY) {
  84662. deltaY = -event.wheelDeltaY;
  84663. }
  84664. if (!deltaY && event.wheelDelta) {
  84665. deltaY = -event.wheelDelta;
  84666. }
  84667. if (!deltaY) return;
  84668. var body = this.$refs.body;
  84669. var currentScrollTop = body.scrollTop;
  84670. if (deltaY < 0 && currentScrollTop !== 0) {
  84671. event.preventDefault();
  84672. }
  84673. if (deltaY > 0 && body.scrollHeight - body.clientHeight > currentScrollTop) {
  84674. event.preventDefault();
  84675. }
  84676. var step = 0;
  84677. var timeId = setInterval(function () {
  84678. (0, _newArrowCheck3.default)(this, _this16);
  84679. step += 5;
  84680. if (deltaY > 0) {
  84681. body.scrollTop += 2;
  84682. } else {
  84683. body.scrollTop -= 2;
  84684. }
  84685. if (step >= Math.abs(deltaY)) {
  84686. clearInterval(timeId);
  84687. }
  84688. }.bind(this), 5);
  84689. },
  84690. handleMouseWheel: function handleMouseWheel(event) {
  84691. var deltaX = event.deltaX;
  84692. var $body = this.$refs.body;
  84693. if (deltaX > 0) {
  84694. $body.scrollLeft = $body.scrollLeft + 10;
  84695. } else {
  84696. $body.scrollLeft = $body.scrollLeft - 10;
  84697. }
  84698. },
  84699. sortData: function sortData(data, type, index) {
  84700. var _this17 = this;
  84701. var key = this.cloneColumns[index].key;
  84702. data.sort(function (a, b) {
  84703. (0, _newArrowCheck3.default)(this, _this17);
  84704. if (this.cloneColumns[index].sortMethod) {
  84705. return this.cloneColumns[index].sortMethod(a[key], b[key], type);
  84706. } else {
  84707. if (type === 'asc') {
  84708. return a[key] > b[key] ? 1 : -1;
  84709. } else if (type === 'desc') {
  84710. return a[key] < b[key] ? 1 : -1;
  84711. }
  84712. }
  84713. }.bind(this));
  84714. for (var i = 0; i < data.length; i++) {
  84715. if (data[i].children && data[i].children.length) {
  84716. data[i].children = this.sortData(data[i].children, type, index);
  84717. }
  84718. }
  84719. return data;
  84720. },
  84721. handleSort: function handleSort(_index, type) {
  84722. var _this18 = this;
  84723. var index = this.GetOriginalIndex(_index);
  84724. this.cloneColumns.forEach(function (col) {
  84725. (0, _newArrowCheck3.default)(this, _this18);
  84726. return col._sortType = 'normal';
  84727. }.bind(this));
  84728. var key = this.cloneColumns[index].key;
  84729. if (this.cloneColumns[index].sortable !== 'custom') {
  84730. if (type === 'normal') {
  84731. this.rebuildData = this.makeDataWithFilter();
  84732. } else {
  84733. this.rebuildData = this.sortData(this.rebuildData, type, index);
  84734. }
  84735. }
  84736. this.cloneColumns[index]._sortType = type;
  84737. this.$emit('on-sort-change', {
  84738. column: JSON.parse((0, _stringify2.default)(this.allColumns[this.cloneColumns[index]._index])),
  84739. key: key,
  84740. order: type
  84741. });
  84742. },
  84743. handleFilterHide: function handleFilterHide(index) {
  84744. if (!this.cloneColumns[index]._isFiltered) this.cloneColumns[index]._filterChecked = [];
  84745. },
  84746. filterData: function filterData(data, column) {
  84747. var _this19 = this;
  84748. return data.filter(function (row) {
  84749. (0, _newArrowCheck3.default)(this, _this19);
  84750. if (typeof column.filterRemote === 'function') return true;
  84751. var status = !column._filterChecked.length;
  84752. for (var i = 0; i < column._filterChecked.length; i++) {
  84753. status = column.filterMethod(column._filterChecked[i], row);
  84754. if (status) break;
  84755. }
  84756. return status;
  84757. }.bind(this));
  84758. },
  84759. filterOtherData: function filterOtherData(data, index) {
  84760. var _this20 = this;
  84761. var column = this.cloneColumns[index];
  84762. if (typeof column.filterRemote === 'function') {
  84763. column.filterRemote.call(this.$parent, column._filterChecked, column.key, column);
  84764. }
  84765. this.cloneColumns.forEach(function (col, colIndex) {
  84766. (0, _newArrowCheck3.default)(this, _this20);
  84767. if (colIndex !== index) {
  84768. data = this.filterData(data, col);
  84769. }
  84770. }.bind(this));
  84771. return data;
  84772. },
  84773. handleFilter: function handleFilter(index) {
  84774. var column = this.cloneColumns[index];
  84775. var filterData = this.makeDataWithSort();
  84776. filterData = this.filterOtherData(filterData, index);
  84777. this.rebuildData = this.filterData(filterData, column);
  84778. this.cloneColumns[index]._isFiltered = true;
  84779. this.cloneColumns[index]._filterVisible = false;
  84780. this.$emit('on-filter-change', column);
  84781. },
  84782. GetOriginalIndex: function GetOriginalIndex(_index) {
  84783. var _this21 = this;
  84784. return this.cloneColumns.findIndex(function (item) {
  84785. (0, _newArrowCheck3.default)(this, _this21);
  84786. return item._index === _index;
  84787. }.bind(this));
  84788. },
  84789. handleFilterSelect: function handleFilterSelect(_index, value) {
  84790. var index = this.GetOriginalIndex(_index);
  84791. this.cloneColumns[index]._filterChecked = [value];
  84792. this.handleFilter(index);
  84793. },
  84794. handleFilterReset: function handleFilterReset(_index) {
  84795. var index = this.GetOriginalIndex(_index);
  84796. this.cloneColumns[index]._isFiltered = false;
  84797. this.cloneColumns[index]._filterVisible = false;
  84798. this.cloneColumns[index]._filterChecked = [];
  84799. var filterData = this.makeDataWithSort();
  84800. filterData = this.filterOtherData(filterData, index);
  84801. this.rebuildData = filterData;
  84802. this.$emit('on-filter-change', this.cloneColumns[index]);
  84803. },
  84804. makeData: function makeData() {
  84805. var _this22 = this;
  84806. var data = (0, _assist.deepCopy)(this.data);
  84807. data.forEach(function (row, index) {
  84808. (0, _newArrowCheck3.default)(this, _this22);
  84809. row._index = index;
  84810. row._rowKey = typeof this.rowKey === 'string' ? row[this.rowKey] : rowKey++;
  84811. if (row.children && row.children.length) {
  84812. row.children = this.makeChildrenData(row);
  84813. }
  84814. }.bind(this));
  84815. return data;
  84816. },
  84817. makeChildrenData: function makeChildrenData(data) {
  84818. var _this23 = this;
  84819. if (data.children && data.children.length) {
  84820. return data.children.map(function (row, index) {
  84821. (0, _newArrowCheck3.default)(this, _this23);
  84822. var newRow = (0, _assist.deepCopy)(row);
  84823. newRow._index = index;
  84824. newRow._rowKey = typeof this.rowKey === 'string' ? newRow[this.rowKey] : rowKey++;
  84825. if (newRow.children && newRow.children.length) {
  84826. newRow.children = this.makeChildrenData(newRow);
  84827. }
  84828. return newRow;
  84829. }.bind(this));
  84830. } else {
  84831. return data;
  84832. }
  84833. },
  84834. makeDataWithSort: function makeDataWithSort() {
  84835. var data = this.makeData();
  84836. var sortType = 'normal';
  84837. var sortIndex = -1;
  84838. var isCustom = false;
  84839. for (var i = 0; i < this.cloneColumns.length; i++) {
  84840. if (this.cloneColumns[i]._sortType !== 'normal') {
  84841. sortType = this.cloneColumns[i]._sortType;
  84842. sortIndex = i;
  84843. isCustom = this.cloneColumns[i].sortable === 'custom';
  84844. break;
  84845. }
  84846. }
  84847. if (sortType !== 'normal' && !isCustom) data = this.sortData(data, sortType, sortIndex);
  84848. return data;
  84849. },
  84850. makeDataWithFilter: function makeDataWithFilter() {
  84851. var _this24 = this;
  84852. var data = this.makeData();
  84853. this.cloneColumns.forEach(function (col) {
  84854. (0, _newArrowCheck3.default)(this, _this24);
  84855. return data = this.filterData(data, col);
  84856. }.bind(this));
  84857. return data;
  84858. },
  84859. makeDataWithSortAndFilter: function makeDataWithSortAndFilter() {
  84860. var _this25 = this;
  84861. var data = this.makeDataWithSort();
  84862. this.cloneColumns.forEach(function (col) {
  84863. (0, _newArrowCheck3.default)(this, _this25);
  84864. return data = this.filterData(data, col);
  84865. }.bind(this));
  84866. return data;
  84867. },
  84868. makeObjBaseData: function makeObjBaseData(row) {
  84869. var newRow = (0, _assist.deepCopy)(row);
  84870. if (typeof this.rowKey === 'string') {
  84871. newRow._rowKey = newRow[this.rowKey];
  84872. }
  84873. newRow._isHover = false;
  84874. if (newRow._disabled) {
  84875. newRow._isDisabled = newRow._disabled;
  84876. } else {
  84877. newRow._isDisabled = false;
  84878. }
  84879. if (newRow._checked) {
  84880. newRow._isChecked = newRow._checked;
  84881. } else {
  84882. newRow._isChecked = false;
  84883. }
  84884. if (newRow._expanded) {
  84885. newRow._isExpanded = newRow._expanded;
  84886. } else {
  84887. newRow._isExpanded = false;
  84888. }
  84889. if (newRow._highlight) {
  84890. newRow._isHighlight = newRow._highlight;
  84891. } else {
  84892. newRow._isHighlight = false;
  84893. }
  84894. return newRow;
  84895. },
  84896. makeObjData: function makeObjData() {
  84897. var _this26 = this;
  84898. var data = {};
  84899. this.data.forEach(function (row, index) {
  84900. (0, _newArrowCheck3.default)(this, _this26);
  84901. var newRow = this.makeObjBaseData(row);
  84902. if (newRow.children && newRow.children.length) {
  84903. if (newRow._showChildren) {
  84904. newRow._isShowChildren = newRow._showChildren;
  84905. } else {
  84906. newRow._isShowChildren = false;
  84907. }
  84908. newRow.children = this.makeChildrenObjData(newRow);
  84909. }
  84910. data[index] = newRow;
  84911. }.bind(this));
  84912. return data;
  84913. },
  84914. makeChildrenObjData: function makeChildrenObjData(data) {
  84915. var _this27 = this;
  84916. if (data.children && data.children.length) {
  84917. return data.children.map(function (row) {
  84918. (0, _newArrowCheck3.default)(this, _this27);
  84919. var newRow = this.makeObjBaseData(row);
  84920. if (newRow._showChildren) {
  84921. newRow._isShowChildren = newRow._showChildren;
  84922. } else {
  84923. newRow._isShowChildren = false;
  84924. }
  84925. if (newRow.children && newRow.children.length) {
  84926. newRow.children = this.makeChildrenObjData(newRow);
  84927. }
  84928. return newRow;
  84929. }.bind(this));
  84930. } else {
  84931. return data;
  84932. }
  84933. },
  84934. makeColumnsId: function makeColumnsId(columns) {
  84935. var _this28 = this;
  84936. return columns.map(function (item) {
  84937. (0, _newArrowCheck3.default)(this, _this28);
  84938. if ('children' in item) this.makeColumnsId(item.children);
  84939. item.__id = (0, _util.getRandomStr)(6);
  84940. return item;
  84941. }.bind(this));
  84942. },
  84943. makeColumns: function makeColumns(cols) {
  84944. var _this29 = this;
  84945. var columns = (0, _assist.deepCopy)((0, _util.getAllColumns)(cols));
  84946. var left = [];
  84947. var right = [];
  84948. var center = [];
  84949. columns.forEach(function (column, index) {
  84950. (0, _newArrowCheck3.default)(this, _this29);
  84951. column._index = index;
  84952. column._columnKey = columnKey++;
  84953. column.width = parseInt(column.width);
  84954. column._width = column.width ? column.width : '';
  84955. column._sortType = 'normal';
  84956. column._filterVisible = false;
  84957. column._isFiltered = false;
  84958. column._filterChecked = [];
  84959. if ('filterMultiple' in column) {
  84960. column._filterMultiple = column.filterMultiple;
  84961. } else {
  84962. column._filterMultiple = true;
  84963. }
  84964. if ('filteredValue' in column) {
  84965. column._filterChecked = column.filteredValue;
  84966. column._isFiltered = true;
  84967. }
  84968. if ('sortType' in column) {
  84969. column._sortType = column.sortType;
  84970. }
  84971. if (column.fixed && column.fixed === 'left') {
  84972. left.push(column);
  84973. } else if (column.fixed && column.fixed === 'right') {
  84974. right.push(column);
  84975. } else {
  84976. center.push(column);
  84977. }
  84978. }.bind(this));
  84979. return left.concat(center).concat(right);
  84980. },
  84981. makeColumnRows: function makeColumnRows(fixedType, cols) {
  84982. return (0, _util.convertToRows)(cols, fixedType);
  84983. },
  84984. exportCsv: function exportCsv(params) {
  84985. if (params.filename) {
  84986. if (params.filename.indexOf('.csv') === -1) {
  84987. params.filename += '.csv';
  84988. }
  84989. } else {
  84990. params.filename = 'table.csv';
  84991. }
  84992. var columns = [];
  84993. var datas = [];
  84994. if (params.columns && params.data) {
  84995. columns = params.columns;
  84996. datas = params.data;
  84997. } else {
  84998. columns = this.allColumns;
  84999. if (!('original' in params)) params.original = true;
  85000. datas = params.original ? this.data : this.rebuildData;
  85001. }
  85002. var noHeader = false;
  85003. if ('noHeader' in params) noHeader = params.noHeader;
  85004. var data = (0, _csv2.default)(columns, datas, params, noHeader);
  85005. if (params.callback) params.callback(data);else _exportCsv2.default.download(params.filename, data);
  85006. },
  85007. dragAndDrop: function dragAndDrop(a, b) {
  85008. this.$emit('on-drag-drop', a, b);
  85009. },
  85010. handleClickContextMenuOutside: function handleClickContextMenuOutside() {
  85011. this.contextMenuVisible = false;
  85012. }
  85013. },
  85014. created: function created() {
  85015. if (!this.context) this.currentContext = this.$parent;
  85016. this.showSlotHeader = this.$slots.header !== undefined;
  85017. this.showSlotFooter = this.$slots.footer !== undefined;
  85018. this.rebuildData = this.makeDataWithSortAndFilter();
  85019. },
  85020. mounted: function mounted() {
  85021. var _this30 = this;
  85022. this.handleResize();
  85023. this.$nextTick(function () {
  85024. (0, _newArrowCheck3.default)(this, _this30);
  85025. return this.ready = true;
  85026. }.bind(this));
  85027. (0, _dom.on)(window, 'resize', this.handleResize);
  85028. this.observer = (0, _elementResizeDetector2.default)();
  85029. this.observer.listenTo(this.$el, this.handleResize);
  85030. this.$on('on-visible-change', function (val) {
  85031. (0, _newArrowCheck3.default)(this, _this30);
  85032. if (val) {
  85033. this.$nextTick(function () {
  85034. (0, _newArrowCheck3.default)(this, _this30);
  85035. this.handleResize();
  85036. }.bind(this));
  85037. }
  85038. }.bind(this));
  85039. },
  85040. beforeDestroy: function beforeDestroy() {
  85041. this.$off('on-visible-change');
  85042. (0, _dom.off)(window, 'resize', this.handleResize);
  85043. this.observer.removeAllListeners(this.$el);
  85044. this.observer.uninstall(this.$el);
  85045. this.observer = null;
  85046. },
  85047. watch: {
  85048. data: {
  85049. handler: function handler() {
  85050. var _this31 = this;
  85051. var oldDataLen = this.rebuildData.length;
  85052. this.objData = this.makeObjData();
  85053. this.rebuildData = this.makeDataWithSortAndFilter();
  85054. this.handleResize();
  85055. if (!oldDataLen) {
  85056. this.fixedHeader();
  85057. }
  85058. setTimeout(function () {
  85059. (0, _newArrowCheck3.default)(this, _this31);
  85060. this.cloneData = (0, _assist.deepCopy)(this.data);
  85061. }.bind(this), 0);
  85062. },
  85063. deep: true
  85064. },
  85065. columns: {
  85066. handler: function handler() {
  85067. var colsWithId = this.makeColumnsId(this.columns);
  85068. this.allColumns = (0, _util.getAllColumns)(colsWithId);
  85069. this.cloneColumns = this.makeColumns(colsWithId);
  85070. this.columnRows = this.makeColumnRows(false, colsWithId);
  85071. this.leftFixedColumnRows = this.makeColumnRows('left', colsWithId);
  85072. this.rightFixedColumnRows = this.makeColumnRows('right', colsWithId);
  85073. this.rebuildData = this.makeDataWithSortAndFilter();
  85074. this.handleResize();
  85075. },
  85076. deep: true
  85077. },
  85078. height: function height() {
  85079. this.handleResize();
  85080. },
  85081. maxHeight: function maxHeight() {
  85082. this.handleResize();
  85083. },
  85084. showHorizontalScrollBar: function showHorizontalScrollBar() {
  85085. this.handleResize();
  85086. },
  85087. showVerticalScrollBar: function showVerticalScrollBar() {
  85088. this.handleResize();
  85089. }
  85090. }
  85091. };
  85092. /***/ }),
  85093. /* 235 */
  85094. /***/ (function(module, exports, __webpack_require__) {
  85095. var isObject = __webpack_require__(18);
  85096. module.exports = function (it, TYPE) {
  85097. if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
  85098. return it;
  85099. };
  85100. /***/ }),
  85101. /* 236 */
  85102. /***/ (function(module, exports, __webpack_require__) {
  85103. "use strict";
  85104. Object.defineProperty(exports, "__esModule", {
  85105. value: true
  85106. });
  85107. var _newArrowCheck2 = __webpack_require__(1);
  85108. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  85109. var _defineProperty2 = __webpack_require__(2);
  85110. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  85111. var _assign = __webpack_require__(15);
  85112. var _assign2 = _interopRequireDefault(_assign);
  85113. var _checkboxGroup = __webpack_require__(143);
  85114. var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
  85115. var _checkbox = __webpack_require__(49);
  85116. var _checkbox2 = _interopRequireDefault(_checkbox);
  85117. var _poptip = __webpack_require__(219);
  85118. var _poptip2 = _interopRequireDefault(_poptip);
  85119. var _button = __webpack_require__(28);
  85120. var _button2 = _interopRequireDefault(_button);
  85121. var _header = __webpack_require__(568);
  85122. var _header2 = _interopRequireDefault(_header);
  85123. var _mixin = __webpack_require__(95);
  85124. var _mixin2 = _interopRequireDefault(_mixin);
  85125. var _locale = __webpack_require__(6);
  85126. var _locale2 = _interopRequireDefault(_locale);
  85127. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  85128. exports.default = {
  85129. name: 'TableHead',
  85130. mixins: [_mixin2.default, _locale2.default],
  85131. components: { CheckboxGroup: _checkboxGroup2.default, Checkbox: _checkbox2.default, Poptip: _poptip2.default, iButton: _button2.default, renderHeader: _header2.default },
  85132. props: {
  85133. prefixCls: String,
  85134. styleObject: Object,
  85135. columns: Array,
  85136. objData: Object,
  85137. data: Array,
  85138. columnsWidth: Object,
  85139. fixed: {
  85140. type: [Boolean, String],
  85141. default: false
  85142. },
  85143. columnRows: Array,
  85144. fixedColumnRows: Array
  85145. },
  85146. data: function data() {
  85147. return {
  85148. draggingColumn: null,
  85149. dragging: false,
  85150. dragState: {}
  85151. };
  85152. },
  85153. computed: {
  85154. styles: function styles() {
  85155. var style = (0, _assign2.default)({}, this.styleObject);
  85156. var width = parseInt(this.styleObject.width);
  85157. style.width = String(width) + 'px';
  85158. return style;
  85159. },
  85160. isSelectAll: function isSelectAll() {
  85161. var isSelectAll = true;
  85162. if (!this.data.length) isSelectAll = false;
  85163. var isAllDisabledAndUnSelected = true;
  85164. for (var i in this.objData) {
  85165. var objData = this.objData[i];
  85166. if (!objData._isChecked && !objData._isDisabled) {
  85167. isSelectAll = false;
  85168. break;
  85169. } else if (objData.children && objData.children.length) {
  85170. isSelectAll = this.isChildrenSelected(objData, isSelectAll);
  85171. }
  85172. if (!(objData._isDisabled && !objData._isChecked)) {
  85173. isAllDisabledAndUnSelected = false;
  85174. } else if (objData.children && objData.children.length) {
  85175. isAllDisabledAndUnSelected = this.isChildrenAllDisabledAndUnSelected(objData, isAllDisabledAndUnSelected);
  85176. }
  85177. }
  85178. if (isAllDisabledAndUnSelected) isSelectAll = false;
  85179. return isSelectAll;
  85180. },
  85181. headRows: function headRows() {
  85182. var isGroup = this.columnRows.length > 1;
  85183. if (isGroup) {
  85184. return this.fixed ? this.fixedColumnRows : this.columnRows;
  85185. } else {
  85186. return [this.columns];
  85187. }
  85188. },
  85189. isSelectDisabled: function isSelectDisabled() {
  85190. var isSelectDisabled = true;
  85191. if (this.data.length) {
  85192. for (var i in this.objData) {
  85193. var objData = this.objData[i];
  85194. if (!objData._isDisabled) {
  85195. isSelectDisabled = false;
  85196. } else if (objData.children && objData.children.length) {
  85197. isSelectDisabled = this.isChildrenDisabled(objData, isSelectDisabled);
  85198. }
  85199. }
  85200. }
  85201. return isSelectDisabled;
  85202. }
  85203. },
  85204. methods: {
  85205. cellClasses: function cellClasses(column) {
  85206. var _ref;
  85207. return [String(this.prefixCls) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-selection', column.type === 'selection'), _ref)];
  85208. },
  85209. scrollBarCellClass: function scrollBarCellClass() {
  85210. var hasRightFixed = false;
  85211. for (var i in this.headRows) {
  85212. for (var j in this.headRows[i]) {
  85213. if (this.headRows[i][j].fixed === 'right') {
  85214. hasRightFixed = true;
  85215. break;
  85216. }
  85217. if (hasRightFixed) break;
  85218. }
  85219. }
  85220. return [(0, _defineProperty3.default)({}, String(this.prefixCls) + '-hidden', hasRightFixed)];
  85221. },
  85222. itemClasses: function itemClasses(column, item) {
  85223. return [String(this.prefixCls) + '-filter-select-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-filter-select-item-selected', column._filterChecked[0] === item.value)];
  85224. },
  85225. itemAllClasses: function itemAllClasses(column) {
  85226. return [String(this.prefixCls) + '-filter-select-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-filter-select-item-selected', !column._filterChecked.length)];
  85227. },
  85228. selectAll: function selectAll() {
  85229. var status = !this.isSelectAll;
  85230. this.$parent.selectAll(status);
  85231. },
  85232. handleSort: function handleSort(index, type) {
  85233. var _this = this;
  85234. var column = this.columns.find(function (item) {
  85235. (0, _newArrowCheck3.default)(this, _this);
  85236. return item._index === index;
  85237. }.bind(this));
  85238. var _index = column._index;
  85239. if (column._sortType === type) {
  85240. type = 'normal';
  85241. }
  85242. this.$parent.handleSort(_index, type);
  85243. },
  85244. handleSortByHead: function handleSortByHead(index) {
  85245. var _this2 = this;
  85246. var column = this.columns.find(function (item) {
  85247. (0, _newArrowCheck3.default)(this, _this2);
  85248. return item._index === index;
  85249. }.bind(this));
  85250. if (column.sortable) {
  85251. var type = column._sortType;
  85252. if (type === 'normal') {
  85253. this.handleSort(index, 'asc');
  85254. } else if (type === 'asc') {
  85255. this.handleSort(index, 'desc');
  85256. } else {
  85257. this.handleSort(index, 'normal');
  85258. }
  85259. }
  85260. },
  85261. handleFilter: function handleFilter(index) {
  85262. this.$parent.handleFilter(index);
  85263. },
  85264. handleSelect: function handleSelect(index, value) {
  85265. this.$parent.handleFilterSelect(index, value);
  85266. },
  85267. handleReset: function handleReset(index) {
  85268. this.$parent.handleFilterReset(index);
  85269. },
  85270. handleFilterHide: function handleFilterHide(index) {
  85271. this.$parent.handleFilterHide(index);
  85272. },
  85273. getColumn: function getColumn(rowIndex, index) {
  85274. var _this3 = this;
  85275. var isGroup = this.columnRows.length > 1;
  85276. if (isGroup) {
  85277. var id = this.headRows[rowIndex][index].__id;
  85278. return this.columns.filter(function (item) {
  85279. (0, _newArrowCheck3.default)(this, _this3);
  85280. return item.__id === id;
  85281. }.bind(this))[0];
  85282. } else {
  85283. return this.headRows[rowIndex][index];
  85284. }
  85285. },
  85286. handleMouseDown: function handleMouseDown(column, event) {
  85287. var _this4 = this;
  85288. if (this.$isServer) return;
  85289. if (this.draggingColumn) {
  85290. this.dragging = true;
  85291. var table = this.$parent;
  85292. var tableEl = table.$el;
  85293. var tableLeft = tableEl.getBoundingClientRect().left;
  85294. var columnEl = this.$el.querySelector('th.ivu-table-column-' + String(column.__id));
  85295. var columnRect = columnEl.getBoundingClientRect();
  85296. var minLeft = columnRect.left - tableLeft + 30;
  85297. table.showResizeLine = true;
  85298. this.dragState = {
  85299. startMouseLeft: event.clientX,
  85300. startLeft: columnRect.right - tableLeft,
  85301. startColumnLeft: columnRect.left - tableLeft,
  85302. tableLeft: tableLeft
  85303. };
  85304. var resizeProxy = table.$refs.resizeLine;
  85305. resizeProxy.style.left = this.dragState.startLeft + 'px';
  85306. document.onselectstart = function () {
  85307. return false;
  85308. };
  85309. document.ondragstart = function () {
  85310. return false;
  85311. };
  85312. var handleMouseMove = function (event) {
  85313. (0, _newArrowCheck3.default)(this, _this4);
  85314. var deltaLeft = event.clientX - this.dragState.startMouseLeft;
  85315. var proxyLeft = this.dragState.startLeft + deltaLeft;
  85316. resizeProxy.style.left = Math.max(minLeft, proxyLeft) + 'px';
  85317. }.bind(this);
  85318. var handleMouseUp = function () {
  85319. (0, _newArrowCheck3.default)(this, _this4);
  85320. if (this.dragging) {
  85321. var _dragState = this.dragState,
  85322. startColumnLeft = _dragState.startColumnLeft,
  85323. startLeft = _dragState.startLeft;
  85324. var finalLeft = parseInt(resizeProxy.style.left, 10);
  85325. var columnWidth = finalLeft - startColumnLeft;
  85326. var _column = table.columns.find(function (item) {
  85327. (0, _newArrowCheck3.default)(this, _this4);
  85328. return item.__id === column.__id;
  85329. }.bind(this));
  85330. if (_column) _column.width = columnWidth;
  85331. table.$emit('on-column-width-resize', _column.width, startLeft - startColumnLeft, column, event);
  85332. document.body.style.cursor = '';
  85333. this.dragging = false;
  85334. this.draggingColumn = null;
  85335. this.dragState = {};
  85336. table.showResizeLine = false;
  85337. }
  85338. document.removeEventListener('mousemove', handleMouseMove);
  85339. document.removeEventListener('mouseup', handleMouseUp);
  85340. document.onselectstart = null;
  85341. document.ondragstart = null;
  85342. }.bind(this);
  85343. document.addEventListener('mousemove', handleMouseMove);
  85344. document.addEventListener('mouseup', handleMouseUp);
  85345. }
  85346. },
  85347. handleMouseMove: function handleMouseMove(column, event) {
  85348. var target = event.target;
  85349. while (target && target.tagName !== 'TH') {
  85350. target = target.parentNode;
  85351. }
  85352. if (!column || !column.resizable) return;
  85353. if (!this.dragging) {
  85354. var rect = target.getBoundingClientRect();
  85355. var bodyStyle = document.body.style;
  85356. if (rect.width > 12 && rect.right - event.pageX < 8) {
  85357. bodyStyle.cursor = 'col-resize';
  85358. this.draggingColumn = column;
  85359. } else if (!this.dragging) {
  85360. bodyStyle.cursor = '';
  85361. this.draggingColumn = null;
  85362. }
  85363. }
  85364. },
  85365. handleMouseOut: function handleMouseOut() {
  85366. if (this.$isServer) return;
  85367. document.body.style.cursor = '';
  85368. },
  85369. isChildrenSelected: function isChildrenSelected(objData, isSelectAll) {
  85370. var _this5 = this;
  85371. var status = isSelectAll;
  85372. if (objData.children && objData.children.length) {
  85373. objData.children.forEach(function (row) {
  85374. (0, _newArrowCheck3.default)(this, _this5);
  85375. if (!row._isChecked && !row._isDisabled) {
  85376. status = false;
  85377. } else if (row.children && row.children.length) {
  85378. status = this.isChildrenSelected(row, status);
  85379. }
  85380. }.bind(this));
  85381. }
  85382. return status;
  85383. },
  85384. isChildrenAllDisabledAndUnSelected: function isChildrenAllDisabledAndUnSelected(objData, isAllDisabledAndUnSelected) {
  85385. var _this6 = this;
  85386. var status = isAllDisabledAndUnSelected;
  85387. if (objData.children && objData.children.length) {
  85388. objData.children.forEach(function (row) {
  85389. (0, _newArrowCheck3.default)(this, _this6);
  85390. if (!(row._isDisabled && !row._isChecked)) {
  85391. status = false;
  85392. } else if (row.children && row.children.length) {
  85393. status = this.isChildrenAllDisabledAndUnSelected(row, status);
  85394. }
  85395. }.bind(this));
  85396. }
  85397. return status;
  85398. },
  85399. isChildrenDisabled: function isChildrenDisabled(objData, isSelectDisabled) {
  85400. var _this7 = this;
  85401. var status = isSelectDisabled;
  85402. if (objData.children && objData.children.length) {
  85403. objData.children.forEach(function (row) {
  85404. (0, _newArrowCheck3.default)(this, _this7);
  85405. if (!row._isDisabled) {
  85406. status = false;
  85407. } else if (row.children && row.children.length) {
  85408. status = this.isChildrenDisabled(row, status);
  85409. }
  85410. }.bind(this));
  85411. }
  85412. return status;
  85413. }
  85414. }
  85415. };
  85416. /***/ }),
  85417. /* 237 */
  85418. /***/ (function(module, exports, __webpack_require__) {
  85419. "use strict";
  85420. Object.defineProperty(exports, "__esModule", {
  85421. value: true
  85422. });
  85423. var _defineProperty2 = __webpack_require__(2);
  85424. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  85425. var _newArrowCheck2 = __webpack_require__(1);
  85426. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  85427. var _typeof2 = __webpack_require__(27);
  85428. var _typeof3 = _interopRequireDefault(_typeof2);
  85429. var _tableTr = __webpack_require__(571);
  85430. var _tableTr2 = _interopRequireDefault(_tableTr);
  85431. var _cell = __webpack_require__(573);
  85432. var _cell2 = _interopRequireDefault(_cell);
  85433. var _expand = __webpack_require__(240);
  85434. var _expand2 = _interopRequireDefault(_expand);
  85435. var _mixin = __webpack_require__(95);
  85436. var _mixin2 = _interopRequireDefault(_mixin);
  85437. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  85438. exports.default = {
  85439. name: 'TableBody',
  85440. mixins: [_mixin2.default],
  85441. components: { TableCell: _cell2.default, Expand: _expand2.default, TableTr: _tableTr2.default },
  85442. props: {
  85443. prefixCls: String,
  85444. styleObject: Object,
  85445. columns: Array,
  85446. data: Array,
  85447. objData: Object,
  85448. columnsWidth: Object,
  85449. fixed: {
  85450. type: [Boolean, String],
  85451. default: false
  85452. },
  85453. draggable: {
  85454. type: Boolean,
  85455. default: false
  85456. },
  85457. rowKey: {
  85458. type: [Boolean, String],
  85459. default: false
  85460. }
  85461. },
  85462. computed: {
  85463. expandRender: function expandRender() {
  85464. var render = function render() {
  85465. return '';
  85466. };
  85467. for (var i = 0; i < this.columns.length; i++) {
  85468. var column = this.columns[i];
  85469. if (column.type && column.type === 'expand') {
  85470. if (column.render) render = column.render;
  85471. }
  85472. }
  85473. return render;
  85474. }
  85475. },
  85476. methods: {
  85477. rowChecked: function rowChecked(_index) {
  85478. return this.objData[_index] && this.objData[_index]._isChecked;
  85479. },
  85480. rowDisabled: function rowDisabled(_index) {
  85481. return this.objData[_index] && this.objData[_index]._isDisabled;
  85482. },
  85483. rowExpanded: function rowExpanded(_index) {
  85484. return this.objData[_index] && this.objData[_index]._isExpanded;
  85485. },
  85486. rowStatusByRowKey: function rowStatusByRowKey(type, rowKey) {
  85487. var data = this.$parent.getDataByRowKey(rowKey);
  85488. return data[type];
  85489. },
  85490. handleMouseIn: function handleMouseIn(_index, event, rowKey) {
  85491. event.stopPropagation();
  85492. this.$parent.handleMouseIn(_index, rowKey);
  85493. },
  85494. handleMouseOut: function handleMouseOut(_index, event, rowKey) {
  85495. event.stopPropagation();
  85496. this.$parent.handleMouseOut(_index, rowKey);
  85497. },
  85498. clickCurrentRow: function clickCurrentRow(_index, event, rowKey) {
  85499. this.$parent.clickCurrentRow(_index, rowKey);
  85500. },
  85501. dblclickCurrentRow: function dblclickCurrentRow(_index, event, rowKey) {
  85502. event.stopPropagation();
  85503. this.$parent.dblclickCurrentRow(_index, rowKey);
  85504. },
  85505. clickCell: function clickCell(row, column, key, event) {
  85506. this.$parent.$emit('on-cell-click', row, column, row[key], event);
  85507. },
  85508. contextmenuCurrentRow: function contextmenuCurrentRow(_index, event, rowKey) {
  85509. event.stopPropagation();
  85510. if (this.$parent.contextMenu) event.preventDefault();
  85511. this.$parent.contextmenuCurrentRow(_index, rowKey, event);
  85512. },
  85513. selectStartCurrentRow: function selectStartCurrentRow() {
  85514. if (this.$parent.contextMenu) {}
  85515. },
  85516. getSpan: function getSpan(row, column, rowIndex, columnIndex) {
  85517. var fn = this.$parent.spanMethod;
  85518. if (typeof fn === 'function') {
  85519. var result = fn({
  85520. row: row,
  85521. column: column,
  85522. rowIndex: rowIndex,
  85523. columnIndex: columnIndex
  85524. });
  85525. var rowspan = 1;
  85526. var colspan = 1;
  85527. if (Array.isArray(result)) {
  85528. rowspan = result[0];
  85529. colspan = result[1];
  85530. } else if ((typeof result === 'undefined' ? 'undefined' : (0, _typeof3.default)(result)) === 'object') {
  85531. rowspan = result.rowspan;
  85532. colspan = result.colspan;
  85533. }
  85534. return {
  85535. rowspan: rowspan,
  85536. colspan: colspan
  85537. };
  85538. } else {
  85539. return {};
  85540. }
  85541. },
  85542. showWithSpan: function showWithSpan(row, column, rowIndex, columnIndex) {
  85543. var result = this.getSpan(row, column, rowIndex, columnIndex);
  85544. return !('rowspan' in result && result.rowspan === 0 || 'colspan' in result && result.colspan === 0);
  85545. },
  85546. isTrShow: function isTrShow(rowKey) {
  85547. var status = true;
  85548. var child = void 0;
  85549. for (var i in this.objData) {
  85550. var row = this.objData[i];
  85551. var showChildren = row._isShowChildren;
  85552. if (row._rowKey === rowKey) {
  85553. status = status && showChildren;
  85554. break;
  85555. } else if (row.children && row.children.length) {
  85556. child = this.getTrStatus(rowKey, row, status && showChildren);
  85557. if (child[0] && child[0]._rowKey === rowKey) {
  85558. return child[1];
  85559. }
  85560. }
  85561. }
  85562. return status;
  85563. },
  85564. getTrStatus: function getTrStatus(rowKey, data, parentStatus) {
  85565. var status = parentStatus;
  85566. var childData = void 0;
  85567. if (data.children && data.children.length) {
  85568. for (var i = 0; i < data.children.length; i++) {
  85569. var row = data.children[i];
  85570. var showChildren = row._isShowChildren;
  85571. if (row._rowKey === rowKey) {
  85572. childData = row;
  85573. status = status && showChildren;
  85574. break;
  85575. } else if (row.children && row.children.length) {
  85576. var child = this.getTrStatus(rowKey, row, status && showChildren);
  85577. if (child[0] && child[0]._rowKey === rowKey) {
  85578. return child;
  85579. }
  85580. }
  85581. }
  85582. }
  85583. return [childData, status];
  85584. },
  85585. getLevel: function getLevel(rowKey) {
  85586. var level = void 0;
  85587. var child = void 0;
  85588. for (var i = 0; i < this.data.length; i++) {
  85589. var row = this.data[i];
  85590. if (row[this.rowKey] === rowKey) {
  85591. level = 0;
  85592. break;
  85593. } else if (row.children && row.children.length) {
  85594. child = this.getChildLevel(row, rowKey, 1);
  85595. if (child[0] && child[0][this.rowKey] === rowKey) {
  85596. return child[1];
  85597. }
  85598. }
  85599. }
  85600. return level;
  85601. },
  85602. getChildLevel: function getChildLevel(data, rowKey, level) {
  85603. var newLevel = void 0;
  85604. var childData = void 0;
  85605. if (data.children && data.children.length) {
  85606. for (var i = 0; i < data.children.length; i++) {
  85607. var row = data.children[i];
  85608. if (row[this.rowKey] === rowKey) {
  85609. childData = row;
  85610. newLevel = level;
  85611. break;
  85612. } else if (row.children && row.children.length) {
  85613. var child = this.getChildLevel(row, rowKey, level + 1);
  85614. if (child[0] && child[0][this.rowKey] === rowKey) {
  85615. return child;
  85616. }
  85617. }
  85618. }
  85619. }
  85620. return [childData, newLevel];
  85621. },
  85622. getChildNode: function getChildNode(h, data, nodes) {
  85623. var _this = this;
  85624. if (data.children && data.children.length) {
  85625. data.children.forEach(function (row, index) {
  85626. (0, _newArrowCheck3.default)(this, _this);
  85627. var $tds = [];
  85628. this.columns.forEach(function (column, colIndex) {
  85629. (0, _newArrowCheck3.default)(this, _this);
  85630. if (this.showWithSpan(row, column, index, colIndex)) {
  85631. var $tableCell = h(_cell2.default, {
  85632. props: {
  85633. fixed: this.fixed,
  85634. 'prefix-cls': this.prefixCls,
  85635. row: row,
  85636. column: column,
  85637. 'natural-index': index,
  85638. index: row._index,
  85639. checked: this.rowStatusByRowKey('_isChecked', row._rowKey),
  85640. disabled: this.rowStatusByRowKey('_isDisabled', row._rowKey),
  85641. expanded: this.rowStatusByRowKey('_isExpanded', row._rowKey),
  85642. treeNode: true,
  85643. treeLevel: this.getLevel(row._rowKey)
  85644. },
  85645. key: column._columnKey
  85646. });
  85647. var $td = h('td', {
  85648. class: this.alignCls(column, row),
  85649. attrs: this.getSpan(row, column, index, colIndex),
  85650. on: {
  85651. click: function click(e) {
  85652. (0, _newArrowCheck3.default)(this, _this);
  85653. return this.clickCell(row, column, column.key, e);
  85654. }.bind(this)
  85655. }
  85656. }, [$tableCell]);
  85657. $tds.push($td);
  85658. }
  85659. }.bind(this));
  85660. var trStyle = {};
  85661. if (!this.isTrShow(data._rowKey)) trStyle.display = 'none';
  85662. var $tableTr = h(_tableTr2.default, {
  85663. props: {
  85664. draggable: false,
  85665. row: row,
  85666. 'prefix-cls': this.prefixCls,
  85667. isChildren: true
  85668. },
  85669. style: trStyle,
  85670. key: this.rowKey ? row._rowKey : index,
  85671. nativeOn: {
  85672. mouseenter: function mouseenter(e) {
  85673. (0, _newArrowCheck3.default)(this, _this);
  85674. return this.handleMouseIn(row._index, e, row._rowKey);
  85675. }.bind(this),
  85676. mouseleave: function mouseleave(e) {
  85677. (0, _newArrowCheck3.default)(this, _this);
  85678. return this.handleMouseOut(row._index, e, row._rowKey);
  85679. }.bind(this),
  85680. click: function click(e) {
  85681. (0, _newArrowCheck3.default)(this, _this);
  85682. return this.clickCurrentRow(row._index, e, row._rowKey);
  85683. }.bind(this),
  85684. dblclick: function dblclick(e) {
  85685. (0, _newArrowCheck3.default)(this, _this);
  85686. return this.dblclickCurrentRow(row._index, e, row._rowKey);
  85687. }.bind(this),
  85688. contextmenu: function contextmenu(e) {
  85689. (0, _newArrowCheck3.default)(this, _this);
  85690. return this.contextmenuCurrentRow(row._index, e, row._rowKey);
  85691. }.bind(this),
  85692. selectstart: function selectstart(e) {
  85693. (0, _newArrowCheck3.default)(this, _this);
  85694. return this.selectStartCurrentRow(row._index, e, row._rowKey);
  85695. }.bind(this)
  85696. }
  85697. }, $tds);
  85698. nodes.push($tableTr);
  85699. if (row.children && row.children.length) {
  85700. this.getChildNode(h, row, nodes);
  85701. }
  85702. }.bind(this));
  85703. return nodes;
  85704. } else {
  85705. return nodes;
  85706. }
  85707. }
  85708. },
  85709. render: function render(h) {
  85710. var _this2 = this;
  85711. var $cols = [];
  85712. this.columns.forEach(function (column) {
  85713. (0, _newArrowCheck3.default)(this, _this2);
  85714. var $col = h('col', {
  85715. attrs: {
  85716. width: this.setCellWidth(column)
  85717. }
  85718. });
  85719. $cols.push($col);
  85720. }.bind(this));
  85721. var $colgroup = h('colgroup', {}, $cols);
  85722. var $tableTrs = [];
  85723. this.data.forEach(function (row, index) {
  85724. (0, _newArrowCheck3.default)(this, _this2);
  85725. var $tds = [];
  85726. this.columns.forEach(function (column, colIndex) {
  85727. (0, _newArrowCheck3.default)(this, _this2);
  85728. if (this.showWithSpan(row, column, index, colIndex)) {
  85729. var $tableCell = h(_cell2.default, {
  85730. props: {
  85731. fixed: this.fixed,
  85732. 'prefix-cls': this.prefixCls,
  85733. row: row,
  85734. column: column,
  85735. 'natural-index': index,
  85736. index: row._index,
  85737. checked: this.rowChecked(row._index),
  85738. disabled: this.rowDisabled(row._index),
  85739. expanded: this.rowExpanded(row._index)
  85740. },
  85741. key: column._columnKey
  85742. });
  85743. var $td = h('td', {
  85744. class: this.alignCls(column, row),
  85745. attrs: this.getSpan(row, column, index, colIndex),
  85746. on: {
  85747. click: function click(e) {
  85748. (0, _newArrowCheck3.default)(this, _this2);
  85749. return this.clickCell(row, column, column.key, e);
  85750. }.bind(this)
  85751. }
  85752. }, [$tableCell]);
  85753. $tds.push($td);
  85754. }
  85755. }.bind(this));
  85756. var $tableTr = h(_tableTr2.default, {
  85757. props: {
  85758. draggable: this.draggable,
  85759. row: row,
  85760. 'prefix-cls': this.prefixCls
  85761. },
  85762. key: this.rowKey ? row._rowKey : index,
  85763. nativeOn: {
  85764. mouseenter: function mouseenter(e) {
  85765. (0, _newArrowCheck3.default)(this, _this2);
  85766. return this.handleMouseIn(row._index, e);
  85767. }.bind(this),
  85768. mouseleave: function mouseleave(e) {
  85769. (0, _newArrowCheck3.default)(this, _this2);
  85770. return this.handleMouseOut(row._index, e);
  85771. }.bind(this),
  85772. click: function click(e) {
  85773. (0, _newArrowCheck3.default)(this, _this2);
  85774. return this.clickCurrentRow(row._index, e);
  85775. }.bind(this),
  85776. dblclick: function dblclick(e) {
  85777. (0, _newArrowCheck3.default)(this, _this2);
  85778. return this.dblclickCurrentRow(row._index, e);
  85779. }.bind(this),
  85780. contextmenu: function contextmenu(e) {
  85781. (0, _newArrowCheck3.default)(this, _this2);
  85782. return this.contextmenuCurrentRow(row._index, e);
  85783. }.bind(this),
  85784. selectstart: function selectstart(e) {
  85785. (0, _newArrowCheck3.default)(this, _this2);
  85786. return this.selectStartCurrentRow(row._index, e);
  85787. }.bind(this)
  85788. }
  85789. }, $tds);
  85790. $tableTrs.push($tableTr);
  85791. if (this.rowExpanded(row._index)) {
  85792. var $Expand = h(_expand2.default, {
  85793. props: {
  85794. row: row,
  85795. render: this.expandRender,
  85796. index: row._index
  85797. },
  85798. key: this.rowKey ? row._rowKey : index
  85799. });
  85800. var $td = h('td', {
  85801. attrs: {
  85802. colspan: this.columns.length
  85803. },
  85804. class: this.prefixCls + '-expanded-cell'
  85805. }, [$Expand]);
  85806. var $tr = h('tr', {
  85807. class: (0, _defineProperty3.default)({}, this.prefixCls + '-expanded-hidden', this.fixed)
  85808. }, [$td]);
  85809. $tableTrs.push($tr);
  85810. }
  85811. if (row.children && row.children.length) {
  85812. var $childNodes = this.getChildNode(h, row, []);
  85813. $childNodes.forEach(function (item) {
  85814. (0, _newArrowCheck3.default)(this, _this2);
  85815. $tableTrs.push(item);
  85816. }.bind(this));
  85817. }
  85818. }.bind(this));
  85819. var $tbody = h('tbody', {
  85820. class: this.prefixCls + '-tbody'
  85821. }, [$tableTrs]);
  85822. return h('table', {
  85823. attrs: {
  85824. cellspacing: '0',
  85825. cellpadding: '0',
  85826. border: '0'
  85827. },
  85828. style: this.styleObject
  85829. }, [$colgroup, $tbody]);
  85830. }
  85831. };
  85832. /***/ }),
  85833. /* 238 */
  85834. /***/ (function(module, exports, __webpack_require__) {
  85835. "use strict";
  85836. Object.defineProperty(exports, "__esModule", {
  85837. value: true
  85838. });
  85839. var _defineProperty2 = __webpack_require__(2);
  85840. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  85841. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  85842. exports.default = {
  85843. props: {
  85844. row: Object,
  85845. prefixCls: String,
  85846. draggable: Boolean,
  85847. isChildren: Boolean },
  85848. computed: {
  85849. objData: function objData() {
  85850. return this.$parent.objData;
  85851. }
  85852. },
  85853. methods: {
  85854. onDrag: function onDrag(e, index) {
  85855. e.dataTransfer.setData('index', index);
  85856. },
  85857. onDrop: function onDrop(e, index) {
  85858. var dragIndex = e.dataTransfer.getData('index');
  85859. this.$parent.$parent.dragAndDrop(dragIndex, index);
  85860. e.preventDefault();
  85861. },
  85862. allowDrop: function allowDrop(e) {
  85863. e.preventDefault();
  85864. },
  85865. rowClasses: function rowClasses(_index) {
  85866. var _ref;
  85867. var objData = this.isChildren ? this.$parent.$parent.getDataByRowKey(this.row._rowKey) : this.objData[_index];
  85868. return [String(this.prefixCls) + '-row', this.rowClsName(_index), (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-row-highlight', objData && objData._isHighlight), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-row-hover', objData && objData._isHover), _ref)];
  85869. },
  85870. rowClsName: function rowClsName(_index) {
  85871. return this.$parent.$parent.rowClassName(this.objData[_index], _index);
  85872. }
  85873. }
  85874. };
  85875. /***/ }),
  85876. /* 239 */
  85877. /***/ (function(module, exports, __webpack_require__) {
  85878. "use strict";
  85879. Object.defineProperty(exports, "__esModule", {
  85880. value: true
  85881. });
  85882. var _defineProperty2 = __webpack_require__(2);
  85883. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  85884. var _expand = __webpack_require__(240);
  85885. var _expand2 = _interopRequireDefault(_expand);
  85886. var _slot = __webpack_require__(574);
  85887. var _slot2 = _interopRequireDefault(_slot);
  85888. var _icon = __webpack_require__(8);
  85889. var _icon2 = _interopRequireDefault(_icon);
  85890. var _checkbox = __webpack_require__(49);
  85891. var _checkbox2 = _interopRequireDefault(_checkbox);
  85892. var _tooltip = __webpack_require__(93);
  85893. var _tooltip2 = _interopRequireDefault(_tooltip);
  85894. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  85895. exports.default = {
  85896. name: 'TableCell',
  85897. components: { Icon: _icon2.default, Checkbox: _checkbox2.default, TableExpand: _expand2.default, TableSlot: _slot2.default, Tooltip: _tooltip2.default },
  85898. inject: ['tableRoot'],
  85899. props: {
  85900. prefixCls: String,
  85901. row: Object,
  85902. column: Object,
  85903. naturalIndex: Number,
  85904. index: Number,
  85905. checked: Boolean,
  85906. disabled: Boolean,
  85907. expanded: Boolean,
  85908. fixed: {
  85909. type: [Boolean, String],
  85910. default: false
  85911. },
  85912. treeNode: Boolean,
  85913. treeLevel: {
  85914. type: Number,
  85915. default: 0
  85916. }
  85917. },
  85918. data: function data() {
  85919. return {
  85920. renderType: '',
  85921. uid: -1,
  85922. context: this.$parent.$parent.$parent.currentContext,
  85923. showTooltip: false };
  85924. },
  85925. computed: {
  85926. classes: function classes() {
  85927. var _ref;
  85928. return [String(this.prefixCls) + '-cell', (_ref = {}, (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-hidden', !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right')), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-ellipsis', this.column.ellipsis || false), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-expand', this.renderType === 'expand'), (0, _defineProperty3.default)(_ref, String(this.prefixCls) + '-cell-with-selection', this.renderType === 'selection'), _ref)];
  85929. },
  85930. expandCls: function expandCls() {
  85931. return [String(this.prefixCls) + '-cell-expand', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-cell-expand-expanded', this.expanded)];
  85932. },
  85933. showChildren: function showChildren() {
  85934. var status = false;
  85935. if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
  85936. var data = this.row;
  85937. if (data.children && data.children.length || '_loading' in data) {
  85938. if (this.column.tree) status = true;
  85939. }
  85940. }
  85941. return status;
  85942. },
  85943. showTreeNode: function showTreeNode() {
  85944. var status = false;
  85945. if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
  85946. if (this.column.tree && this.treeNode) status = true;
  85947. }
  85948. return status;
  85949. },
  85950. showLevel: function showLevel() {
  85951. var status = false;
  85952. if (this.renderType === 'html' || this.renderType === 'normal' || this.renderType === 'render' || this.renderType === 'slot') {
  85953. if (this.column.tree && this.treeNode) status = true;
  85954. }
  85955. return status;
  85956. },
  85957. treeLevelStyle: function treeLevelStyle() {
  85958. return {
  85959. 'padding-left': this.treeLevel * this.tableRoot.indentSize + 'px'
  85960. };
  85961. },
  85962. childrenExpand: function childrenExpand() {
  85963. var data = this.tableRoot.getDataByRowKey(this.row._rowKey);
  85964. return data._isShowChildren;
  85965. },
  85966. childrenLoading: function childrenLoading() {
  85967. var data = this.tableRoot.getDataByRowKey(this.row._rowKey);
  85968. return '_loading' in data && data._loading;
  85969. }
  85970. },
  85971. methods: {
  85972. toggleSelect: function toggleSelect() {
  85973. if (this.treeNode) {
  85974. this.$parent.$parent.$parent.toggleSelect(this.index, this.row._rowKey);
  85975. } else {
  85976. this.$parent.$parent.$parent.toggleSelect(this.index);
  85977. }
  85978. },
  85979. toggleExpand: function toggleExpand() {
  85980. this.$parent.$parent.$parent.toggleExpand(this.index);
  85981. },
  85982. handleClick: function handleClick() {},
  85983. handleTooltipIn: function handleTooltipIn() {
  85984. var $content = this.$refs.content;
  85985. var range = document.createRange();
  85986. range.setStart($content, 0);
  85987. range.setEnd($content, $content.childNodes.length);
  85988. var rangeWidth = range.getBoundingClientRect().width;
  85989. this.showTooltip = rangeWidth > $content.offsetWidth;
  85990. range = null;
  85991. },
  85992. handleToggleTree: function handleToggleTree() {
  85993. this.$parent.$parent.$parent.toggleTree(this.row._rowKey);
  85994. }
  85995. },
  85996. created: function created() {
  85997. if (this.column.type === 'index') {
  85998. this.renderType = 'index';
  85999. } else if (this.column.type === 'selection') {
  86000. this.renderType = 'selection';
  86001. } else if (this.column.type === 'html') {
  86002. this.renderType = 'html';
  86003. } else if (this.column.type === 'expand') {
  86004. this.renderType = 'expand';
  86005. } else if (this.column.render) {
  86006. this.renderType = 'render';
  86007. } else if (this.column.slot) {
  86008. this.renderType = 'slot';
  86009. } else {
  86010. this.renderType = 'normal';
  86011. }
  86012. }
  86013. };
  86014. /***/ }),
  86015. /* 240 */
  86016. /***/ (function(module, exports, __webpack_require__) {
  86017. "use strict";
  86018. Object.defineProperty(exports, "__esModule", {
  86019. value: true
  86020. });
  86021. var _newArrowCheck2 = __webpack_require__(1);
  86022. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  86023. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  86024. exports.default = {
  86025. name: 'TableExpand',
  86026. functional: true,
  86027. props: {
  86028. row: Object,
  86029. render: Function,
  86030. index: Number,
  86031. column: {
  86032. type: Object,
  86033. default: null
  86034. }
  86035. },
  86036. render: function render(h, ctx) {
  86037. (0, _newArrowCheck3.default)(undefined, undefined);
  86038. var params = {
  86039. row: ctx.props.row,
  86040. index: ctx.props.index
  86041. };
  86042. if (ctx.props.column) params.column = ctx.props.column;
  86043. return ctx.props.render(h, params);
  86044. }.bind(undefined)
  86045. };
  86046. /***/ }),
  86047. /* 241 */
  86048. /***/ (function(module, exports, __webpack_require__) {
  86049. "use strict";
  86050. Object.defineProperty(exports, "__esModule", {
  86051. value: true
  86052. });
  86053. var _defineProperty2 = __webpack_require__(2);
  86054. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  86055. var _mixin = __webpack_require__(95);
  86056. var _mixin2 = _interopRequireDefault(_mixin);
  86057. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  86058. exports.default = {
  86059. name: 'TableSummary',
  86060. mixins: [_mixin2.default],
  86061. props: {
  86062. prefixCls: String,
  86063. styleObject: Object,
  86064. columns: Array,
  86065. data: Object,
  86066. columnsWidth: Object,
  86067. fixed: {
  86068. type: [Boolean, String],
  86069. default: false
  86070. }
  86071. },
  86072. methods: {
  86073. cellCls: function cellCls(column) {
  86074. return [(0, _defineProperty3.default)({}, 'ivu-table-hidden', this.fixed === 'left' && column.fixed !== 'left' || this.fixed === 'right' && column.fixed !== 'right' || !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right'))];
  86075. }
  86076. }
  86077. };
  86078. /***/ }),
  86079. /* 242 */
  86080. /***/ (function(module, exports, __webpack_require__) {
  86081. "use strict";
  86082. Object.defineProperty(exports, "__esModule", {
  86083. value: true
  86084. });
  86085. var _toConsumableArray2 = __webpack_require__(17);
  86086. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  86087. var _typeof2 = __webpack_require__(27);
  86088. var _typeof3 = _interopRequireDefault(_typeof2);
  86089. var _defineProperty2 = __webpack_require__(2);
  86090. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  86091. var _getIterator2 = __webpack_require__(45);
  86092. var _getIterator3 = _interopRequireDefault(_getIterator2);
  86093. var _newArrowCheck2 = __webpack_require__(1);
  86094. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  86095. var _icon = __webpack_require__(8);
  86096. var _icon2 = _interopRequireDefault(_icon);
  86097. var _render = __webpack_require__(215);
  86098. var _render2 = _interopRequireDefault(_render);
  86099. var _dropdown = __webpack_require__(61);
  86100. var _dropdown2 = _interopRequireDefault(_dropdown);
  86101. var _dropdownMenu = __webpack_require__(62);
  86102. var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
  86103. var _assist = __webpack_require__(3);
  86104. var _emitter = __webpack_require__(4);
  86105. var _emitter2 = _interopRequireDefault(_emitter);
  86106. var _elementResizeDetector = __webpack_require__(94);
  86107. var _elementResizeDetector2 = _interopRequireDefault(_elementResizeDetector);
  86108. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  86109. var prefixCls = 'ivu-tabs';
  86110. var transitionTime = 300;
  86111. var getNextTab = function (list, activeKey, direction, countDisabledAlso) {
  86112. (0, _newArrowCheck3.default)(undefined, undefined);
  86113. var currentIndex = list.findIndex(function (tab) {
  86114. (0, _newArrowCheck3.default)(undefined, undefined);
  86115. return tab.name === activeKey;
  86116. }.bind(undefined));
  86117. var nextIndex = (currentIndex + direction + list.length) % list.length;
  86118. var nextTab = list[nextIndex];
  86119. if (nextTab.disabled) return getNextTab(list, nextTab.name, direction, countDisabledAlso);else return nextTab;
  86120. }.bind(undefined);
  86121. var focusFirst = function (element, root) {
  86122. (0, _newArrowCheck3.default)(undefined, undefined);
  86123. try {
  86124. element.focus();
  86125. } catch (err) {}
  86126. if (document.activeElement == element && element !== root) return true;
  86127. var candidates = element.children;
  86128. var _iteratorNormalCompletion = true;
  86129. var _didIteratorError = false;
  86130. var _iteratorError = undefined;
  86131. try {
  86132. for (var _iterator = (0, _getIterator3.default)(candidates), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
  86133. var candidate = _step.value;
  86134. if (focusFirst(candidate, root)) return true;
  86135. }
  86136. } catch (err) {
  86137. _didIteratorError = true;
  86138. _iteratorError = err;
  86139. } finally {
  86140. try {
  86141. if (!_iteratorNormalCompletion && _iterator.return) {
  86142. _iterator.return();
  86143. }
  86144. } finally {
  86145. if (_didIteratorError) {
  86146. throw _iteratorError;
  86147. }
  86148. }
  86149. }
  86150. return false;
  86151. }.bind(undefined);
  86152. exports.default = {
  86153. name: 'Tabs',
  86154. mixins: [_emitter2.default],
  86155. components: { Icon: _icon2.default, Render: _render2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
  86156. provide: function provide() {
  86157. return { TabsInstance: this };
  86158. },
  86159. props: {
  86160. value: {
  86161. type: [String, Number]
  86162. },
  86163. type: {
  86164. validator: function validator(value) {
  86165. return (0, _assist.oneOf)(value, ['line', 'card']);
  86166. },
  86167. default: 'line'
  86168. },
  86169. size: {
  86170. validator: function validator(value) {
  86171. return (0, _assist.oneOf)(value, ['small', 'default']);
  86172. },
  86173. default: 'default'
  86174. },
  86175. animated: {
  86176. type: Boolean,
  86177. default: true
  86178. },
  86179. captureFocus: {
  86180. type: Boolean,
  86181. default: false
  86182. },
  86183. closable: {
  86184. type: Boolean,
  86185. default: false
  86186. },
  86187. beforeRemove: Function,
  86188. name: {
  86189. type: String
  86190. },
  86191. draggable: {
  86192. type: Boolean,
  86193. default: false
  86194. }
  86195. },
  86196. data: function data() {
  86197. return {
  86198. prefixCls: prefixCls,
  86199. navList: [],
  86200. barWidth: 0,
  86201. barOffset: 0,
  86202. activeKey: this.value,
  86203. focusedKey: this.value,
  86204. showSlot: false,
  86205. navStyle: {
  86206. transform: ''
  86207. },
  86208. scrollable: false,
  86209. transitioning: false,
  86210. contextMenuVisible: false,
  86211. contextMenuStyles: {
  86212. top: 0,
  86213. left: 0
  86214. }
  86215. };
  86216. },
  86217. computed: {
  86218. classes: function classes() {
  86219. var _ref;
  86220. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-card', this.type === 'card'), (0, _defineProperty3.default)(_ref, prefixCls + '-mini', this.size === 'small' && this.type === 'line'), (0, _defineProperty3.default)(_ref, prefixCls + '-no-animation', !this.animated), _ref)];
  86221. },
  86222. contentClasses: function contentClasses() {
  86223. return [prefixCls + '-content', (0, _defineProperty3.default)({}, prefixCls + '-content-animated', this.animated)];
  86224. },
  86225. barClasses: function barClasses() {
  86226. return [prefixCls + '-ink-bar', (0, _defineProperty3.default)({}, prefixCls + '-ink-bar-animated', this.animated)];
  86227. },
  86228. contentStyle: function contentStyle() {
  86229. var x = this.getTabIndex(this.activeKey);
  86230. var p = x === 0 ? '0%' : '-' + String(x) + '00%';
  86231. var style = {};
  86232. if (x > -1) {
  86233. style = {
  86234. transform: 'translateX(' + p + ') translateZ(0px)'
  86235. };
  86236. }
  86237. return style;
  86238. },
  86239. barStyle: function barStyle() {
  86240. var style = {
  86241. visibility: 'hidden',
  86242. width: String(this.barWidth) + 'px'
  86243. };
  86244. if (this.type === 'line') style.visibility = 'visible';
  86245. if (this.animated) {
  86246. style.transform = 'translate3d(' + String(this.barOffset) + 'px, 0px, 0px)';
  86247. } else {
  86248. style.left = String(this.barOffset) + 'px';
  86249. }
  86250. return style;
  86251. },
  86252. arrowType: function arrowType() {
  86253. var type = 'ios-close';
  86254. if (this.$IVIEW) {
  86255. if (this.$IVIEW.tabs.customCloseIcon) {
  86256. type = '';
  86257. } else if (this.$IVIEW.tabs.closeIcon) {
  86258. type = this.$IVIEW.tabs.closeIcon;
  86259. }
  86260. }
  86261. return type;
  86262. },
  86263. customArrowType: function customArrowType() {
  86264. var type = '';
  86265. if (this.$IVIEW) {
  86266. if (this.$IVIEW.tabs.customCloseIcon) {
  86267. type = this.$IVIEW.tabs.customCloseIcon;
  86268. }
  86269. }
  86270. return type;
  86271. },
  86272. arrowSize: function arrowSize() {
  86273. var size = '';
  86274. if (this.$IVIEW) {
  86275. if (this.$IVIEW.tabs.closeIconSize) {
  86276. size = this.$IVIEW.tabs.closeIconSize;
  86277. }
  86278. }
  86279. return size;
  86280. }
  86281. },
  86282. methods: {
  86283. getTabs: function getTabs() {
  86284. var _this = this;
  86285. var AllTabPanes = (0, _assist.findComponentsDownward)(this, 'TabPane');
  86286. var TabPanes = [];
  86287. AllTabPanes.forEach(function (item) {
  86288. (0, _newArrowCheck3.default)(this, _this);
  86289. if (item.tab && this.name) {
  86290. if (item.tab === this.name) {
  86291. TabPanes.push(item);
  86292. }
  86293. } else {
  86294. TabPanes.push(item);
  86295. }
  86296. }.bind(this));
  86297. TabPanes.sort(function (a, b) {
  86298. (0, _newArrowCheck3.default)(this, _this);
  86299. if (a.index && b.index) {
  86300. return a.index > b.index ? 1 : -1;
  86301. }
  86302. }.bind(this));
  86303. return TabPanes;
  86304. },
  86305. updateNav: function updateNav() {
  86306. var _this2 = this;
  86307. this.navList = [];
  86308. this.getTabs().forEach(function (pane, index) {
  86309. (0, _newArrowCheck3.default)(this, _this2);
  86310. this.navList.push({
  86311. labelType: (0, _typeof3.default)(pane.label),
  86312. label: pane.label,
  86313. icon: pane.icon || '',
  86314. name: pane.currentName || index,
  86315. disabled: pane.disabled,
  86316. closable: pane.closable,
  86317. contextMenu: pane.contextMenu
  86318. });
  86319. if (!pane.currentName) pane.currentName = index;
  86320. if (index === 0) {
  86321. if (!this.activeKey) this.activeKey = pane.currentName || index;
  86322. }
  86323. }.bind(this));
  86324. this.updateStatus();
  86325. this.updateBar();
  86326. },
  86327. updateBar: function updateBar() {
  86328. var _this3 = this;
  86329. this.$nextTick(function () {
  86330. (0, _newArrowCheck3.default)(this, _this3);
  86331. var index = this.getTabIndex(this.activeKey);
  86332. if (!this.$refs.nav) return;
  86333. var prevTabs = this.$refs.nav.querySelectorAll('.' + prefixCls + '-tab');
  86334. var tab = prevTabs[index];
  86335. this.barWidth = tab ? parseFloat(tab.offsetWidth) : 0;
  86336. if (index > 0) {
  86337. var offset = 0;
  86338. var gutter = this.size === 'small' ? 0 : 16;
  86339. for (var i = 0; i < index; i++) {
  86340. offset += parseFloat(prevTabs[i].offsetWidth) + gutter;
  86341. }
  86342. this.barOffset = offset;
  86343. } else {
  86344. this.barOffset = 0;
  86345. }
  86346. this.updateNavScroll();
  86347. }.bind(this));
  86348. },
  86349. updateStatus: function updateStatus() {
  86350. var _this4 = this;
  86351. var tabs = this.getTabs();
  86352. tabs.forEach(function (tab) {
  86353. (0, _newArrowCheck3.default)(this, _this4);
  86354. return tab.show = tab.currentName === this.activeKey || this.animated;
  86355. }.bind(this));
  86356. },
  86357. tabCls: function tabCls(item) {
  86358. var _ref4;
  86359. return [prefixCls + '-tab', (_ref4 = {}, (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-disabled', item.disabled), (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-active', item.name === this.activeKey), (0, _defineProperty3.default)(_ref4, prefixCls + '-tab-focused', item.name === this.focusedKey), _ref4)];
  86360. },
  86361. handleChange: function handleChange(index) {
  86362. var _this5 = this;
  86363. if (this.transitioning) return;
  86364. this.transitioning = true;
  86365. setTimeout(function () {
  86366. (0, _newArrowCheck3.default)(this, _this5);
  86367. return this.transitioning = false;
  86368. }.bind(this), transitionTime);
  86369. var nav = this.navList[index];
  86370. if (!nav || nav.disabled) return;
  86371. this.activeKey = nav.name;
  86372. this.$emit('input', nav.name);
  86373. this.$emit('on-click', nav.name);
  86374. },
  86375. handleDblclick: function handleDblclick(index) {
  86376. var nav = this.navList[index];
  86377. if (!nav || nav.disabled) return;
  86378. this.$emit('on-dblclick', nav.name);
  86379. },
  86380. handleContextmenu: function handleContextmenu(index, event) {
  86381. var _this6 = this;
  86382. if (this.contextMenuVisible) this.handleClickContextMenuOutside();
  86383. this.$nextTick(function () {
  86384. (0, _newArrowCheck3.default)(this, _this6);
  86385. var nav = this.navList[index];
  86386. if (!nav || nav.disabled || !nav.contextMenu) return;
  86387. event.preventDefault();
  86388. var $TabsWrap = this.$refs.tabsWrap;
  86389. var TabsBounding = $TabsWrap.getBoundingClientRect();
  86390. var position = {
  86391. left: event.clientX - TabsBounding.left + 'px',
  86392. top: event.clientY - TabsBounding.top + 'px'
  86393. };
  86394. this.contextMenuStyles = position;
  86395. this.contextMenuVisible = true;
  86396. this.$emit('on-contextmenu', nav, event, position);
  86397. }.bind(this));
  86398. },
  86399. handleClickContextMenuOutside: function handleClickContextMenuOutside() {
  86400. this.contextMenuVisible = false;
  86401. },
  86402. handlePreventSelect: function handlePreventSelect(index, event) {
  86403. var nav = this.navList[index];
  86404. if (!nav || nav.disabled || !nav.contextMenu) return;
  86405. event.preventDefault();
  86406. },
  86407. handleTabKeyNavigation: function handleTabKeyNavigation(e) {
  86408. if (e.keyCode !== 37 && e.keyCode !== 39) return;
  86409. var direction = e.keyCode === 39 ? 1 : -1;
  86410. var nextTab = getNextTab(this.navList, this.focusedKey, direction);
  86411. this.focusedKey = nextTab.name;
  86412. },
  86413. handleTabKeyboardSelect: function handleTabKeyboardSelect() {
  86414. var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  86415. if (init) return;
  86416. var focused = this.focusedKey || 0;
  86417. var index = this.getTabIndex(focused);
  86418. this.handleChange(index);
  86419. },
  86420. handleRemove: function handleRemove(index) {
  86421. var _this7 = this;
  86422. if (!this.beforeRemove) {
  86423. return this.handleRemoveTab(index);
  86424. }
  86425. var before = this.beforeRemove(index);
  86426. if (before && before.then) {
  86427. before.then(function () {
  86428. (0, _newArrowCheck3.default)(this, _this7);
  86429. this.handleRemoveTab(index);
  86430. }.bind(this));
  86431. } else {
  86432. this.handleRemoveTab(index);
  86433. }
  86434. },
  86435. handleRemoveTab: function handleRemoveTab(index) {
  86436. var _this8 = this;
  86437. var tabs = this.getTabs();
  86438. var tab = tabs[index];
  86439. tab.$destroy();
  86440. if (tab.currentName === this.activeKey) {
  86441. var newTabs = this.getTabs();
  86442. var activeKey = -1;
  86443. if (newTabs.length) {
  86444. var leftNoDisabledTabs = tabs.filter(function (item, itemIndex) {
  86445. (0, _newArrowCheck3.default)(this, _this8);
  86446. return !item.disabled && itemIndex < index;
  86447. }.bind(this));
  86448. var rightNoDisabledTabs = tabs.filter(function (item, itemIndex) {
  86449. (0, _newArrowCheck3.default)(this, _this8);
  86450. return !item.disabled && itemIndex > index;
  86451. }.bind(this));
  86452. if (rightNoDisabledTabs.length) {
  86453. activeKey = rightNoDisabledTabs[0].currentName;
  86454. } else if (leftNoDisabledTabs.length) {
  86455. activeKey = leftNoDisabledTabs[leftNoDisabledTabs.length - 1].currentName;
  86456. } else {
  86457. activeKey = newTabs[0].currentName;
  86458. }
  86459. }
  86460. this.activeKey = activeKey;
  86461. this.$emit('input', activeKey);
  86462. }
  86463. this.$emit('on-tab-remove', tab.currentName);
  86464. this.updateNav();
  86465. },
  86466. showClose: function showClose(item) {
  86467. if (this.type === 'card') {
  86468. if (item.closable !== null) {
  86469. return item.closable;
  86470. } else {
  86471. return this.closable;
  86472. }
  86473. } else {
  86474. return false;
  86475. }
  86476. },
  86477. scrollPrev: function scrollPrev() {
  86478. var containerWidth = this.$refs.navScroll.offsetWidth;
  86479. var currentOffset = this.getCurrentScrollOffset();
  86480. if (!currentOffset) return;
  86481. var newOffset = currentOffset > containerWidth ? currentOffset - containerWidth : 0;
  86482. this.setOffset(newOffset);
  86483. },
  86484. scrollNext: function scrollNext() {
  86485. var navWidth = this.$refs.nav.offsetWidth;
  86486. var containerWidth = this.$refs.navScroll.offsetWidth;
  86487. var currentOffset = this.getCurrentScrollOffset();
  86488. if (navWidth - currentOffset <= containerWidth) return;
  86489. var newOffset = navWidth - currentOffset > containerWidth * 2 ? currentOffset + containerWidth : navWidth - containerWidth;
  86490. this.setOffset(newOffset);
  86491. },
  86492. getCurrentScrollOffset: function getCurrentScrollOffset() {
  86493. var navStyle = this.navStyle;
  86494. return navStyle.transform ? Number(navStyle.transform.match(/translateX\(-(\d+(\.\d+)*)px\)/)[1]) : 0;
  86495. },
  86496. getTabIndex: function getTabIndex(name) {
  86497. var _this9 = this;
  86498. return this.navList.findIndex(function (nav) {
  86499. (0, _newArrowCheck3.default)(this, _this9);
  86500. return nav.name === name;
  86501. }.bind(this));
  86502. },
  86503. setOffset: function setOffset(value) {
  86504. this.navStyle.transform = 'translateX(-' + String(value) + 'px)';
  86505. },
  86506. scrollToActiveTab: function scrollToActiveTab() {
  86507. if (!this.scrollable) return;
  86508. var nav = this.$refs.nav;
  86509. var activeTab = this.$el.querySelector('.' + prefixCls + '-tab-active');
  86510. if (!activeTab) return;
  86511. var navScroll = this.$refs.navScroll;
  86512. var activeTabBounding = activeTab.getBoundingClientRect();
  86513. var navScrollBounding = navScroll.getBoundingClientRect();
  86514. var navBounding = nav.getBoundingClientRect();
  86515. var currentOffset = this.getCurrentScrollOffset();
  86516. var newOffset = currentOffset;
  86517. if (navBounding.right < navScrollBounding.right) {
  86518. newOffset = nav.offsetWidth - navScrollBounding.width;
  86519. }
  86520. if (activeTabBounding.left < navScrollBounding.left) {
  86521. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  86522. } else if (activeTabBounding.right > navScrollBounding.right) {
  86523. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  86524. }
  86525. if (currentOffset !== newOffset) {
  86526. this.setOffset(Math.max(newOffset, 0));
  86527. }
  86528. },
  86529. updateNavScroll: function updateNavScroll() {
  86530. var navWidth = this.$refs.nav.offsetWidth;
  86531. var containerWidth = this.$refs.navScroll.offsetWidth;
  86532. var currentOffset = this.getCurrentScrollOffset();
  86533. if (containerWidth < navWidth) {
  86534. this.scrollable = true;
  86535. if (navWidth - currentOffset < containerWidth) {
  86536. this.setOffset(navWidth - containerWidth);
  86537. }
  86538. } else {
  86539. this.scrollable = false;
  86540. if (currentOffset > 0) {
  86541. this.setOffset(0);
  86542. }
  86543. }
  86544. },
  86545. handleScroll: function handleScroll(e) {
  86546. e.preventDefault();
  86547. e.stopPropagation();
  86548. var type = e.type;
  86549. var delta = 0;
  86550. if (type === 'DOMMouseScroll' || type === 'mousewheel') {
  86551. delta = e.wheelDelta ? e.wheelDelta : -(e.detail || 0) * 40;
  86552. }
  86553. if (delta > 0) {
  86554. this.scrollPrev();
  86555. } else {
  86556. this.scrollNext();
  86557. }
  86558. },
  86559. handleResize: function handleResize() {
  86560. this.updateNavScroll();
  86561. },
  86562. isInsideHiddenElement: function isInsideHiddenElement() {
  86563. var parentNode = this.$el.parentNode;
  86564. while (parentNode && parentNode !== document.body) {
  86565. if (parentNode.style && parentNode.style.display === 'none') {
  86566. return parentNode;
  86567. }
  86568. parentNode = parentNode.parentNode;
  86569. }
  86570. return false;
  86571. },
  86572. updateVisibility: function updateVisibility(index) {
  86573. var _this10 = this;
  86574. [].concat((0, _toConsumableArray3.default)(this.$refs.panes.querySelectorAll('.' + prefixCls + '-tabpane'))).forEach(function (el, i) {
  86575. (0, _newArrowCheck3.default)(this, _this10);
  86576. if (index === i) {
  86577. [].concat((0, _toConsumableArray3.default)(el.children)).filter(function (child) {
  86578. (0, _newArrowCheck3.default)(this, _this10);
  86579. return child.classList.contains(prefixCls + '-tabpane');
  86580. }.bind(this)).forEach(function (child) {
  86581. (0, _newArrowCheck3.default)(this, _this10);
  86582. return child.style.visibility = 'visible';
  86583. }.bind(this));
  86584. if (this.captureFocus) setTimeout(function () {
  86585. (0, _newArrowCheck3.default)(this, _this10);
  86586. return focusFirst(el, el);
  86587. }.bind(this), transitionTime);
  86588. } else {
  86589. setTimeout(function () {
  86590. (0, _newArrowCheck3.default)(this, _this10);
  86591. [].concat((0, _toConsumableArray3.default)(el.children)).filter(function (child) {
  86592. (0, _newArrowCheck3.default)(this, _this10);
  86593. return child.classList.contains(prefixCls + '-tabpane');
  86594. }.bind(this)).forEach(function (child) {
  86595. (0, _newArrowCheck3.default)(this, _this10);
  86596. return child.style.visibility = 'hidden';
  86597. }.bind(this));
  86598. }.bind(this), transitionTime);
  86599. }
  86600. }.bind(this));
  86601. },
  86602. handleDrag: function handleDrag(index, event) {
  86603. var nav = this.navList[index];
  86604. if (nav) {
  86605. event.dataTransfer.setData('tab-name', nav.name);
  86606. }
  86607. },
  86608. handleDrop: function handleDrop(index, event) {
  86609. var _this11 = this;
  86610. var nav = this.navList[index];
  86611. if (nav) {
  86612. var dragName = event.dataTransfer.getData('tab-name');
  86613. event.preventDefault();
  86614. var navNames = this.navList.map(function (item) {
  86615. (0, _newArrowCheck3.default)(this, _this11);
  86616. return item.name;
  86617. }.bind(this));
  86618. var a = parseInt(navNames.findIndex(function (item) {
  86619. (0, _newArrowCheck3.default)(this, _this11);
  86620. return item === dragName;
  86621. }.bind(this)));
  86622. var b = parseInt(navNames.findIndex(function (item) {
  86623. (0, _newArrowCheck3.default)(this, _this11);
  86624. return item === nav.name;
  86625. }.bind(this)));
  86626. navNames.splice.apply(navNames, [b, 1].concat((0, _toConsumableArray3.default)(navNames.splice(a, 1, navNames[b]))));
  86627. this.$emit('on-drag-drop', dragName, nav.name, a, b, navNames);
  86628. }
  86629. }
  86630. },
  86631. watch: {
  86632. value: function value(val) {
  86633. this.activeKey = val;
  86634. this.focusedKey = val;
  86635. },
  86636. activeKey: function activeKey(val) {
  86637. var _this12 = this;
  86638. this.focusedKey = val;
  86639. this.updateBar();
  86640. this.updateStatus();
  86641. this.broadcast('Table', 'on-visible-change', true);
  86642. this.$nextTick(function () {
  86643. (0, _newArrowCheck3.default)(this, _this12);
  86644. this.scrollToActiveTab();
  86645. }.bind(this));
  86646. var nextIndex = Math.max(this.getTabIndex(this.focusedKey), 0);
  86647. this.updateVisibility(nextIndex);
  86648. }
  86649. },
  86650. mounted: function mounted() {
  86651. var _this13 = this;
  86652. this.showSlot = this.$slots.extra !== undefined;
  86653. this.observer = (0, _elementResizeDetector2.default)();
  86654. this.observer.listenTo(this.$refs.navWrap, this.handleResize);
  86655. var hiddenParentNode = this.isInsideHiddenElement();
  86656. if (hiddenParentNode) {
  86657. this.mutationObserver = new _assist.MutationObserver(function () {
  86658. (0, _newArrowCheck3.default)(this, _this13);
  86659. if (hiddenParentNode.style.display !== 'none') {
  86660. this.updateBar();
  86661. this.mutationObserver.disconnect();
  86662. }
  86663. }.bind(this));
  86664. this.mutationObserver.observe(hiddenParentNode, { attributes: true, childList: true, characterData: true, attributeFilter: ['style'] });
  86665. }
  86666. this.handleTabKeyboardSelect(true);
  86667. this.updateVisibility(this.getTabIndex(this.activeKey));
  86668. },
  86669. beforeDestroy: function beforeDestroy() {
  86670. this.observer.removeListener(this.$refs.navWrap, this.handleResize);
  86671. if (this.mutationObserver) this.mutationObserver.disconnect();
  86672. }
  86673. };
  86674. /***/ }),
  86675. /* 243 */
  86676. /***/ (function(module, exports, __webpack_require__) {
  86677. "use strict";
  86678. Object.defineProperty(exports, "__esModule", {
  86679. value: true
  86680. });
  86681. var prefixCls = 'ivu-tabs-tabpane';
  86682. exports.default = {
  86683. name: 'TabPane',
  86684. inject: ['TabsInstance'],
  86685. props: {
  86686. name: {
  86687. type: String
  86688. },
  86689. label: {
  86690. type: [String, Function],
  86691. default: ''
  86692. },
  86693. icon: {
  86694. type: String
  86695. },
  86696. disabled: {
  86697. type: Boolean,
  86698. default: false
  86699. },
  86700. closable: {
  86701. type: Boolean,
  86702. default: null
  86703. },
  86704. tab: {
  86705. type: String
  86706. },
  86707. index: {
  86708. type: Number
  86709. },
  86710. contextMenu: {
  86711. type: Boolean,
  86712. default: false
  86713. }
  86714. },
  86715. data: function data() {
  86716. return {
  86717. prefixCls: prefixCls,
  86718. show: true,
  86719. currentName: this.name
  86720. };
  86721. },
  86722. computed: {
  86723. contentStyle: function contentStyle() {
  86724. return {
  86725. visibility: this.TabsInstance.activeKey !== this.currentName ? 'hidden' : 'visible'
  86726. };
  86727. }
  86728. },
  86729. methods: {
  86730. updateNav: function updateNav() {
  86731. this.TabsInstance.updateNav();
  86732. }
  86733. },
  86734. watch: {
  86735. name: function name(val) {
  86736. this.currentName = val;
  86737. this.updateNav();
  86738. },
  86739. label: function label() {
  86740. this.updateNav();
  86741. },
  86742. icon: function icon() {
  86743. this.updateNav();
  86744. },
  86745. disabled: function disabled() {
  86746. this.updateNav();
  86747. }
  86748. },
  86749. mounted: function mounted() {
  86750. this.updateNav();
  86751. },
  86752. destroyed: function destroyed() {
  86753. this.updateNav();
  86754. }
  86755. };
  86756. /***/ }),
  86757. /* 244 */
  86758. /***/ (function(module, exports, __webpack_require__) {
  86759. "use strict";
  86760. Object.defineProperty(exports, "__esModule", {
  86761. value: true
  86762. });
  86763. var _defineProperty2 = __webpack_require__(2);
  86764. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  86765. var _icon = __webpack_require__(19);
  86766. var _icon2 = _interopRequireDefault(_icon);
  86767. var _assist = __webpack_require__(3);
  86768. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  86769. var prefixCls = 'ivu-tag';
  86770. var initColorList = ['default', 'primary', 'success', 'warning', 'error', 'blue', 'green', 'red', 'yellow', 'pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
  86771. var colorList = ['pink', 'magenta', 'volcano', 'orange', 'gold', 'lime', 'cyan', 'geekblue', 'purple'];
  86772. exports.default = {
  86773. name: 'Tag',
  86774. components: { Icon: _icon2.default },
  86775. props: {
  86776. closable: {
  86777. type: Boolean,
  86778. default: false
  86779. },
  86780. checkable: {
  86781. type: Boolean,
  86782. default: false
  86783. },
  86784. checked: {
  86785. type: Boolean,
  86786. default: true
  86787. },
  86788. color: {
  86789. type: String,
  86790. default: 'default'
  86791. },
  86792. type: {
  86793. validator: function validator(value) {
  86794. return (0, _assist.oneOf)(value, ['border', 'dot']);
  86795. }
  86796. },
  86797. name: {
  86798. type: [String, Number]
  86799. },
  86800. fade: {
  86801. type: Boolean,
  86802. default: true
  86803. },
  86804. size: {
  86805. validator: function validator(value) {
  86806. return (0, _assist.oneOf)(value, ['default', 'medium', 'large']);
  86807. },
  86808. default: 'default'
  86809. }
  86810. },
  86811. data: function data() {
  86812. return {
  86813. isChecked: this.checked
  86814. };
  86815. },
  86816. computed: {
  86817. classes: function classes() {
  86818. var _ref;
  86819. return ['' + prefixCls, prefixCls + '-size-' + String(this.size), (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.color), !!this.color && (0, _assist.oneOf)(this.color, initColorList)), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-closable', this.closable), (0, _defineProperty3.default)(_ref, prefixCls + '-checked', this.isChecked), _ref)];
  86820. },
  86821. wraperStyles: function wraperStyles() {
  86822. return (0, _assist.oneOf)(this.color, initColorList) ? {} : { background: this.isChecked ? this.defaultTypeColor : 'transparent', borderWidth: '1px', borderStyle: 'solid', borderColor: this.type !== 'dot' && this.type !== 'border' && this.isChecked ? this.borderColor : this.lineColor, color: this.lineColor };
  86823. },
  86824. textClasses: function textClasses() {
  86825. return [prefixCls + '-text', this.type === 'border' ? (0, _assist.oneOf)(this.color, initColorList) ? prefixCls + '-color-' + String(this.color) : '' : '', this.type !== 'dot' && this.type !== 'border' && this.color !== 'default' ? this.isChecked && colorList.indexOf(this.color) < 0 ? prefixCls + '-color-white' : '' : ''];
  86826. },
  86827. dotClasses: function dotClasses() {
  86828. return prefixCls + '-dot-inner';
  86829. },
  86830. iconClass: function iconClass() {
  86831. if (this.type === 'dot') {
  86832. return '';
  86833. } else if (this.type === 'border') {
  86834. return (0, _assist.oneOf)(this.color, initColorList) ? prefixCls + '-color-' + String(this.color) : '';
  86835. } else {
  86836. return this.color !== undefined ? this.color === 'default' ? '' : 'rgb(255, 255, 255)' : '';
  86837. }
  86838. },
  86839. showDot: function showDot() {
  86840. return !!this.type && this.type === 'dot';
  86841. },
  86842. lineColor: function lineColor() {
  86843. if (this.type === 'dot') {
  86844. return '';
  86845. } else if (this.type === 'border') {
  86846. return this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '';
  86847. } else {
  86848. return this.color !== undefined ? this.color === 'default' ? '' : 'rgb(255, 255, 255)' : '';
  86849. }
  86850. },
  86851. borderColor: function borderColor() {
  86852. return this.color !== undefined ? this.color === 'default' ? '' : this.color : '';
  86853. },
  86854. dotColor: function dotColor() {
  86855. return this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '';
  86856. },
  86857. textColorStyle: function textColorStyle() {
  86858. return (0, _assist.oneOf)(this.color, initColorList) ? {} : this.type !== 'dot' && this.type !== 'border' ? this.isChecked ? { color: this.lineColor } : {} : { color: this.lineColor };
  86859. },
  86860. bgColorStyle: function bgColorStyle() {
  86861. return (0, _assist.oneOf)(this.color, initColorList) ? {} : { background: this.dotColor };
  86862. },
  86863. defaultTypeColor: function defaultTypeColor() {
  86864. return this.type !== 'dot' && this.type !== 'border' ? this.color !== undefined ? (0, _assist.oneOf)(this.color, initColorList) ? '' : this.color : '' : '';
  86865. }
  86866. },
  86867. methods: {
  86868. close: function close(event) {
  86869. if (this.name === undefined) {
  86870. this.$emit('on-close', event);
  86871. } else {
  86872. this.$emit('on-close', event, this.name);
  86873. }
  86874. },
  86875. check: function check() {
  86876. if (!this.checkable) return;
  86877. var checked = !this.isChecked;
  86878. this.isChecked = checked;
  86879. if (this.name === undefined) {
  86880. this.$emit('on-change', checked);
  86881. } else {
  86882. this.$emit('on-change', checked, this.name);
  86883. }
  86884. }
  86885. },
  86886. watch: {
  86887. checked: function checked(val) {
  86888. this.isChecked = val;
  86889. }
  86890. }
  86891. };
  86892. /***/ }),
  86893. /* 245 */
  86894. /***/ (function(module, exports, __webpack_require__) {
  86895. "use strict";
  86896. Object.defineProperty(exports, "__esModule", {
  86897. value: true
  86898. });
  86899. var _newArrowCheck2 = __webpack_require__(1);
  86900. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  86901. var _typeof2 = __webpack_require__(27);
  86902. var _typeof3 = _interopRequireDefault(_typeof2);
  86903. var _defineProperty2 = __webpack_require__(2);
  86904. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  86905. var _vue = __webpack_require__(16);
  86906. var _vue2 = _interopRequireDefault(_vue);
  86907. var _assist = __webpack_require__(3);
  86908. var _locale = __webpack_require__(6);
  86909. var _locale2 = _interopRequireDefault(_locale);
  86910. var _time = __webpack_require__(592);
  86911. var _time2 = _interopRequireDefault(_time);
  86912. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  86913. var isServer = _vue2.default.prototype.$isServer;
  86914. var prefixCls = 'ivu-time';
  86915. exports.default = {
  86916. name: 'Time',
  86917. mixins: [_locale2.default],
  86918. props: {
  86919. time: {
  86920. type: [Number, Date, String],
  86921. required: true
  86922. },
  86923. type: {
  86924. type: String,
  86925. validator: function validator(value) {
  86926. return (0, _assist.oneOf)(value, ['relative', 'date', 'datetime']);
  86927. },
  86928. default: 'relative'
  86929. },
  86930. hash: {
  86931. type: String,
  86932. default: ''
  86933. },
  86934. interval: {
  86935. type: Number,
  86936. default: 60
  86937. }
  86938. },
  86939. data: function data() {
  86940. return {
  86941. date: ''
  86942. };
  86943. },
  86944. computed: {
  86945. classes: function classes() {
  86946. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-with-hash', this.hash)];
  86947. }
  86948. },
  86949. watch: {
  86950. time: function time() {
  86951. if (!isServer) this.setTime();
  86952. }
  86953. },
  86954. methods: {
  86955. handleClick: function handleClick() {
  86956. if (this.hash !== '') window.location.hash = this.hash;
  86957. },
  86958. setTime: function setTime() {
  86959. var type = (0, _typeof3.default)(this.time);
  86960. var time = void 0;
  86961. if (type === 'number') {
  86962. var timestamp = this.time.toString().length > 10 ? this.time : this.time * 1000;
  86963. time = new Date(timestamp).getTime();
  86964. } else if (type === 'object') {
  86965. time = this.time.getTime();
  86966. } else if (type === 'string') {
  86967. time = new Date(this.time).getTime();
  86968. }
  86969. if (this.type === 'relative') {
  86970. this.date = (0, _time2.default)(time, this.t);
  86971. } else {
  86972. var date = new Date(this.time);
  86973. var year = date.getFullYear();
  86974. var month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1;
  86975. var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
  86976. var hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours();
  86977. var minute = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
  86978. var second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
  86979. if (this.type === 'datetime') {
  86980. this.date = String(year) + '-' + String(month) + '-' + String(day) + ' ' + String(hour) + ':' + String(minute) + ':' + String(second);
  86981. } else if (this.type === 'date') {
  86982. this.date = String(year) + '-' + String(month) + '-' + String(day);
  86983. }
  86984. }
  86985. }
  86986. },
  86987. mounted: function mounted() {
  86988. var _this = this;
  86989. this.setTime();
  86990. if (isServer) return;
  86991. this.timer = setInterval(function () {
  86992. (0, _newArrowCheck3.default)(this, _this);
  86993. this.setTime();
  86994. }.bind(this), 1000 * this.interval);
  86995. },
  86996. beforeDestroy: function beforeDestroy() {
  86997. if (this.timer) clearInterval(this.timer);
  86998. }
  86999. };
  87000. /***/ }),
  87001. /* 246 */
  87002. /***/ (function(module, exports, __webpack_require__) {
  87003. "use strict";
  87004. Object.defineProperty(exports, "__esModule", {
  87005. value: true
  87006. });
  87007. var _defineProperty2 = __webpack_require__(2);
  87008. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  87009. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87010. var prefixCls = 'ivu-timeline';
  87011. exports.default = {
  87012. name: 'Timeline',
  87013. props: {
  87014. pending: {
  87015. type: Boolean,
  87016. default: false
  87017. }
  87018. },
  87019. computed: {
  87020. classes: function classes() {
  87021. return ['' + prefixCls, (0, _defineProperty3.default)({}, prefixCls + '-pending', this.pending)];
  87022. }
  87023. }
  87024. };
  87025. /***/ }),
  87026. /* 247 */
  87027. /***/ (function(module, exports, __webpack_require__) {
  87028. "use strict";
  87029. Object.defineProperty(exports, "__esModule", {
  87030. value: true
  87031. });
  87032. var _defineProperty2 = __webpack_require__(2);
  87033. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  87034. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87035. var prefixCls = 'ivu-timeline';
  87036. exports.default = {
  87037. name: 'TimelineItem',
  87038. props: {
  87039. color: {
  87040. type: String,
  87041. default: 'blue'
  87042. }
  87043. },
  87044. data: function data() {
  87045. return {
  87046. dot: false
  87047. };
  87048. },
  87049. mounted: function mounted() {
  87050. this.dot = this.$refs.dot.innerHTML.length ? true : false;
  87051. },
  87052. computed: {
  87053. itemClasses: function itemClasses() {
  87054. return prefixCls + '-item';
  87055. },
  87056. tailClasses: function tailClasses() {
  87057. return prefixCls + '-item-tail';
  87058. },
  87059. headClasses: function headClasses() {
  87060. var _ref;
  87061. return [prefixCls + '-item-head', (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-item-head-custom', this.dot), (0, _defineProperty3.default)(_ref, prefixCls + '-item-head-' + String(this.color), this.headColorShow), _ref)];
  87062. },
  87063. headColorShow: function headColorShow() {
  87064. return this.color == 'blue' || this.color == 'red' || this.color == 'green';
  87065. },
  87066. customColor: function customColor() {
  87067. var style = {};
  87068. if (this.color) {
  87069. if (!this.headColorShow) {
  87070. style = {
  87071. 'color': this.color,
  87072. 'border-color': this.color
  87073. };
  87074. }
  87075. }
  87076. return style;
  87077. },
  87078. contentClasses: function contentClasses() {
  87079. return prefixCls + '-item-content';
  87080. }
  87081. }
  87082. };
  87083. /***/ }),
  87084. /* 248 */
  87085. /***/ (function(module, exports, __webpack_require__) {
  87086. "use strict";
  87087. Object.defineProperty(exports, "__esModule", {
  87088. value: true
  87089. });
  87090. var _toConsumableArray2 = __webpack_require__(17);
  87091. var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
  87092. var _newArrowCheck2 = __webpack_require__(1);
  87093. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  87094. var _list = __webpack_require__(604);
  87095. var _list2 = _interopRequireDefault(_list);
  87096. var _operation = __webpack_require__(608);
  87097. var _operation2 = _interopRequireDefault(_operation);
  87098. var _locale = __webpack_require__(6);
  87099. var _locale2 = _interopRequireDefault(_locale);
  87100. var _emitter = __webpack_require__(4);
  87101. var _emitter2 = _interopRequireDefault(_emitter);
  87102. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87103. var prefixCls = 'ivu-transfer';
  87104. exports.default = {
  87105. name: 'Transfer',
  87106. mixins: [_emitter2.default, _locale2.default],
  87107. render: function render(h) {
  87108. var _this2 = this;
  87109. function cloneVNode(vnode) {
  87110. var _this = this;
  87111. var clonedChildren = vnode.children && vnode.children.map(function (vnode) {
  87112. (0, _newArrowCheck3.default)(this, _this);
  87113. return cloneVNode(vnode);
  87114. }.bind(this));
  87115. var cloned = h(vnode.tag, vnode.data, clonedChildren);
  87116. cloned.text = vnode.text;
  87117. cloned.isComment = vnode.isComment;
  87118. cloned.componentOptions = vnode.componentOptions;
  87119. cloned.elm = vnode.elm;
  87120. cloned.context = vnode.context;
  87121. cloned.ns = vnode.ns;
  87122. cloned.isStatic = vnode.isStatic;
  87123. cloned.key = vnode.key;
  87124. return cloned;
  87125. }
  87126. var vNodes = this.$slots.default === undefined ? [] : this.$slots.default;
  87127. var clonedVNodes = this.$slots.default === undefined ? [] : vNodes.map(function (vnode) {
  87128. (0, _newArrowCheck3.default)(this, _this2);
  87129. return cloneVNode(vnode);
  87130. }.bind(this));
  87131. return h('div', {
  87132. 'class': this.classes
  87133. }, [h(_list2.default, {
  87134. ref: 'left',
  87135. props: {
  87136. prefixCls: this.prefixCls + '-list',
  87137. data: this.leftData,
  87138. renderFormat: this.renderFormat,
  87139. checkedKeys: this.leftCheckedKeys,
  87140. validKeysCount: this.leftValidKeysCount,
  87141. listStyle: this.listStyle,
  87142. title: this.localeTitles[0],
  87143. filterable: this.filterable,
  87144. filterPlaceholder: this.localeFilterPlaceholder,
  87145. filterMethod: this.filterMethod,
  87146. notFoundText: this.localeNotFoundText
  87147. },
  87148. on: {
  87149. 'on-checked-keys-change': this.handleLeftCheckedKeysChange
  87150. }
  87151. }, vNodes), h(_operation2.default, {
  87152. props: {
  87153. prefixCls: this.prefixCls,
  87154. operations: this.operations,
  87155. leftActive: this.leftValidKeysCount > 0,
  87156. rightActive: this.rightValidKeysCount > 0,
  87157. reverseOperation: this.reverseOperation
  87158. }
  87159. }), h(_list2.default, {
  87160. ref: 'right',
  87161. props: {
  87162. prefixCls: this.prefixCls + '-list',
  87163. data: this.rightData,
  87164. renderFormat: this.renderFormat,
  87165. checkedKeys: this.rightCheckedKeys,
  87166. validKeysCount: this.rightValidKeysCount,
  87167. listStyle: this.listStyle,
  87168. title: this.localeTitles[1],
  87169. filterable: this.filterable,
  87170. filterPlaceholder: this.localeFilterPlaceholder,
  87171. filterMethod: this.filterMethod,
  87172. notFoundText: this.localeNotFoundText
  87173. },
  87174. on: {
  87175. 'on-checked-keys-change': this.handleRightCheckedKeysChange
  87176. }
  87177. }, clonedVNodes)]);
  87178. },
  87179. props: {
  87180. data: {
  87181. type: Array,
  87182. default: function _default() {
  87183. return [];
  87184. }
  87185. },
  87186. renderFormat: {
  87187. type: Function,
  87188. default: function _default(item) {
  87189. return item.label || item.key;
  87190. }
  87191. },
  87192. targetKeys: {
  87193. type: Array,
  87194. default: function _default() {
  87195. return [];
  87196. }
  87197. },
  87198. selectedKeys: {
  87199. type: Array,
  87200. default: function _default() {
  87201. return [];
  87202. }
  87203. },
  87204. listStyle: {
  87205. type: Object,
  87206. default: function _default() {
  87207. return {};
  87208. }
  87209. },
  87210. titles: {
  87211. type: Array
  87212. },
  87213. operations: {
  87214. type: Array,
  87215. default: function _default() {
  87216. return [];
  87217. }
  87218. },
  87219. filterable: {
  87220. type: Boolean,
  87221. default: false
  87222. },
  87223. filterPlaceholder: {
  87224. type: String
  87225. },
  87226. filterMethod: {
  87227. type: Function,
  87228. default: function _default(data, query) {
  87229. var type = 'label' in data ? 'label' : 'key';
  87230. return data[type].indexOf(query) > -1;
  87231. }
  87232. },
  87233. notFoundText: {
  87234. type: String
  87235. },
  87236. reverseOperation: {
  87237. type: Boolean,
  87238. default: false
  87239. }
  87240. },
  87241. data: function data() {
  87242. return {
  87243. prefixCls: prefixCls,
  87244. leftData: [],
  87245. rightData: [],
  87246. leftCheckedKeys: [],
  87247. rightCheckedKeys: []
  87248. };
  87249. },
  87250. computed: {
  87251. classes: function classes() {
  87252. return ['' + prefixCls];
  87253. },
  87254. leftValidKeysCount: function leftValidKeysCount() {
  87255. return this.getValidKeys('left').length;
  87256. },
  87257. rightValidKeysCount: function rightValidKeysCount() {
  87258. return this.getValidKeys('right').length;
  87259. },
  87260. localeFilterPlaceholder: function localeFilterPlaceholder() {
  87261. if (this.filterPlaceholder === undefined) {
  87262. return this.t('i.transfer.filterPlaceholder');
  87263. } else {
  87264. return this.filterPlaceholder;
  87265. }
  87266. },
  87267. localeNotFoundText: function localeNotFoundText() {
  87268. if (this.notFoundText === undefined) {
  87269. return this.t('i.transfer.notFoundText');
  87270. } else {
  87271. return this.notFoundText;
  87272. }
  87273. },
  87274. localeTitles: function localeTitles() {
  87275. if (this.titles === undefined) {
  87276. return [this.t('i.transfer.titles.source'), this.t('i.transfer.titles.target')];
  87277. } else {
  87278. return this.titles;
  87279. }
  87280. }
  87281. },
  87282. methods: {
  87283. getValidKeys: function getValidKeys(direction) {
  87284. var _this3 = this;
  87285. return this[String(direction) + 'Data'].filter(function (data) {
  87286. (0, _newArrowCheck3.default)(this, _this3);
  87287. return !data.disabled && this[String(direction) + 'CheckedKeys'].indexOf(data.key) > -1;
  87288. }.bind(this)).map(function (data) {
  87289. (0, _newArrowCheck3.default)(this, _this3);
  87290. return data.key;
  87291. }.bind(this));
  87292. },
  87293. splitData: function splitData() {
  87294. var _this4 = this;
  87295. var init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
  87296. this.leftData = [].concat((0, _toConsumableArray3.default)(this.data));
  87297. this.rightData = [];
  87298. if (this.targetKeys.length > 0) {
  87299. this.targetKeys.forEach(function (targetKey) {
  87300. (0, _newArrowCheck3.default)(this, _this4);
  87301. var filteredData = this.leftData.filter(function (data, index) {
  87302. (0, _newArrowCheck3.default)(this, _this4);
  87303. if (data.key === targetKey) {
  87304. this.leftData.splice(index, 1);
  87305. return true;
  87306. }
  87307. return false;
  87308. }.bind(this));
  87309. if (filteredData && filteredData.length > 0) this.rightData.push(filteredData[0]);
  87310. }.bind(this));
  87311. }
  87312. if (init) {
  87313. this.splitSelectedKey();
  87314. }
  87315. },
  87316. splitSelectedKey: function splitSelectedKey() {
  87317. var _this5 = this;
  87318. var selectedKeys = this.selectedKeys;
  87319. if (selectedKeys.length > 0) {
  87320. this.leftCheckedKeys = this.leftData.filter(function (data) {
  87321. (0, _newArrowCheck3.default)(this, _this5);
  87322. return selectedKeys.indexOf(data.key) > -1;
  87323. }.bind(this)).map(function (data) {
  87324. (0, _newArrowCheck3.default)(this, _this5);
  87325. return data.key;
  87326. }.bind(this));
  87327. this.rightCheckedKeys = this.rightData.filter(function (data) {
  87328. (0, _newArrowCheck3.default)(this, _this5);
  87329. return selectedKeys.indexOf(data.key) > -1;
  87330. }.bind(this)).map(function (data) {
  87331. (0, _newArrowCheck3.default)(this, _this5);
  87332. return data.key;
  87333. }.bind(this));
  87334. }
  87335. },
  87336. moveTo: function moveTo(direction) {
  87337. var _this6 = this;
  87338. var targetKeys = this.targetKeys;
  87339. var opposite = direction === 'left' ? 'right' : 'left';
  87340. var moveKeys = this.getValidKeys(opposite);
  87341. var newTargetKeys = direction === 'right' ? moveKeys.concat(targetKeys) : targetKeys.filter(function (targetKey) {
  87342. (0, _newArrowCheck3.default)(this, _this6);
  87343. return !moveKeys.some(function (checkedKey) {
  87344. (0, _newArrowCheck3.default)(this, _this6);
  87345. return targetKey === checkedKey;
  87346. }.bind(this));
  87347. }.bind(this));
  87348. this.$refs[opposite].toggleSelectAll(false);
  87349. this.$emit('on-change', newTargetKeys, direction, moveKeys);
  87350. this.dispatch('FormItem', 'on-form-change', {
  87351. tarketKeys: newTargetKeys,
  87352. direction: direction,
  87353. moveKeys: moveKeys
  87354. });
  87355. },
  87356. handleLeftCheckedKeysChange: function handleLeftCheckedKeysChange(keys) {
  87357. this.leftCheckedKeys = keys;
  87358. },
  87359. handleRightCheckedKeysChange: function handleRightCheckedKeysChange(keys) {
  87360. this.rightCheckedKeys = keys;
  87361. },
  87362. handleCheckedKeys: function handleCheckedKeys() {
  87363. var sourceSelectedKeys = this.getValidKeys('left');
  87364. var targetSelectedKeys = this.getValidKeys('right');
  87365. this.$emit('on-selected-change', sourceSelectedKeys, targetSelectedKeys);
  87366. }
  87367. },
  87368. watch: {
  87369. targetKeys: function targetKeys() {
  87370. this.splitData(false);
  87371. },
  87372. data: function data() {
  87373. this.splitData(false);
  87374. }
  87375. },
  87376. mounted: function mounted() {
  87377. this.splitData(true);
  87378. }
  87379. };
  87380. /***/ }),
  87381. /* 249 */
  87382. /***/ (function(module, exports, __webpack_require__) {
  87383. "use strict";
  87384. Object.defineProperty(exports, "__esModule", {
  87385. value: true
  87386. });
  87387. var _newArrowCheck2 = __webpack_require__(1);
  87388. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  87389. var _defineProperty2 = __webpack_require__(2);
  87390. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  87391. var _search = __webpack_require__(605);
  87392. var _search2 = _interopRequireDefault(_search);
  87393. var _checkbox = __webpack_require__(49);
  87394. var _checkbox2 = _interopRequireDefault(_checkbox);
  87395. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87396. exports.default = {
  87397. name: 'TransferList',
  87398. components: { Search: _search2.default, Checkbox: _checkbox2.default },
  87399. props: {
  87400. prefixCls: String,
  87401. data: Array,
  87402. renderFormat: Function,
  87403. checkedKeys: Array,
  87404. listStyle: Object,
  87405. title: [String, Number],
  87406. filterable: Boolean,
  87407. filterPlaceholder: String,
  87408. filterMethod: Function,
  87409. notFoundText: String,
  87410. validKeysCount: Number
  87411. },
  87412. data: function data() {
  87413. return {
  87414. showItems: [],
  87415. query: '',
  87416. showFooter: true
  87417. };
  87418. },
  87419. watch: {
  87420. data: function data() {
  87421. this.updateFilteredData();
  87422. }
  87423. },
  87424. computed: {
  87425. classes: function classes() {
  87426. return ['' + String(this.prefixCls), (0, _defineProperty3.default)({}, String(this.prefixCls) + '-with-footer', this.showFooter)];
  87427. },
  87428. bodyClasses: function bodyClasses() {
  87429. var _ref2;
  87430. return [String(this.prefixCls) + '-body', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, String(this.prefixCls) + '-body-with-search', this.filterable), (0, _defineProperty3.default)(_ref2, String(this.prefixCls) + '-body-with-footer', this.showFooter), _ref2)];
  87431. },
  87432. count: function count() {
  87433. var validKeysCount = this.validKeysCount;
  87434. return (validKeysCount > 0 ? String(validKeysCount) + '/' : '') + ('' + String(this.data.length));
  87435. },
  87436. checkedAll: function checkedAll() {
  87437. var _this = this;
  87438. return this.filterData.filter(function (data) {
  87439. (0, _newArrowCheck3.default)(this, _this);
  87440. return !data.disabled;
  87441. }.bind(this)).length === this.validKeysCount && this.validKeysCount !== 0;
  87442. },
  87443. checkedAllDisabled: function checkedAllDisabled() {
  87444. var _this2 = this;
  87445. return this.filterData.filter(function (data) {
  87446. (0, _newArrowCheck3.default)(this, _this2);
  87447. return !data.disabled;
  87448. }.bind(this)).length <= 0;
  87449. },
  87450. filterData: function filterData() {
  87451. var _this3 = this;
  87452. return this.showItems.filter(function (item) {
  87453. (0, _newArrowCheck3.default)(this, _this3);
  87454. return this.filterMethod(item, this.query);
  87455. }.bind(this));
  87456. }
  87457. },
  87458. methods: {
  87459. itemClasses: function itemClasses(item) {
  87460. return [String(this.prefixCls) + '-content-item', (0, _defineProperty3.default)({}, String(this.prefixCls) + '-content-item-disabled', item.disabled)];
  87461. },
  87462. showLabel: function showLabel(item) {
  87463. return this.renderFormat(item);
  87464. },
  87465. isCheck: function isCheck(item) {
  87466. var _this4 = this;
  87467. return this.checkedKeys.some(function (key) {
  87468. (0, _newArrowCheck3.default)(this, _this4);
  87469. return key === item.key;
  87470. }.bind(this));
  87471. },
  87472. select: function select(item) {
  87473. if (item.disabled) return;
  87474. var index = this.checkedKeys.indexOf(item.key);
  87475. index > -1 ? this.checkedKeys.splice(index, 1) : this.checkedKeys.push(item.key);
  87476. this.$parent.handleCheckedKeys();
  87477. },
  87478. updateFilteredData: function updateFilteredData() {
  87479. this.showItems = this.data;
  87480. },
  87481. toggleSelectAll: function toggleSelectAll(status) {
  87482. var _this5 = this;
  87483. var keys = status ? this.filterData.filter(function (data) {
  87484. (0, _newArrowCheck3.default)(this, _this5);
  87485. return !data.disabled || this.checkedKeys.indexOf(data.key) > -1;
  87486. }.bind(this)).map(function (data) {
  87487. (0, _newArrowCheck3.default)(this, _this5);
  87488. return data.key;
  87489. }.bind(this)) : this.filterData.filter(function (data) {
  87490. (0, _newArrowCheck3.default)(this, _this5);
  87491. return data.disabled && this.checkedKeys.indexOf(data.key) > -1;
  87492. }.bind(this)).map(function (data) {
  87493. (0, _newArrowCheck3.default)(this, _this5);
  87494. return data.key;
  87495. }.bind(this));
  87496. this.$emit('on-checked-keys-change', keys);
  87497. },
  87498. handleQueryClear: function handleQueryClear() {
  87499. this.query = '';
  87500. },
  87501. handleQueryChange: function handleQueryChange(val) {
  87502. this.query = val;
  87503. }
  87504. },
  87505. created: function created() {
  87506. this.updateFilteredData();
  87507. },
  87508. mounted: function mounted() {
  87509. this.showFooter = this.$slots.default !== undefined;
  87510. }
  87511. };
  87512. /***/ }),
  87513. /* 250 */
  87514. /***/ (function(module, exports, __webpack_require__) {
  87515. "use strict";
  87516. Object.defineProperty(exports, "__esModule", {
  87517. value: true
  87518. });
  87519. var _input = __webpack_require__(38);
  87520. var _input2 = _interopRequireDefault(_input);
  87521. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87522. exports.default = {
  87523. name: 'Search',
  87524. components: { iInput: _input2.default },
  87525. props: {
  87526. prefixCls: String,
  87527. placeholder: String,
  87528. query: String
  87529. },
  87530. data: function data() {
  87531. return {
  87532. currentQuery: this.query
  87533. };
  87534. },
  87535. watch: {
  87536. query: function query(val) {
  87537. this.currentQuery = val;
  87538. },
  87539. currentQuery: function currentQuery(val) {
  87540. this.$emit('on-query-change', val);
  87541. }
  87542. },
  87543. computed: {
  87544. icon: function icon() {
  87545. return this.query === '' ? 'ios-search' : 'ios-close-circle';
  87546. }
  87547. },
  87548. methods: {
  87549. handleClick: function handleClick() {
  87550. if (this.currentQuery === '') return;
  87551. this.currentQuery = '';
  87552. this.$emit('on-query-clear');
  87553. }
  87554. }
  87555. };
  87556. /***/ }),
  87557. /* 251 */
  87558. /***/ (function(module, exports, __webpack_require__) {
  87559. "use strict";
  87560. Object.defineProperty(exports, "__esModule", {
  87561. value: true
  87562. });
  87563. var _button = __webpack_require__(28);
  87564. var _button2 = _interopRequireDefault(_button);
  87565. var _icon = __webpack_require__(8);
  87566. var _icon2 = _interopRequireDefault(_icon);
  87567. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87568. exports.default = {
  87569. name: 'Operation',
  87570. components: { iButton: _button2.default, Icon: _icon2.default },
  87571. props: {
  87572. prefixCls: String,
  87573. operations: Array,
  87574. leftActive: Boolean,
  87575. rightActive: Boolean,
  87576. reverseOperation: Boolean
  87577. },
  87578. methods: {
  87579. moveToLeft: function moveToLeft() {
  87580. this.$parent.moveTo('left');
  87581. },
  87582. moveToRight: function moveToRight() {
  87583. this.$parent.moveTo('right');
  87584. }
  87585. }
  87586. };
  87587. /***/ }),
  87588. /* 252 */
  87589. /***/ (function(module, exports, __webpack_require__) {
  87590. "use strict";
  87591. Object.defineProperty(exports, "__esModule", {
  87592. value: true
  87593. });
  87594. var _newArrowCheck2 = __webpack_require__(1);
  87595. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  87596. var _node = __webpack_require__(612);
  87597. var _node2 = _interopRequireDefault(_node);
  87598. var _dropdown = __webpack_require__(61);
  87599. var _dropdown2 = _interopRequireDefault(_dropdown);
  87600. var _dropdownMenu = __webpack_require__(62);
  87601. var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
  87602. var _emitter = __webpack_require__(4);
  87603. var _emitter2 = _interopRequireDefault(_emitter);
  87604. var _locale = __webpack_require__(6);
  87605. var _locale2 = _interopRequireDefault(_locale);
  87606. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87607. var prefixCls = 'ivu-tree';
  87608. exports.default = {
  87609. name: 'Tree',
  87610. mixins: [_emitter2.default, _locale2.default],
  87611. components: { TreeNode: _node2.default, Dropdown: _dropdown2.default, DropdownMenu: _dropdownMenu2.default },
  87612. provide: function provide() {
  87613. return { TreeInstance: this };
  87614. },
  87615. props: {
  87616. data: {
  87617. type: Array,
  87618. default: function _default() {
  87619. return [];
  87620. }
  87621. },
  87622. multiple: {
  87623. type: Boolean,
  87624. default: false
  87625. },
  87626. showCheckbox: {
  87627. type: Boolean,
  87628. default: false
  87629. },
  87630. checkStrictly: {
  87631. type: Boolean,
  87632. default: false
  87633. },
  87634. checkDirectly: {
  87635. type: Boolean,
  87636. default: false
  87637. },
  87638. emptyText: {
  87639. type: String
  87640. },
  87641. childrenKey: {
  87642. type: String,
  87643. default: 'children'
  87644. },
  87645. loadData: {
  87646. type: Function
  87647. },
  87648. render: {
  87649. type: Function
  87650. },
  87651. selectNode: {
  87652. type: Boolean,
  87653. default: true
  87654. },
  87655. expandNode: {
  87656. type: Boolean,
  87657. default: false
  87658. }
  87659. },
  87660. data: function data() {
  87661. return {
  87662. prefixCls: prefixCls,
  87663. stateTree: this.data,
  87664. flatState: [],
  87665. contextMenuVisible: false,
  87666. contextMenuStyles: {
  87667. top: 0,
  87668. left: 0
  87669. }
  87670. };
  87671. },
  87672. watch: {
  87673. data: {
  87674. deep: true,
  87675. handler: function handler() {
  87676. this.stateTree = this.data;
  87677. this.flatState = this.compileFlatState();
  87678. this.rebuildTree();
  87679. }
  87680. }
  87681. },
  87682. computed: {
  87683. localeEmptyText: function localeEmptyText() {
  87684. if (typeof this.emptyText === 'undefined') {
  87685. return this.t('i.tree.emptyText');
  87686. } else {
  87687. return this.emptyText;
  87688. }
  87689. }
  87690. },
  87691. methods: {
  87692. compileFlatState: function compileFlatState() {
  87693. var _this2 = this;
  87694. var keyCounter = 0;
  87695. var childrenKey = this.childrenKey;
  87696. var flatTree = [];
  87697. function flattenChildren(node, parent) {
  87698. var _this = this;
  87699. node.nodeKey = keyCounter++;
  87700. flatTree[node.nodeKey] = { node: node, nodeKey: node.nodeKey };
  87701. if (typeof parent != 'undefined') {
  87702. flatTree[node.nodeKey].parent = parent.nodeKey;
  87703. flatTree[parent.nodeKey][childrenKey].push(node.nodeKey);
  87704. }
  87705. if (node[childrenKey]) {
  87706. flatTree[node.nodeKey][childrenKey] = [];
  87707. node[childrenKey].forEach(function (child) {
  87708. (0, _newArrowCheck3.default)(this, _this);
  87709. return flattenChildren(child, node);
  87710. }.bind(this));
  87711. }
  87712. }
  87713. this.stateTree.forEach(function (rootNode) {
  87714. (0, _newArrowCheck3.default)(this, _this2);
  87715. flattenChildren(rootNode);
  87716. }.bind(this));
  87717. return flatTree;
  87718. },
  87719. updateTreeUp: function updateTreeUp(nodeKey) {
  87720. var _this3 = this;
  87721. var parentKey = this.flatState[nodeKey].parent;
  87722. if (typeof parentKey == 'undefined' || this.checkStrictly) return;
  87723. var node = this.flatState[nodeKey].node;
  87724. var parent = this.flatState[parentKey].node;
  87725. if (node.checked == parent.checked && node.indeterminate == parent.indeterminate) return;
  87726. if (node.checked == true) {
  87727. this.$set(parent, 'checked', parent[this.childrenKey].every(function (node) {
  87728. (0, _newArrowCheck3.default)(this, _this3);
  87729. return node.checked;
  87730. }.bind(this)));
  87731. this.$set(parent, 'indeterminate', !parent.checked);
  87732. } else {
  87733. this.$set(parent, 'checked', false);
  87734. this.$set(parent, 'indeterminate', parent[this.childrenKey].some(function (node) {
  87735. (0, _newArrowCheck3.default)(this, _this3);
  87736. return node.checked || node.indeterminate;
  87737. }.bind(this)));
  87738. }
  87739. this.updateTreeUp(parentKey);
  87740. },
  87741. rebuildTree: function rebuildTree() {
  87742. var _this4 = this;
  87743. var checkedNodes = this.getCheckedNodes();
  87744. checkedNodes.forEach(function (node) {
  87745. (0, _newArrowCheck3.default)(this, _this4);
  87746. this.updateTreeDown(node, { checked: true });
  87747. var parentKey = this.flatState[node.nodeKey].parent;
  87748. if (!parentKey && parentKey !== 0) return;
  87749. var parent = this.flatState[parentKey].node;
  87750. var childHasCheckSetter = typeof node.checked != 'undefined' && node.checked;
  87751. if (childHasCheckSetter && parent.checked != node.checked) {
  87752. this.updateTreeUp(node.nodeKey);
  87753. }
  87754. }.bind(this));
  87755. },
  87756. getSelectedNodes: function getSelectedNodes() {
  87757. var _this5 = this;
  87758. return this.flatState.filter(function (obj) {
  87759. (0, _newArrowCheck3.default)(this, _this5);
  87760. return obj.node.selected;
  87761. }.bind(this)).map(function (obj) {
  87762. (0, _newArrowCheck3.default)(this, _this5);
  87763. return obj.node;
  87764. }.bind(this));
  87765. },
  87766. getCheckedNodes: function getCheckedNodes() {
  87767. var _this6 = this;
  87768. return this.flatState.filter(function (obj) {
  87769. (0, _newArrowCheck3.default)(this, _this6);
  87770. return obj.node.checked;
  87771. }.bind(this)).map(function (obj) {
  87772. (0, _newArrowCheck3.default)(this, _this6);
  87773. return obj.node;
  87774. }.bind(this));
  87775. },
  87776. getCheckedAndIndeterminateNodes: function getCheckedAndIndeterminateNodes() {
  87777. var _this7 = this;
  87778. return this.flatState.filter(function (obj) {
  87779. (0, _newArrowCheck3.default)(this, _this7);
  87780. return obj.node.checked || obj.node.indeterminate;
  87781. }.bind(this)).map(function (obj) {
  87782. (0, _newArrowCheck3.default)(this, _this7);
  87783. return obj.node;
  87784. }.bind(this));
  87785. },
  87786. updateTreeDown: function updateTreeDown(node) {
  87787. var _this8 = this;
  87788. var changes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  87789. if (this.checkStrictly) return;
  87790. for (var key in changes) {
  87791. this.$set(node, key, changes[key]);
  87792. }
  87793. if (node[this.childrenKey]) {
  87794. node[this.childrenKey].forEach(function (child) {
  87795. (0, _newArrowCheck3.default)(this, _this8);
  87796. this.updateTreeDown(child, changes);
  87797. }.bind(this));
  87798. }
  87799. },
  87800. handleSelect: function handleSelect(nodeKey) {
  87801. var _this9 = this;
  87802. if (!this.flatState[nodeKey]) return;
  87803. var node = this.flatState[nodeKey].node;
  87804. if (!this.multiple) {
  87805. var currentSelectedKey = this.flatState.findIndex(function (obj) {
  87806. (0, _newArrowCheck3.default)(this, _this9);
  87807. return obj.node.selected;
  87808. }.bind(this));
  87809. if (currentSelectedKey >= 0 && currentSelectedKey !== nodeKey) this.$set(this.flatState[currentSelectedKey].node, 'selected', false);
  87810. }
  87811. this.$set(node, 'selected', !node.selected);
  87812. this.$emit('on-select-change', this.getSelectedNodes(), node);
  87813. },
  87814. handleCheck: function handleCheck(_ref) {
  87815. var checked = _ref.checked,
  87816. nodeKey = _ref.nodeKey;
  87817. if (!this.flatState[nodeKey]) return;
  87818. var node = this.flatState[nodeKey].node;
  87819. this.$set(node, 'checked', checked);
  87820. this.$set(node, 'indeterminate', false);
  87821. this.updateTreeUp(nodeKey);
  87822. this.updateTreeDown(node, { checked: checked, indeterminate: false });
  87823. this.$emit('on-check-change', this.getCheckedNodes(), node);
  87824. },
  87825. handleContextmenu: function handleContextmenu(_ref2) {
  87826. var _this10 = this;
  87827. var data = _ref2.data,
  87828. event = _ref2.event;
  87829. if (this.contextMenuVisible) this.handleClickContextMenuOutside();
  87830. this.$nextTick(function () {
  87831. (0, _newArrowCheck3.default)(this, _this10);
  87832. var $TreeWrap = this.$refs.treeWrap;
  87833. var TreeBounding = $TreeWrap.getBoundingClientRect();
  87834. var position = {
  87835. left: event.clientX - TreeBounding.left + 'px',
  87836. top: event.clientY - TreeBounding.top + 'px'
  87837. };
  87838. this.contextMenuStyles = position;
  87839. this.contextMenuVisible = true;
  87840. this.$emit('on-contextmenu', data, event, position);
  87841. }.bind(this));
  87842. },
  87843. handleClickContextMenuOutside: function handleClickContextMenuOutside() {
  87844. this.contextMenuVisible = false;
  87845. }
  87846. },
  87847. created: function created() {
  87848. this.flatState = this.compileFlatState();
  87849. this.rebuildTree();
  87850. },
  87851. mounted: function mounted() {
  87852. var _this11 = this;
  87853. this.$on('on-check', this.handleCheck);
  87854. this.$on('on-selected', this.handleSelect);
  87855. this.$on('toggle-expand', function (node) {
  87856. (0, _newArrowCheck3.default)(this, _this11);
  87857. return this.$emit('on-toggle-expand', node);
  87858. }.bind(this));
  87859. this.$on('contextmenu', this.handleContextmenu);
  87860. }
  87861. };
  87862. /***/ }),
  87863. /* 253 */
  87864. /***/ (function(module, exports, __webpack_require__) {
  87865. "use strict";
  87866. Object.defineProperty(exports, "__esModule", {
  87867. value: true
  87868. });
  87869. var _newArrowCheck2 = __webpack_require__(1);
  87870. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  87871. var _defineProperty2 = __webpack_require__(2);
  87872. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  87873. var _checkbox = __webpack_require__(49);
  87874. var _checkbox2 = _interopRequireDefault(_checkbox);
  87875. var _icon = __webpack_require__(8);
  87876. var _icon2 = _interopRequireDefault(_icon);
  87877. var _render = __webpack_require__(613);
  87878. var _render2 = _interopRequireDefault(_render);
  87879. var _collapseTransition = __webpack_require__(83);
  87880. var _collapseTransition2 = _interopRequireDefault(_collapseTransition);
  87881. var _emitter = __webpack_require__(4);
  87882. var _emitter2 = _interopRequireDefault(_emitter);
  87883. var _assist = __webpack_require__(3);
  87884. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  87885. var prefixCls = 'ivu-tree';
  87886. exports.default = {
  87887. name: 'TreeNode',
  87888. mixins: [_emitter2.default],
  87889. inject: ['TreeInstance'],
  87890. components: { Checkbox: _checkbox2.default, Icon: _icon2.default, CollapseTransition: _collapseTransition2.default, Render: _render2.default },
  87891. props: {
  87892. data: {
  87893. type: Object,
  87894. default: function _default() {
  87895. return {};
  87896. }
  87897. },
  87898. multiple: {
  87899. type: Boolean,
  87900. default: false
  87901. },
  87902. childrenKey: {
  87903. type: String,
  87904. default: 'children'
  87905. },
  87906. showCheckbox: {
  87907. type: Boolean,
  87908. default: false
  87909. },
  87910. appear: {
  87911. type: Boolean,
  87912. default: false
  87913. }
  87914. },
  87915. data: function data() {
  87916. return {
  87917. prefixCls: prefixCls,
  87918. appearByClickArrow: false
  87919. };
  87920. },
  87921. computed: {
  87922. classes: function classes() {
  87923. return [prefixCls + '-children'];
  87924. },
  87925. selectedCls: function selectedCls() {
  87926. return [(0, _defineProperty3.default)({}, prefixCls + '-node-selected', this.data.selected)];
  87927. },
  87928. arrowClasses: function arrowClasses() {
  87929. var _ref2;
  87930. return [prefixCls + '-arrow', (_ref2 = {}, (0, _defineProperty3.default)(_ref2, prefixCls + '-arrow-disabled', this.data.disabled), (0, _defineProperty3.default)(_ref2, prefixCls + '-arrow-open', this.data.expand), _ref2)];
  87931. },
  87932. titleClasses: function titleClasses() {
  87933. return [prefixCls + '-title', (0, _defineProperty3.default)({}, prefixCls + '-title-selected', this.data.selected)];
  87934. },
  87935. showArrow: function showArrow() {
  87936. return this.data[this.childrenKey] && this.data[this.childrenKey].length || 'loading' in this.data && !this.data.loading;
  87937. },
  87938. showLoading: function showLoading() {
  87939. return 'loading' in this.data && this.data.loading;
  87940. },
  87941. isParentRender: function isParentRender() {
  87942. var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
  87943. return Tree && Tree.render;
  87944. },
  87945. parentRender: function parentRender() {
  87946. var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
  87947. if (Tree && Tree.render) {
  87948. return Tree.render;
  87949. } else {
  87950. return null;
  87951. }
  87952. },
  87953. node: function node() {
  87954. var _this = this;
  87955. var Tree = (0, _assist.findComponentUpward)(this, 'Tree');
  87956. if (Tree) {
  87957. return [Tree.flatState, Tree.flatState.find(function (item) {
  87958. (0, _newArrowCheck3.default)(this, _this);
  87959. return item.nodeKey === this.data.nodeKey;
  87960. }.bind(this))];
  87961. } else {
  87962. return [];
  87963. }
  87964. },
  87965. children: function children() {
  87966. return this.data[this.childrenKey];
  87967. },
  87968. arrowType: function arrowType() {
  87969. var type = 'ios-arrow-forward';
  87970. if (this.$IVIEW) {
  87971. if (this.$IVIEW.tree.customArrow) {
  87972. type = '';
  87973. } else if (this.$IVIEW.tree.arrow) {
  87974. type = this.$IVIEW.tree.arrow;
  87975. }
  87976. }
  87977. return type;
  87978. },
  87979. customArrowType: function customArrowType() {
  87980. var type = '';
  87981. if (this.$IVIEW) {
  87982. if (this.$IVIEW.tree.customArrow) {
  87983. type = this.$IVIEW.tree.customArrow;
  87984. }
  87985. }
  87986. return type;
  87987. },
  87988. arrowSize: function arrowSize() {
  87989. var size = '';
  87990. if (this.$IVIEW) {
  87991. if (this.$IVIEW.tree.arrowSize) {
  87992. size = this.$IVIEW.tree.arrowSize;
  87993. }
  87994. }
  87995. return size;
  87996. }
  87997. },
  87998. methods: {
  87999. handleExpand: function handleExpand() {
  88000. var _this2 = this;
  88001. var item = this.data;
  88002. this.appearByClickArrow = true;
  88003. if (item[this.childrenKey].length === 0) {
  88004. var tree = (0, _assist.findComponentUpward)(this, 'Tree');
  88005. if (tree && tree.loadData) {
  88006. this.$set(this.data, 'loading', true);
  88007. tree.loadData(item, function (children) {
  88008. (0, _newArrowCheck3.default)(this, _this2);
  88009. this.$set(this.data, 'loading', false);
  88010. if (children.length) {
  88011. this.$set(this.data, this.childrenKey, children);
  88012. this.$nextTick(function () {
  88013. (0, _newArrowCheck3.default)(this, _this2);
  88014. return this.handleExpand();
  88015. }.bind(this));
  88016. }
  88017. }.bind(this));
  88018. return;
  88019. }
  88020. }
  88021. if (item[this.childrenKey] && item[this.childrenKey].length) {
  88022. this.$set(this.data, 'expand', !this.data.expand);
  88023. this.dispatch('Tree', 'toggle-expand', this.data);
  88024. }
  88025. },
  88026. handleClickNode: function handleClickNode() {
  88027. if (this.TreeInstance.expandNode) {
  88028. if (this.showArrow) this.handleExpand();
  88029. } else if (this.TreeInstance.selectNode) {
  88030. this.handleSelect();
  88031. }
  88032. },
  88033. handleSelect: function handleSelect() {
  88034. if (this.data.disabled) return;
  88035. if (this.TreeInstance.showCheckbox && this.TreeInstance.checkDirectly) {
  88036. this.handleCheck();
  88037. } else {
  88038. this.dispatch('Tree', 'on-selected', this.data.nodeKey);
  88039. }
  88040. },
  88041. handleCheck: function handleCheck() {
  88042. if (this.data.disabled) return;
  88043. var changes = {
  88044. checked: !this.data.checked && !this.data.indeterminate,
  88045. nodeKey: this.data.nodeKey
  88046. };
  88047. this.dispatch('Tree', 'on-check', changes);
  88048. },
  88049. handleContextmenu: function handleContextmenu(data, event) {
  88050. if (data.contextmenu) {
  88051. event.preventDefault();
  88052. this.dispatch('Tree', 'contextmenu', { data: data, event: event });
  88053. }
  88054. },
  88055. handlePreventSelect: function handlePreventSelect(data, event) {
  88056. if (data.contextmenu) {
  88057. event.preventDefault();
  88058. }
  88059. }
  88060. }
  88061. };
  88062. /***/ }),
  88063. /* 254 */
  88064. /***/ (function(module, exports, __webpack_require__) {
  88065. "use strict";
  88066. Object.defineProperty(exports, "__esModule", {
  88067. value: true
  88068. });
  88069. var _newArrowCheck2 = __webpack_require__(1);
  88070. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  88071. var _defineProperty2 = __webpack_require__(2);
  88072. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  88073. var _uploadList = __webpack_require__(618);
  88074. var _uploadList2 = _interopRequireDefault(_uploadList);
  88075. var _ajax = __webpack_require__(620);
  88076. var _ajax2 = _interopRequireDefault(_ajax);
  88077. var _assist = __webpack_require__(3);
  88078. var _emitter = __webpack_require__(4);
  88079. var _emitter2 = _interopRequireDefault(_emitter);
  88080. var _form = __webpack_require__(11);
  88081. var _form2 = _interopRequireDefault(_form);
  88082. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88083. var prefixCls = 'ivu-upload';
  88084. exports.default = {
  88085. name: 'Upload',
  88086. mixins: [_emitter2.default, _form2.default],
  88087. components: { UploadList: _uploadList2.default },
  88088. props: {
  88089. action: {
  88090. type: String,
  88091. required: true
  88092. },
  88093. headers: {
  88094. type: Object,
  88095. default: function _default() {
  88096. return {};
  88097. }
  88098. },
  88099. multiple: {
  88100. type: Boolean,
  88101. default: false
  88102. },
  88103. data: {
  88104. type: Object
  88105. },
  88106. name: {
  88107. type: String,
  88108. default: 'file'
  88109. },
  88110. withCredentials: {
  88111. type: Boolean,
  88112. default: false
  88113. },
  88114. showUploadList: {
  88115. type: Boolean,
  88116. default: true
  88117. },
  88118. type: {
  88119. type: String,
  88120. validator: function validator(value) {
  88121. return (0, _assist.oneOf)(value, ['select', 'drag']);
  88122. },
  88123. default: 'select'
  88124. },
  88125. format: {
  88126. type: Array,
  88127. default: function _default() {
  88128. return [];
  88129. }
  88130. },
  88131. accept: {
  88132. type: String
  88133. },
  88134. maxSize: {
  88135. type: Number
  88136. },
  88137. beforeUpload: Function,
  88138. onProgress: {
  88139. type: Function,
  88140. default: function _default() {
  88141. return {};
  88142. }
  88143. },
  88144. onSuccess: {
  88145. type: Function,
  88146. default: function _default() {
  88147. return {};
  88148. }
  88149. },
  88150. onError: {
  88151. type: Function,
  88152. default: function _default() {
  88153. return {};
  88154. }
  88155. },
  88156. onRemove: {
  88157. type: Function,
  88158. default: function _default() {
  88159. return {};
  88160. }
  88161. },
  88162. onPreview: {
  88163. type: Function,
  88164. default: function _default() {
  88165. return {};
  88166. }
  88167. },
  88168. onExceededSize: {
  88169. type: Function,
  88170. default: function _default() {
  88171. return {};
  88172. }
  88173. },
  88174. onFormatError: {
  88175. type: Function,
  88176. default: function _default() {
  88177. return {};
  88178. }
  88179. },
  88180. defaultFileList: {
  88181. type: Array,
  88182. default: function _default() {
  88183. return [];
  88184. }
  88185. },
  88186. paste: {
  88187. type: Boolean,
  88188. default: false
  88189. },
  88190. disabled: {
  88191. type: Boolean,
  88192. default: false
  88193. },
  88194. webkitdirectory: {
  88195. type: Boolean,
  88196. default: false
  88197. }
  88198. },
  88199. data: function data() {
  88200. return {
  88201. prefixCls: prefixCls,
  88202. dragOver: false,
  88203. fileList: [],
  88204. tempIndex: 1
  88205. };
  88206. },
  88207. computed: {
  88208. classes: function classes() {
  88209. var _ref;
  88210. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-select', this.type === 'select'), (0, _defineProperty3.default)(_ref, prefixCls + '-drag', this.type === 'drag'), (0, _defineProperty3.default)(_ref, prefixCls + '-dragOver', this.type === 'drag' && this.dragOver), _ref)];
  88211. }
  88212. },
  88213. methods: {
  88214. handleClick: function handleClick() {
  88215. if (this.itemDisabled) return;
  88216. this.$refs.input.click();
  88217. },
  88218. handleChange: function handleChange(e) {
  88219. var files = e.target.files;
  88220. if (!files) {
  88221. return;
  88222. }
  88223. this.uploadFiles(files);
  88224. this.$refs.input.value = null;
  88225. },
  88226. onDrop: function onDrop(e) {
  88227. this.dragOver = false;
  88228. if (this.itemDisabled) return;
  88229. this.uploadFiles(e.dataTransfer.files);
  88230. },
  88231. handlePaste: function handlePaste(e) {
  88232. if (this.itemDisabled) return;
  88233. if (this.paste) {
  88234. this.uploadFiles(e.clipboardData.files);
  88235. }
  88236. },
  88237. uploadFiles: function uploadFiles(files) {
  88238. var _this = this;
  88239. var postFiles = Array.prototype.slice.call(files);
  88240. if (!this.multiple) postFiles = postFiles.slice(0, 1);
  88241. if (postFiles.length === 0) return;
  88242. postFiles.forEach(function (file) {
  88243. (0, _newArrowCheck3.default)(this, _this);
  88244. this.upload(file);
  88245. }.bind(this));
  88246. },
  88247. upload: function upload(file) {
  88248. var _this2 = this;
  88249. if (!this.beforeUpload) {
  88250. return this.post(file);
  88251. }
  88252. var before = this.beforeUpload(file);
  88253. if (before && before.then) {
  88254. before.then(function (processedFile) {
  88255. (0, _newArrowCheck3.default)(this, _this2);
  88256. if (Object.prototype.toString.call(processedFile) === '[object File]') {
  88257. this.post(processedFile);
  88258. } else {
  88259. this.post(file);
  88260. }
  88261. }.bind(this), function () {
  88262. (0, _newArrowCheck3.default)(this, _this2);
  88263. }.bind(this));
  88264. } else if (before !== false) {
  88265. this.post(file);
  88266. } else {}
  88267. },
  88268. post: function post(file) {
  88269. var _this3 = this;
  88270. if (this.format.length) {
  88271. var _file_format = file.name.split('.').pop().toLocaleLowerCase();
  88272. var checked = this.format.some(function (item) {
  88273. (0, _newArrowCheck3.default)(this, _this3);
  88274. return item.toLocaleLowerCase() === _file_format;
  88275. }.bind(this));
  88276. if (!checked) {
  88277. this.onFormatError(file, this.fileList);
  88278. return false;
  88279. }
  88280. }
  88281. if (this.maxSize) {
  88282. if (file.size > this.maxSize * 1024) {
  88283. this.onExceededSize(file, this.fileList);
  88284. return false;
  88285. }
  88286. }
  88287. this.handleStart(file);
  88288. var formData = new FormData();
  88289. formData.append(this.name, file);
  88290. (0, _ajax2.default)({
  88291. headers: this.headers,
  88292. withCredentials: this.withCredentials,
  88293. file: file,
  88294. data: this.data,
  88295. filename: this.name,
  88296. action: this.action,
  88297. onProgress: function onProgress(e) {
  88298. (0, _newArrowCheck3.default)(this, _this3);
  88299. this.handleProgress(e, file);
  88300. }.bind(this),
  88301. onSuccess: function onSuccess(res) {
  88302. (0, _newArrowCheck3.default)(this, _this3);
  88303. this.handleSuccess(res, file);
  88304. }.bind(this),
  88305. onError: function onError(err, response) {
  88306. (0, _newArrowCheck3.default)(this, _this3);
  88307. this.handleError(err, response, file);
  88308. }.bind(this)
  88309. });
  88310. },
  88311. handleStart: function handleStart(file) {
  88312. file.uid = Date.now() + this.tempIndex++;
  88313. var _file = {
  88314. status: 'uploading',
  88315. name: file.name,
  88316. size: file.size,
  88317. percentage: 0,
  88318. uid: file.uid,
  88319. showProgress: true
  88320. };
  88321. this.fileList.push(_file);
  88322. },
  88323. getFile: function getFile(file) {
  88324. var _this4 = this;
  88325. var fileList = this.fileList;
  88326. var target = void 0;
  88327. fileList.every(function (item) {
  88328. (0, _newArrowCheck3.default)(this, _this4);
  88329. target = file.uid === item.uid ? item : null;
  88330. return !target;
  88331. }.bind(this));
  88332. return target;
  88333. },
  88334. handleProgress: function handleProgress(e, file) {
  88335. var _file = this.getFile(file);
  88336. this.onProgress(e, _file, this.fileList);
  88337. _file.percentage = e.percent || 0;
  88338. },
  88339. handleSuccess: function handleSuccess(res, file) {
  88340. var _this5 = this;
  88341. var _file = this.getFile(file);
  88342. if (_file) {
  88343. _file.status = 'finished';
  88344. _file.response = res;
  88345. this.onSuccess(res, _file, this.fileList);
  88346. this.dispatch('FormItem', 'on-form-change', _file);
  88347. setTimeout(function () {
  88348. (0, _newArrowCheck3.default)(this, _this5);
  88349. _file.showProgress = false;
  88350. }.bind(this), 1000);
  88351. }
  88352. },
  88353. handleError: function handleError(err, response, file) {
  88354. var _file = this.getFile(file);
  88355. var fileList = this.fileList;
  88356. _file.status = 'fail';
  88357. fileList.splice(fileList.indexOf(_file), 1);
  88358. this.onError(err, response, file);
  88359. },
  88360. handleRemove: function handleRemove(file) {
  88361. var fileList = this.fileList;
  88362. fileList.splice(fileList.indexOf(file), 1);
  88363. this.onRemove(file, fileList);
  88364. },
  88365. handlePreview: function handlePreview(file) {
  88366. if (file.status === 'finished') {
  88367. this.onPreview(file);
  88368. }
  88369. },
  88370. clearFiles: function clearFiles() {
  88371. this.fileList = [];
  88372. }
  88373. },
  88374. watch: {
  88375. defaultFileList: {
  88376. immediate: true,
  88377. handler: function handler(fileList) {
  88378. var _this6 = this;
  88379. this.fileList = fileList.map(function (item) {
  88380. (0, _newArrowCheck3.default)(this, _this6);
  88381. item.status = 'finished';
  88382. item.percentage = 100;
  88383. item.uid = Date.now() + this.tempIndex++;
  88384. return item;
  88385. }.bind(this));
  88386. }
  88387. }
  88388. }
  88389. };
  88390. /***/ }),
  88391. /* 255 */
  88392. /***/ (function(module, exports, __webpack_require__) {
  88393. "use strict";
  88394. Object.defineProperty(exports, "__esModule", {
  88395. value: true
  88396. });
  88397. var _defineProperty2 = __webpack_require__(2);
  88398. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  88399. var _icon = __webpack_require__(8);
  88400. var _icon2 = _interopRequireDefault(_icon);
  88401. var _progress = __webpack_require__(222);
  88402. var _progress2 = _interopRequireDefault(_progress);
  88403. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88404. var prefixCls = 'ivu-upload';
  88405. exports.default = {
  88406. name: 'UploadList',
  88407. components: { Icon: _icon2.default, iProgress: _progress2.default },
  88408. props: {
  88409. files: {
  88410. type: Array,
  88411. default: function _default() {
  88412. return [];
  88413. }
  88414. }
  88415. },
  88416. data: function data() {
  88417. return {
  88418. prefixCls: prefixCls
  88419. };
  88420. },
  88421. methods: {
  88422. fileCls: function fileCls(file) {
  88423. return [prefixCls + '-list-file', (0, _defineProperty3.default)({}, prefixCls + '-list-file-finish', file.status === 'finished')];
  88424. },
  88425. handleClick: function handleClick(file) {
  88426. this.$emit('on-file-click', file);
  88427. },
  88428. handlePreview: function handlePreview(file) {
  88429. this.$emit('on-file-preview', file);
  88430. },
  88431. handleRemove: function handleRemove(file) {
  88432. this.$emit('on-file-remove', file);
  88433. },
  88434. format: function format(file) {
  88435. var format = file.name.split('.').pop().toLocaleLowerCase() || '';
  88436. var type = 'ios-document-outline';
  88437. if (['gif', 'jpg', 'jpeg', 'png', 'bmp', 'webp'].indexOf(format) > -1) {
  88438. type = 'ios-image';
  88439. }
  88440. if (['mp4', 'm3u8', 'rmvb', 'avi', 'swf', '3gp', 'mkv', 'flv'].indexOf(format) > -1) {
  88441. type = 'ios-film';
  88442. }
  88443. if (['mp3', 'wav', 'wma', 'ogg', 'aac', 'flac'].indexOf(format) > -1) {
  88444. type = 'ios-musical-notes';
  88445. }
  88446. if (['doc', 'txt', 'docx', 'pages', 'epub', 'pdf'].indexOf(format) > -1) {
  88447. type = 'md-document';
  88448. }
  88449. if (['numbers', 'csv', 'xls', 'xlsx'].indexOf(format) > -1) {
  88450. type = 'ios-stats';
  88451. }
  88452. if (['keynote', 'ppt', 'pptx'].indexOf(format) > -1) {
  88453. type = 'ios-videocam';
  88454. }
  88455. return type;
  88456. },
  88457. parsePercentage: function parsePercentage(val) {
  88458. return parseInt(val, 10);
  88459. }
  88460. }
  88461. };
  88462. /***/ }),
  88463. /* 256 */
  88464. /***/ (function(module, exports, __webpack_require__) {
  88465. "use strict";
  88466. Object.defineProperty(exports, "__esModule", {
  88467. value: true
  88468. });
  88469. var _newArrowCheck2 = __webpack_require__(1);
  88470. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  88471. var _defineProperty2 = __webpack_require__(2);
  88472. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  88473. var _assist = __webpack_require__(3);
  88474. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88475. var prefixCls = 'ivu-row';
  88476. exports.default = {
  88477. name: 'Row',
  88478. props: {
  88479. type: {
  88480. validator: function validator(value) {
  88481. return (0, _assist.oneOf)(value, ['flex']);
  88482. }
  88483. },
  88484. align: {
  88485. validator: function validator(value) {
  88486. return (0, _assist.oneOf)(value, ['top', 'middle', 'bottom']);
  88487. }
  88488. },
  88489. justify: {
  88490. validator: function validator(value) {
  88491. return (0, _assist.oneOf)(value, ['start', 'end', 'center', 'space-around', 'space-between']);
  88492. }
  88493. },
  88494. gutter: {
  88495. type: Number,
  88496. default: 0
  88497. },
  88498. className: String,
  88499. wrap: {
  88500. type: Boolean,
  88501. default: true
  88502. }
  88503. },
  88504. computed: {
  88505. classes: function classes() {
  88506. var _ref;
  88507. return ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type), !!this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type) + '-' + String(this.align), !!this.align && this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.type) + '-' + String(this.justify), !!this.justify && this.type), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.align), !!this.align), (0, _defineProperty3.default)(_ref, prefixCls + '-' + String(this.justify), !!this.justify), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), (0, _defineProperty3.default)(_ref, prefixCls + '-no-wrap', !this.wrap), _ref)];
  88508. },
  88509. styles: function styles() {
  88510. var style = {};
  88511. if (this.gutter !== 0) {
  88512. style = {
  88513. marginLeft: this.gutter / -2 + 'px',
  88514. marginRight: this.gutter / -2 + 'px'
  88515. };
  88516. }
  88517. return style;
  88518. }
  88519. },
  88520. methods: {
  88521. updateGutter: function updateGutter(val) {
  88522. var _this = this;
  88523. var Col = (0, _assist.findComponentDownward)(this, 'iCol');
  88524. var Cols = (0, _assist.findBrothersComponents)(Col, 'iCol', false);
  88525. if (Cols.length) {
  88526. Cols.forEach(function (child) {
  88527. (0, _newArrowCheck3.default)(this, _this);
  88528. if (val !== 0) {
  88529. child.gutter = val;
  88530. }
  88531. }.bind(this));
  88532. }
  88533. }
  88534. },
  88535. watch: {
  88536. gutter: function gutter(val) {
  88537. this.updateGutter(val);
  88538. }
  88539. }
  88540. };
  88541. /***/ }),
  88542. /* 257 */
  88543. /***/ (function(module, exports, __webpack_require__) {
  88544. "use strict";
  88545. Object.defineProperty(exports, "__esModule", {
  88546. value: true
  88547. });
  88548. var _keys = __webpack_require__(21);
  88549. var _keys2 = _interopRequireDefault(_keys);
  88550. var _typeof2 = __webpack_require__(27);
  88551. var _typeof3 = _interopRequireDefault(_typeof2);
  88552. var _newArrowCheck2 = __webpack_require__(1);
  88553. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  88554. var _defineProperty2 = __webpack_require__(2);
  88555. var _defineProperty3 = _interopRequireDefault(_defineProperty2);
  88556. var _assist = __webpack_require__(3);
  88557. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88558. var prefixCls = 'ivu-col';
  88559. function parseFlex(flex) {
  88560. if (typeof flex === 'number') {
  88561. return flex + ' ' + flex + ' auto';
  88562. }
  88563. if (/^\d+(\.\d+)?(px|em|rem|%)$/.test(flex)) {
  88564. return '0 0 ' + String(flex);
  88565. }
  88566. return flex;
  88567. }
  88568. exports.default = {
  88569. name: 'iCol',
  88570. props: {
  88571. span: [Number, String],
  88572. order: [Number, String],
  88573. offset: [Number, String],
  88574. push: [Number, String],
  88575. pull: [Number, String],
  88576. className: String,
  88577. xs: [Number, Object],
  88578. sm: [Number, Object],
  88579. md: [Number, Object],
  88580. lg: [Number, Object],
  88581. xl: [Number, Object],
  88582. xxl: [Number, Object],
  88583. flex: {
  88584. type: [Number, String],
  88585. default: ''
  88586. }
  88587. },
  88588. data: function data() {
  88589. return {
  88590. gutter: 0
  88591. };
  88592. },
  88593. computed: {
  88594. classes: function classes() {
  88595. var _ref,
  88596. _this = this;
  88597. var classList = ['' + prefixCls, (_ref = {}, (0, _defineProperty3.default)(_ref, prefixCls + '-span-' + String(this.span), this.span), (0, _defineProperty3.default)(_ref, prefixCls + '-order-' + String(this.order), this.order), (0, _defineProperty3.default)(_ref, prefixCls + '-offset-' + String(this.offset), this.offset), (0, _defineProperty3.default)(_ref, prefixCls + '-push-' + String(this.push), this.push), (0, _defineProperty3.default)(_ref, prefixCls + '-pull-' + String(this.pull), this.pull), (0, _defineProperty3.default)(_ref, '' + String(this.className), !!this.className), _ref)];
  88598. ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach(function (size) {
  88599. (0, _newArrowCheck3.default)(this, _this);
  88600. if (typeof this[size] === 'number') {
  88601. classList.push(prefixCls + '-span-' + String(size) + '-' + String(this[size]));
  88602. } else if ((0, _typeof3.default)(this[size]) === 'object') {
  88603. var props = this[size];
  88604. (0, _keys2.default)(props).forEach(function (prop) {
  88605. (0, _newArrowCheck3.default)(this, _this);
  88606. classList.push(prop !== 'span' ? prefixCls + '-' + String(size) + '-' + String(prop) + '-' + String(props[prop]) : prefixCls + '-span-' + String(size) + '-' + String(props[prop]));
  88607. }.bind(this));
  88608. }
  88609. }.bind(this));
  88610. return classList;
  88611. },
  88612. styles: function styles() {
  88613. var style = {};
  88614. if (this.gutter !== 0) {
  88615. style = {
  88616. paddingLeft: this.gutter / 2 + 'px',
  88617. paddingRight: this.gutter / 2 + 'px'
  88618. };
  88619. }
  88620. if (this.flex) {
  88621. style.flex = parseFlex(this.flex);
  88622. }
  88623. return style;
  88624. }
  88625. },
  88626. methods: {
  88627. updateGutter: function updateGutter() {
  88628. var Row = (0, _assist.findComponentUpward)(this, 'Row');
  88629. if (Row) {
  88630. Row.updateGutter(Row.gutter);
  88631. }
  88632. }
  88633. },
  88634. mounted: function mounted() {
  88635. this.updateGutter();
  88636. },
  88637. beforeDestroy: function beforeDestroy() {
  88638. this.updateGutter();
  88639. }
  88640. };
  88641. /***/ }),
  88642. /* 258 */
  88643. /***/ (function(module, exports, __webpack_require__) {
  88644. "use strict";
  88645. Object.defineProperty(exports, "__esModule", {
  88646. value: true
  88647. });
  88648. var _newArrowCheck2 = __webpack_require__(1);
  88649. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  88650. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88651. var prefixCls = 'ivu-select-group';
  88652. exports.default = {
  88653. name: 'OptionGroup',
  88654. props: {
  88655. label: {
  88656. type: String,
  88657. default: ''
  88658. }
  88659. },
  88660. data: function data() {
  88661. return {
  88662. prefixCls: prefixCls,
  88663. hidden: false };
  88664. },
  88665. methods: {
  88666. queryChange: function queryChange() {
  88667. var _this = this;
  88668. this.$nextTick(function () {
  88669. (0, _newArrowCheck3.default)(this, _this);
  88670. var options = this.$refs.options.querySelectorAll('.ivu-select-item');
  88671. var hasVisibleOption = false;
  88672. for (var i = 0; i < options.length; i++) {
  88673. if (options[i].style.display !== 'none') {
  88674. hasVisibleOption = true;
  88675. break;
  88676. }
  88677. }
  88678. this.hidden = !hasVisibleOption;
  88679. }.bind(this));
  88680. }
  88681. },
  88682. mounted: function mounted() {
  88683. var _this2 = this;
  88684. this.$on('on-query-change', function () {
  88685. (0, _newArrowCheck3.default)(this, _this2);
  88686. this.queryChange();
  88687. return true;
  88688. }.bind(this));
  88689. },
  88690. beforeDestroy: function beforeDestroy() {
  88691. this.$off('on-query-change');
  88692. }
  88693. };
  88694. /***/ }),
  88695. /* 259 */
  88696. /***/ (function(module, exports, __webpack_require__) {
  88697. "use strict";
  88698. var _newArrowCheck2 = __webpack_require__(1);
  88699. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  88700. var _keys = __webpack_require__(21);
  88701. var _keys2 = _interopRequireDefault(_keys);
  88702. var _extends2 = __webpack_require__(32);
  88703. var _extends3 = _interopRequireDefault(_extends2);
  88704. var _affix = __webpack_require__(267);
  88705. var _affix2 = _interopRequireDefault(_affix);
  88706. var _alert = __webpack_require__(273);
  88707. var _alert2 = _interopRequireDefault(_alert);
  88708. var _anchor = __webpack_require__(283);
  88709. var _anchor2 = _interopRequireDefault(_anchor);
  88710. var _anchorLink = __webpack_require__(286);
  88711. var _anchorLink2 = _interopRequireDefault(_anchorLink);
  88712. var _autoComplete = __webpack_require__(289);
  88713. var _autoComplete2 = _interopRequireDefault(_autoComplete);
  88714. var _avatar = __webpack_require__(341);
  88715. var _avatar2 = _interopRequireDefault(_avatar);
  88716. var _backTop = __webpack_require__(343);
  88717. var _backTop2 = _interopRequireDefault(_backTop);
  88718. var _badge = __webpack_require__(346);
  88719. var _badge2 = _interopRequireDefault(_badge);
  88720. var _breadcrumb = __webpack_require__(349);
  88721. var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
  88722. var _button = __webpack_require__(354);
  88723. var _button2 = _interopRequireDefault(_button);
  88724. var _card = __webpack_require__(358);
  88725. var _card2 = _interopRequireDefault(_card);
  88726. var _carousel = __webpack_require__(361);
  88727. var _carousel2 = _interopRequireDefault(_carousel);
  88728. var _cascader = __webpack_require__(366);
  88729. var _cascader2 = _interopRequireDefault(_cascader);
  88730. var _cell = __webpack_require__(373);
  88731. var _cell2 = _interopRequireDefault(_cell);
  88732. var _checkbox = __webpack_require__(380);
  88733. var _checkbox2 = _interopRequireDefault(_checkbox);
  88734. var _circle = __webpack_require__(383);
  88735. var _circle2 = _interopRequireDefault(_circle);
  88736. var _collapse = __webpack_require__(387);
  88737. var _collapse2 = _interopRequireDefault(_collapse);
  88738. var _colorPicker = __webpack_require__(392);
  88739. var _colorPicker2 = _interopRequireDefault(_colorPicker);
  88740. var _content = __webpack_require__(403);
  88741. var _content2 = _interopRequireDefault(_content);
  88742. var _datePicker = __webpack_require__(405);
  88743. var _datePicker2 = _interopRequireDefault(_datePicker);
  88744. var _divider = __webpack_require__(425);
  88745. var _divider2 = _interopRequireDefault(_divider);
  88746. var _drawer = __webpack_require__(428);
  88747. var _drawer2 = _interopRequireDefault(_drawer);
  88748. var _dropdown = __webpack_require__(431);
  88749. var _dropdown2 = _interopRequireDefault(_dropdown);
  88750. var _footer = __webpack_require__(436);
  88751. var _footer2 = _interopRequireDefault(_footer);
  88752. var _form = __webpack_require__(438);
  88753. var _form2 = _interopRequireDefault(_form);
  88754. var _header = __webpack_require__(452);
  88755. var _header2 = _interopRequireDefault(_header);
  88756. var _icon = __webpack_require__(19);
  88757. var _icon2 = _interopRequireDefault(_icon);
  88758. var _input = __webpack_require__(454);
  88759. var _input2 = _interopRequireDefault(_input);
  88760. var _inputNumber = __webpack_require__(455);
  88761. var _inputNumber2 = _interopRequireDefault(_inputNumber);
  88762. var _scroll = __webpack_require__(457);
  88763. var _scroll2 = _interopRequireDefault(_scroll);
  88764. var _split = __webpack_require__(468);
  88765. var _split2 = _interopRequireDefault(_split);
  88766. var _layout = __webpack_require__(473);
  88767. var _layout2 = _interopRequireDefault(_layout);
  88768. var _list = __webpack_require__(477);
  88769. var _list2 = _interopRequireDefault(_list);
  88770. var _loadingBar = __webpack_require__(484);
  88771. var _loadingBar2 = _interopRequireDefault(_loadingBar);
  88772. var _menu = __webpack_require__(488);
  88773. var _menu2 = _interopRequireDefault(_menu);
  88774. var _message = __webpack_require__(497);
  88775. var _message2 = _interopRequireDefault(_message);
  88776. var _modal = __webpack_require__(502);
  88777. var _modal2 = _interopRequireDefault(_modal);
  88778. var _notice = __webpack_require__(506);
  88779. var _notice2 = _interopRequireDefault(_notice);
  88780. var _page = __webpack_require__(507);
  88781. var _page2 = _interopRequireDefault(_page);
  88782. var _poptip = __webpack_require__(512);
  88783. var _poptip2 = _interopRequireDefault(_poptip);
  88784. var _progress = __webpack_require__(514);
  88785. var _progress2 = _interopRequireDefault(_progress);
  88786. var _radio = __webpack_require__(516);
  88787. var _radio2 = _interopRequireDefault(_radio);
  88788. var _rate = __webpack_require__(521);
  88789. var _rate2 = _interopRequireDefault(_rate);
  88790. var _sider = __webpack_require__(524);
  88791. var _sider2 = _interopRequireDefault(_sider);
  88792. var _slider = __webpack_require__(525);
  88793. var _slider2 = _interopRequireDefault(_slider);
  88794. var _spin = __webpack_require__(540);
  88795. var _spin2 = _interopRequireDefault(_spin);
  88796. var _steps = __webpack_require__(542);
  88797. var _steps2 = _interopRequireDefault(_steps);
  88798. var _switch = __webpack_require__(547);
  88799. var _switch2 = _interopRequireDefault(_switch);
  88800. var _table = __webpack_require__(550);
  88801. var _table2 = _interopRequireDefault(_table);
  88802. var _tabs = __webpack_require__(582);
  88803. var _tabs2 = _interopRequireDefault(_tabs);
  88804. var _tag = __webpack_require__(587);
  88805. var _tag2 = _interopRequireDefault(_tag);
  88806. var _time = __webpack_require__(590);
  88807. var _time2 = _interopRequireDefault(_time);
  88808. var _timeline = __webpack_require__(594);
  88809. var _timeline2 = _interopRequireDefault(_timeline);
  88810. var _timePicker = __webpack_require__(599);
  88811. var _timePicker2 = _interopRequireDefault(_timePicker);
  88812. var _tooltip = __webpack_require__(601);
  88813. var _tooltip2 = _interopRequireDefault(_tooltip);
  88814. var _transfer = __webpack_require__(602);
  88815. var _transfer2 = _interopRequireDefault(_transfer);
  88816. var _tree = __webpack_require__(610);
  88817. var _tree2 = _interopRequireDefault(_tree);
  88818. var _upload = __webpack_require__(616);
  88819. var _upload2 = _interopRequireDefault(_upload);
  88820. var _grid = __webpack_require__(622);
  88821. var _select = __webpack_require__(627);
  88822. var _index = __webpack_require__(120);
  88823. var _index2 = _interopRequireDefault(_index);
  88824. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  88825. var components = {
  88826. Affix: _affix2.default,
  88827. Alert: _alert2.default,
  88828. Anchor: _anchor2.default,
  88829. AnchorLink: _anchorLink2.default,
  88830. AutoComplete: _autoComplete2.default,
  88831. Avatar: _avatar2.default,
  88832. BackTop: _backTop2.default,
  88833. Badge: _badge2.default,
  88834. Breadcrumb: _breadcrumb2.default,
  88835. BreadcrumbItem: _breadcrumb2.default.Item,
  88836. Button: _button2.default,
  88837. ButtonGroup: _button2.default.Group,
  88838. Card: _card2.default,
  88839. Carousel: _carousel2.default,
  88840. CarouselItem: _carousel2.default.Item,
  88841. Cascader: _cascader2.default,
  88842. Cell: _cell2.default,
  88843. CellGroup: _cell2.default.Group,
  88844. Checkbox: _checkbox2.default,
  88845. CheckboxGroup: _checkbox2.default.Group,
  88846. Col: _grid.Col,
  88847. Collapse: _collapse2.default,
  88848. ColorPicker: _colorPicker2.default,
  88849. Content: _content2.default,
  88850. DatePicker: _datePicker2.default,
  88851. Divider: _divider2.default,
  88852. Drawer: _drawer2.default,
  88853. Dropdown: _dropdown2.default,
  88854. DropdownItem: _dropdown2.default.Item,
  88855. DropdownMenu: _dropdown2.default.Menu,
  88856. Footer: _footer2.default,
  88857. Form: _form2.default,
  88858. FormItem: _form2.default.Item,
  88859. Header: _header2.default,
  88860. Icon: _icon2.default,
  88861. Input: _input2.default,
  88862. InputNumber: _inputNumber2.default,
  88863. Scroll: _scroll2.default,
  88864. Sider: _sider2.default,
  88865. Split: _split2.default,
  88866. Submenu: _menu2.default.Sub,
  88867. Layout: _layout2.default,
  88868. List: _list2.default,
  88869. ListItem: _list2.default.Item,
  88870. ListItemMeta: _list2.default.Item.Meta,
  88871. LoadingBar: _loadingBar2.default,
  88872. Menu: _menu2.default,
  88873. MenuGroup: _menu2.default.Group,
  88874. MenuItem: _menu2.default.Item,
  88875. Message: _message2.default,
  88876. Modal: _modal2.default,
  88877. Notice: _notice2.default,
  88878. Option: _select.Option,
  88879. OptionGroup: _select.OptionGroup,
  88880. Page: _page2.default,
  88881. Panel: _collapse2.default.Panel,
  88882. Poptip: _poptip2.default,
  88883. Progress: _progress2.default,
  88884. Radio: _radio2.default,
  88885. RadioGroup: _radio2.default.Group,
  88886. Rate: _rate2.default,
  88887. Row: _grid.Row,
  88888. Select: _select.Select,
  88889. Slider: _slider2.default,
  88890. Spin: _spin2.default,
  88891. Step: _steps2.default.Step,
  88892. Steps: _steps2.default,
  88893. Table: _table2.default,
  88894. Tabs: _tabs2.default,
  88895. TabPane: _tabs2.default.Pane,
  88896. Tag: _tag2.default,
  88897. Time: _time2.default,
  88898. Timeline: _timeline2.default,
  88899. TimelineItem: _timeline2.default.Item,
  88900. TimePicker: _timePicker2.default,
  88901. Tooltip: _tooltip2.default,
  88902. Transfer: _transfer2.default,
  88903. Tree: _tree2.default,
  88904. Upload: _upload2.default
  88905. };
  88906. var iview = (0, _extends3.default)({}, components, {
  88907. iButton: _button2.default,
  88908. iCircle: _circle2.default,
  88909. iCol: _grid.Col,
  88910. iContent: _content2.default,
  88911. iForm: _form2.default,
  88912. iFooter: _footer2.default,
  88913. iHeader: _header2.default,
  88914. iInput: _input2.default,
  88915. iMenu: _menu2.default,
  88916. iOption: _select.Option,
  88917. iProgress: _progress2.default,
  88918. iSelect: _select.Select,
  88919. iSwitch: _switch2.default,
  88920. iTable: _table2.default,
  88921. iTime: _time2.default
  88922. });
  88923. var install = function install(Vue) {
  88924. var _this = this;
  88925. var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  88926. if (install.installed) return;
  88927. _index2.default.use(opts.locale);
  88928. _index2.default.i18n(opts.i18n);
  88929. (0, _keys2.default)(iview).forEach(function (key) {
  88930. (0, _newArrowCheck3.default)(this, _this);
  88931. Vue.component(key, iview[key]);
  88932. }.bind(this));
  88933. Vue.prototype.$IVIEW = {
  88934. size: opts.size || '',
  88935. transfer: 'transfer' in opts ? opts.transfer : '',
  88936. capture: 'capture' in opts ? opts.capture : true,
  88937. select: {
  88938. arrow: opts.select ? opts.select.arrow ? opts.select.arrow : '' : '',
  88939. customArrow: opts.select ? opts.select.customArrow ? opts.select.customArrow : '' : '',
  88940. arrowSize: opts.select ? opts.select.arrowSize ? opts.select.arrowSize : '' : ''
  88941. },
  88942. cell: {
  88943. arrow: opts.cell ? opts.cell.arrow ? opts.cell.arrow : '' : '',
  88944. customArrow: opts.cell ? opts.cell.customArrow ? opts.cell.customArrow : '' : '',
  88945. arrowSize: opts.cell ? opts.cell.arrowSize ? opts.cell.arrowSize : '' : ''
  88946. },
  88947. menu: {
  88948. arrow: opts.menu ? opts.menu.arrow ? opts.menu.arrow : '' : '',
  88949. customArrow: opts.menu ? opts.menu.customArrow ? opts.menu.customArrow : '' : '',
  88950. arrowSize: opts.menu ? opts.menu.arrowSize ? opts.menu.arrowSize : '' : ''
  88951. },
  88952. tree: {
  88953. arrow: opts.tree ? opts.tree.arrow ? opts.tree.arrow : '' : '',
  88954. customArrow: opts.tree ? opts.tree.customArrow ? opts.tree.customArrow : '' : '',
  88955. arrowSize: opts.tree ? opts.tree.arrowSize ? opts.tree.arrowSize : '' : ''
  88956. },
  88957. cascader: {
  88958. arrow: opts.cascader ? opts.cascader.arrow ? opts.cascader.arrow : '' : '',
  88959. customArrow: opts.cascader ? opts.cascader.customArrow ? opts.cascader.customArrow : '' : '',
  88960. arrowSize: opts.cascader ? opts.cascader.arrowSize ? opts.cascader.arrowSize : '' : '',
  88961. itemArrow: opts.cascader ? opts.cascader.itemArrow ? opts.cascader.itemArrow : '' : '',
  88962. customItemArrow: opts.cascader ? opts.cascader.customItemArrow ? opts.cascader.customItemArrow : '' : '',
  88963. itemArrowSize: opts.cascader ? opts.cascader.itemArrowSize ? opts.cascader.itemArrowSize : '' : ''
  88964. },
  88965. colorPicker: {
  88966. arrow: opts.colorPicker ? opts.colorPicker.arrow ? opts.colorPicker.arrow : '' : '',
  88967. customArrow: opts.colorPicker ? opts.colorPicker.customArrow ? opts.colorPicker.customArrow : '' : '',
  88968. arrowSize: opts.colorPicker ? opts.colorPicker.arrowSize ? opts.colorPicker.arrowSize : '' : ''
  88969. },
  88970. datePicker: {
  88971. icon: opts.datePicker ? opts.datePicker.icon ? opts.datePicker.icon : '' : '',
  88972. customIcon: opts.datePicker ? opts.datePicker.customIcon ? opts.datePicker.customIcon : '' : '',
  88973. iconSize: opts.datePicker ? opts.datePicker.iconSize ? opts.datePicker.iconSize : '' : ''
  88974. },
  88975. timePicker: {
  88976. icon: opts.timePicker ? opts.timePicker.icon ? opts.timePicker.icon : '' : '',
  88977. customIcon: opts.timePicker ? opts.timePicker.customIcon ? opts.timePicker.customIcon : '' : '',
  88978. iconSize: opts.timePicker ? opts.timePicker.iconSize ? opts.timePicker.iconSize : '' : ''
  88979. },
  88980. tabs: {
  88981. closeIcon: opts.tabs ? opts.tabs.closeIcon ? opts.tabs.closeIcon : '' : '',
  88982. customCloseIcon: opts.tabs ? opts.tabs.customCloseIcon ? opts.tabs.customCloseIcon : '' : '',
  88983. closeIconSize: opts.tabs ? opts.tabs.closeIconSize ? opts.tabs.closeIconSize : '' : ''
  88984. },
  88985. modal: {
  88986. maskClosable: opts.modal ? 'maskClosable' in opts.modal ? opts.modal.maskClosable : '' : ''
  88987. }
  88988. };
  88989. Vue.prototype.$Loading = _loadingBar2.default;
  88990. Vue.prototype.$Message = _message2.default;
  88991. Vue.prototype.$Modal = _modal2.default;
  88992. Vue.prototype.$Notice = _notice2.default;
  88993. Vue.prototype.$Spin = _spin2.default;
  88994. };
  88995. if (typeof window !== 'undefined' && window.Vue) {
  88996. install(window.Vue);
  88997. }
  88998. var API = (0, _extends3.default)({
  88999. version: '4.7.0',
  89000. locale: _index2.default.use,
  89001. i18n: _index2.default.i18n,
  89002. install: install,
  89003. Circle: _circle2.default,
  89004. Switch: _switch2.default
  89005. }, components);
  89006. API.lang = function (code) {
  89007. (0, _newArrowCheck3.default)(undefined, undefined);
  89008. var langObject = window['iview/locale'].default;
  89009. if (code === langObject.i.locale) _index2.default.use(langObject);else console.log('The ' + String(code) + ' language pack is not loaded.');
  89010. }.bind(undefined);
  89011. module.exports.default = module.exports = API;
  89012. /***/ }),
  89013. /* 260 */
  89014. /***/ (function(module, exports, __webpack_require__) {
  89015. __webpack_require__(261);
  89016. module.exports = __webpack_require__(5).Object.keys;
  89017. /***/ }),
  89018. /* 261 */
  89019. /***/ (function(module, exports, __webpack_require__) {
  89020. // 19.1.2.14 Object.keys(O)
  89021. var toObject = __webpack_require__(29);
  89022. var $keys = __webpack_require__(40);
  89023. __webpack_require__(97)('keys', function () {
  89024. return function keys(it) {
  89025. return $keys(toObject(it));
  89026. };
  89027. });
  89028. /***/ }),
  89029. /* 262 */
  89030. /***/ (function(module, exports, __webpack_require__) {
  89031. // false -> Array#indexOf
  89032. // true -> Array#includes
  89033. var toIObject = __webpack_require__(33);
  89034. var toLength = __webpack_require__(52);
  89035. var toAbsoluteIndex = __webpack_require__(263);
  89036. module.exports = function (IS_INCLUDES) {
  89037. return function ($this, el, fromIndex) {
  89038. var O = toIObject($this);
  89039. var length = toLength(O.length);
  89040. var index = toAbsoluteIndex(fromIndex, length);
  89041. var value;
  89042. // Array#includes uses SameValueZero equality algorithm
  89043. // eslint-disable-next-line no-self-compare
  89044. if (IS_INCLUDES && el != el) while (length > index) {
  89045. value = O[index++];
  89046. // eslint-disable-next-line no-self-compare
  89047. if (value != value) return true;
  89048. // Array#indexOf ignores holes, Array#includes - not
  89049. } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
  89050. if (O[index] === el) return IS_INCLUDES || index || 0;
  89051. } return !IS_INCLUDES && -1;
  89052. };
  89053. };
  89054. /***/ }),
  89055. /* 263 */
  89056. /***/ (function(module, exports, __webpack_require__) {
  89057. var toInteger = __webpack_require__(65);
  89058. var max = Math.max;
  89059. var min = Math.min;
  89060. module.exports = function (index, length) {
  89061. index = toInteger(index);
  89062. return index < 0 ? max(index + length, 0) : min(index, length);
  89063. };
  89064. /***/ }),
  89065. /* 264 */
  89066. /***/ (function(module, exports, __webpack_require__) {
  89067. __webpack_require__(265);
  89068. module.exports = __webpack_require__(5).Object.assign;
  89069. /***/ }),
  89070. /* 265 */
  89071. /***/ (function(module, exports, __webpack_require__) {
  89072. // 19.1.3.1 Object.assign(target, source)
  89073. var $export = __webpack_require__(7);
  89074. $export($export.S + $export.F, 'Object', { assign: __webpack_require__(266) });
  89075. /***/ }),
  89076. /* 266 */
  89077. /***/ (function(module, exports, __webpack_require__) {
  89078. "use strict";
  89079. // 19.1.2.1 Object.assign(target, source, ...)
  89080. var DESCRIPTORS = __webpack_require__(13);
  89081. var getKeys = __webpack_require__(40);
  89082. var gOPS = __webpack_require__(71);
  89083. var pIE = __webpack_require__(54);
  89084. var toObject = __webpack_require__(29);
  89085. var IObject = __webpack_require__(64);
  89086. var $assign = Object.assign;
  89087. // should work with symbols and should have deterministic property order (V8 bug)
  89088. module.exports = !$assign || __webpack_require__(31)(function () {
  89089. var A = {};
  89090. var B = {};
  89091. // eslint-disable-next-line no-undef
  89092. var S = Symbol();
  89093. var K = 'abcdefghijklmnopqrst';
  89094. A[S] = 7;
  89095. K.split('').forEach(function (k) { B[k] = k; });
  89096. return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
  89097. }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  89098. var T = toObject(target);
  89099. var aLen = arguments.length;
  89100. var index = 1;
  89101. var getSymbols = gOPS.f;
  89102. var isEnum = pIE.f;
  89103. while (aLen > index) {
  89104. var S = IObject(arguments[index++]);
  89105. var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
  89106. var length = keys.length;
  89107. var j = 0;
  89108. var key;
  89109. while (length > j) {
  89110. key = keys[j++];
  89111. if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
  89112. }
  89113. } return T;
  89114. } : $assign;
  89115. /***/ }),
  89116. /* 267 */
  89117. /***/ (function(module, exports, __webpack_require__) {
  89118. "use strict";
  89119. Object.defineProperty(exports, "__esModule", {
  89120. value: true
  89121. });
  89122. var _affix = __webpack_require__(268);
  89123. var _affix2 = _interopRequireDefault(_affix);
  89124. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89125. exports.default = _affix2.default;
  89126. /***/ }),
  89127. /* 268 */
  89128. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89129. "use strict";
  89130. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  89131. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__ = __webpack_require__(99);
  89132. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__);
  89133. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  89134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__ = __webpack_require__(272);
  89135. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__);
  89136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  89137. /* script */
  89138. /* template */
  89139. /* template functional */
  89140. var __vue_template_functional__ = false
  89141. /* styles */
  89142. var __vue_styles__ = null
  89143. /* scopeId */
  89144. var __vue_scopeId__ = null
  89145. /* moduleIdentifier (server only) */
  89146. var __vue_module_identifier__ = null
  89147. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  89148. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_affix_vue___default.a,
  89149. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__["render"],
  89150. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c6e81d2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_affix_vue__["staticRenderFns"],
  89151. __vue_template_functional__,
  89152. __vue_styles__,
  89153. __vue_scopeId__,
  89154. __vue_module_identifier__
  89155. )
  89156. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  89157. /***/ }),
  89158. /* 269 */
  89159. /***/ (function(module, exports, __webpack_require__) {
  89160. module.exports = { "default": __webpack_require__(270), __esModule: true };
  89161. /***/ }),
  89162. /* 270 */
  89163. /***/ (function(module, exports, __webpack_require__) {
  89164. __webpack_require__(271);
  89165. var $Object = __webpack_require__(5).Object;
  89166. module.exports = function defineProperty(it, key, desc) {
  89167. return $Object.defineProperty(it, key, desc);
  89168. };
  89169. /***/ }),
  89170. /* 271 */
  89171. /***/ (function(module, exports, __webpack_require__) {
  89172. var $export = __webpack_require__(7);
  89173. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  89174. $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperty: __webpack_require__(14).f });
  89175. /***/ }),
  89176. /* 272 */
  89177. /***/ (function(module, exports, __webpack_require__) {
  89178. "use strict";
  89179. Object.defineProperty(exports, "__esModule", {
  89180. value: true
  89181. });
  89182. var render = function render() {
  89183. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', [_c('div', { ref: "point", class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slot, expression: "slot" }], style: _vm.slotStyle })]);
  89184. };
  89185. var staticRenderFns = [];
  89186. exports.render = render;
  89187. exports.staticRenderFns = staticRenderFns;
  89188. /***/ }),
  89189. /* 273 */
  89190. /***/ (function(module, exports, __webpack_require__) {
  89191. "use strict";
  89192. Object.defineProperty(exports, "__esModule", {
  89193. value: true
  89194. });
  89195. var _alert = __webpack_require__(274);
  89196. var _alert2 = _interopRequireDefault(_alert);
  89197. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89198. exports.default = _alert2.default;
  89199. /***/ }),
  89200. /* 274 */
  89201. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89202. "use strict";
  89203. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  89204. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__ = __webpack_require__(100);
  89205. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__);
  89206. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  89207. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__ = __webpack_require__(282);
  89208. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__);
  89209. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  89210. /* script */
  89211. /* template */
  89212. /* template functional */
  89213. var __vue_template_functional__ = false
  89214. /* styles */
  89215. var __vue_styles__ = null
  89216. /* scopeId */
  89217. var __vue_scopeId__ = null
  89218. /* moduleIdentifier (server only) */
  89219. var __vue_module_identifier__ = null
  89220. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  89221. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alert_vue___default.a,
  89222. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__["render"],
  89223. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_72ea7b7c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alert_vue__["staticRenderFns"],
  89224. __vue_template_functional__,
  89225. __vue_styles__,
  89226. __vue_scopeId__,
  89227. __vue_module_identifier__
  89228. )
  89229. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  89230. /***/ }),
  89231. /* 275 */
  89232. /***/ (function(module, exports, __webpack_require__) {
  89233. "use strict";
  89234. Object.defineProperty(exports, "__esModule", {
  89235. value: true
  89236. });
  89237. var render = function render() {
  89238. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('i', { class: _vm.classes, style: _vm.styles, on: { "click": _vm.handleClick } });
  89239. };
  89240. var staticRenderFns = [];
  89241. exports.render = render;
  89242. exports.staticRenderFns = staticRenderFns;
  89243. /***/ }),
  89244. /* 276 */
  89245. /***/ (function(module, exports, __webpack_require__) {
  89246. __webpack_require__(46);
  89247. __webpack_require__(35);
  89248. module.exports = __webpack_require__(281);
  89249. /***/ }),
  89250. /* 277 */
  89251. /***/ (function(module, exports, __webpack_require__) {
  89252. "use strict";
  89253. var addToUnscopables = __webpack_require__(278);
  89254. var step = __webpack_require__(102);
  89255. var Iterators = __webpack_require__(34);
  89256. var toIObject = __webpack_require__(33);
  89257. // 22.1.3.4 Array.prototype.entries()
  89258. // 22.1.3.13 Array.prototype.keys()
  89259. // 22.1.3.29 Array.prototype.values()
  89260. // 22.1.3.30 Array.prototype[@@iterator]()
  89261. module.exports = __webpack_require__(72)(Array, 'Array', function (iterated, kind) {
  89262. this._t = toIObject(iterated); // target
  89263. this._i = 0; // next index
  89264. this._k = kind; // kind
  89265. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  89266. }, function () {
  89267. var O = this._t;
  89268. var kind = this._k;
  89269. var index = this._i++;
  89270. if (!O || index >= O.length) {
  89271. this._t = undefined;
  89272. return step(1);
  89273. }
  89274. if (kind == 'keys') return step(0, index);
  89275. if (kind == 'values') return step(0, O[index]);
  89276. return step(0, [index, O[index]]);
  89277. }, 'values');
  89278. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  89279. Iterators.Arguments = Iterators.Array;
  89280. addToUnscopables('keys');
  89281. addToUnscopables('values');
  89282. addToUnscopables('entries');
  89283. /***/ }),
  89284. /* 278 */
  89285. /***/ (function(module, exports) {
  89286. module.exports = function () { /* empty */ };
  89287. /***/ }),
  89288. /* 279 */
  89289. /***/ (function(module, exports, __webpack_require__) {
  89290. "use strict";
  89291. var create = __webpack_require__(55);
  89292. var descriptor = __webpack_require__(44);
  89293. var setToStringTag = __webpack_require__(47);
  89294. var IteratorPrototype = {};
  89295. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  89296. __webpack_require__(25)(IteratorPrototype, __webpack_require__(10)('iterator'), function () { return this; });
  89297. module.exports = function (Constructor, NAME, next) {
  89298. Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  89299. setToStringTag(Constructor, NAME + ' Iterator');
  89300. };
  89301. /***/ }),
  89302. /* 280 */
  89303. /***/ (function(module, exports, __webpack_require__) {
  89304. var toInteger = __webpack_require__(65);
  89305. var defined = __webpack_require__(63);
  89306. // true -> String#at
  89307. // false -> String#codePointAt
  89308. module.exports = function (TO_STRING) {
  89309. return function (that, pos) {
  89310. var s = String(defined(that));
  89311. var i = toInteger(pos);
  89312. var l = s.length;
  89313. var a, b;
  89314. if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
  89315. a = s.charCodeAt(i);
  89316. return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  89317. ? TO_STRING ? s.charAt(i) : a
  89318. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  89319. };
  89320. };
  89321. /***/ }),
  89322. /* 281 */
  89323. /***/ (function(module, exports, __webpack_require__) {
  89324. var anObject = __webpack_require__(22);
  89325. var get = __webpack_require__(73);
  89326. module.exports = __webpack_require__(5).getIterator = function (it) {
  89327. var iterFn = get(it);
  89328. if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
  89329. return anObject(iterFn.call(it));
  89330. };
  89331. /***/ }),
  89332. /* 282 */
  89333. /***/ (function(module, exports, __webpack_require__) {
  89334. "use strict";
  89335. Object.defineProperty(exports, "__esModule", {
  89336. value: true
  89337. });
  89338. var render = function render() {
  89339. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": _vm.fade ? 'fade' : '' } }, [!_vm.closed ? _c('div', { class: _vm.wrapClasses }, [_vm.showIcon ? _c('span', { class: _vm.iconClasses }, [_vm._t("icon", [_c('Icon', { attrs: { "type": _vm.iconType } })])], 2) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.messageClasses }, [_vm._t("default")], 2), _vm._v(" "), _c('span', { class: _vm.descClasses }, [_vm._t("desc")], 2), _vm._v(" "), _vm.closable ? _c('a', { class: _vm.closeClasses, on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e()]) : _vm._e()]);
  89340. };
  89341. var staticRenderFns = [];
  89342. exports.render = render;
  89343. exports.staticRenderFns = staticRenderFns;
  89344. /***/ }),
  89345. /* 283 */
  89346. /***/ (function(module, exports, __webpack_require__) {
  89347. "use strict";
  89348. Object.defineProperty(exports, "__esModule", {
  89349. value: true
  89350. });
  89351. var _anchor = __webpack_require__(284);
  89352. var _anchor2 = _interopRequireDefault(_anchor);
  89353. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89354. exports.default = _anchor2.default;
  89355. /***/ }),
  89356. /* 284 */
  89357. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89358. "use strict";
  89359. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  89360. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__ = __webpack_require__(107);
  89361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__);
  89362. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  89363. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__ = __webpack_require__(285);
  89364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__);
  89365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  89366. /* script */
  89367. /* template */
  89368. /* template functional */
  89369. var __vue_template_functional__ = false
  89370. /* styles */
  89371. var __vue_styles__ = null
  89372. /* scopeId */
  89373. var __vue_scopeId__ = null
  89374. /* moduleIdentifier (server only) */
  89375. var __vue_module_identifier__ = null
  89376. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  89377. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_vue___default.a,
  89378. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__["render"],
  89379. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_13a5a54e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_vue__["staticRenderFns"],
  89380. __vue_template_functional__,
  89381. __vue_styles__,
  89382. __vue_scopeId__,
  89383. __vue_module_identifier__
  89384. )
  89385. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  89386. /***/ }),
  89387. /* 285 */
  89388. /***/ (function(module, exports, __webpack_require__) {
  89389. "use strict";
  89390. Object.defineProperty(exports, "__esModule", {
  89391. value: true
  89392. });
  89393. var render = function render() {
  89394. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.wrapperComponent, { tag: "component", attrs: { "offset-top": _vm.offsetTop, "offset-bottom": _vm.offsetBottom }, on: { "on-change": _vm.handleAffixStateChange } }, [_c('div', { class: _vm.prefix + "-wrapper", style: _vm.wrapperStyle }, [_c('div', { class: "" + _vm.prefix }, [_c('div', { class: _vm.prefix + "-ink" }, [_c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.showInk, expression: "showInk" }], class: _vm.prefix + "-ink-ball", style: { top: _vm.inkTop + "px" } })]), _vm._v(" "), _vm._t("default")], 2)])]);
  89395. };
  89396. var staticRenderFns = [];
  89397. exports.render = render;
  89398. exports.staticRenderFns = staticRenderFns;
  89399. /***/ }),
  89400. /* 286 */
  89401. /***/ (function(module, exports, __webpack_require__) {
  89402. "use strict";
  89403. Object.defineProperty(exports, "__esModule", {
  89404. value: true
  89405. });
  89406. var _anchorLink = __webpack_require__(287);
  89407. var _anchorLink2 = _interopRequireDefault(_anchorLink);
  89408. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89409. exports.default = _anchorLink2.default;
  89410. /***/ }),
  89411. /* 287 */
  89412. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89413. "use strict";
  89414. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  89415. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__ = __webpack_require__(108);
  89416. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__);
  89417. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  89418. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__ = __webpack_require__(288);
  89419. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__);
  89420. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  89421. /* script */
  89422. /* template */
  89423. /* template functional */
  89424. var __vue_template_functional__ = false
  89425. /* styles */
  89426. var __vue_styles__ = null
  89427. /* scopeId */
  89428. var __vue_scopeId__ = null
  89429. /* moduleIdentifier (server only) */
  89430. var __vue_module_identifier__ = null
  89431. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  89432. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_anchor_link_vue___default.a,
  89433. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__["render"],
  89434. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_14eb8c86_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_anchor_link_vue__["staticRenderFns"],
  89435. __vue_template_functional__,
  89436. __vue_styles__,
  89437. __vue_scopeId__,
  89438. __vue_module_identifier__
  89439. )
  89440. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  89441. /***/ }),
  89442. /* 288 */
  89443. /***/ (function(module, exports, __webpack_require__) {
  89444. "use strict";
  89445. Object.defineProperty(exports, "__esModule", {
  89446. value: true
  89447. });
  89448. var render = function render() {
  89449. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.anchorLinkClasses }, [_c('a', { class: _vm.linkTitleClasses, attrs: { "href": _vm.href, "data-scroll-offset": _vm.scrollOffset, "data-href": _vm.href, "title": _vm.title }, on: { "click": function click($event) {
  89450. $event.preventDefault();return _vm.goAnchor($event);
  89451. } } }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _vm._t("default")], 2);
  89452. };
  89453. var staticRenderFns = [];
  89454. exports.render = render;
  89455. exports.staticRenderFns = staticRenderFns;
  89456. /***/ }),
  89457. /* 289 */
  89458. /***/ (function(module, exports, __webpack_require__) {
  89459. "use strict";
  89460. Object.defineProperty(exports, "__esModule", {
  89461. value: true
  89462. });
  89463. var _autoComplete = __webpack_require__(290);
  89464. var _autoComplete2 = _interopRequireDefault(_autoComplete);
  89465. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89466. exports.default = _autoComplete2.default;
  89467. /***/ }),
  89468. /* 290 */
  89469. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  89470. "use strict";
  89471. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  89472. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__ = __webpack_require__(109);
  89473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__);
  89474. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  89475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__ = __webpack_require__(340);
  89476. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__);
  89477. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  89478. /* script */
  89479. /* template */
  89480. /* template functional */
  89481. var __vue_template_functional__ = false
  89482. /* styles */
  89483. var __vue_styles__ = null
  89484. /* scopeId */
  89485. var __vue_scopeId__ = null
  89486. /* moduleIdentifier (server only) */
  89487. var __vue_module_identifier__ = null
  89488. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  89489. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_auto_complete_vue___default.a,
  89490. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__["render"],
  89491. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_88c5f044_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_auto_complete_vue__["staticRenderFns"],
  89492. __vue_template_functional__,
  89493. __vue_styles__,
  89494. __vue_scopeId__,
  89495. __vue_module_identifier__
  89496. )
  89497. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  89498. /***/ }),
  89499. /* 291 */
  89500. /***/ (function(module, exports, __webpack_require__) {
  89501. module.exports = { "default": __webpack_require__(292), __esModule: true };
  89502. /***/ }),
  89503. /* 292 */
  89504. /***/ (function(module, exports, __webpack_require__) {
  89505. __webpack_require__(46);
  89506. __webpack_require__(35);
  89507. module.exports = __webpack_require__(293);
  89508. /***/ }),
  89509. /* 293 */
  89510. /***/ (function(module, exports, __webpack_require__) {
  89511. var classof = __webpack_require__(56);
  89512. var ITERATOR = __webpack_require__(10)('iterator');
  89513. var Iterators = __webpack_require__(34);
  89514. module.exports = __webpack_require__(5).isIterable = function (it) {
  89515. var O = Object(it);
  89516. return O[ITERATOR] !== undefined
  89517. || '@@iterator' in O
  89518. // eslint-disable-next-line no-prototype-builtins
  89519. || Iterators.hasOwnProperty(classof(O));
  89520. };
  89521. /***/ }),
  89522. /* 294 */
  89523. /***/ (function(module, exports, __webpack_require__) {
  89524. __webpack_require__(295);
  89525. module.exports = __webpack_require__(5).Number.isFinite;
  89526. /***/ }),
  89527. /* 295 */
  89528. /***/ (function(module, exports, __webpack_require__) {
  89529. // 20.1.2.2 Number.isFinite(number)
  89530. var $export = __webpack_require__(7);
  89531. var _isFinite = __webpack_require__(9).isFinite;
  89532. $export($export.S, 'Number', {
  89533. isFinite: function isFinite(it) {
  89534. return typeof it == 'number' && _isFinite(it);
  89535. }
  89536. });
  89537. /***/ }),
  89538. /* 296 */
  89539. /***/ (function(module, exports, __webpack_require__) {
  89540. var core = __webpack_require__(5);
  89541. var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
  89542. module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
  89543. return $JSON.stringify.apply($JSON, arguments);
  89544. };
  89545. /***/ }),
  89546. /* 297 */
  89547. /***/ (function(module, exports, __webpack_require__) {
  89548. __webpack_require__(35);
  89549. __webpack_require__(298);
  89550. module.exports = __webpack_require__(5).Array.from;
  89551. /***/ }),
  89552. /* 298 */
  89553. /***/ (function(module, exports, __webpack_require__) {
  89554. "use strict";
  89555. var ctx = __webpack_require__(24);
  89556. var $export = __webpack_require__(7);
  89557. var toObject = __webpack_require__(29);
  89558. var call = __webpack_require__(112);
  89559. var isArrayIter = __webpack_require__(113);
  89560. var toLength = __webpack_require__(52);
  89561. var createProperty = __webpack_require__(299);
  89562. var getIterFn = __webpack_require__(73);
  89563. $export($export.S + $export.F * !__webpack_require__(114)(function (iter) { Array.from(iter); }), 'Array', {
  89564. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  89565. from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
  89566. var O = toObject(arrayLike);
  89567. var C = typeof this == 'function' ? this : Array;
  89568. var aLen = arguments.length;
  89569. var mapfn = aLen > 1 ? arguments[1] : undefined;
  89570. var mapping = mapfn !== undefined;
  89571. var index = 0;
  89572. var iterFn = getIterFn(O);
  89573. var length, result, step, iterator;
  89574. if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
  89575. // if object isn't iterable or it's array with default iterator - use simple case
  89576. if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
  89577. for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
  89578. createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
  89579. }
  89580. } else {
  89581. length = toLength(O.length);
  89582. for (result = new C(length); length > index; index++) {
  89583. createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
  89584. }
  89585. }
  89586. result.length = index;
  89587. return result;
  89588. }
  89589. });
  89590. /***/ }),
  89591. /* 299 */
  89592. /***/ (function(module, exports, __webpack_require__) {
  89593. "use strict";
  89594. var $defineProperty = __webpack_require__(14);
  89595. var createDesc = __webpack_require__(44);
  89596. module.exports = function (object, index, value) {
  89597. if (index in object) $defineProperty.f(object, index, createDesc(0, value));
  89598. else object[index] = value;
  89599. };
  89600. /***/ }),
  89601. /* 300 */
  89602. /***/ (function(module, exports, __webpack_require__) {
  89603. "use strict";
  89604. Object.defineProperty(exports, "__esModule", {
  89605. value: true
  89606. });
  89607. var render = function render() {
  89608. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-select-dropdown", class: _vm.className, style: _vm.styles }, [_vm._t("default")], 2);
  89609. };
  89610. var staticRenderFns = [];
  89611. exports.render = render;
  89612. exports.staticRenderFns = staticRenderFns;
  89613. /***/ }),
  89614. /* 301 */
  89615. /***/ (function(module, exports, __webpack_require__) {
  89616. module.exports = { "default": __webpack_require__(302), __esModule: true };
  89617. /***/ }),
  89618. /* 302 */
  89619. /***/ (function(module, exports, __webpack_require__) {
  89620. __webpack_require__(35);
  89621. __webpack_require__(46);
  89622. module.exports = __webpack_require__(77).f('iterator');
  89623. /***/ }),
  89624. /* 303 */
  89625. /***/ (function(module, exports, __webpack_require__) {
  89626. module.exports = { "default": __webpack_require__(304), __esModule: true };
  89627. /***/ }),
  89628. /* 304 */
  89629. /***/ (function(module, exports, __webpack_require__) {
  89630. __webpack_require__(305);
  89631. __webpack_require__(80);
  89632. __webpack_require__(309);
  89633. __webpack_require__(310);
  89634. module.exports = __webpack_require__(5).Symbol;
  89635. /***/ }),
  89636. /* 305 */
  89637. /***/ (function(module, exports, __webpack_require__) {
  89638. "use strict";
  89639. // ECMAScript 6 symbols shim
  89640. var global = __webpack_require__(9);
  89641. var has = __webpack_require__(30);
  89642. var DESCRIPTORS = __webpack_require__(13);
  89643. var $export = __webpack_require__(7);
  89644. var redefine = __webpack_require__(103);
  89645. var META = __webpack_require__(78).KEY;
  89646. var $fails = __webpack_require__(31);
  89647. var shared = __webpack_require__(67);
  89648. var setToStringTag = __webpack_require__(47);
  89649. var uid = __webpack_require__(53);
  89650. var wks = __webpack_require__(10);
  89651. var wksExt = __webpack_require__(77);
  89652. var wksDefine = __webpack_require__(79);
  89653. var enumKeys = __webpack_require__(306);
  89654. var isArray = __webpack_require__(118);
  89655. var anObject = __webpack_require__(22);
  89656. var isObject = __webpack_require__(18);
  89657. var toObject = __webpack_require__(29);
  89658. var toIObject = __webpack_require__(33);
  89659. var toPrimitive = __webpack_require__(70);
  89660. var createDesc = __webpack_require__(44);
  89661. var _create = __webpack_require__(55);
  89662. var gOPNExt = __webpack_require__(307);
  89663. var $GOPD = __webpack_require__(308);
  89664. var $GOPS = __webpack_require__(71);
  89665. var $DP = __webpack_require__(14);
  89666. var $keys = __webpack_require__(40);
  89667. var gOPD = $GOPD.f;
  89668. var dP = $DP.f;
  89669. var gOPN = gOPNExt.f;
  89670. var $Symbol = global.Symbol;
  89671. var $JSON = global.JSON;
  89672. var _stringify = $JSON && $JSON.stringify;
  89673. var PROTOTYPE = 'prototype';
  89674. var HIDDEN = wks('_hidden');
  89675. var TO_PRIMITIVE = wks('toPrimitive');
  89676. var isEnum = {}.propertyIsEnumerable;
  89677. var SymbolRegistry = shared('symbol-registry');
  89678. var AllSymbols = shared('symbols');
  89679. var OPSymbols = shared('op-symbols');
  89680. var ObjectProto = Object[PROTOTYPE];
  89681. var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
  89682. var QObject = global.QObject;
  89683. // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
  89684. var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
  89685. // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
  89686. var setSymbolDesc = DESCRIPTORS && $fails(function () {
  89687. return _create(dP({}, 'a', {
  89688. get: function () { return dP(this, 'a', { value: 7 }).a; }
  89689. })).a != 7;
  89690. }) ? function (it, key, D) {
  89691. var protoDesc = gOPD(ObjectProto, key);
  89692. if (protoDesc) delete ObjectProto[key];
  89693. dP(it, key, D);
  89694. if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
  89695. } : dP;
  89696. var wrap = function (tag) {
  89697. var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
  89698. sym._k = tag;
  89699. return sym;
  89700. };
  89701. var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
  89702. return typeof it == 'symbol';
  89703. } : function (it) {
  89704. return it instanceof $Symbol;
  89705. };
  89706. var $defineProperty = function defineProperty(it, key, D) {
  89707. if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
  89708. anObject(it);
  89709. key = toPrimitive(key, true);
  89710. anObject(D);
  89711. if (has(AllSymbols, key)) {
  89712. if (!D.enumerable) {
  89713. if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
  89714. it[HIDDEN][key] = true;
  89715. } else {
  89716. if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
  89717. D = _create(D, { enumerable: createDesc(0, false) });
  89718. } return setSymbolDesc(it, key, D);
  89719. } return dP(it, key, D);
  89720. };
  89721. var $defineProperties = function defineProperties(it, P) {
  89722. anObject(it);
  89723. var keys = enumKeys(P = toIObject(P));
  89724. var i = 0;
  89725. var l = keys.length;
  89726. var key;
  89727. while (l > i) $defineProperty(it, key = keys[i++], P[key]);
  89728. return it;
  89729. };
  89730. var $create = function create(it, P) {
  89731. return P === undefined ? _create(it) : $defineProperties(_create(it), P);
  89732. };
  89733. var $propertyIsEnumerable = function propertyIsEnumerable(key) {
  89734. var E = isEnum.call(this, key = toPrimitive(key, true));
  89735. if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
  89736. return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
  89737. };
  89738. var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
  89739. it = toIObject(it);
  89740. key = toPrimitive(key, true);
  89741. if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
  89742. var D = gOPD(it, key);
  89743. if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
  89744. return D;
  89745. };
  89746. var $getOwnPropertyNames = function getOwnPropertyNames(it) {
  89747. var names = gOPN(toIObject(it));
  89748. var result = [];
  89749. var i = 0;
  89750. var key;
  89751. while (names.length > i) {
  89752. if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
  89753. } return result;
  89754. };
  89755. var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
  89756. var IS_OP = it === ObjectProto;
  89757. var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
  89758. var result = [];
  89759. var i = 0;
  89760. var key;
  89761. while (names.length > i) {
  89762. if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
  89763. } return result;
  89764. };
  89765. // 19.4.1.1 Symbol([description])
  89766. if (!USE_NATIVE) {
  89767. $Symbol = function Symbol() {
  89768. if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
  89769. var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
  89770. var $set = function (value) {
  89771. if (this === ObjectProto) $set.call(OPSymbols, value);
  89772. if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
  89773. setSymbolDesc(this, tag, createDesc(1, value));
  89774. };
  89775. if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
  89776. return wrap(tag);
  89777. };
  89778. redefine($Symbol[PROTOTYPE], 'toString', function toString() {
  89779. return this._k;
  89780. });
  89781. $GOPD.f = $getOwnPropertyDescriptor;
  89782. $DP.f = $defineProperty;
  89783. __webpack_require__(119).f = gOPNExt.f = $getOwnPropertyNames;
  89784. __webpack_require__(54).f = $propertyIsEnumerable;
  89785. $GOPS.f = $getOwnPropertySymbols;
  89786. if (DESCRIPTORS && !__webpack_require__(42)) {
  89787. redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
  89788. }
  89789. wksExt.f = function (name) {
  89790. return wrap(wks(name));
  89791. };
  89792. }
  89793. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
  89794. for (var es6Symbols = (
  89795. // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
  89796. 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
  89797. ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
  89798. for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
  89799. $export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
  89800. // 19.4.2.1 Symbol.for(key)
  89801. 'for': function (key) {
  89802. return has(SymbolRegistry, key += '')
  89803. ? SymbolRegistry[key]
  89804. : SymbolRegistry[key] = $Symbol(key);
  89805. },
  89806. // 19.4.2.5 Symbol.keyFor(sym)
  89807. keyFor: function keyFor(sym) {
  89808. if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
  89809. for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
  89810. },
  89811. useSetter: function () { setter = true; },
  89812. useSimple: function () { setter = false; }
  89813. });
  89814. $export($export.S + $export.F * !USE_NATIVE, 'Object', {
  89815. // 19.1.2.2 Object.create(O [, Properties])
  89816. create: $create,
  89817. // 19.1.2.4 Object.defineProperty(O, P, Attributes)
  89818. defineProperty: $defineProperty,
  89819. // 19.1.2.3 Object.defineProperties(O, Properties)
  89820. defineProperties: $defineProperties,
  89821. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  89822. getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
  89823. // 19.1.2.7 Object.getOwnPropertyNames(O)
  89824. getOwnPropertyNames: $getOwnPropertyNames,
  89825. // 19.1.2.8 Object.getOwnPropertySymbols(O)
  89826. getOwnPropertySymbols: $getOwnPropertySymbols
  89827. });
  89828. // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
  89829. // https://bugs.chromium.org/p/v8/issues/detail?id=3443
  89830. var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
  89831. $export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
  89832. getOwnPropertySymbols: function getOwnPropertySymbols(it) {
  89833. return $GOPS.f(toObject(it));
  89834. }
  89835. });
  89836. // 24.3.2 JSON.stringify(value [, replacer [, space]])
  89837. $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
  89838. var S = $Symbol();
  89839. // MS Edge converts symbol values to JSON as {}
  89840. // WebKit converts symbol values to JSON as null
  89841. // V8 throws on boxed symbols
  89842. return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
  89843. })), 'JSON', {
  89844. stringify: function stringify(it) {
  89845. var args = [it];
  89846. var i = 1;
  89847. var replacer, $replacer;
  89848. while (arguments.length > i) args.push(arguments[i++]);
  89849. $replacer = replacer = args[1];
  89850. if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
  89851. if (!isArray(replacer)) replacer = function (key, value) {
  89852. if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
  89853. if (!isSymbol(value)) return value;
  89854. };
  89855. args[1] = replacer;
  89856. return _stringify.apply($JSON, args);
  89857. }
  89858. });
  89859. // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
  89860. $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(25)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
  89861. // 19.4.3.5 Symbol.prototype[@@toStringTag]
  89862. setToStringTag($Symbol, 'Symbol');
  89863. // 20.2.1.9 Math[@@toStringTag]
  89864. setToStringTag(Math, 'Math', true);
  89865. // 24.3.3 JSON[@@toStringTag]
  89866. setToStringTag(global.JSON, 'JSON', true);
  89867. /***/ }),
  89868. /* 306 */
  89869. /***/ (function(module, exports, __webpack_require__) {
  89870. // all enumerable object keys, includes symbols
  89871. var getKeys = __webpack_require__(40);
  89872. var gOPS = __webpack_require__(71);
  89873. var pIE = __webpack_require__(54);
  89874. module.exports = function (it) {
  89875. var result = getKeys(it);
  89876. var getSymbols = gOPS.f;
  89877. if (getSymbols) {
  89878. var symbols = getSymbols(it);
  89879. var isEnum = pIE.f;
  89880. var i = 0;
  89881. var key;
  89882. while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
  89883. } return result;
  89884. };
  89885. /***/ }),
  89886. /* 307 */
  89887. /***/ (function(module, exports, __webpack_require__) {
  89888. // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
  89889. var toIObject = __webpack_require__(33);
  89890. var gOPN = __webpack_require__(119).f;
  89891. var toString = {}.toString;
  89892. var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
  89893. ? Object.getOwnPropertyNames(window) : [];
  89894. var getWindowNames = function (it) {
  89895. try {
  89896. return gOPN(it);
  89897. } catch (e) {
  89898. return windowNames.slice();
  89899. }
  89900. };
  89901. module.exports.f = function getOwnPropertyNames(it) {
  89902. return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
  89903. };
  89904. /***/ }),
  89905. /* 308 */
  89906. /***/ (function(module, exports, __webpack_require__) {
  89907. var pIE = __webpack_require__(54);
  89908. var createDesc = __webpack_require__(44);
  89909. var toIObject = __webpack_require__(33);
  89910. var toPrimitive = __webpack_require__(70);
  89911. var has = __webpack_require__(30);
  89912. var IE8_DOM_DEFINE = __webpack_require__(98);
  89913. var gOPD = Object.getOwnPropertyDescriptor;
  89914. exports.f = __webpack_require__(13) ? gOPD : function getOwnPropertyDescriptor(O, P) {
  89915. O = toIObject(O);
  89916. P = toPrimitive(P, true);
  89917. if (IE8_DOM_DEFINE) try {
  89918. return gOPD(O, P);
  89919. } catch (e) { /* empty */ }
  89920. if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
  89921. };
  89922. /***/ }),
  89923. /* 309 */
  89924. /***/ (function(module, exports, __webpack_require__) {
  89925. __webpack_require__(79)('asyncIterator');
  89926. /***/ }),
  89927. /* 310 */
  89928. /***/ (function(module, exports, __webpack_require__) {
  89929. __webpack_require__(79)('observable');
  89930. /***/ }),
  89931. /* 311 */
  89932. /***/ (function(module, exports, __webpack_require__) {
  89933. module.exports = { "default": __webpack_require__(312), __esModule: true };
  89934. /***/ }),
  89935. /* 312 */
  89936. /***/ (function(module, exports, __webpack_require__) {
  89937. __webpack_require__(313);
  89938. var $Object = __webpack_require__(5).Object;
  89939. module.exports = function defineProperties(T, D) {
  89940. return $Object.defineProperties(T, D);
  89941. };
  89942. /***/ }),
  89943. /* 313 */
  89944. /***/ (function(module, exports, __webpack_require__) {
  89945. var $export = __webpack_require__(7);
  89946. // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
  89947. $export($export.S + $export.F * !__webpack_require__(13), 'Object', { defineProperties: __webpack_require__(104) });
  89948. /***/ }),
  89949. /* 314 */
  89950. /***/ (function(module, exports, __webpack_require__) {
  89951. module.exports = { "default": __webpack_require__(315), __esModule: true };
  89952. /***/ }),
  89953. /* 315 */
  89954. /***/ (function(module, exports, __webpack_require__) {
  89955. __webpack_require__(316);
  89956. var $Object = __webpack_require__(5).Object;
  89957. module.exports = function create(P, D) {
  89958. return $Object.create(P, D);
  89959. };
  89960. /***/ }),
  89961. /* 316 */
  89962. /***/ (function(module, exports, __webpack_require__) {
  89963. var $export = __webpack_require__(7);
  89964. // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  89965. $export($export.S, 'Object', { create: __webpack_require__(55) });
  89966. /***/ }),
  89967. /* 317 */
  89968. /***/ (function(module, exports, __webpack_require__) {
  89969. module.exports = { "default": __webpack_require__(318), __esModule: true };
  89970. /***/ }),
  89971. /* 318 */
  89972. /***/ (function(module, exports, __webpack_require__) {
  89973. __webpack_require__(319);
  89974. module.exports = __webpack_require__(5).Object.getPrototypeOf;
  89975. /***/ }),
  89976. /* 319 */
  89977. /***/ (function(module, exports, __webpack_require__) {
  89978. // 19.1.2.9 Object.getPrototypeOf(O)
  89979. var toObject = __webpack_require__(29);
  89980. var $getPrototypeOf = __webpack_require__(106);
  89981. __webpack_require__(97)('getPrototypeOf', function () {
  89982. return function getPrototypeOf(it) {
  89983. return $getPrototypeOf(toObject(it));
  89984. };
  89985. });
  89986. /***/ }),
  89987. /* 320 */
  89988. /***/ (function(module, exports, __webpack_require__) {
  89989. "use strict";
  89990. Object.defineProperty(exports, "__esModule", {
  89991. value: true
  89992. });
  89993. var _lang = __webpack_require__(321);
  89994. var _lang2 = _interopRequireDefault(_lang);
  89995. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  89996. var lang = {
  89997. i: {
  89998. locale: 'zh-CN',
  89999. select: {
  90000. placeholder: '请选择',
  90001. noMatch: '无匹配数据',
  90002. loading: '加载中'
  90003. },
  90004. table: {
  90005. noDataText: '暂无数据',
  90006. noFilteredDataText: '暂无筛选结果',
  90007. confirmFilter: '筛选',
  90008. resetFilter: '重置',
  90009. clearFilter: '全部',
  90010. sumText: '合计'
  90011. },
  90012. datepicker: {
  90013. selectDate: '选择日期',
  90014. selectTime: '选择时间',
  90015. startTime: '开始时间',
  90016. endTime: '结束时间',
  90017. clear: '清空',
  90018. ok: '确定',
  90019. datePanelLabel: '[yyyy年] [m月]',
  90020. month: '月',
  90021. month1: '1 月',
  90022. month2: '2 月',
  90023. month3: '3 月',
  90024. month4: '4 月',
  90025. month5: '5 月',
  90026. month6: '6 月',
  90027. month7: '7 月',
  90028. month8: '8 月',
  90029. month9: '9 月',
  90030. month10: '10 月',
  90031. month11: '11 月',
  90032. month12: '12 月',
  90033. year: '年',
  90034. weekStartDay: '0',
  90035. weeks: {
  90036. sun: '日',
  90037. mon: '一',
  90038. tue: '二',
  90039. wed: '三',
  90040. thu: '四',
  90041. fri: '五',
  90042. sat: '六'
  90043. },
  90044. months: {
  90045. m1: '1月',
  90046. m2: '2月',
  90047. m3: '3月',
  90048. m4: '4月',
  90049. m5: '5月',
  90050. m6: '6月',
  90051. m7: '7月',
  90052. m8: '8月',
  90053. m9: '9月',
  90054. m10: '10月',
  90055. m11: '11月',
  90056. m12: '12月'
  90057. }
  90058. },
  90059. transfer: {
  90060. titles: {
  90061. source: '源列表',
  90062. target: '目的列表'
  90063. },
  90064. filterPlaceholder: '请输入搜索内容',
  90065. notFoundText: '列表为空'
  90066. },
  90067. modal: {
  90068. okText: '确定',
  90069. cancelText: '取消'
  90070. },
  90071. poptip: {
  90072. okText: '确定',
  90073. cancelText: '取消'
  90074. },
  90075. page: {
  90076. prev: '上一页',
  90077. next: '下一页',
  90078. total: '共',
  90079. item: '条',
  90080. items: '条',
  90081. prev5: '向前 5 页',
  90082. next5: '向后 5 页',
  90083. page: '条/页',
  90084. goto: '跳至',
  90085. p: '页'
  90086. },
  90087. rate: {
  90088. star: '星',
  90089. stars: '星'
  90090. },
  90091. time: {
  90092. before: '前',
  90093. after: '后',
  90094. just: '刚刚',
  90095. seconds: '秒',
  90096. minutes: '分钟',
  90097. hours: '小时',
  90098. days: '天'
  90099. },
  90100. tree: {
  90101. emptyText: '暂无数据'
  90102. }
  90103. }
  90104. };
  90105. (0, _lang2.default)(lang);
  90106. exports.default = lang;
  90107. /***/ }),
  90108. /* 321 */
  90109. /***/ (function(module, exports, __webpack_require__) {
  90110. "use strict";
  90111. Object.defineProperty(exports, "__esModule", {
  90112. value: true
  90113. });
  90114. exports.default = function (lang) {
  90115. if (!isServer) {
  90116. if (typeof window.iview !== 'undefined') {
  90117. if (!('langs' in iview)) {
  90118. iview.langs = {};
  90119. }
  90120. iview.langs[lang.i.locale] = lang;
  90121. }
  90122. }
  90123. };
  90124. var _vue = __webpack_require__(16);
  90125. var _vue2 = _interopRequireDefault(_vue);
  90126. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90127. var isServer = _vue2.default.prototype.$isServer;
  90128. ;
  90129. /***/ }),
  90130. /* 322 */
  90131. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90132. "use strict";
  90133. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90134. var isMergeableObject = function isMergeableObject(value) {
  90135. return isNonNullObject(value)
  90136. && !isSpecial(value)
  90137. };
  90138. function isNonNullObject(value) {
  90139. return !!value && typeof value === 'object'
  90140. }
  90141. function isSpecial(value) {
  90142. var stringValue = Object.prototype.toString.call(value);
  90143. return stringValue === '[object RegExp]'
  90144. || stringValue === '[object Date]'
  90145. || isReactElement(value)
  90146. }
  90147. // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
  90148. var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
  90149. var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
  90150. function isReactElement(value) {
  90151. return value.$$typeof === REACT_ELEMENT_TYPE
  90152. }
  90153. function emptyTarget(val) {
  90154. return Array.isArray(val) ? [] : {}
  90155. }
  90156. function cloneUnlessOtherwiseSpecified(value, options) {
  90157. return (options.clone !== false && options.isMergeableObject(value))
  90158. ? deepmerge(emptyTarget(value), value, options)
  90159. : value
  90160. }
  90161. function defaultArrayMerge(target, source, options) {
  90162. return target.concat(source).map(function(element) {
  90163. return cloneUnlessOtherwiseSpecified(element, options)
  90164. })
  90165. }
  90166. function mergeObject(target, source, options) {
  90167. var destination = {};
  90168. if (options.isMergeableObject(target)) {
  90169. Object.keys(target).forEach(function(key) {
  90170. destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
  90171. });
  90172. }
  90173. Object.keys(source).forEach(function(key) {
  90174. if (!options.isMergeableObject(source[key]) || !target[key]) {
  90175. destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
  90176. } else {
  90177. destination[key] = deepmerge(target[key], source[key], options);
  90178. }
  90179. });
  90180. return destination
  90181. }
  90182. function deepmerge(target, source, options) {
  90183. options = options || {};
  90184. options.arrayMerge = options.arrayMerge || defaultArrayMerge;
  90185. options.isMergeableObject = options.isMergeableObject || isMergeableObject;
  90186. var sourceIsArray = Array.isArray(source);
  90187. var targetIsArray = Array.isArray(target);
  90188. var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
  90189. if (!sourceAndTargetTypesMatch) {
  90190. return cloneUnlessOtherwiseSpecified(source, options)
  90191. } else if (sourceIsArray) {
  90192. return options.arrayMerge(target, source, options)
  90193. } else {
  90194. return mergeObject(target, source, options)
  90195. }
  90196. }
  90197. deepmerge.all = function deepmergeAll(array, options) {
  90198. if (!Array.isArray(array)) {
  90199. throw new Error('first argument should be an array')
  90200. }
  90201. return array.reduce(function(prev, next) {
  90202. return deepmerge(prev, next, options)
  90203. }, {})
  90204. };
  90205. var deepmerge_1 = deepmerge;
  90206. /* harmony default export */ __webpack_exports__["default"] = (deepmerge_1);
  90207. /***/ }),
  90208. /* 323 */
  90209. /***/ (function(module, exports, __webpack_require__) {
  90210. "use strict";
  90211. Object.defineProperty(exports, "__esModule", {
  90212. value: true
  90213. });
  90214. var _newArrowCheck2 = __webpack_require__(1);
  90215. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  90216. var _typeof2 = __webpack_require__(27);
  90217. var _typeof3 = _interopRequireDefault(_typeof2);
  90218. exports.default = function () {
  90219. function hasOwn(obj, key) {
  90220. return Object.prototype.hasOwnProperty.call(obj, key);
  90221. }
  90222. function template(string) {
  90223. var _this = this;
  90224. for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  90225. args[_key - 1] = arguments[_key];
  90226. }
  90227. if (args.length === 1 && (0, _typeof3.default)(args[0]) === 'object') {
  90228. args = args[0];
  90229. }
  90230. if (!args || !args.hasOwnProperty) {
  90231. args = {};
  90232. }
  90233. return string.replace(RE_NARGS, function (match, prefix, i, index) {
  90234. (0, _newArrowCheck3.default)(this, _this);
  90235. var result = void 0;
  90236. if (string[index - 1] === '{' && string[index + match.length] === '}') {
  90237. return i;
  90238. } else {
  90239. result = hasOwn(args, i) ? args[i] : null;
  90240. if (result === null || result === undefined) {
  90241. return '';
  90242. }
  90243. return result;
  90244. }
  90245. }.bind(this));
  90246. }
  90247. return template;
  90248. };
  90249. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90250. var RE_NARGS = /(%|)\{([0-9a-zA-Z_]+)\}/g;
  90251. /***/ }),
  90252. /* 324 */
  90253. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90254. "use strict";
  90255. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90256. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__ = __webpack_require__(121);
  90257. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__);
  90258. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90259. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__ = __webpack_require__(325);
  90260. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__);
  90261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90262. /* script */
  90263. /* template */
  90264. /* template functional */
  90265. var __vue_template_functional__ = false
  90266. /* styles */
  90267. var __vue_styles__ = null
  90268. /* scopeId */
  90269. var __vue_scopeId__ = null
  90270. /* moduleIdentifier (server only) */
  90271. var __vue_module_identifier__ = null
  90272. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90273. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_select_head_vue___default.a,
  90274. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__["render"],
  90275. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_541b737c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_select_head_vue__["staticRenderFns"],
  90276. __vue_template_functional__,
  90277. __vue_styles__,
  90278. __vue_scopeId__,
  90279. __vue_module_identifier__
  90280. )
  90281. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90282. /***/ }),
  90283. /* 325 */
  90284. /***/ (function(module, exports, __webpack_require__) {
  90285. "use strict";
  90286. Object.defineProperty(exports, "__esModule", {
  90287. value: true
  90288. });
  90289. var render = function render() {
  90290. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.headCls, on: { "click": _vm.onHeaderClick } }, [_vm.$slots.prefix || _vm.prefix ? _c('span', { class: [_vm.prefixCls + '-prefix'] }, [_vm._t("prefix", [_vm.prefix ? _c('Icon', { attrs: { "type": _vm.prefix } }) : _vm._e()])], 2) : _vm._e(), _vm._v(" "), _vm._l(_vm.selectedMultiple, function (item, index) {
  90291. return _vm.maxTagCount === undefined || index < _vm.maxTagCount ? _c('div', { staticClass: "ivu-tag ivu-tag-checked" }, [_c('span', { staticClass: "ivu-tag-text", class: { 'ivu-select-multiple-tag-hidden': item.disabled } }, [_vm._v(_vm._s(item.tag !== undefined ? item.tag : item.label))]), _vm._v(" "), !item.disabled ? _c('Icon', { attrs: { "type": "ios-close" }, nativeOn: { "click": function click($event) {
  90292. $event.stopPropagation();return _vm.removeTag(item);
  90293. } } }) : _vm._e()], 1) : _vm._e();
  90294. }), _vm.maxTagCount !== undefined && _vm.selectedMultiple.length > _vm.maxTagCount ? _c('div', { staticClass: "ivu-tag ivu-tag-checked" }, [_c('span', { staticClass: "ivu-tag-text ivu-select-max-tag" }, [_vm.maxTagPlaceholder ? [_vm._v(_vm._s(_vm.maxTagPlaceholder(_vm.selectedMultiple.length - _vm.maxTagCount)))] : [_vm._v("+ " + _vm._s(_vm.selectedMultiple.length - _vm.maxTagCount) + "...")]], 2)]) : _vm._e(), _vm._v(" "), _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.singleDisplayValue, expression: "singleDisplayValue" }], class: _vm.singleDisplayClasses }, [_vm._v(_vm._s(_vm.singleDisplayValue))]), _vm._v(" "), _vm.filterable ? _c('input', { directives: [{ name: "model", rawName: "v-model", value: _vm.query, expression: "query" }], ref: "input", class: [_vm.prefixCls + '-input'], style: _vm.inputStyle, attrs: { "id": _vm.inputElementId, "type": "text", "disabled": _vm.disabled, "placeholder": _vm.showPlaceholder ? _vm.localePlaceholder : '', "autocomplete": "off", "spellcheck": "false" }, domProps: { "value": _vm.query }, on: { "keydown": [_vm.resetInputState, function ($event) {
  90295. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) {
  90296. return null;
  90297. }return _vm.handleInputDelete($event);
  90298. }, function ($event) {
  90299. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  90300. return null;
  90301. }return _vm.handleInputEnter($event);
  90302. }], "focus": _vm.onInputFocus, "blur": _vm.onInputBlur, "input": function input($event) {
  90303. if ($event.target.composing) {
  90304. return;
  90305. }_vm.query = $event.target.value;
  90306. } } }) : _vm._e(), _vm._v(" "), _vm.resetSelect ? _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": "ios-close-circle" }, nativeOn: { "click": function click($event) {
  90307. $event.stopPropagation();return _vm.onClear($event);
  90308. } } }) : _vm._e(), _vm._v(" "), !_vm.resetSelect && !_vm.remote ? _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e()], 2);
  90309. };
  90310. var staticRenderFns = [];
  90311. exports.render = render;
  90312. exports.staticRenderFns = staticRenderFns;
  90313. /***/ }),
  90314. /* 326 */
  90315. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90316. "use strict";
  90317. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90318. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__ = __webpack_require__(122);
  90319. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__);
  90320. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90321. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90322. /* script */
  90323. /* template */
  90324. var __vue_render__, __vue_static_render_fns__
  90325. /* template functional */
  90326. var __vue_template_functional__ = false
  90327. /* styles */
  90328. var __vue_styles__ = null
  90329. /* scopeId */
  90330. var __vue_scopeId__ = null
  90331. /* moduleIdentifier (server only) */
  90332. var __vue_module_identifier__ = null
  90333. var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90334. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_functional_options_vue___default.a,
  90335. __vue_render__,
  90336. __vue_static_render_fns__,
  90337. __vue_template_functional__,
  90338. __vue_styles__,
  90339. __vue_scopeId__,
  90340. __vue_module_identifier__
  90341. )
  90342. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90343. /***/ }),
  90344. /* 327 */
  90345. /***/ (function(module, exports, __webpack_require__) {
  90346. "use strict";
  90347. Object.defineProperty(exports, "__esModule", {
  90348. value: true
  90349. });
  90350. var render = function render() {
  90351. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture }, { name: "click-outside", rawName: "v-click-outside:[capture].mousedown", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture, modifiers: { "mousedown": true } }, { name: "click-outside", rawName: "v-click-outside:[capture].touchstart", value: _vm.onClickOutside, expression: "onClickOutside", arg: _vm.capture, modifiers: { "touchstart": true } }], class: _vm.classes }, [_c('div', { ref: "reference", class: _vm.selectionCls, attrs: { "tabindex": _vm.selectTabindex }, on: { "blur": _vm.toggleHeaderFocus, "focus": _vm.toggleHeaderFocus, "click": _vm.toggleMenu, "keydown": [function ($event) {
  90352. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  90353. return null;
  90354. }return _vm.handleKeydown($event);
  90355. }, function ($event) {
  90356. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  90357. return null;
  90358. }return _vm.handleKeydown($event);
  90359. }, function ($event) {
  90360. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  90361. return null;
  90362. }$event.preventDefault();return _vm.handleKeydown($event);
  90363. }, function ($event) {
  90364. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  90365. return null;
  90366. }$event.preventDefault();return _vm.handleKeydown($event);
  90367. }, function ($event) {
  90368. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
  90369. return null;
  90370. }return _vm.handleKeydown($event);
  90371. }, function ($event) {
  90372. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "delete", [8, 46], $event.key, ["Backspace", "Delete", "Del"])) {
  90373. return null;
  90374. }return _vm.handleKeydown($event);
  90375. }], "mouseenter": function mouseenter($event) {
  90376. _vm.hasMouseHoverHead = true;
  90377. }, "mouseleave": function mouseleave($event) {
  90378. _vm.hasMouseHoverHead = false;
  90379. } } }, [_vm._t("input", [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.publicValue } }), _vm._v(" "), _c('select-head', { attrs: { "filterable": _vm.filterable, "multiple": _vm.multiple, "values": _vm.values, "clearable": _vm.canBeCleared, "prefix": _vm.prefix, "disabled": _vm.itemDisabled, "remote": _vm.remote, "input-element-id": _vm.elementId, "initial-label": _vm.initialLabel, "placeholder": _vm.placeholder, "query-prop": _vm.query, "max-tag-count": _vm.maxTagCount, "max-tag-placeholder": _vm.maxTagPlaceholder, "allow-create": _vm.allowCreate, "show-create-item": _vm.showCreateItem }, on: { "on-query-change": _vm.onQueryChange, "on-input-focus": function onInputFocus($event) {
  90380. _vm.isFocused = true;
  90381. }, "on-input-blur": function onInputBlur($event) {
  90382. _vm.isFocused = false;
  90383. }, "on-clear": _vm.clearSingleSelect, "on-enter": _vm.handleCreateItem } }, [_vm._t("prefix", null, { "slot": "prefix" })], 2)])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.dropVisible, expression: "dropVisible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "dropdown", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "data-transfer": _vm.transfer, "transfer": _vm.transfer, "eventsEnabled": _vm.eventsEnabled } }, [_c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.showNotFoundLabel && !_vm.allowCreate, expression: "showNotFoundLabel && !allowCreate" }], class: [_vm.prefixCls + '-not-found'] }, [_c('li', [_vm._v(_vm._s(_vm.localeNotFoundText))])]), _vm._v(" "), !_vm.remote || _vm.remote && !_vm.loading ? _c('functional-options', { class: _vm.prefixCls + '-dropdown-list', attrs: { "options": _vm.selectOptions, "slot-update-hook": _vm.updateSlotOptions, "slot-options": _vm.slotOptions } }, [_vm.showCreateItem ? _c('li', { class: _vm.prefixCls + '-item', on: { "click": _vm.handleCreateItem } }, [_vm._v("\n " + _vm._s(_vm.query) + "\n "), _c('Icon', { class: _vm.prefixCls + '-item-enter', attrs: { "type": "md-return-left" } })], 1) : _vm._e()]) : _c('ul', { class: _vm.prefixCls + '-dropdown-list' }, [_vm.showCreateItem ? _c('li', { class: _vm.prefixCls + '-item', on: { "click": _vm.handleCreateItem } }, [_vm._v("\n " + _vm._s(_vm.query) + "\n "), _c('Icon', { class: _vm.prefixCls + '-item-enter', attrs: { "type": "md-return-left" } })], 1) : _vm._e()]), _vm._v(" "), _c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.loading, expression: "loading" }], class: [_vm.prefixCls + '-loading'] }, [_vm._v(_vm._s(_vm.localeLoadingText))])], 1)], 1)], 1);
  90384. };
  90385. var staticRenderFns = [];
  90386. exports.render = render;
  90387. exports.staticRenderFns = staticRenderFns;
  90388. /***/ }),
  90389. /* 328 */
  90390. /***/ (function(module, exports, __webpack_require__) {
  90391. "use strict";
  90392. Object.defineProperty(exports, "__esModule", {
  90393. value: true
  90394. });
  90395. var render = function render() {
  90396. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "click": function click($event) {
  90397. $event.stopPropagation();return _vm.select($event);
  90398. }, "mousedown": function mousedown($event) {
  90399. $event.preventDefault();
  90400. } } }, [_vm._t("default", [_vm._v(_vm._s(_vm.showLabel))])], 2);
  90401. };
  90402. var staticRenderFns = [];
  90403. exports.render = render;
  90404. exports.staticRenderFns = staticRenderFns;
  90405. /***/ }),
  90406. /* 329 */
  90407. /***/ (function(module, exports, __webpack_require__) {
  90408. module.exports = { "default": __webpack_require__(330), __esModule: true };
  90409. /***/ }),
  90410. /* 330 */
  90411. /***/ (function(module, exports, __webpack_require__) {
  90412. __webpack_require__(331);
  90413. module.exports = __webpack_require__(5).Number.isNaN;
  90414. /***/ }),
  90415. /* 331 */
  90416. /***/ (function(module, exports, __webpack_require__) {
  90417. // 20.1.2.4 Number.isNaN(number)
  90418. var $export = __webpack_require__(7);
  90419. $export($export.S, 'Number', {
  90420. isNaN: function isNaN(number) {
  90421. // eslint-disable-next-line no-self-compare
  90422. return number != number;
  90423. }
  90424. });
  90425. /***/ }),
  90426. /* 332 */
  90427. /***/ (function(module, exports, __webpack_require__) {
  90428. "use strict";
  90429. Object.defineProperty(exports, "__esModule", {
  90430. value: true
  90431. });
  90432. var _maxSafeInteger = __webpack_require__(333);
  90433. var _maxSafeInteger2 = _interopRequireDefault(_maxSafeInteger);
  90434. var _minSafeInteger = __webpack_require__(336);
  90435. var _minSafeInteger2 = _interopRequireDefault(_minSafeInteger);
  90436. var _newArrowCheck2 = __webpack_require__(1);
  90437. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  90438. exports.default = calcTextareaHeight;
  90439. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90440. var HIDDEN_TEXTAREA_STYLE = '\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n';
  90441. var SIZING_STYLE = ['letter-spacing', 'line-height', 'padding-top', 'padding-bottom', 'font-family', 'font-weight', 'font-size', 'text-rendering', 'text-transform', 'width', 'text-indent', 'padding-left', 'padding-right', 'border-width', 'box-sizing'];
  90442. var computedStyleCache = {};
  90443. var hiddenTextarea = void 0;
  90444. function calculateNodeStyling(node) {
  90445. var _this = this;
  90446. var useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  90447. var nodeRef = node.getAttribute('id') || node.getAttribute('data-reactid') || node.getAttribute('name');
  90448. if (useCache && computedStyleCache[nodeRef]) {
  90449. return computedStyleCache[nodeRef];
  90450. }
  90451. var style = window.getComputedStyle(node);
  90452. var boxSizing = style.getPropertyValue('box-sizing') || style.getPropertyValue('-moz-box-sizing') || style.getPropertyValue('-webkit-box-sizing');
  90453. var paddingSize = parseFloat(style.getPropertyValue('padding-bottom')) + parseFloat(style.getPropertyValue('padding-top'));
  90454. var borderSize = parseFloat(style.getPropertyValue('border-bottom-width')) + parseFloat(style.getPropertyValue('border-top-width'));
  90455. var sizingStyle = SIZING_STYLE.map(function (name) {
  90456. (0, _newArrowCheck3.default)(this, _this);
  90457. return String(name) + ':' + String(style.getPropertyValue(name));
  90458. }.bind(this)).join(';');
  90459. var nodeInfo = {
  90460. sizingStyle: sizingStyle,
  90461. paddingSize: paddingSize,
  90462. borderSize: borderSize,
  90463. boxSizing: boxSizing
  90464. };
  90465. if (useCache && nodeRef) {
  90466. computedStyleCache[nodeRef] = nodeInfo;
  90467. }
  90468. return nodeInfo;
  90469. }
  90470. function calcTextareaHeight(uiTextNode) {
  90471. var minRows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
  90472. var maxRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  90473. var useCache = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  90474. if (!hiddenTextarea) {
  90475. hiddenTextarea = document.createElement('textarea');
  90476. document.body.appendChild(hiddenTextarea);
  90477. }
  90478. if (uiTextNode.getAttribute('wrap')) {
  90479. hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
  90480. } else {
  90481. hiddenTextarea.removeAttribute('wrap');
  90482. }
  90483. var _calculateNodeStyling = calculateNodeStyling(uiTextNode, useCache),
  90484. paddingSize = _calculateNodeStyling.paddingSize,
  90485. borderSize = _calculateNodeStyling.borderSize,
  90486. boxSizing = _calculateNodeStyling.boxSizing,
  90487. sizingStyle = _calculateNodeStyling.sizingStyle;
  90488. hiddenTextarea.setAttribute('style', String(sizingStyle) + ';' + HIDDEN_TEXTAREA_STYLE);
  90489. hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
  90490. var minHeight = _minSafeInteger2.default;
  90491. var maxHeight = _maxSafeInteger2.default;
  90492. var height = hiddenTextarea.scrollHeight;
  90493. var overflowY = void 0;
  90494. if (boxSizing === 'border-box') {
  90495. height = height + borderSize;
  90496. } else if (boxSizing === 'content-box') {
  90497. height = height - paddingSize;
  90498. }
  90499. if (minRows !== null || maxRows !== null) {
  90500. hiddenTextarea.value = ' ';
  90501. var singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  90502. if (minRows !== null) {
  90503. minHeight = singleRowHeight * minRows;
  90504. if (boxSizing === 'border-box') {
  90505. minHeight = minHeight + paddingSize + borderSize;
  90506. }
  90507. height = Math.max(minHeight, height);
  90508. }
  90509. if (maxRows !== null) {
  90510. maxHeight = singleRowHeight * maxRows;
  90511. if (boxSizing === 'border-box') {
  90512. maxHeight = maxHeight + paddingSize + borderSize;
  90513. }
  90514. overflowY = height > maxHeight ? '' : 'hidden';
  90515. height = Math.min(maxHeight, height);
  90516. }
  90517. }
  90518. if (!maxRows) {
  90519. overflowY = 'hidden';
  90520. }
  90521. return {
  90522. height: String(height) + 'px',
  90523. minHeight: String(minHeight) + 'px',
  90524. maxHeight: String(maxHeight) + 'px',
  90525. overflowY: overflowY
  90526. };
  90527. }
  90528. /***/ }),
  90529. /* 333 */
  90530. /***/ (function(module, exports, __webpack_require__) {
  90531. module.exports = { "default": __webpack_require__(334), __esModule: true };
  90532. /***/ }),
  90533. /* 334 */
  90534. /***/ (function(module, exports, __webpack_require__) {
  90535. __webpack_require__(335);
  90536. module.exports = 0x1fffffffffffff;
  90537. /***/ }),
  90538. /* 335 */
  90539. /***/ (function(module, exports, __webpack_require__) {
  90540. // 20.1.2.6 Number.MAX_SAFE_INTEGER
  90541. var $export = __webpack_require__(7);
  90542. $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
  90543. /***/ }),
  90544. /* 336 */
  90545. /***/ (function(module, exports, __webpack_require__) {
  90546. module.exports = { "default": __webpack_require__(337), __esModule: true };
  90547. /***/ }),
  90548. /* 337 */
  90549. /***/ (function(module, exports, __webpack_require__) {
  90550. __webpack_require__(338);
  90551. module.exports = -0x1fffffffffffff;
  90552. /***/ }),
  90553. /* 338 */
  90554. /***/ (function(module, exports, __webpack_require__) {
  90555. // 20.1.2.10 Number.MIN_SAFE_INTEGER
  90556. var $export = __webpack_require__(7);
  90557. $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
  90558. /***/ }),
  90559. /* 339 */
  90560. /***/ (function(module, exports, __webpack_require__) {
  90561. "use strict";
  90562. Object.defineProperty(exports, "__esModule", {
  90563. value: true
  90564. });
  90565. var render = function render() {
  90566. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm.type !== 'textarea' ? [_vm.prepend ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slotReady, expression: "slotReady" }], class: [_vm.prefixCls + '-group-prepend'] }, [_vm._t("prepend")], 2) : _vm._e(), _vm._v(" "), _vm.clearable && _vm.currentValue && !_vm.itemDisabled ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-ios-close-circle', _vm.prefixCls + '-icon', _vm.prefixCls + '-icon-clear', _vm.prefixCls + '-icon-normal'], style: _vm.clearableStyles, on: { "click": _vm.handleClear } }) : _vm.icon ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.icon, _vm.prefixCls + '-icon', _vm.prefixCls + '-icon-normal'], on: { "click": _vm.handleIconClick } }) : _vm.search && _vm.enterButton === false ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-search", class: [_vm.prefixCls + '-icon', _vm.prefixCls + '-icon-normal', _vm.prefixCls + '-search-icon'], on: { "click": _vm.handleSearch } }) : _vm.showSuffix ? _c('span', { staticClass: "ivu-input-suffix" }, [_vm._t("suffix", [_vm.suffix ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.suffix] }) : _vm._e()])], 2) : _vm.showWordLimit ? _c('span', { staticClass: "ivu-input-word-count" }, [_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))]) : _vm.password ? _c('span', { staticClass: "ivu-input-suffix", on: { "click": _vm.handleToggleShowPassword } }, [_vm.showPassword ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-eye-outline" }) : _c('i', { staticClass: "ivu-icon ivu-icon-ios-eye-off-outline" })]) : _vm._e(), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [!_vm.icon ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop", class: [_vm.prefixCls + '-icon', _vm.prefixCls + '-icon-validate'] }) : _vm._e()]), _vm._v(" "), _c('input', { ref: "input", class: _vm.inputClasses, attrs: { "id": _vm.elementId, "autocomplete": _vm.autocomplete, "spellcheck": _vm.spellcheck, "type": _vm.currentType, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "maxlength": _vm.maxlength, "readonly": _vm.readonly, "name": _vm.name, "number": _vm.number, "autofocus": _vm.autofocus }, domProps: { "value": _vm.currentValue }, on: { "keyup": [function ($event) {
  90567. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  90568. return null;
  90569. }return _vm.handleEnter($event);
  90570. }, _vm.handleKeyup], "keypress": _vm.handleKeypress, "keydown": _vm.handleKeydown, "focus": _vm.handleFocus, "blur": _vm.handleBlur, "compositionstart": _vm.handleComposition, "compositionupdate": _vm.handleComposition, "compositionend": _vm.handleComposition, "input": _vm.handleInput, "change": _vm.handleChange } }), _vm._v(" "), _vm.append ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.slotReady, expression: "slotReady" }], class: [_vm.prefixCls + '-group-append'] }, [_vm._t("append")], 2) : _vm.search && _vm.enterButton ? _c('div', { class: [_vm.prefixCls + '-group-append', _vm.prefixCls + '-search'], on: { "click": _vm.handleSearch } }, [_vm.enterButton === true ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-search" }) : [_vm._v(_vm._s(_vm.enterButton))]], 2) : _vm.showPrefix ? _c('span', { staticClass: "ivu-input-prefix" }, [_vm._t("prefix", [_vm.prefix ? _c('i', { staticClass: "ivu-icon", class: ['ivu-icon-' + _vm.prefix] }) : _vm._e()])], 2) : _vm._e()] : [_c('textarea', { ref: "textarea", class: _vm.textareaClasses, style: _vm.textareaStyles, attrs: { "id": _vm.elementId, "wrap": _vm.wrap, "autocomplete": _vm.autocomplete, "spellcheck": _vm.spellcheck, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "rows": _vm.rows, "maxlength": _vm.maxlength, "readonly": _vm.readonly, "name": _vm.name, "autofocus": _vm.autofocus }, domProps: { "value": _vm.currentValue }, on: { "keyup": [function ($event) {
  90571. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  90572. return null;
  90573. }return _vm.handleEnter($event);
  90574. }, _vm.handleKeyup], "keypress": _vm.handleKeypress, "keydown": _vm.handleKeydown, "focus": _vm.handleFocus, "blur": _vm.handleBlur, "compositionstart": _vm.handleComposition, "compositionupdate": _vm.handleComposition, "compositionend": _vm.handleComposition, "input": _vm.handleInput } }), _vm._v(" "), _vm.showWordLimit ? _c('span', { staticClass: "ivu-input-word-count" }, [_vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))]) : _vm._e()]], 2);
  90575. };
  90576. var staticRenderFns = [];
  90577. exports.render = render;
  90578. exports.staticRenderFns = staticRenderFns;
  90579. /***/ }),
  90580. /* 340 */
  90581. /***/ (function(module, exports, __webpack_require__) {
  90582. "use strict";
  90583. Object.defineProperty(exports, "__esModule", {
  90584. value: true
  90585. });
  90586. var render = function render() {
  90587. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('i-select', { ref: "select", staticClass: "ivu-auto-complete", attrs: { "label": _vm.label, "disabled": _vm.itemDisabled, "clearable": _vm.clearable, "placeholder": _vm.placeholder, "size": _vm.size, "placement": _vm.placement, "value": _vm.currentValue, "transfer-class-name": _vm.transferClassName, "filterable": "", "remote": "", "auto-complete": "", "remote-method": _vm.remoteMethod, "transfer": _vm.transfer, "capture": _vm.capture, "eventsEnabled": _vm.eventsEnabled }, on: { "on-select": _vm.handleSelect, "on-clickoutside": _vm.handleClickOutside } }, [_vm._t("input", [_c('i-input', { ref: "input", attrs: { "slot": "input", "element-id": _vm.elementId, "name": _vm.name, "placeholder": _vm.placeholder, "disabled": _vm.itemDisabled, "size": _vm.size, "icon": _vm.inputIcon }, on: { "on-click": _vm.handleClear, "on-focus": _vm.handleFocus, "on-blur": _vm.handleBlur }, slot: "input", model: { value: _vm.currentValue, callback: function callback($$v) {
  90588. _vm.currentValue = $$v;
  90589. }, expression: "currentValue" } })]), _vm._v(" "), _vm._t("default", _vm._l(_vm.filteredData, function (item) {
  90590. return _c('i-option', { key: item, attrs: { "value": item } }, [_vm._v(_vm._s(item))]);
  90591. }))], 2);
  90592. };
  90593. var staticRenderFns = [];
  90594. exports.render = render;
  90595. exports.staticRenderFns = staticRenderFns;
  90596. /***/ }),
  90597. /* 341 */
  90598. /***/ (function(module, exports, __webpack_require__) {
  90599. "use strict";
  90600. Object.defineProperty(exports, "__esModule", {
  90601. value: true
  90602. });
  90603. var _avatar = __webpack_require__(125);
  90604. var _avatar2 = _interopRequireDefault(_avatar);
  90605. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90606. exports.default = _avatar2.default;
  90607. /***/ }),
  90608. /* 342 */
  90609. /***/ (function(module, exports, __webpack_require__) {
  90610. "use strict";
  90611. Object.defineProperty(exports, "__esModule", {
  90612. value: true
  90613. });
  90614. var render = function render() {
  90615. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.classes, style: _vm.styles }, [_vm.src ? _c('img', { attrs: { "src": _vm.src }, on: { "error": _vm.handleError } }) : _vm.icon || _vm.customIcon ? _c('Icon', { attrs: { "type": _vm.icon, "custom": _vm.customIcon } }) : _c('span', { ref: "children", class: [_vm.prefixCls + '-string'], style: _vm.childrenStyle }, [_vm._t("default")], 2)], 1);
  90616. };
  90617. var staticRenderFns = [];
  90618. exports.render = render;
  90619. exports.staticRenderFns = staticRenderFns;
  90620. /***/ }),
  90621. /* 343 */
  90622. /***/ (function(module, exports, __webpack_require__) {
  90623. "use strict";
  90624. Object.defineProperty(exports, "__esModule", {
  90625. value: true
  90626. });
  90627. var _backTop = __webpack_require__(344);
  90628. var _backTop2 = _interopRequireDefault(_backTop);
  90629. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90630. exports.default = _backTop2.default;
  90631. /***/ }),
  90632. /* 344 */
  90633. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90634. "use strict";
  90635. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__ = __webpack_require__(127);
  90637. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__);
  90638. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90639. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__ = __webpack_require__(345);
  90640. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__);
  90641. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90642. /* script */
  90643. /* template */
  90644. /* template functional */
  90645. var __vue_template_functional__ = false
  90646. /* styles */
  90647. var __vue_styles__ = null
  90648. /* scopeId */
  90649. var __vue_scopeId__ = null
  90650. /* moduleIdentifier (server only) */
  90651. var __vue_module_identifier__ = null
  90652. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90653. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_back_top_vue___default.a,
  90654. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__["render"],
  90655. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_30ee77ed_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_back_top_vue__["staticRenderFns"],
  90656. __vue_template_functional__,
  90657. __vue_styles__,
  90658. __vue_scopeId__,
  90659. __vue_module_identifier__
  90660. )
  90661. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90662. /***/ }),
  90663. /* 345 */
  90664. /***/ (function(module, exports, __webpack_require__) {
  90665. "use strict";
  90666. Object.defineProperty(exports, "__esModule", {
  90667. value: true
  90668. });
  90669. var render = function render() {
  90670. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles, on: { "click": _vm.back } }, [_vm._t("default", [_c('div', { class: _vm.innerClasses }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-up" })])])], 2);
  90671. };
  90672. var staticRenderFns = [];
  90673. exports.render = render;
  90674. exports.staticRenderFns = staticRenderFns;
  90675. /***/ }),
  90676. /* 346 */
  90677. /***/ (function(module, exports, __webpack_require__) {
  90678. "use strict";
  90679. Object.defineProperty(exports, "__esModule", {
  90680. value: true
  90681. });
  90682. var _badge = __webpack_require__(347);
  90683. var _badge2 = _interopRequireDefault(_badge);
  90684. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90685. exports.default = _badge2.default;
  90686. /***/ }),
  90687. /* 347 */
  90688. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90689. "use strict";
  90690. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90691. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__ = __webpack_require__(128);
  90692. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__);
  90693. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90694. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__ = __webpack_require__(348);
  90695. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__);
  90696. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90697. /* script */
  90698. /* template */
  90699. /* template functional */
  90700. var __vue_template_functional__ = false
  90701. /* styles */
  90702. var __vue_styles__ = null
  90703. /* scopeId */
  90704. var __vue_scopeId__ = null
  90705. /* moduleIdentifier (server only) */
  90706. var __vue_module_identifier__ = null
  90707. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90708. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_badge_vue___default.a,
  90709. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__["render"],
  90710. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5343a9da_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_badge_vue__["staticRenderFns"],
  90711. __vue_template_functional__,
  90712. __vue_styles__,
  90713. __vue_scopeId__,
  90714. __vue_module_identifier__
  90715. )
  90716. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90717. /***/ }),
  90718. /* 348 */
  90719. /***/ (function(module, exports, __webpack_require__) {
  90720. "use strict";
  90721. Object.defineProperty(exports, "__esModule", {
  90722. value: true
  90723. });
  90724. var render = function render() {
  90725. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.dot ? _c('span', { ref: "badge", class: _vm.classes }, [_vm._t("default"), _vm._v(" "), _c('sup', { directives: [{ name: "show", rawName: "v-show", value: _vm.badge, expression: "badge" }], class: _vm.dotClasses, style: _vm.styles })], 2) : _vm.status || _vm.color ? _c('span', { ref: "badge", staticClass: "ivu-badge-status", class: _vm.classes }, [_c('span', { class: _vm.statusClasses, style: _vm.statusStyles }), _vm._v(" "), _c('span', { staticClass: "ivu-badge-status-text" }, [_vm._t("text", [_vm._v(_vm._s(_vm.text))])], 2)]) : _c('span', { ref: "badge", class: _vm.classes }, [_vm._t("default"), _vm._v(" "), _vm.$slots.count ? _c('sup', { class: _vm.customCountClasses, style: _vm.styles }, [_vm._t("count")], 2) : _vm.hasCount ? _c('sup', { directives: [{ name: "show", rawName: "v-show", value: _vm.badge, expression: "badge" }], class: _vm.countClasses, style: _vm.styles }, [_vm._t("text", [_vm._v(_vm._s(_vm.finalCount))])], 2) : _vm._e()], 2);
  90726. };
  90727. var staticRenderFns = [];
  90728. exports.render = render;
  90729. exports.staticRenderFns = staticRenderFns;
  90730. /***/ }),
  90731. /* 349 */
  90732. /***/ (function(module, exports, __webpack_require__) {
  90733. "use strict";
  90734. Object.defineProperty(exports, "__esModule", {
  90735. value: true
  90736. });
  90737. var _breadcrumb = __webpack_require__(350);
  90738. var _breadcrumb2 = _interopRequireDefault(_breadcrumb);
  90739. var _breadcrumbItem = __webpack_require__(352);
  90740. var _breadcrumbItem2 = _interopRequireDefault(_breadcrumbItem);
  90741. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90742. _breadcrumb2.default.Item = _breadcrumbItem2.default;
  90743. exports.default = _breadcrumb2.default;
  90744. /***/ }),
  90745. /* 350 */
  90746. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90747. "use strict";
  90748. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90749. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__ = __webpack_require__(129);
  90750. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__);
  90751. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90752. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__ = __webpack_require__(351);
  90753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__);
  90754. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90755. /* script */
  90756. /* template */
  90757. /* template functional */
  90758. var __vue_template_functional__ = false
  90759. /* styles */
  90760. var __vue_styles__ = null
  90761. /* scopeId */
  90762. var __vue_scopeId__ = null
  90763. /* moduleIdentifier (server only) */
  90764. var __vue_module_identifier__ = null
  90765. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90766. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_vue___default.a,
  90767. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__["render"],
  90768. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_53b534b8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_vue__["staticRenderFns"],
  90769. __vue_template_functional__,
  90770. __vue_styles__,
  90771. __vue_scopeId__,
  90772. __vue_module_identifier__
  90773. )
  90774. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90775. /***/ }),
  90776. /* 351 */
  90777. /***/ (function(module, exports, __webpack_require__) {
  90778. "use strict";
  90779. Object.defineProperty(exports, "__esModule", {
  90780. value: true
  90781. });
  90782. var render = function render() {
  90783. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
  90784. };
  90785. var staticRenderFns = [];
  90786. exports.render = render;
  90787. exports.staticRenderFns = staticRenderFns;
  90788. /***/ }),
  90789. /* 352 */
  90790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90791. "use strict";
  90792. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__ = __webpack_require__(130);
  90794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__);
  90795. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90796. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__ = __webpack_require__(353);
  90797. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__);
  90798. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90799. /* script */
  90800. /* template */
  90801. /* template functional */
  90802. var __vue_template_functional__ = false
  90803. /* styles */
  90804. var __vue_styles__ = null
  90805. /* scopeId */
  90806. var __vue_scopeId__ = null
  90807. /* moduleIdentifier (server only) */
  90808. var __vue_module_identifier__ = null
  90809. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90810. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_breadcrumb_item_vue___default.a,
  90811. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__["render"],
  90812. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70d61118_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_breadcrumb_item_vue__["staticRenderFns"],
  90813. __vue_template_functional__,
  90814. __vue_styles__,
  90815. __vue_scopeId__,
  90816. __vue_module_identifier__
  90817. )
  90818. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90819. /***/ }),
  90820. /* 353 */
  90821. /***/ (function(module, exports, __webpack_require__) {
  90822. "use strict";
  90823. Object.defineProperty(exports, "__esModule", {
  90824. value: true
  90825. });
  90826. var render = function render() {
  90827. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.to ? _c('a', { class: _vm.linkClasses, attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
  90828. if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
  90829. return null;
  90830. }return _vm.handleCheckClick($event, false);
  90831. }, function ($event) {
  90832. if (!$event.ctrlKey) {
  90833. return null;
  90834. }return _vm.handleCheckClick($event, true);
  90835. }, function ($event) {
  90836. if (!$event.metaKey) {
  90837. return null;
  90838. }return _vm.handleCheckClick($event, true);
  90839. }] } }, [_vm._t("default")], 2) : _c('span', { class: _vm.linkClasses }, [_vm._t("default")], 2), _vm._v(" "), !_vm.showSeparator ? _c('span', { class: _vm.separatorClasses, domProps: { "innerHTML": _vm._s(_vm.separator) } }) : _c('span', { class: _vm.separatorClasses }, [_vm._t("separator")], 2)]);
  90840. };
  90841. var staticRenderFns = [];
  90842. exports.render = render;
  90843. exports.staticRenderFns = staticRenderFns;
  90844. /***/ }),
  90845. /* 354 */
  90846. /***/ (function(module, exports, __webpack_require__) {
  90847. "use strict";
  90848. Object.defineProperty(exports, "__esModule", {
  90849. value: true
  90850. });
  90851. var _button = __webpack_require__(28);
  90852. var _button2 = _interopRequireDefault(_button);
  90853. var _buttonGroup = __webpack_require__(356);
  90854. var _buttonGroup2 = _interopRequireDefault(_buttonGroup);
  90855. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90856. _button2.default.Group = _buttonGroup2.default;
  90857. exports.default = _button2.default;
  90858. /***/ }),
  90859. /* 355 */
  90860. /***/ (function(module, exports, __webpack_require__) {
  90861. "use strict";
  90862. Object.defineProperty(exports, "__esModule", {
  90863. value: true
  90864. });
  90865. var render = function render() {
  90866. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.tagName, _vm._b({ tag: "component", class: _vm.classes, attrs: { "disabled": _vm.itemDisabled }, on: { "click": _vm.handleClickLink } }, 'component', _vm.tagProps, false), [_vm.loading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : _vm._e(), _vm._v(" "), (_vm.icon || _vm.customIcon) && !_vm.loading ? _c('Icon', { attrs: { "type": _vm.icon, "custom": _vm.customIcon } }) : _vm._e(), _vm._v(" "), _vm.showSlot ? _c('span', { ref: "slot" }, [_vm._t("default")], 2) : _vm._e()], 1);
  90867. };
  90868. var staticRenderFns = [];
  90869. exports.render = render;
  90870. exports.staticRenderFns = staticRenderFns;
  90871. /***/ }),
  90872. /* 356 */
  90873. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90874. "use strict";
  90875. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90876. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__ = __webpack_require__(132);
  90877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__);
  90878. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90879. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__ = __webpack_require__(357);
  90880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__);
  90881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90882. /* script */
  90883. /* template */
  90884. /* template functional */
  90885. var __vue_template_functional__ = false
  90886. /* styles */
  90887. var __vue_styles__ = null
  90888. /* scopeId */
  90889. var __vue_scopeId__ = null
  90890. /* moduleIdentifier (server only) */
  90891. var __vue_module_identifier__ = null
  90892. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90893. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_button_group_vue___default.a,
  90894. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__["render"],
  90895. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_592f1b56_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_button_group_vue__["staticRenderFns"],
  90896. __vue_template_functional__,
  90897. __vue_styles__,
  90898. __vue_scopeId__,
  90899. __vue_module_identifier__
  90900. )
  90901. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90902. /***/ }),
  90903. /* 357 */
  90904. /***/ (function(module, exports, __webpack_require__) {
  90905. "use strict";
  90906. Object.defineProperty(exports, "__esModule", {
  90907. value: true
  90908. });
  90909. var render = function render() {
  90910. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
  90911. };
  90912. var staticRenderFns = [];
  90913. exports.render = render;
  90914. exports.staticRenderFns = staticRenderFns;
  90915. /***/ }),
  90916. /* 358 */
  90917. /***/ (function(module, exports, __webpack_require__) {
  90918. "use strict";
  90919. Object.defineProperty(exports, "__esModule", {
  90920. value: true
  90921. });
  90922. var _card = __webpack_require__(359);
  90923. var _card2 = _interopRequireDefault(_card);
  90924. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90925. exports.default = _card2.default;
  90926. /***/ }),
  90927. /* 359 */
  90928. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90929. "use strict";
  90930. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90931. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__ = __webpack_require__(133);
  90932. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__);
  90933. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90934. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__ = __webpack_require__(360);
  90935. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__);
  90936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90937. /* script */
  90938. /* template */
  90939. /* template functional */
  90940. var __vue_template_functional__ = false
  90941. /* styles */
  90942. var __vue_styles__ = null
  90943. /* scopeId */
  90944. var __vue_scopeId__ = null
  90945. /* moduleIdentifier (server only) */
  90946. var __vue_module_identifier__ = null
  90947. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  90948. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_card_vue___default.a,
  90949. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__["render"],
  90950. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_23408e01_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_card_vue__["staticRenderFns"],
  90951. __vue_template_functional__,
  90952. __vue_styles__,
  90953. __vue_scopeId__,
  90954. __vue_module_identifier__
  90955. )
  90956. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  90957. /***/ }),
  90958. /* 360 */
  90959. /***/ (function(module, exports, __webpack_require__) {
  90960. "use strict";
  90961. Object.defineProperty(exports, "__esModule", {
  90962. value: true
  90963. });
  90964. var render = function render() {
  90965. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c(_vm.tagName, _vm._b({ tag: "component", class: _vm.classes, on: { "click": _vm.handleClickLink } }, 'component', _vm.tagProps, false), [_vm.showHead ? _c('div', { class: _vm.headClasses }, [_vm._t("title", [_vm.title ? _c('p', [_vm.icon ? _c('Icon', { attrs: { "type": _vm.icon } }) : _vm._e(), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.title))])], 1) : _vm._e()])], 2) : _vm._e(), _vm._v(" "), _vm.showExtra ? _c('div', { class: _vm.extraClasses }, [_vm._t("extra")], 2) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.bodyClasses, style: _vm.bodyStyles }, [_vm._t("default")], 2)]);
  90966. };
  90967. var staticRenderFns = [];
  90968. exports.render = render;
  90969. exports.staticRenderFns = staticRenderFns;
  90970. /***/ }),
  90971. /* 361 */
  90972. /***/ (function(module, exports, __webpack_require__) {
  90973. "use strict";
  90974. Object.defineProperty(exports, "__esModule", {
  90975. value: true
  90976. });
  90977. var _carousel = __webpack_require__(362);
  90978. var _carousel2 = _interopRequireDefault(_carousel);
  90979. var _carouselItem = __webpack_require__(364);
  90980. var _carouselItem2 = _interopRequireDefault(_carouselItem);
  90981. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  90982. _carousel2.default.Item = _carouselItem2.default;
  90983. exports.default = _carousel2.default;
  90984. /***/ }),
  90985. /* 362 */
  90986. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  90987. "use strict";
  90988. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  90989. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__ = __webpack_require__(134);
  90990. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__);
  90991. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  90992. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__ = __webpack_require__(363);
  90993. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__);
  90994. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  90995. /* script */
  90996. /* template */
  90997. /* template functional */
  90998. var __vue_template_functional__ = false
  90999. /* styles */
  91000. var __vue_styles__ = null
  91001. /* scopeId */
  91002. var __vue_scopeId__ = null
  91003. /* moduleIdentifier (server only) */
  91004. var __vue_module_identifier__ = null
  91005. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91006. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_vue___default.a,
  91007. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__["render"],
  91008. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0c091c07_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_vue__["staticRenderFns"],
  91009. __vue_template_functional__,
  91010. __vue_styles__,
  91011. __vue_scopeId__,
  91012. __vue_module_identifier__
  91013. )
  91014. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91015. /***/ }),
  91016. /* 363 */
  91017. /***/ (function(module, exports, __webpack_require__) {
  91018. "use strict";
  91019. Object.defineProperty(exports, "__esModule", {
  91020. value: true
  91021. });
  91022. var render = function render() {
  91023. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('button', { staticClass: "left", class: _vm.arrowClasses, attrs: { "type": "button" }, on: { "click": function click($event) {
  91024. return _vm.arrowEvent(-1);
  91025. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-list'] }, [_c('div', { ref: "originTrack", class: [_vm.prefixCls + '-track', _vm.showCopyTrack ? '' : 'higher'], style: _vm.trackStyles, on: { "click": function click($event) {
  91026. return _vm.handleClick('currentIndex');
  91027. } } }, [_vm._t("default")], 2), _vm._v(" "), _vm.loop ? _c('div', { ref: "copyTrack", class: [_vm.prefixCls + '-track', _vm.showCopyTrack ? 'higher' : ''], style: _vm.copyTrackStyles, on: { "click": function click($event) {
  91028. return _vm.handleClick('copyTrackIndex');
  91029. } } }) : _vm._e()]), _vm._v(" "), _c('button', { staticClass: "right", class: _vm.arrowClasses, attrs: { "type": "button" }, on: { "click": function click($event) {
  91030. return _vm.arrowEvent(1);
  91031. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('ul', { class: _vm.dotsClasses }, [_vm._l(_vm.slides.length, function (n) {
  91032. return [_c('li', { class: [n - 1 === _vm.currentIndex ? _vm.prefixCls + '-active' : ''], on: { "click": function click($event) {
  91033. return _vm.dotsEvent('click', n - 1);
  91034. }, "mouseover": function mouseover($event) {
  91035. return _vm.dotsEvent('hover', n - 1);
  91036. } } }, [_c('button', { class: [_vm.radiusDot ? 'radius' : ''], attrs: { "type": "button" } })])];
  91037. })], 2)]);
  91038. };
  91039. var staticRenderFns = [];
  91040. exports.render = render;
  91041. exports.staticRenderFns = staticRenderFns;
  91042. /***/ }),
  91043. /* 364 */
  91044. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91045. "use strict";
  91046. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91047. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__ = __webpack_require__(135);
  91048. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__);
  91049. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91050. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__ = __webpack_require__(365);
  91051. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__);
  91052. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91053. /* script */
  91054. /* template */
  91055. /* template functional */
  91056. var __vue_template_functional__ = false
  91057. /* styles */
  91058. var __vue_styles__ = null
  91059. /* scopeId */
  91060. var __vue_scopeId__ = null
  91061. /* moduleIdentifier (server only) */
  91062. var __vue_module_identifier__ = null
  91063. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91064. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_carousel_item_vue___default.a,
  91065. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__["render"],
  91066. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d35b7f7_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_carousel_item_vue__["staticRenderFns"],
  91067. __vue_template_functional__,
  91068. __vue_styles__,
  91069. __vue_scopeId__,
  91070. __vue_module_identifier__
  91071. )
  91072. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91073. /***/ }),
  91074. /* 365 */
  91075. /***/ (function(module, exports, __webpack_require__) {
  91076. "use strict";
  91077. Object.defineProperty(exports, "__esModule", {
  91078. value: true
  91079. });
  91080. var render = function render() {
  91081. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls, style: _vm.styles }, [_vm._t("default")], 2);
  91082. };
  91083. var staticRenderFns = [];
  91084. exports.render = render;
  91085. exports.staticRenderFns = staticRenderFns;
  91086. /***/ }),
  91087. /* 366 */
  91088. /***/ (function(module, exports, __webpack_require__) {
  91089. "use strict";
  91090. Object.defineProperty(exports, "__esModule", {
  91091. value: true
  91092. });
  91093. var _cascader = __webpack_require__(367);
  91094. var _cascader2 = _interopRequireDefault(_cascader);
  91095. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91096. exports.default = _cascader2.default;
  91097. /***/ }),
  91098. /* 367 */
  91099. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91100. "use strict";
  91101. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91102. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__ = __webpack_require__(136);
  91103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__);
  91104. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__ = __webpack_require__(372);
  91106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__);
  91107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91108. /* script */
  91109. /* template */
  91110. /* template functional */
  91111. var __vue_template_functional__ = false
  91112. /* styles */
  91113. var __vue_styles__ = null
  91114. /* scopeId */
  91115. var __vue_scopeId__ = null
  91116. /* moduleIdentifier (server only) */
  91117. var __vue_module_identifier__ = null
  91118. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91119. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cascader_vue___default.a,
  91120. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__["render"],
  91121. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_035d76bf_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cascader_vue__["staticRenderFns"],
  91122. __vue_template_functional__,
  91123. __vue_styles__,
  91124. __vue_scopeId__,
  91125. __vue_module_identifier__
  91126. )
  91127. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91128. /***/ }),
  91129. /* 368 */
  91130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91131. "use strict";
  91132. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__ = __webpack_require__(137);
  91134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__);
  91135. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__ = __webpack_require__(371);
  91137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__);
  91138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91139. /* script */
  91140. /* template */
  91141. /* template functional */
  91142. var __vue_template_functional__ = false
  91143. /* styles */
  91144. var __vue_styles__ = null
  91145. /* scopeId */
  91146. var __vue_scopeId__ = null
  91147. /* moduleIdentifier (server only) */
  91148. var __vue_module_identifier__ = null
  91149. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91150. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_caspanel_vue___default.a,
  91151. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__["render"],
  91152. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cb61ec76_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_caspanel_vue__["staticRenderFns"],
  91153. __vue_template_functional__,
  91154. __vue_styles__,
  91155. __vue_scopeId__,
  91156. __vue_module_identifier__
  91157. )
  91158. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91159. /***/ }),
  91160. /* 369 */
  91161. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91162. "use strict";
  91163. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91164. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__ = __webpack_require__(138);
  91165. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__);
  91166. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91167. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__ = __webpack_require__(370);
  91168. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__);
  91169. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91170. /* script */
  91171. /* template */
  91172. /* template functional */
  91173. var __vue_template_functional__ = false
  91174. /* styles */
  91175. var __vue_styles__ = null
  91176. /* scopeId */
  91177. var __vue_scopeId__ = null
  91178. /* moduleIdentifier (server only) */
  91179. var __vue_module_identifier__ = null
  91180. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91181. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_casitem_vue___default.a,
  91182. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__["render"],
  91183. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ca89d2a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_casitem_vue__["staticRenderFns"],
  91184. __vue_template_functional__,
  91185. __vue_styles__,
  91186. __vue_scopeId__,
  91187. __vue_module_identifier__
  91188. )
  91189. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91190. /***/ }),
  91191. /* 370 */
  91192. /***/ (function(module, exports, __webpack_require__) {
  91193. "use strict";
  91194. Object.defineProperty(exports, "__esModule", {
  91195. value: true
  91196. });
  91197. var render = function render() {
  91198. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes }, [_vm._v("\n " + _vm._s(_vm.data.label) + "\n "), _vm.showArrow ? _c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e(), _vm._v(" "), _vm.showLoading ? _c('i', { staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop ivu-cascader-menu-item-loading" }) : _vm._e()], 1);
  91199. };
  91200. var staticRenderFns = [];
  91201. exports.render = render;
  91202. exports.staticRenderFns = staticRenderFns;
  91203. /***/ }),
  91204. /* 371 */
  91205. /***/ (function(module, exports, __webpack_require__) {
  91206. "use strict";
  91207. Object.defineProperty(exports, "__esModule", {
  91208. value: true
  91209. });
  91210. var render = function render() {
  91211. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.data && _vm.data.length ? _c('ul', { class: [_vm.prefixCls + '-menu'] }, _vm._l(_vm.data, function (item) {
  91212. return _c('Casitem', { key: _vm.getKey(), attrs: { "prefix-cls": _vm.prefixCls, "data": item, "tmp-item": _vm.tmpItem }, nativeOn: { "click": function click($event) {
  91213. $event.stopPropagation();return _vm.handleClickItem(item);
  91214. }, "mouseenter": function mouseenter($event) {
  91215. $event.stopPropagation();return _vm.handleHoverItem(item);
  91216. } } });
  91217. }), 1) : _vm._e(), _vm.sublist && _vm.sublist.length ? _c('Caspanel', { attrs: { "prefix-cls": _vm.prefixCls, "data": _vm.sublist, "disabled": _vm.disabled, "trigger": _vm.trigger, "change-on-select": _vm.changeOnSelect } }) : _vm._e()], 1);
  91218. };
  91219. var staticRenderFns = [];
  91220. exports.render = render;
  91221. exports.staticRenderFns = staticRenderFns;
  91222. /***/ }),
  91223. /* 372 */
  91224. /***/ (function(module, exports, __webpack_require__) {
  91225. "use strict";
  91226. Object.defineProperty(exports, "__esModule", {
  91227. value: true
  91228. });
  91229. var render = function render() {
  91230. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.handleClose, expression: "handleClose" }], class: _vm.classes }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'], on: { "click": _vm.toggleOpen } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _vm._t("default", [_c('i-input', { ref: "input", attrs: { "element-id": _vm.elementId, "readonly": !_vm.filterable, "disabled": _vm.itemDisabled, "value": _vm.displayInputRender, "size": _vm.size, "placeholder": _vm.inputPlaceholder }, on: { "on-change": _vm.handleInput } }), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query === '', expression: "filterable && query === ''" }], class: [_vm.prefixCls + '-label'], on: { "click": _vm.handleFocus } }, [_vm._v(_vm._s(_vm.displayRender))]), _vm._v(" "), _c('Icon', { directives: [{ name: "show", rawName: "v-show", value: _vm.showCloseIcon, expression: "showCloseIcon" }], class: [_vm.prefixCls + '-arrow'], attrs: { "type": "ios-close-circle" }, nativeOn: { "click": function click($event) {
  91231. $event.stopPropagation();return _vm.clearSelect($event);
  91232. } } }), _vm._v(" "), _c('Icon', { class: [_vm.prefixCls + '-arrow'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer } }, [_c('div', [_c('Caspanel', { directives: [{ name: "show", rawName: "v-show", value: !_vm.filterable || _vm.filterable && _vm.query === '', expression: "!filterable || (filterable && query === '')" }], ref: "caspanel", attrs: { "prefix-cls": _vm.prefixCls, "data": _vm.data, "disabled": _vm.itemDisabled, "change-on-select": _vm.changeOnSelect, "trigger": _vm.trigger } }), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query !== '' && _vm.querySelections.length, expression: "filterable && query !== '' && querySelections.length" }], class: [_vm.prefixCls + '-dropdown'] }, [_c('ul', { class: [_vm.selectPrefixCls + '-dropdown-list'] }, _vm._l(_vm.querySelections, function (item, index) {
  91233. var _obj;
  91234. return _c('li', { class: [_vm.selectPrefixCls + '-item', (_obj = {}, _obj[_vm.selectPrefixCls + '-item-disabled'] = item.disabled, _obj)], domProps: { "innerHTML": _vm._s(item.display) }, on: { "click": function click($event) {
  91235. return _vm.handleSelectItem(index);
  91236. } } });
  91237. }), 0)]), _vm._v(" "), _c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.filterable && _vm.query !== '' && !_vm.querySelections.length || !_vm.data.length, expression: "(filterable && query !== '' && !querySelections.length) || !data.length" }], class: [_vm.prefixCls + '-not-found-tip'] }, [_c('li', [_vm._v(_vm._s(_vm.localeNotFoundText))])])], 1)])], 1)], 1);
  91238. };
  91239. var staticRenderFns = [];
  91240. exports.render = render;
  91241. exports.staticRenderFns = staticRenderFns;
  91242. /***/ }),
  91243. /* 373 */
  91244. /***/ (function(module, exports, __webpack_require__) {
  91245. "use strict";
  91246. Object.defineProperty(exports, "__esModule", {
  91247. value: true
  91248. });
  91249. var _cell = __webpack_require__(374);
  91250. var _cell2 = _interopRequireDefault(_cell);
  91251. var _cellGroup = __webpack_require__(378);
  91252. var _cellGroup2 = _interopRequireDefault(_cellGroup);
  91253. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91254. _cell2.default.Group = _cellGroup2.default;
  91255. exports.default = _cell2.default;
  91256. /***/ }),
  91257. /* 374 */
  91258. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91259. "use strict";
  91260. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91261. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__ = __webpack_require__(139);
  91262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__);
  91263. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91264. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__ = __webpack_require__(377);
  91265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__);
  91266. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91267. /* script */
  91268. /* template */
  91269. /* template functional */
  91270. var __vue_template_functional__ = false
  91271. /* styles */
  91272. var __vue_styles__ = null
  91273. /* scopeId */
  91274. var __vue_scopeId__ = null
  91275. /* moduleIdentifier (server only) */
  91276. var __vue_module_identifier__ = null
  91277. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91278. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default.a,
  91279. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["render"],
  91280. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_45b2aeb6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["staticRenderFns"],
  91281. __vue_template_functional__,
  91282. __vue_styles__,
  91283. __vue_scopeId__,
  91284. __vue_module_identifier__
  91285. )
  91286. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91287. /***/ }),
  91288. /* 375 */
  91289. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91290. "use strict";
  91291. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91292. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__ = __webpack_require__(140);
  91293. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__);
  91294. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91295. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__ = __webpack_require__(376);
  91296. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__);
  91297. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91298. /* script */
  91299. /* template */
  91300. /* template functional */
  91301. var __vue_template_functional__ = false
  91302. /* styles */
  91303. var __vue_styles__ = null
  91304. /* scopeId */
  91305. var __vue_scopeId__ = null
  91306. /* moduleIdentifier (server only) */
  91307. var __vue_module_identifier__ = null
  91308. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91309. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_item_vue___default.a,
  91310. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__["render"],
  91311. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7f3078d4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_item_vue__["staticRenderFns"],
  91312. __vue_template_functional__,
  91313. __vue_styles__,
  91314. __vue_scopeId__,
  91315. __vue_module_identifier__
  91316. )
  91317. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91318. /***/ }),
  91319. /* 376 */
  91320. /***/ (function(module, exports, __webpack_require__) {
  91321. "use strict";
  91322. Object.defineProperty(exports, "__esModule", {
  91323. value: true
  91324. });
  91325. var render = function render() {
  91326. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-cell-item" }, [_c('div', { staticClass: "ivu-cell-icon" }, [_vm._t("icon")], 2), _vm._v(" "), _c('div', { staticClass: "ivu-cell-main" }, [_c('div', { staticClass: "ivu-cell-title" }, [_vm._t("default", [_vm._v(_vm._s(_vm.title))])], 2), _vm._v(" "), _c('div', { staticClass: "ivu-cell-label" }, [_vm._t("label", [_vm._v(_vm._s(_vm.label))])], 2)]), _vm._v(" "), _c('div', { staticClass: "ivu-cell-footer" }, [_c('span', { staticClass: "ivu-cell-extra" }, [_vm._t("extra", [_vm._v(_vm._s(_vm.extra))])], 2)])]);
  91327. };
  91328. var staticRenderFns = [];
  91329. exports.render = render;
  91330. exports.staticRenderFns = staticRenderFns;
  91331. /***/ }),
  91332. /* 377 */
  91333. /***/ (function(module, exports, __webpack_require__) {
  91334. "use strict";
  91335. Object.defineProperty(exports, "__esModule", {
  91336. value: true
  91337. });
  91338. var render = function render() {
  91339. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.to ? _c('a', { staticClass: "ivu-cell-link", attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
  91340. if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
  91341. return null;
  91342. }return _vm.handleClickItem($event, false);
  91343. }, function ($event) {
  91344. if (!$event.ctrlKey) {
  91345. return null;
  91346. }return _vm.handleClickItem($event, true);
  91347. }, function ($event) {
  91348. if (!$event.metaKey) {
  91349. return null;
  91350. }return _vm.handleClickItem($event, true);
  91351. }] } }, [_c('CellItem', { attrs: { "title": _vm.title, "label": _vm.label, "extra": _vm.extra } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._v(" "), _vm._t("default", null, { "slot": "default" }), _vm._v(" "), _vm._t("extra", null, { "slot": "extra" }), _vm._v(" "), _vm._t("label", null, { "slot": "label" })], 2)], 1) : _c('div', { staticClass: "ivu-cell-link", on: { "click": _vm.handleClickItem } }, [_c('CellItem', { attrs: { "title": _vm.title, "label": _vm.label, "extra": _vm.extra } }, [_vm._t("icon", null, { "slot": "icon" }), _vm._v(" "), _vm._t("default", null, { "slot": "default" }), _vm._v(" "), _vm._t("extra", null, { "slot": "extra" }), _vm._v(" "), _vm._t("label", null, { "slot": "label" })], 2)], 1), _vm._v(" "), _vm.to ? _c('div', { staticClass: "ivu-cell-arrow" }, [_vm._t("arrow", [_c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })])], 2) : _vm._e()]);
  91352. };
  91353. var staticRenderFns = [];
  91354. exports.render = render;
  91355. exports.staticRenderFns = staticRenderFns;
  91356. /***/ }),
  91357. /* 378 */
  91358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91359. "use strict";
  91360. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__ = __webpack_require__(141);
  91362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__);
  91363. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__ = __webpack_require__(379);
  91365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__);
  91366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91367. /* script */
  91368. /* template */
  91369. /* template functional */
  91370. var __vue_template_functional__ = false
  91371. /* styles */
  91372. var __vue_styles__ = null
  91373. /* scopeId */
  91374. var __vue_scopeId__ = null
  91375. /* moduleIdentifier (server only) */
  91376. var __vue_module_identifier__ = null
  91377. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91378. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_group_vue___default.a,
  91379. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__["render"],
  91380. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4dc556d9_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_group_vue__["staticRenderFns"],
  91381. __vue_template_functional__,
  91382. __vue_styles__,
  91383. __vue_scopeId__,
  91384. __vue_module_identifier__
  91385. )
  91386. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91387. /***/ }),
  91388. /* 379 */
  91389. /***/ (function(module, exports, __webpack_require__) {
  91390. "use strict";
  91391. Object.defineProperty(exports, "__esModule", {
  91392. value: true
  91393. });
  91394. var render = function render() {
  91395. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-cell-group" }, [_vm._t("default")], 2);
  91396. };
  91397. var staticRenderFns = [];
  91398. exports.render = render;
  91399. exports.staticRenderFns = staticRenderFns;
  91400. /***/ }),
  91401. /* 380 */
  91402. /***/ (function(module, exports, __webpack_require__) {
  91403. "use strict";
  91404. Object.defineProperty(exports, "__esModule", {
  91405. value: true
  91406. });
  91407. var _checkbox = __webpack_require__(49);
  91408. var _checkbox2 = _interopRequireDefault(_checkbox);
  91409. var _checkboxGroup = __webpack_require__(143);
  91410. var _checkboxGroup2 = _interopRequireDefault(_checkboxGroup);
  91411. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91412. _checkbox2.default.Group = _checkboxGroup2.default;
  91413. exports.default = _checkbox2.default;
  91414. /***/ }),
  91415. /* 381 */
  91416. /***/ (function(module, exports, __webpack_require__) {
  91417. "use strict";
  91418. Object.defineProperty(exports, "__esModule", {
  91419. value: true
  91420. });
  91421. var render = function render() {
  91422. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('label', { class: _vm.wrapClasses }, [_c('span', { class: _vm.checkboxClasses }, [_c('span', { class: _vm.innerClasses }), _vm._v(" "), _vm.group ? _c('input', { directives: [{ name: "model", rawName: "v-model", value: _vm.model, expression: "model" }], class: _vm.inputClasses, attrs: { "type": "checkbox", "disabled": _vm.itemDisabled, "name": _vm.name }, domProps: { "value": _vm.label, "checked": Array.isArray(_vm.model) ? _vm._i(_vm.model, _vm.label) > -1 : _vm.model }, on: { "change": [function ($event) {
  91423. var $$a = _vm.model,
  91424. $$el = $event.target,
  91425. $$c = $$el.checked ? true : false;if (Array.isArray($$a)) {
  91426. var $$v = _vm.label,
  91427. $$i = _vm._i($$a, $$v);if ($$el.checked) {
  91428. $$i < 0 && (_vm.model = $$a.concat([$$v]));
  91429. } else {
  91430. $$i > -1 && (_vm.model = $$a.slice(0, $$i).concat($$a.slice($$i + 1)));
  91431. }
  91432. } else {
  91433. _vm.model = $$c;
  91434. }
  91435. }, _vm.change], "focus": _vm.onFocus, "blur": _vm.onBlur } }) : _c('input', { class: _vm.inputClasses, attrs: { "type": "checkbox", "disabled": _vm.itemDisabled, "name": _vm.name }, domProps: { "checked": _vm.currentValue }, on: { "change": _vm.change, "focus": _vm.onFocus, "blur": _vm.onBlur } })]), _vm._v(" "), _vm._t("default", [_vm.showSlot ? _c('span', [_vm._v(_vm._s(_vm.label))]) : _vm._e()])], 2);
  91436. };
  91437. var staticRenderFns = [];
  91438. exports.render = render;
  91439. exports.staticRenderFns = staticRenderFns;
  91440. /***/ }),
  91441. /* 382 */
  91442. /***/ (function(module, exports, __webpack_require__) {
  91443. "use strict";
  91444. Object.defineProperty(exports, "__esModule", {
  91445. value: true
  91446. });
  91447. var render = function render() {
  91448. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
  91449. };
  91450. var staticRenderFns = [];
  91451. exports.render = render;
  91452. exports.staticRenderFns = staticRenderFns;
  91453. /***/ }),
  91454. /* 383 */
  91455. /***/ (function(module, exports, __webpack_require__) {
  91456. "use strict";
  91457. Object.defineProperty(exports, "__esModule", {
  91458. value: true
  91459. });
  91460. var _circle = __webpack_require__(384);
  91461. var _circle2 = _interopRequireDefault(_circle);
  91462. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91463. exports.default = _circle2.default;
  91464. /***/ }),
  91465. /* 384 */
  91466. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91467. "use strict";
  91468. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91469. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__ = __webpack_require__(145);
  91470. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__);
  91471. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91472. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__ = __webpack_require__(386);
  91473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__);
  91474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91475. /* script */
  91476. /* template */
  91477. /* template functional */
  91478. var __vue_template_functional__ = false
  91479. /* styles */
  91480. var __vue_styles__ = null
  91481. /* scopeId */
  91482. var __vue_scopeId__ = null
  91483. /* moduleIdentifier (server only) */
  91484. var __vue_module_identifier__ = null
  91485. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91486. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_circle_vue___default.a,
  91487. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__["render"],
  91488. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_02f73f92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_circle_vue__["staticRenderFns"],
  91489. __vue_template_functional__,
  91490. __vue_styles__,
  91491. __vue_scopeId__,
  91492. __vue_module_identifier__
  91493. )
  91494. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91495. /***/ }),
  91496. /* 385 */
  91497. /***/ (function(module, exports, __webpack_require__) {
  91498. "use strict";
  91499. Object.defineProperty(exports, "__esModule", {
  91500. value: true
  91501. });
  91502. exports.default = function () {
  91503. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  91504. var $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
  91505. var maxPos = $chars.length;
  91506. var str = '';
  91507. for (var i = 0; i < len; i++) {
  91508. str += $chars.charAt(Math.floor(Math.random() * maxPos));
  91509. }
  91510. return str;
  91511. };
  91512. /***/ }),
  91513. /* 386 */
  91514. /***/ (function(module, exports, __webpack_require__) {
  91515. "use strict";
  91516. Object.defineProperty(exports, "__esModule", {
  91517. value: true
  91518. });
  91519. var render = function render() {
  91520. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, style: _vm.circleSize }, [_c('svg', { attrs: { "viewBox": "0 0 100 100" } }, [_vm.showDefs ? _c('defs', [_c('linearGradient', { attrs: { "id": _vm.id, "x1": "100%", "y1": "0%", "x2": "0%", "y2": "0%" } }, [_c('stop', { attrs: { "offset": "0%", "stop-color": _vm.strokeColor[0] } }), _vm._v(" "), _c('stop', { attrs: { "offset": "100%", "stop-color": _vm.strokeColor[1] } })], 1)], 1) : _vm._e(), _vm._v(" "), _c('path', { style: _vm.trailStyle, attrs: { "d": _vm.pathString, "stroke": _vm.trailColor, "stroke-width": _vm.trailWidth, "fill-opacity": 0, "stroke-linecap": _vm.strokeLinecap } }), _vm._v(" "), _c('path', { style: _vm.pathStyle, attrs: { "d": _vm.pathString, "stroke-linecap": _vm.strokeLinecap, "stroke": _vm.strokeValue, "stroke-width": _vm.computedStrokeWidth, "fill-opacity": "0" } })]), _vm._v(" "), _c('div', { class: _vm.innerClasses }, [_vm._t("default")], 2)]);
  91521. };
  91522. var staticRenderFns = [];
  91523. exports.render = render;
  91524. exports.staticRenderFns = staticRenderFns;
  91525. /***/ }),
  91526. /* 387 */
  91527. /***/ (function(module, exports, __webpack_require__) {
  91528. "use strict";
  91529. Object.defineProperty(exports, "__esModule", {
  91530. value: true
  91531. });
  91532. var _collapse = __webpack_require__(388);
  91533. var _collapse2 = _interopRequireDefault(_collapse);
  91534. var _panel = __webpack_require__(390);
  91535. var _panel2 = _interopRequireDefault(_panel);
  91536. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91537. _collapse2.default.Panel = _panel2.default;
  91538. exports.default = _collapse2.default;
  91539. /***/ }),
  91540. /* 388 */
  91541. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91542. "use strict";
  91543. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91544. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__ = __webpack_require__(146);
  91545. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__);
  91546. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91547. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__ = __webpack_require__(389);
  91548. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__);
  91549. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91550. /* script */
  91551. /* template */
  91552. /* template functional */
  91553. var __vue_template_functional__ = false
  91554. /* styles */
  91555. var __vue_styles__ = null
  91556. /* scopeId */
  91557. var __vue_scopeId__ = null
  91558. /* moduleIdentifier (server only) */
  91559. var __vue_module_identifier__ = null
  91560. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91561. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_collapse_vue___default.a,
  91562. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__["render"],
  91563. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_63c3031f_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_collapse_vue__["staticRenderFns"],
  91564. __vue_template_functional__,
  91565. __vue_styles__,
  91566. __vue_scopeId__,
  91567. __vue_module_identifier__
  91568. )
  91569. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91570. /***/ }),
  91571. /* 389 */
  91572. /***/ (function(module, exports, __webpack_require__) {
  91573. "use strict";
  91574. Object.defineProperty(exports, "__esModule", {
  91575. value: true
  91576. });
  91577. var render = function render() {
  91578. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
  91579. };
  91580. var staticRenderFns = [];
  91581. exports.render = render;
  91582. exports.staticRenderFns = staticRenderFns;
  91583. /***/ }),
  91584. /* 390 */
  91585. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91586. "use strict";
  91587. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91588. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__ = __webpack_require__(147);
  91589. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__);
  91590. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91591. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__ = __webpack_require__(391);
  91592. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__);
  91593. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91594. /* script */
  91595. /* template */
  91596. /* template functional */
  91597. var __vue_template_functional__ = false
  91598. /* styles */
  91599. var __vue_styles__ = null
  91600. /* scopeId */
  91601. var __vue_scopeId__ = null
  91602. /* moduleIdentifier (server only) */
  91603. var __vue_module_identifier__ = null
  91604. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91605. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_panel_vue___default.a,
  91606. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__["render"],
  91607. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_21f3ec22_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_panel_vue__["staticRenderFns"],
  91608. __vue_template_functional__,
  91609. __vue_styles__,
  91610. __vue_scopeId__,
  91611. __vue_module_identifier__
  91612. )
  91613. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91614. /***/ }),
  91615. /* 391 */
  91616. /***/ (function(module, exports, __webpack_require__) {
  91617. "use strict";
  91618. Object.defineProperty(exports, "__esModule", {
  91619. value: true
  91620. });
  91621. var render = function render() {
  91622. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.itemClasses }, [_c('div', { class: _vm.headerClasses, on: { "click": _vm.toggle } }, [!_vm.hideArrow ? _c('Icon', { attrs: { "type": "ios-arrow-forward" } }) : _vm._e(), _vm._v(" "), _vm._t("default")], 2), _vm._v(" "), _vm.mounted ? _c('collapse-transition', [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isActive, expression: "isActive" }], class: _vm.contentClasses }, [_c('div', { class: _vm.boxClasses }, [_vm._t("content")], 2)])]) : _vm._e()], 1);
  91623. };
  91624. var staticRenderFns = [];
  91625. exports.render = render;
  91626. exports.staticRenderFns = staticRenderFns;
  91627. /***/ }),
  91628. /* 392 */
  91629. /***/ (function(module, exports, __webpack_require__) {
  91630. "use strict";
  91631. Object.defineProperty(exports, "__esModule", {
  91632. value: true
  91633. });
  91634. var _colorPicker = __webpack_require__(393);
  91635. var _colorPicker2 = _interopRequireDefault(_colorPicker);
  91636. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  91637. exports.default = _colorPicker2.default;
  91638. /***/ }),
  91639. /* 393 */
  91640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91641. "use strict";
  91642. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91643. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__ = __webpack_require__(148);
  91644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__);
  91645. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91646. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__ = __webpack_require__(402);
  91647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__);
  91648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91649. /* script */
  91650. /* template */
  91651. /* template functional */
  91652. var __vue_template_functional__ = false
  91653. /* styles */
  91654. var __vue_styles__ = null
  91655. /* scopeId */
  91656. var __vue_scopeId__ = null
  91657. /* moduleIdentifier (server only) */
  91658. var __vue_module_identifier__ = null
  91659. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91660. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_color_picker_vue___default.a,
  91661. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__["render"],
  91662. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e2bfa368_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_color_picker_vue__["staticRenderFns"],
  91663. __vue_template_functional__,
  91664. __vue_styles__,
  91665. __vue_scopeId__,
  91666. __vue_module_identifier__
  91667. )
  91668. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91669. /***/ }),
  91670. /* 394 */
  91671. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91672. "use strict";
  91673. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91674. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__ = __webpack_require__(150);
  91675. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__);
  91676. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91677. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__ = __webpack_require__(395);
  91678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__);
  91679. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91680. /* script */
  91681. /* template */
  91682. /* template functional */
  91683. var __vue_template_functional__ = false
  91684. /* styles */
  91685. var __vue_styles__ = null
  91686. /* scopeId */
  91687. var __vue_scopeId__ = null
  91688. /* moduleIdentifier (server only) */
  91689. var __vue_module_identifier__ = null
  91690. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91691. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_recommend_colors_vue___default.a,
  91692. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__["render"],
  91693. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0ac3e803_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_recommend_colors_vue__["staticRenderFns"],
  91694. __vue_template_functional__,
  91695. __vue_styles__,
  91696. __vue_scopeId__,
  91697. __vue_module_identifier__
  91698. )
  91699. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91700. /***/ }),
  91701. /* 395 */
  91702. /***/ (function(module, exports, __webpack_require__) {
  91703. "use strict";
  91704. Object.defineProperty(exports, "__esModule", {
  91705. value: true
  91706. });
  91707. var render = function render() {
  91708. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "reference", attrs: { "tabindex": "0" }, on: { "click": _vm.handleClick, "keydown": [function ($event) {
  91709. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91710. return null;
  91711. }return _vm.handleEscape($event);
  91712. }, function ($event) {
  91713. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  91714. return null;
  91715. }return _vm.handleEnter($event);
  91716. }, function ($event) {
  91717. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  91718. return null;
  91719. }if ('button' in $event && $event.button !== 0) {
  91720. return null;
  91721. }return _vm.handleArrow($event, 'x', _vm.left);
  91722. }, function ($event) {
  91723. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  91724. return null;
  91725. }if ('button' in $event && $event.button !== 2) {
  91726. return null;
  91727. }return _vm.handleArrow($event, 'x', _vm.right);
  91728. }, function ($event) {
  91729. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  91730. return null;
  91731. }return _vm.handleArrow($event, 'y', _vm.up);
  91732. }, function ($event) {
  91733. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  91734. return null;
  91735. }return _vm.handleArrow($event, 'y', _vm.down);
  91736. }], "blur": _vm.blurColor, "focus": _vm.focusColor } }, [_vm._l(_vm.list, function (item, index) {
  91737. return [_c('div', { key: item + ':' + index, class: [_vm.prefixCls + '-picker-colors-wrapper'] }, [_c('div', { attrs: { "data-color-id": index } }, [_c('div', { class: [_vm.prefixCls + '-picker-colors-wrapper-color'], style: { background: item } }), _vm._v(" "), _c('div', { ref: 'color-circle-' + index, refInFor: true, class: [_vm.prefixCls + '-picker-colors-wrapper-circle', _vm.hideClass] })])]), _vm._v(" "), _vm.lineBreak(_vm.list, index) ? _c('br') : _vm._e()];
  91738. })], 2);
  91739. };
  91740. var staticRenderFns = [];
  91741. exports.render = render;
  91742. exports.staticRenderFns = staticRenderFns;
  91743. /***/ }),
  91744. /* 396 */
  91745. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91746. "use strict";
  91747. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91748. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__ = __webpack_require__(152);
  91749. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__);
  91750. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91751. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__ = __webpack_require__(397);
  91752. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__);
  91753. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91754. /* script */
  91755. /* template */
  91756. /* template functional */
  91757. var __vue_template_functional__ = false
  91758. /* styles */
  91759. var __vue_styles__ = null
  91760. /* scopeId */
  91761. var __vue_scopeId__ = null
  91762. /* moduleIdentifier (server only) */
  91763. var __vue_module_identifier__ = null
  91764. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91765. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_saturation_vue___default.a,
  91766. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__["render"],
  91767. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0757ab84_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_saturation_vue__["staticRenderFns"],
  91768. __vue_template_functional__,
  91769. __vue_styles__,
  91770. __vue_scopeId__,
  91771. __vue_module_identifier__
  91772. )
  91773. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91774. /***/ }),
  91775. /* 397 */
  91776. /***/ (function(module, exports, __webpack_require__) {
  91777. "use strict";
  91778. Object.defineProperty(exports, "__esModule", {
  91779. value: true
  91780. });
  91781. var render = function render() {
  91782. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-saturation-wrapper'], attrs: { "tabindex": "0" }, on: { "keydown": [function ($event) {
  91783. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91784. return null;
  91785. }return _vm.handleEscape($event);
  91786. }, function ($event) {
  91787. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  91788. return null;
  91789. }if ('button' in $event && $event.button !== 0) {
  91790. return null;
  91791. }return _vm.handleLeft($event);
  91792. }, function ($event) {
  91793. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  91794. return null;
  91795. }if ('button' in $event && $event.button !== 2) {
  91796. return null;
  91797. }return _vm.handleRight($event);
  91798. }, function ($event) {
  91799. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  91800. return null;
  91801. }return _vm.handleUp($event);
  91802. }, function ($event) {
  91803. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  91804. return null;
  91805. }return _vm.handleDown($event);
  91806. }], "click": function click($event) {
  91807. return _vm.$el.focus();
  91808. } } }, [_c('div', { ref: "container", class: [_vm.prefixCls + '-saturation'], style: _vm.bgColorStyle, on: { "mousedown": _vm.handleMouseDown } }, [_c('div', { class: [_vm.prefixCls + '-saturation--white'] }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-saturation--black'] }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-saturation-pointer'], style: _vm.pointerStyle }, [_c('div', { class: [_vm.prefixCls + '-saturation-circle'] })])])]);
  91809. };
  91810. var staticRenderFns = [];
  91811. exports.render = render;
  91812. exports.staticRenderFns = staticRenderFns;
  91813. /***/ }),
  91814. /* 398 */
  91815. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91816. "use strict";
  91817. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91818. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__ = __webpack_require__(153);
  91819. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__);
  91820. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91821. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__ = __webpack_require__(399);
  91822. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__);
  91823. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91824. /* script */
  91825. /* template */
  91826. /* template functional */
  91827. var __vue_template_functional__ = false
  91828. /* styles */
  91829. var __vue_styles__ = null
  91830. /* scopeId */
  91831. var __vue_scopeId__ = null
  91832. /* moduleIdentifier (server only) */
  91833. var __vue_module_identifier__ = null
  91834. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91835. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_hue_vue___default.a,
  91836. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__["render"],
  91837. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4a42dff6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_hue_vue__["staticRenderFns"],
  91838. __vue_template_functional__,
  91839. __vue_styles__,
  91840. __vue_scopeId__,
  91841. __vue_module_identifier__
  91842. )
  91843. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91844. /***/ }),
  91845. /* 399 */
  91846. /***/ (function(module, exports, __webpack_require__) {
  91847. "use strict";
  91848. Object.defineProperty(exports, "__esModule", {
  91849. value: true
  91850. });
  91851. var render = function render() {
  91852. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-hue'], attrs: { "tabindex": "0" }, on: { "click": function click($event) {
  91853. return _vm.$el.focus();
  91854. }, "keydown": [function ($event) {
  91855. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91856. return null;
  91857. }return _vm.handleEscape($event);
  91858. }, function ($event) {
  91859. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  91860. return null;
  91861. }if ('button' in $event && $event.button !== 0) {
  91862. return null;
  91863. }return _vm.handleLeft($event);
  91864. }, function ($event) {
  91865. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  91866. return null;
  91867. }if ('button' in $event && $event.button !== 2) {
  91868. return null;
  91869. }return _vm.handleRight($event);
  91870. }, function ($event) {
  91871. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  91872. return null;
  91873. }return _vm.handleUp($event);
  91874. }, function ($event) {
  91875. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  91876. return null;
  91877. }return _vm.handleDown($event);
  91878. }] } }, [_c('div', { ref: "container", class: [_vm.prefixCls + '-hue-container'], on: { "mousedown": _vm.handleMouseDown, "touchmove": _vm.handleChange, "touchstart": _vm.handleChange } }, [_c('div', { class: [_vm.prefixCls + '-hue-pointer'], style: { top: 0, left: _vm.percent + "%" } }, [_c('div', { class: [_vm.prefixCls + '-hue-picker'] })])])]);
  91879. };
  91880. var staticRenderFns = [];
  91881. exports.render = render;
  91882. exports.staticRenderFns = staticRenderFns;
  91883. /***/ }),
  91884. /* 400 */
  91885. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  91886. "use strict";
  91887. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  91888. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__ = __webpack_require__(154);
  91889. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__);
  91890. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  91891. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__ = __webpack_require__(401);
  91892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__);
  91893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  91894. /* script */
  91895. /* template */
  91896. /* template functional */
  91897. var __vue_template_functional__ = false
  91898. /* styles */
  91899. var __vue_styles__ = null
  91900. /* scopeId */
  91901. var __vue_scopeId__ = null
  91902. /* moduleIdentifier (server only) */
  91903. var __vue_module_identifier__ = null
  91904. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  91905. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_alpha_vue___default.a,
  91906. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__["render"],
  91907. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_be7eaa8a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_alpha_vue__["staticRenderFns"],
  91908. __vue_template_functional__,
  91909. __vue_styles__,
  91910. __vue_scopeId__,
  91911. __vue_module_identifier__
  91912. )
  91913. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  91914. /***/ }),
  91915. /* 401 */
  91916. /***/ (function(module, exports, __webpack_require__) {
  91917. "use strict";
  91918. Object.defineProperty(exports, "__esModule", {
  91919. value: true
  91920. });
  91921. var render = function render() {
  91922. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-alpha'], attrs: { "tabindex": "0" }, on: { "click": function click($event) {
  91923. return _vm.$el.focus();
  91924. }, "keydown": [function ($event) {
  91925. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91926. return null;
  91927. }return _vm.handleEscape($event);
  91928. }, function ($event) {
  91929. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  91930. return null;
  91931. }if ('button' in $event && $event.button !== 0) {
  91932. return null;
  91933. }return _vm.handleLeft($event);
  91934. }, function ($event) {
  91935. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  91936. return null;
  91937. }if ('button' in $event && $event.button !== 2) {
  91938. return null;
  91939. }return _vm.handleRight($event);
  91940. }, function ($event) {
  91941. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  91942. return null;
  91943. }return _vm.handleUp($event);
  91944. }, function ($event) {
  91945. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  91946. return null;
  91947. }return _vm.handleDown($event);
  91948. }] } }, [_c('div', { class: [_vm.prefixCls + '-alpha-checkboard-wrap'] }, [_c('div', { class: [_vm.prefixCls + '-alpha-checkerboard'] })]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-alpha-gradient'], style: _vm.gradientStyle }), _vm._v(" "), _c('div', { ref: "container", class: [_vm.prefixCls + '-alpha-container'], on: { "mousedown": _vm.handleMouseDown, "touchmove": _vm.handleChange, "touchstart": _vm.handleChange } }, [_c('div', { class: [_vm.prefixCls + '-alpha-pointer'], style: { top: 0, left: _vm.value.a * 100 + "%" } }, [_c('div', { class: [_vm.prefixCls + '-alpha-picker'] })])])]);
  91949. };
  91950. var staticRenderFns = [];
  91951. exports.render = render;
  91952. exports.staticRenderFns = staticRenderFns;
  91953. /***/ }),
  91954. /* 402 */
  91955. /***/ (function(module, exports, __webpack_require__) {
  91956. "use strict";
  91957. Object.defineProperty(exports, "__esModule", {
  91958. value: true
  91959. });
  91960. var render = function render() {
  91961. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture }], class: _vm.classes }, [_c('div', { ref: "reference", class: _vm.wrapClasses, on: { "click": _vm.toggleVisible } }, [_c('input', { attrs: { "name": _vm.name, "type": "hidden" }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _c('Icon', { class: _vm.arrowClasses, attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }), _vm._v(" "), _c('div', { ref: "input", class: _vm.inputClasses, attrs: { "tabindex": _vm.itemDisabled ? undefined : 0 }, on: { "keydown": [function ($event) {
  91962. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
  91963. return null;
  91964. }return _vm.onTab($event);
  91965. }, function ($event) {
  91966. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91967. return null;
  91968. }return _vm.onEscape($event);
  91969. }, function ($event) {
  91970. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  91971. return null;
  91972. }return _vm.onArrow($event);
  91973. }, function ($event) {
  91974. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  91975. return null;
  91976. }return _vm.onArrow($event);
  91977. }] } }, [_c('div', { class: [_vm.prefixCls + '-color'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.value === '' && !_vm.visible, expression: "value === '' && !visible" }], class: [_vm.prefixCls + '-color-empty'] }, [_c('i', { class: [_vm.iconPrefixCls, _vm.iconPrefixCls + '-ios-close'] })]), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.value || _vm.visible, expression: "value || visible" }], style: _vm.displayedColorStyle })])])], 1), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }, { name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], ref: "drop", class: _vm.dropClasses, attrs: { "placement": _vm.placement, "data-transfer": _vm.transfer, "transfer": _vm.transfer, "eventsEnabled": _vm.eventsEnabled } }, [_c('transition', { attrs: { "name": "fade" } }, [_vm.visible ? _c('div', { class: [_vm.prefixCls + '-picker'] }, [_c('div', { class: [_vm.prefixCls + '-picker-wrapper'] }, [_c('div', { class: [_vm.prefixCls + '-picker-panel'] }, [_c('Saturation', { ref: "saturation", attrs: { "focused": _vm.visible }, on: { "change": _vm.childChange }, nativeOn: { "keydown": function keydown($event) {
  91978. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
  91979. return null;
  91980. }return _vm.handleFirstTab($event);
  91981. } }, model: { value: _vm.saturationColors, callback: function callback($$v) {
  91982. _vm.saturationColors = $$v;
  91983. }, expression: "saturationColors" } })], 1), _vm._v(" "), _vm.hue ? _c('div', { class: [_vm.prefixCls + '-picker-hue-slider'] }, [_c('Hue', { on: { "change": _vm.childChange }, model: { value: _vm.saturationColors, callback: function callback($$v) {
  91984. _vm.saturationColors = $$v;
  91985. }, expression: "saturationColors" } })], 1) : _vm._e(), _vm._v(" "), _vm.alpha ? _c('div', { class: [_vm.prefixCls + '-picker-alpha-slider'] }, [_c('Alpha', { on: { "change": _vm.childChange }, model: { value: _vm.saturationColors, callback: function callback($$v) {
  91986. _vm.saturationColors = $$v;
  91987. }, expression: "saturationColors" } })], 1) : _vm._e(), _vm._v(" "), _vm.colors.length ? _c('recommend-colors', { class: [_vm.prefixCls + '-picker-colors'], attrs: { "list": _vm.colors }, on: { "picker-color": _vm.handleSelectColor } }) : _vm._e(), _vm._v(" "), !_vm.colors.length && _vm.recommend ? _c('recommend-colors', { class: [_vm.prefixCls + '-picker-colors'], attrs: { "list": _vm.recommendedColor }, on: { "picker-color": _vm.handleSelectColor } }) : _vm._e()], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-confirm'] }, [_c('span', { class: _vm.confirmColorClasses }, [_vm.editable ? [_c('i-input', { ref: "editColorInput", attrs: { "value": _vm.formatColor, "size": "small" }, on: { "on-enter": _vm.handleEditColor, "on-blur": _vm.handleEditColor } })] : [_vm._v(_vm._s(_vm.formatColor))]], 2), _vm._v(" "), _c('i-button', { ref: "clear", attrs: { "tabindex": 0, "size": "small" }, on: { "keydown": function keydown($event) {
  91988. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  91989. return null;
  91990. }return _vm.handleClear($event);
  91991. } }, nativeOn: { "click": function click($event) {
  91992. return _vm.handleClear($event);
  91993. }, "keydown": function keydown($event) {
  91994. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  91995. return null;
  91996. }return _vm.closer($event);
  91997. } } }, [_vm._v(_vm._s(_vm.t('i.datepicker.clear')))]), _vm._v(" "), _c('i-button', { ref: "ok", attrs: { "tabindex": 0, "size": "small", "type": "primary" }, on: { "keydown": function keydown($event) {
  91998. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  91999. return null;
  92000. }return _vm.handleSuccess($event);
  92001. } }, nativeOn: { "click": function click($event) {
  92002. return _vm.handleSuccess($event);
  92003. }, "keydown": [function ($event) {
  92004. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
  92005. return null;
  92006. }return _vm.handleLastTab($event);
  92007. }, function ($event) {
  92008. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"])) {
  92009. return null;
  92010. }return _vm.closer($event);
  92011. }] } }, [_vm._v(_vm._s(_vm.t('i.datepicker.ok')))])], 1)]) : _vm._e()])], 1)], 1)], 1);
  92012. };
  92013. var staticRenderFns = [];
  92014. exports.render = render;
  92015. exports.staticRenderFns = staticRenderFns;
  92016. /***/ }),
  92017. /* 403 */
  92018. /***/ (function(module, exports, __webpack_require__) {
  92019. "use strict";
  92020. Object.defineProperty(exports, "__esModule", {
  92021. value: true
  92022. });
  92023. var _content = __webpack_require__(155);
  92024. var _content2 = _interopRequireDefault(_content);
  92025. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  92026. exports.default = _content2.default;
  92027. /***/ }),
  92028. /* 404 */
  92029. /***/ (function(module, exports, __webpack_require__) {
  92030. "use strict";
  92031. Object.defineProperty(exports, "__esModule", {
  92032. value: true
  92033. });
  92034. var render = function render() {
  92035. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
  92036. };
  92037. var staticRenderFns = [];
  92038. exports.render = render;
  92039. exports.staticRenderFns = staticRenderFns;
  92040. /***/ }),
  92041. /* 405 */
  92042. /***/ (function(module, exports, __webpack_require__) {
  92043. "use strict";
  92044. Object.defineProperty(exports, "__esModule", {
  92045. value: true
  92046. });
  92047. var _datePicker = __webpack_require__(406);
  92048. var _datePicker2 = _interopRequireDefault(_datePicker);
  92049. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  92050. exports.default = _datePicker2.default;
  92051. /***/ }),
  92052. /* 406 */
  92053. /***/ (function(module, exports, __webpack_require__) {
  92054. "use strict";
  92055. Object.defineProperty(exports, "__esModule", {
  92056. value: true
  92057. });
  92058. var _picker = __webpack_require__(157);
  92059. var _picker2 = _interopRequireDefault(_picker);
  92060. var _date = __webpack_require__(409);
  92061. var _date2 = _interopRequireDefault(_date);
  92062. var _dateRange = __webpack_require__(422);
  92063. var _dateRange2 = _interopRequireDefault(_dateRange);
  92064. var _assist = __webpack_require__(3);
  92065. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  92066. exports.default = {
  92067. name: 'CalendarPicker',
  92068. mixins: [_picker2.default],
  92069. props: {
  92070. type: {
  92071. validator: function validator(value) {
  92072. return (0, _assist.oneOf)(value, ['year', 'month', 'date', 'daterange', 'datetime', 'datetimerange']);
  92073. },
  92074. default: 'date'
  92075. }
  92076. },
  92077. components: { DatePickerPanel: _date2.default, RangeDatePickerPanel: _dateRange2.default },
  92078. computed: {
  92079. panel: function panel() {
  92080. var isRange = this.type === 'daterange' || this.type === 'datetimerange';
  92081. return isRange ? 'RangeDatePickerPanel' : 'DatePickerPanel';
  92082. },
  92083. ownPickerProps: function ownPickerProps() {
  92084. return this.options;
  92085. }
  92086. }
  92087. };
  92088. /***/ }),
  92089. /* 407 */
  92090. /***/ (function(module, exports, __webpack_require__) {
  92091. "use strict";
  92092. var __WEBPACK_AMD_DEFINE_RESULT__;
  92093. (function (main) {
  92094. 'use strict';
  92095. var fecha = {};
  92096. var token = /d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g;
  92097. var twoDigits = /\d\d?/;
  92098. var threeDigits = /\d{3}/;
  92099. var fourDigits = /\d{4}/;
  92100. var word = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
  92101. var noop = function noop() {};
  92102. function shorten(arr, sLen) {
  92103. var newArr = [];
  92104. for (var i = 0, len = arr.length; i < len; i++) {
  92105. newArr.push(arr[i].substr(0, sLen));
  92106. }
  92107. return newArr;
  92108. }
  92109. function monthUpdate(arrName) {
  92110. return function (d, v, i18n) {
  92111. var index = i18n[arrName].indexOf(v.charAt(0).toUpperCase() + v.substr(1).toLowerCase());
  92112. if (~index) {
  92113. d.month = index;
  92114. }
  92115. };
  92116. }
  92117. function pad(val, len) {
  92118. val = String(val);
  92119. len = len || 2;
  92120. while (val.length < len) {
  92121. val = '0' + val;
  92122. }
  92123. return val;
  92124. }
  92125. var dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
  92126. var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
  92127. var monthNamesShort = shorten(monthNames, 3);
  92128. var dayNamesShort = shorten(dayNames, 3);
  92129. fecha.i18n = {
  92130. dayNamesShort: dayNamesShort,
  92131. dayNames: dayNames,
  92132. monthNamesShort: monthNamesShort,
  92133. monthNames: monthNames,
  92134. amPm: ['am', 'pm'],
  92135. DoFn: function DoFn(D) {
  92136. return D + ['th', 'st', 'nd', 'rd'][D % 10 > 3 ? 0 : (D - D % 10 !== 10) * D % 10];
  92137. }
  92138. };
  92139. var formatFlags = {
  92140. D: function D(dateObj) {
  92141. return dateObj.getDay();
  92142. },
  92143. DD: function DD(dateObj) {
  92144. return pad(dateObj.getDay());
  92145. },
  92146. Do: function Do(dateObj, i18n) {
  92147. return i18n.DoFn(dateObj.getDate());
  92148. },
  92149. d: function d(dateObj) {
  92150. return dateObj.getDate();
  92151. },
  92152. dd: function dd(dateObj) {
  92153. return pad(dateObj.getDate());
  92154. },
  92155. ddd: function ddd(dateObj, i18n) {
  92156. return i18n.dayNamesShort[dateObj.getDay()];
  92157. },
  92158. dddd: function dddd(dateObj, i18n) {
  92159. return i18n.dayNames[dateObj.getDay()];
  92160. },
  92161. M: function M(dateObj) {
  92162. return dateObj.getMonth() + 1;
  92163. },
  92164. MM: function MM(dateObj) {
  92165. return pad(dateObj.getMonth() + 1);
  92166. },
  92167. MMM: function MMM(dateObj, i18n) {
  92168. return i18n.monthNamesShort[dateObj.getMonth()];
  92169. },
  92170. MMMM: function MMMM(dateObj, i18n) {
  92171. return i18n.monthNames[dateObj.getMonth()];
  92172. },
  92173. yy: function yy(dateObj) {
  92174. return String(dateObj.getFullYear()).substr(2);
  92175. },
  92176. yyyy: function yyyy(dateObj) {
  92177. return dateObj.getFullYear();
  92178. },
  92179. h: function h(dateObj) {
  92180. return dateObj.getHours() % 12 || 12;
  92181. },
  92182. hh: function hh(dateObj) {
  92183. return pad(dateObj.getHours() % 12 || 12);
  92184. },
  92185. H: function H(dateObj) {
  92186. return dateObj.getHours();
  92187. },
  92188. HH: function HH(dateObj) {
  92189. return pad(dateObj.getHours());
  92190. },
  92191. m: function m(dateObj) {
  92192. return dateObj.getMinutes();
  92193. },
  92194. mm: function mm(dateObj) {
  92195. return pad(dateObj.getMinutes());
  92196. },
  92197. s: function s(dateObj) {
  92198. return dateObj.getSeconds();
  92199. },
  92200. ss: function ss(dateObj) {
  92201. return pad(dateObj.getSeconds());
  92202. },
  92203. S: function S(dateObj) {
  92204. return Math.round(dateObj.getMilliseconds() / 100);
  92205. },
  92206. SS: function SS(dateObj) {
  92207. return pad(Math.round(dateObj.getMilliseconds() / 10), 2);
  92208. },
  92209. SSS: function SSS(dateObj) {
  92210. return pad(dateObj.getMilliseconds(), 3);
  92211. },
  92212. a: function a(dateObj, i18n) {
  92213. return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];
  92214. },
  92215. A: function A(dateObj, i18n) {
  92216. return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase();
  92217. },
  92218. ZZ: function ZZ(dateObj) {
  92219. var o = dateObj.getTimezoneOffset();
  92220. return (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4);
  92221. }
  92222. };
  92223. var parseFlags = {
  92224. d: [twoDigits, function (d, v) {
  92225. d.day = v;
  92226. }],
  92227. M: [twoDigits, function (d, v) {
  92228. d.month = v - 1;
  92229. }],
  92230. yy: [twoDigits, function (d, v) {
  92231. var da = new Date(),
  92232. cent = +('' + da.getFullYear()).substr(0, 2);
  92233. d.year = '' + (v > 68 ? cent - 1 : cent) + v;
  92234. }],
  92235. h: [twoDigits, function (d, v) {
  92236. d.hour = v;
  92237. }],
  92238. m: [twoDigits, function (d, v) {
  92239. d.minute = v;
  92240. }],
  92241. s: [twoDigits, function (d, v) {
  92242. d.second = v;
  92243. }],
  92244. yyyy: [fourDigits, function (d, v) {
  92245. d.year = v;
  92246. }],
  92247. S: [/\d/, function (d, v) {
  92248. d.millisecond = v * 100;
  92249. }],
  92250. SS: [/\d{2}/, function (d, v) {
  92251. d.millisecond = v * 10;
  92252. }],
  92253. SSS: [threeDigits, function (d, v) {
  92254. d.millisecond = v;
  92255. }],
  92256. D: [twoDigits, noop],
  92257. ddd: [word, noop],
  92258. MMM: [word, monthUpdate('monthNamesShort')],
  92259. MMMM: [word, monthUpdate('monthNames')],
  92260. a: [word, function (d, v, i18n) {
  92261. var val = v.toLowerCase();
  92262. if (val === i18n.amPm[0]) {
  92263. d.isPm = false;
  92264. } else if (val === i18n.amPm[1]) {
  92265. d.isPm = true;
  92266. }
  92267. }],
  92268. ZZ: [/[\+\-]\d\d:?\d\d/, function (d, v) {
  92269. var parts = (v + '').match(/([\+\-]|\d\d)/gi),
  92270. minutes;
  92271. if (parts) {
  92272. minutes = +(parts[1] * 60) + parseInt(parts[2], 10);
  92273. d.timezoneOffset = parts[0] === '+' ? minutes : -minutes;
  92274. }
  92275. }]
  92276. };
  92277. parseFlags.DD = parseFlags.DD;
  92278. parseFlags.dddd = parseFlags.ddd;
  92279. parseFlags.Do = parseFlags.dd = parseFlags.d;
  92280. parseFlags.mm = parseFlags.m;
  92281. parseFlags.hh = parseFlags.H = parseFlags.HH = parseFlags.h;
  92282. parseFlags.MM = parseFlags.M;
  92283. parseFlags.ss = parseFlags.s;
  92284. parseFlags.A = parseFlags.a;
  92285. fecha.masks = {
  92286. 'default': 'ddd MMM dd yyyy HH:mm:ss',
  92287. shortDate: 'M/D/yy',
  92288. mediumDate: 'MMM d, yyyy',
  92289. longDate: 'MMMM d, yyyy',
  92290. fullDate: 'dddd, MMMM d, yyyy',
  92291. shortTime: 'HH:mm',
  92292. mediumTime: 'HH:mm:ss',
  92293. longTime: 'HH:mm:ss.SSS'
  92294. };
  92295. fecha.format = function (dateObj, mask, i18nSettings) {
  92296. var i18n = i18nSettings || fecha.i18n;
  92297. if (typeof dateObj === 'number') {
  92298. dateObj = new Date(dateObj);
  92299. }
  92300. if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
  92301. throw new Error('Invalid Date in fecha.format');
  92302. }
  92303. mask = fecha.masks[mask] || mask || fecha.masks['default'];
  92304. return mask.replace(token, function ($0) {
  92305. return $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1);
  92306. });
  92307. };
  92308. fecha.parse = function (dateStr, format, i18nSettings) {
  92309. var i18n = i18nSettings || fecha.i18n;
  92310. if (typeof format !== 'string') {
  92311. throw new Error('Invalid format in fecha.parse');
  92312. }
  92313. format = fecha.masks[format] || format;
  92314. if (dateStr.length > 1000) {
  92315. return false;
  92316. }
  92317. var isValid = true;
  92318. var dateInfo = {};
  92319. format.replace(token, function ($0) {
  92320. if (parseFlags[$0]) {
  92321. var info = parseFlags[$0];
  92322. var index = dateStr.search(info[0]);
  92323. if (!~index) {
  92324. isValid = false;
  92325. } else {
  92326. dateStr.replace(info[0], function (result) {
  92327. info[1](dateInfo, result, i18n);
  92328. dateStr = dateStr.substr(index + result.length);
  92329. return result;
  92330. });
  92331. }
  92332. }
  92333. return parseFlags[$0] ? '' : $0.slice(1, $0.length - 1);
  92334. });
  92335. if (!isValid) {
  92336. return false;
  92337. }
  92338. var today = new Date();
  92339. if (dateInfo.isPm === true && dateInfo.hour != null && +dateInfo.hour !== 12) {
  92340. dateInfo.hour = +dateInfo.hour + 12;
  92341. } else if (dateInfo.isPm === false && +dateInfo.hour === 12) {
  92342. dateInfo.hour = 0;
  92343. }
  92344. var date;
  92345. if (dateInfo.timezoneOffset != null) {
  92346. dateInfo.minute = +(dateInfo.minute || 0) - +dateInfo.timezoneOffset;
  92347. date = new Date(Date.UTC(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0));
  92348. } else {
  92349. date = new Date(dateInfo.year || today.getFullYear(), dateInfo.month || 0, dateInfo.day || 1, dateInfo.hour || 0, dateInfo.minute || 0, dateInfo.second || 0, dateInfo.millisecond || 0);
  92350. }
  92351. return date;
  92352. };
  92353. if (typeof module !== 'undefined' && module.exports) {
  92354. module.exports = fecha;
  92355. } else if (true) {
  92356. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {
  92357. return fecha;
  92358. }).call(exports, __webpack_require__, exports, module),
  92359. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  92360. } else {
  92361. main.fecha = fecha;
  92362. }
  92363. })(undefined);
  92364. /***/ }),
  92365. /* 408 */
  92366. /***/ (function(module, exports, __webpack_require__) {
  92367. "use strict";
  92368. Object.defineProperty(exports, "__esModule", {
  92369. value: true
  92370. });
  92371. var render = function render() {
  92372. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside:[capture].mousedown", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture, modifiers: { "mousedown": true } }, { name: "click-outside", rawName: "v-click-outside:[capture].touchstart", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture, modifiers: { "touchstart": true } }, { name: "click-outside", rawName: "v-click-outside:[capture]", value: _vm.handleClose, expression: "handleClose", arg: _vm.capture }], class: _vm.wrapperClasses }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'] }, [_vm._t("default", [_c('i-input', { key: _vm.forceInputRerender, ref: "input", class: [_vm.prefixCls + '-editor'], attrs: { "element-id": _vm.elementId, "readonly": !_vm.editable || _vm.readonly, "disabled": _vm.itemDisabled, "size": _vm.size, "placeholder": _vm.placeholder, "value": _vm.visualValue, "name": _vm.name }, on: { "on-input-change": _vm.handleInputChange, "on-focus": _vm.handleFocus, "on-blur": _vm.handleBlur }, nativeOn: { "click": function click($event) {
  92373. return _vm.handleFocus($event);
  92374. }, "keydown": function keydown($event) {
  92375. return _vm.handleKeydown($event);
  92376. }, "mouseenter": function mouseenter($event) {
  92377. return _vm.handleInputMouseenter($event);
  92378. }, "mouseleave": function mouseleave($event) {
  92379. return _vm.handleInputMouseleave($event);
  92380. } } }, [_c('Icon', { attrs: { "slot": "suffix", "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize }, on: { "click": _vm.handleIconClick }, slot: "suffix" })], 1)])], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer }, nativeOn: { "click": function click($event) {
  92381. return _vm.handleTransferClick($event);
  92382. } } }, [_c('div', [_c(_vm.panel, _vm._b({ ref: "pickerPanel", tag: "component", attrs: { "visible": _vm.visible, "showTime": _vm.type === 'datetime' || _vm.type === 'datetimerange', "confirm": _vm.isConfirm, "selectionMode": _vm.selectionMode, "steps": _vm.steps, "format": _vm.format, "value": _vm.internalValue, "start-date": _vm.startDate, "split-panels": _vm.splitPanels, "show-week-numbers": _vm.showWeekNumbers, "picker-type": _vm.type, "multiple": _vm.multiple, "focused-date": _vm.focusedDate, "time-picker-options": _vm.timePickerOptions }, on: { "on-pick": _vm.onPick, "on-pick-clear": _vm.handleClear, "on-pick-success": _vm.onPickSuccess, "on-pick-click": function onPickClick($event) {
  92383. _vm.disableClickOutSide = true;
  92384. }, "on-selection-mode-change": _vm.onSelectionModeChange } }, 'component', _vm.ownPickerProps, false))], 1)])], 1)], 1);
  92385. };
  92386. var staticRenderFns = [];
  92387. exports.render = render;
  92388. exports.staticRenderFns = staticRenderFns;
  92389. /***/ }),
  92390. /* 409 */
  92391. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92392. "use strict";
  92393. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  92394. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__ = __webpack_require__(159);
  92395. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__);
  92396. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  92397. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__ = __webpack_require__(421);
  92398. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__);
  92399. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  92400. /* script */
  92401. /* template */
  92402. /* template functional */
  92403. var __vue_template_functional__ = false
  92404. /* styles */
  92405. var __vue_styles__ = null
  92406. /* scopeId */
  92407. var __vue_scopeId__ = null
  92408. /* moduleIdentifier (server only) */
  92409. var __vue_module_identifier__ = null
  92410. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  92411. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_vue___default.a,
  92412. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__["render"],
  92413. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6c43856e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_vue__["staticRenderFns"],
  92414. __vue_template_functional__,
  92415. __vue_styles__,
  92416. __vue_scopeId__,
  92417. __vue_module_identifier__
  92418. )
  92419. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  92420. /***/ }),
  92421. /* 410 */
  92422. /***/ (function(module, exports, __webpack_require__) {
  92423. module.exports = {
  92424. Generator: __webpack_require__(411),
  92425. addLabels: __webpack_require__(412)
  92426. }
  92427. /***/ }),
  92428. /* 411 */
  92429. /***/ (function(module, exports) {
  92430. // calendar with 8 column x 7 rows
  92431. var oneDay = 1000 * 60 * 60 * 24;
  92432. function daysInMonth(year, month) {
  92433. return new Date(year, month + 1, 0).getDate();
  92434. }
  92435. function getYear(year, month, weekNr){
  92436. if (month === 0 && weekNr > 50) return year - 1;
  92437. else if(month === 11 && weekNr < 10) return year + 1;
  92438. else return year;
  92439. }
  92440. function getDateInfo(y, m, d, iso) {
  92441. if (m > 11){
  92442. m = 0;
  92443. y++;
  92444. }
  92445. var currentDay = new Date(y, m, d);
  92446. if (iso) currentDay.setDate(currentDay.getDate() + 4 - (currentDay.getDay() || 7));
  92447. var year = iso ? currentDay.getFullYear() : y;
  92448. var firstOfJanuary = new Date(year, 0, 1);
  92449. var numberOfDays = 1 + Math.round((currentDay - firstOfJanuary) / oneDay);
  92450. if (!iso) numberOfDays += firstOfJanuary.getDay();
  92451. var w = Math.ceil(numberOfDays / 7);
  92452. if (!iso) {
  92453. var initialDay = new Date(y, m, d);
  92454. var beginOfNextYear = new Date(y + 1, 0, 1);
  92455. var startDayOfNextYear = beginOfNextYear.getDay();
  92456. if (initialDay.getTime() >= beginOfNextYear.getTime() - (oneDay * startDayOfNextYear)) w = 1;
  92457. }
  92458. return w;
  92459. }
  92460. function getMonthCalender(year, month, iteratorFns){
  92461. // config passed by binding
  92462. var lang = this.lang || 'en';
  92463. var onlyDays = this.onlyDays;
  92464. var weekStart = typeof this.weekStart === 'undefined' ? 1 : this.weekStart;
  92465. var iso = weekStart === 1;
  92466. var cells = [];
  92467. var monthStartDate = new Date(year, month, 1); // make a date object
  92468. var dayOfWeek = monthStartDate.getDay() || (iso ? 7 : 0); // month week day for day 1
  92469. var currentDay = weekStart - dayOfWeek; // starting position of first day in the week
  92470. var weekNr = getDateInfo(year, month, 1, iso); // get week number of month start
  92471. var maxDays = daysInMonth(year, month); // total days in current month
  92472. var lastMonthMaxDays = daysInMonth(year, month - 1);
  92473. var currentMonth, day, dayBefore;
  92474. var currentYear = getYear(year, month, weekNr);
  92475. var returnObject = {
  92476. month: month,
  92477. year: year,
  92478. daysInMonth: maxDays
  92479. };
  92480. for (var i = 0; i < 7; i++){ // 7 rows in the calendar
  92481. dayBefore = currentDay;
  92482. for (var j = 0; j < 8; j++){ // 8 columns: week nr + 7 days p/ week
  92483. if (i > 0 && j > 0) currentDay++; // not first row, not week nr column
  92484. if (currentDay > maxDays || currentDay < 1){ // day belongs to sibling month
  92485. // calculate day in sibling month
  92486. day = currentDay > maxDays ? currentDay - maxDays : lastMonthMaxDays + currentDay;
  92487. currentMonth = currentDay > maxDays ? month + 1 : month - 1;
  92488. } else {
  92489. day = currentDay;
  92490. currentMonth = month;
  92491. }
  92492. var type = (function(){
  92493. if (j === 0) return 'weekLabel';
  92494. else if (i === 0) return 'dayLabel';
  92495. else if (currentDay < 1) return 'prevMonth';
  92496. else if (currentDay > maxDays) return 'nextMonth';
  92497. else return 'monthDay';
  92498. })();
  92499. var isDay = dayBefore !== currentDay && i > 0;
  92500. var dayData = {
  92501. desc: isDay ? day : weekNr,
  92502. week: weekNr,
  92503. type: type,
  92504. format: iso ? 'ISO 8601' : 'US',
  92505. date: isDay ? new Date(Date.UTC(year, currentMonth, day)) : false,
  92506. year: currentYear,
  92507. index: cells.length
  92508. };
  92509. if (iteratorFns){
  92510. if (typeof iteratorFns === "function") dayData = iteratorFns.call(returnObject, dayData, lang);
  92511. else iteratorFns.forEach(function(fn){
  92512. dayData = fn.call(returnObject, dayData, lang);
  92513. });
  92514. }
  92515. if (onlyDays && isDay) cells.push(dayData); // add only days
  92516. else if (!onlyDays) cells.push(dayData); // add also week numbers and labels
  92517. }
  92518. if (i > 0) weekNr = getDateInfo(year, currentMonth, day + 1, iso);
  92519. currentYear = getYear(year, month, weekNr);
  92520. }
  92521. returnObject.cells = cells;
  92522. return returnObject;
  92523. }
  92524. module.exports = function (config){
  92525. return getMonthCalender.bind(config);
  92526. }
  92527. /***/ }),
  92528. /* 412 */
  92529. /***/ (function(module, exports, __webpack_require__) {
  92530. // calendar with 8 column x 7 rows
  92531. var labels = __webpack_require__(413);
  92532. function isIterable(variable){
  92533. if (variable == null) return false;
  92534. if (variable.constructor === Array) return true;
  92535. if (variable.constructor === Object) return true;
  92536. return false;
  92537. }
  92538. function merge(_new, _old){
  92539. for (var prop in _new){
  92540. if (!_old[prop]) _old[prop] = _new[prop];
  92541. else if (isIterable(_new[prop])) merge(_new[prop], _old[prop]);
  92542. }
  92543. }
  92544. function addLabels(dayObject, lang){
  92545. var cssClass = [labels.classes[dayObject.type]];
  92546. if (dayObject.class) dayObject.class = (typeof dayObject.class == 'string' ? [dayObject.class] : dayObject.class).concat(cssClass);
  92547. else dayObject.class = cssClass;
  92548. if (dayObject.type.indexOf('Label') > 0){
  92549. if (dayObject.index == 0 && labels.weekPlaceholder) dayObject.desc = labels.weekPlaceholder;
  92550. else if (dayObject.index < 8) dayObject.desc = labels.columnNames[lang][dayObject.index];
  92551. else if (dayObject.index % 8 == 0) dayObject.desc = dayObject.week;
  92552. }
  92553. if (dayObject.date) dayObject.monthName = labels.monthNames[lang][dayObject.date.getMonth()];
  92554. if (!this.monthName) this.monthName = labels.monthNames[lang][this.month];
  92555. if (!this.labels) this.labels = {
  92556. monthNames: labels.monthNames[lang],
  92557. columnNames: labels.columnNames[lang],
  92558. classes: labels.classes
  92559. }
  92560. return dayObject;
  92561. }
  92562. addLabels.setLabels = function(newOptions){
  92563. merge(newOptions, labels);
  92564. };
  92565. module.exports = addLabels;
  92566. /***/ }),
  92567. /* 413 */
  92568. /***/ (function(module, exports) {
  92569. module.exports = {
  92570. weekPlaceholder: '',
  92571. columnNames: {
  92572. en: {
  92573. 0: 'w',
  92574. 1: 'monday',
  92575. 2: 'tuesday',
  92576. 3: 'wednesday',
  92577. 4: 'thursday',
  92578. 5: 'friday',
  92579. 6: 'saturday',
  92580. 7: 'sunday'
  92581. },
  92582. sv: {
  92583. 0: 'v',
  92584. 1: 'måndag',
  92585. 2: 'tisdag',
  92586. 3: 'onsdag',
  92587. 4: 'torsdag',
  92588. 5: 'fredag',
  92589. 6: 'lördag',
  92590. 7: 'söndag'
  92591. },
  92592. pt: {
  92593. 0: 's',
  92594. 1: 'segunda',
  92595. 2: 'terça',
  92596. 3: 'quarta',
  92597. 4: 'quinta',
  92598. 5: 'sexta',
  92599. 6: 'sábado',
  92600. 7: 'domingo'
  92601. }
  92602. },
  92603. monthNames: {
  92604. en: [
  92605. "January",
  92606. "February",
  92607. "March",
  92608. "April",
  92609. "May",
  92610. "June",
  92611. "July",
  92612. "August",
  92613. "September",
  92614. "October",
  92615. "November",
  92616. "December"
  92617. ],
  92618. sv: [
  92619. "januari",
  92620. "februari",
  92621. "mars",
  92622. "april",
  92623. "maj",
  92624. "juni",
  92625. "juli",
  92626. "augusti",
  92627. "september",
  92628. "oktober",
  92629. "november",
  92630. "december"
  92631. ],
  92632. pt: [
  92633. "Janeiro",
  92634. "Fevereiro",
  92635. "Março",
  92636. "Abril",
  92637. "Maio",
  92638. "Junho",
  92639. "Julho",
  92640. "Agosto",
  92641. "Setembro",
  92642. "Outubro",
  92643. "Novembro",
  92644. "Dezembro"
  92645. ]
  92646. },
  92647. classes: {
  92648. dayLabel: 'day-of-week',
  92649. weekLabel: 'week-number',
  92650. prevMonth: 'inactive',
  92651. nextMonth: 'inactive',
  92652. monthDay: 'day-in-month'
  92653. }
  92654. };
  92655. /***/ }),
  92656. /* 414 */
  92657. /***/ (function(module, exports, __webpack_require__) {
  92658. "use strict";
  92659. Object.defineProperty(exports, "__esModule", {
  92660. value: true
  92661. });
  92662. var render = function render() {
  92663. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { class: [_vm.prefixCls + '-header'] }, _vm._l(_vm.headerDays, function (day) {
  92664. return _c('span', { key: day }, [_vm._v("\n " + _vm._s(day) + "\n ")]);
  92665. }), 0), _vm._v(" "), _vm._l(_vm.cells, function (cell, i) {
  92666. return _c('span', { key: String(cell.date) + i, class: _vm.getCellCls(cell), on: { "click": function click($event) {
  92667. return _vm.handleClick(cell, $event);
  92668. }, "mouseenter": function mouseenter($event) {
  92669. return _vm.handleMouseMove(cell);
  92670. } } }, [_c('em', [_vm._v(_vm._s(cell.desc))])]);
  92671. })], 2);
  92672. };
  92673. var staticRenderFns = [];
  92674. exports.render = render;
  92675. exports.staticRenderFns = staticRenderFns;
  92676. /***/ }),
  92677. /* 415 */
  92678. /***/ (function(module, exports, __webpack_require__) {
  92679. "use strict";
  92680. Object.defineProperty(exports, "__esModule", {
  92681. value: true
  92682. });
  92683. var render = function render() {
  92684. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, _vm._l(_vm.cells, function (cell) {
  92685. return _c('span', { class: _vm.getCellCls(cell), on: { "click": function click($event) {
  92686. return _vm.handleClick(cell, $event);
  92687. }, "mouseenter": function mouseenter($event) {
  92688. return _vm.handleMouseMove(cell);
  92689. } } }, [_c('em', [_vm._v(_vm._s(cell.date.getFullYear()))])]);
  92690. }), 0);
  92691. };
  92692. var staticRenderFns = [];
  92693. exports.render = render;
  92694. exports.staticRenderFns = staticRenderFns;
  92695. /***/ }),
  92696. /* 416 */
  92697. /***/ (function(module, exports, __webpack_require__) {
  92698. "use strict";
  92699. Object.defineProperty(exports, "__esModule", {
  92700. value: true
  92701. });
  92702. var render = function render() {
  92703. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, _vm._l(_vm.cells, function (cell) {
  92704. return _c('span', { class: _vm.getCellCls(cell), on: { "click": function click($event) {
  92705. return _vm.handleClick(cell, $event);
  92706. }, "mouseenter": function mouseenter($event) {
  92707. return _vm.handleMouseMove(cell);
  92708. } } }, [_c('em', [_vm._v(_vm._s(cell.text))])]);
  92709. }), 0);
  92710. };
  92711. var staticRenderFns = [];
  92712. exports.render = render;
  92713. exports.staticRenderFns = staticRenderFns;
  92714. /***/ }),
  92715. /* 417 */
  92716. /***/ (function(module, exports, __webpack_require__) {
  92717. "use strict";
  92718. Object.defineProperty(exports, "__esModule", {
  92719. value: true
  92720. });
  92721. var render = function render() {
  92722. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { ref: "hours", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.hoursList, function (item) {
  92723. return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
  92724. return _vm.handleClick('hours', item);
  92725. } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
  92726. }), 0)]), _vm._v(" "), _c('div', { ref: "minutes", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.minutesList, function (item) {
  92727. return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
  92728. return _vm.handleClick('minutes', item);
  92729. } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
  92730. }), 0)]), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showSeconds, expression: "showSeconds" }], ref: "seconds", class: [_vm.prefixCls + '-list'] }, [_c('ul', { class: [_vm.prefixCls + '-ul'] }, _vm._l(_vm.secondsList, function (item) {
  92731. return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !item.hide, expression: "!item.hide" }], class: _vm.getCellCls(item), on: { "click": function click($event) {
  92732. return _vm.handleClick('seconds', item);
  92733. } } }, [_vm._v(_vm._s(_vm.formatTime(item.text)))]);
  92734. }), 0)])]);
  92735. };
  92736. var staticRenderFns = [];
  92737. exports.render = render;
  92738. exports.staticRenderFns = staticRenderFns;
  92739. /***/ }),
  92740. /* 418 */
  92741. /***/ (function(module, exports, __webpack_require__) {
  92742. "use strict";
  92743. Object.defineProperty(exports, "__esModule", {
  92744. value: true
  92745. });
  92746. var render = function render() {
  92747. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-confirm'], on: { "!keydown": function keydown($event) {
  92748. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "tab", 9, $event.key, "Tab")) {
  92749. return null;
  92750. }return _vm.handleTab($event);
  92751. } } }, [_vm.showTime ? _c('i-button', { class: _vm.timeClasses, attrs: { "size": "small", "type": "text", "disabled": _vm.timeDisabled }, on: { "click": _vm.handleToggleTime } }, [_vm._v("\n " + _vm._s(_vm.labels.time) + "\n ")]) : _vm._e(), _vm._v(" "), _c('i-button', { attrs: { "size": "small" }, nativeOn: { "click": function click($event) {
  92752. return _vm.handleClear($event);
  92753. }, "keydown": function keydown($event) {
  92754. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  92755. return null;
  92756. }return _vm.handleClear($event);
  92757. } } }, [_vm._v("\n " + _vm._s(_vm.labels.clear) + "\n ")]), _vm._v(" "), _c('i-button', { attrs: { "size": "small", "type": "primary" }, nativeOn: { "click": function click($event) {
  92758. return _vm.handleSuccess($event);
  92759. }, "keydown": function keydown($event) {
  92760. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  92761. return null;
  92762. }return _vm.handleSuccess($event);
  92763. } } }, [_vm._v("\n " + _vm._s(_vm.labels.ok) + "\n ")])], 1);
  92764. };
  92765. var staticRenderFns = [];
  92766. exports.render = render;
  92767. exports.staticRenderFns = staticRenderFns;
  92768. /***/ }),
  92769. /* 419 */
  92770. /***/ (function(module, exports, __webpack_require__) {
  92771. "use strict";
  92772. Object.defineProperty(exports, "__esModule", {
  92773. value: true
  92774. });
  92775. var render = function render() {
  92776. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls + '-body-wrapper'], on: { "mousedown": function mousedown($event) {
  92777. $event.preventDefault();
  92778. } } }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_vm.showDate ? _c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm._v(_vm._s(_vm.visibleDate))]) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'] }, [_c('time-spinner', { ref: "timeSpinner", attrs: { "show-seconds": _vm.showSeconds, "steps": _vm.steps, "hours": _vm.timeSlots[0], "minutes": _vm.timeSlots[1], "seconds": _vm.timeSlots[2], "disabled-hours": _vm.disabledHMS.disabledHours, "disabled-minutes": _vm.disabledHMS.disabledMinutes, "disabled-seconds": _vm.disabledHMS.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { on: { "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
  92779. };
  92780. var staticRenderFns = [];
  92781. exports.render = render;
  92782. exports.staticRenderFns = staticRenderFns;
  92783. /***/ }),
  92784. /* 420 */
  92785. /***/ (function(module, exports, __webpack_require__) {
  92786. "use strict";
  92787. Object.defineProperty(exports, "__esModule", {
  92788. value: true
  92789. });
  92790. var render = function render() {
  92791. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', [_vm.datePanelLabel ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.datePanelLabel.labels[0].type === 'year' || _vm.currentView === 'date', expression: "datePanelLabel.labels[0].type === 'year' || currentView === 'date'" }], class: [_vm.datePrefixCls + '-header-label'], on: { "click": _vm.datePanelLabel.labels[0].handler } }, [_vm._v(_vm._s(_vm.datePanelLabel.labels[0].label))]) : _vm._e(), _vm._v(" "), _vm.datePanelLabel && _vm.currentView === 'date' ? [_vm._v(_vm._s(_vm.datePanelLabel.separator))] : _vm._e(), _vm._v(" "), _vm.datePanelLabel ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.datePanelLabel.labels[1].type === 'year' || _vm.currentView === 'date', expression: "datePanelLabel.labels[1].type === 'year' || currentView === 'date'" }], class: [_vm.datePrefixCls + '-header-label'], on: { "click": _vm.datePanelLabel.labels[1].handler } }, [_vm._v(_vm._s(_vm.datePanelLabel.labels[1].label))]) : _vm._e()], 2);
  92792. };
  92793. var staticRenderFns = [];
  92794. exports.render = render;
  92795. exports.staticRenderFns = staticRenderFns;
  92796. /***/ }),
  92797. /* 421 */
  92798. /***/ (function(module, exports, __webpack_require__) {
  92799. "use strict";
  92800. Object.defineProperty(exports, "__esModule", {
  92801. value: true
  92802. });
  92803. var render = function render() {
  92804. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
  92805. $event.preventDefault();
  92806. } } }, [_vm.shortcuts.length ? _c('div', { class: [_vm.prefixCls + '-sidebar'] }, _vm._l(_vm.shortcuts, function (shortcut) {
  92807. return _c('div', { class: [_vm.prefixCls + '-shortcut'], on: { "click": function click($event) {
  92808. return _vm.handleShortcutClick(shortcut);
  92809. } } }, [_vm._v(_vm._s(shortcut.text))]);
  92810. }), 0) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
  92811. return _vm.changeYear(-1);
  92812. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _vm.pickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
  92813. return _vm.changeMonth(-1);
  92814. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.datePanelLabel, "current-view": _vm.pickerTable.split('-').shift(), "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
  92815. return _vm.changeYear(+1);
  92816. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _vm.pickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
  92817. return _vm.changeMonth(+1);
  92818. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'] }, [_vm.currentView !== 'time' ? _c(_vm.pickerTable, { ref: "pickerTable", tag: "component", attrs: { "table-date": _vm.panelDate, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.dates, "selection-mode": _vm.selectionMode, "disabled-date": _vm.disabledDate, "focused-date": _vm.focusedDate }, on: { "on-pick": _vm.panelPickerHandlers, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isTime, expression: "isTime" }], class: [_vm.prefixCls + '-content'] }, [_vm.currentView === 'time' ? _c('time-picker', _vm._b({ ref: "timePicker", attrs: { "value": _vm.dates, "format": _vm.format, "time-disabled": _vm.timeDisabled, "disabled-date": _vm.disabledDate, "focused-date": _vm.focusedDate }, on: { "on-pick": _vm.handlePick, "on-pick-click": _vm.handlePickClick, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess, "on-pick-toggle-time": _vm.handleToggleTime } }, 'time-picker', _vm.timePickerOptions, false)) : _vm._e()], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { attrs: { "show-time": _vm.showTime, "is-time": _vm.isTime }, on: { "on-pick-toggle-time": _vm.handleToggleTime, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
  92819. };
  92820. var staticRenderFns = [];
  92821. exports.render = render;
  92822. exports.staticRenderFns = staticRenderFns;
  92823. /***/ }),
  92824. /* 422 */
  92825. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92826. "use strict";
  92827. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  92828. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__ = __webpack_require__(174);
  92829. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__);
  92830. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  92831. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__ = __webpack_require__(424);
  92832. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__);
  92833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  92834. /* script */
  92835. /* template */
  92836. /* template functional */
  92837. var __vue_template_functional__ = false
  92838. /* styles */
  92839. var __vue_styles__ = null
  92840. /* scopeId */
  92841. var __vue_scopeId__ = null
  92842. /* moduleIdentifier (server only) */
  92843. var __vue_module_identifier__ = null
  92844. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  92845. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_date_range_vue___default.a,
  92846. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__["render"],
  92847. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_9beaae5e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_date_range_vue__["staticRenderFns"],
  92848. __vue_template_functional__,
  92849. __vue_styles__,
  92850. __vue_scopeId__,
  92851. __vue_module_identifier__
  92852. )
  92853. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  92854. /***/ }),
  92855. /* 423 */
  92856. /***/ (function(module, exports, __webpack_require__) {
  92857. "use strict";
  92858. Object.defineProperty(exports, "__esModule", {
  92859. value: true
  92860. });
  92861. var render = function render() {
  92862. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
  92863. $event.preventDefault();
  92864. } } }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_c('div', { class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-left'] }, [_c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm.showDate ? [_vm._v(_vm._s(_vm.leftDatePanelLabel))] : [_vm._v(_vm._s(_vm.t('i.datepicker.startTime')))]], 2), _vm._v(" "), _c('time-spinner', { ref: "timeSpinner", attrs: { "steps": _vm.steps, "show-seconds": _vm.showSeconds, "hours": _vm.value[0] && _vm.dateStart.getHours(), "minutes": _vm.value[0] && _vm.dateStart.getMinutes(), "seconds": _vm.value[0] && _vm.dateStart.getSeconds(), "disabled-hours": _vm.disabledHours, "disabled-minutes": _vm.disabledMinutes, "disabled-seconds": _vm.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleStartChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-right'] }, [_c('div', { class: [_vm.timePrefixCls + '-header'] }, [_vm.showDate ? [_vm._v(_vm._s(_vm.rightDatePanelLabel))] : [_vm._v(_vm._s(_vm.t('i.datepicker.endTime')))]], 2), _vm._v(" "), _c('time-spinner', { ref: "timeSpinnerEnd", attrs: { "steps": _vm.steps, "show-seconds": _vm.showSeconds, "hours": _vm.value[1] && _vm.dateEnd.getHours(), "minutes": _vm.value[1] && _vm.dateEnd.getMinutes(), "seconds": _vm.value[1] && _vm.dateEnd.getSeconds(), "disabled-hours": _vm.disabledHours, "disabled-minutes": _vm.disabledMinutes, "disabled-seconds": _vm.disabledSeconds, "hide-disabled-options": _vm.hideDisabledOptions }, on: { "on-change": _vm.handleEndChange, "on-pick-click": _vm.handlePickClick } })], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { on: { "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
  92865. };
  92866. var staticRenderFns = [];
  92867. exports.render = render;
  92868. exports.staticRenderFns = staticRenderFns;
  92869. /***/ }),
  92870. /* 424 */
  92871. /***/ (function(module, exports, __webpack_require__) {
  92872. "use strict";
  92873. Object.defineProperty(exports, "__esModule", {
  92874. value: true
  92875. });
  92876. var render = function render() {
  92877. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mousedown": function mousedown($event) {
  92878. $event.preventDefault();
  92879. } } }, [_vm.shortcuts.length ? _c('div', { class: [_vm.prefixCls + '-sidebar'] }, _vm._l(_vm.shortcuts, function (shortcut) {
  92880. return _c('div', { class: [_vm.prefixCls + '-shortcut'], on: { "click": function click($event) {
  92881. return _vm.handleShortcutClick(shortcut);
  92882. } } }, [_vm._v(_vm._s(shortcut.text))]);
  92883. }), 0) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.panelBodyClasses }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.isTime, expression: "!isTime" }], class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-left'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
  92884. return _vm.prevYear('left');
  92885. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _vm.leftPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
  92886. return _vm.prevMonth('left');
  92887. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.leftDatePanelLabel, "current-view": _vm.leftDatePanelView, "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _vm.splitPanels || _vm.leftPickerTable !== 'date-table' ? _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
  92888. return _vm.nextYear('left');
  92889. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e(), _vm._v(" "), _vm.splitPanels && _vm.leftPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
  92890. return _vm.nextMonth('left');
  92891. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _vm.currentView !== 'time' ? _c(_vm.leftPickerTable, { ref: "leftYearTable", tag: "component", attrs: { "table-date": _vm.leftPanelDate, "selection-mode": "range", "disabled-date": _vm.disabledDate, "range-state": _vm.rangeState, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.preSelecting.left ? [_vm.dates[0]] : _vm.dates, "focused-date": _vm.focusedDate }, on: { "on-change-range": _vm.handleChangeRange, "on-pick": _vm.panelPickerHandlers.left, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.isTime, expression: "!isTime" }], class: [_vm.prefixCls + '-content', _vm.prefixCls + '-content-right'] }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView !== 'time', expression: "currentView !== 'time'" }], class: [_vm.datePrefixCls + '-header'] }, [_vm.splitPanels || _vm.rightPickerTable !== 'date-table' ? _c('span', { class: _vm.iconBtnCls('prev', '-double'), on: { "click": function click($event) {
  92892. return _vm.prevYear('right');
  92893. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _vm.splitPanels && _vm.rightPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('prev'), on: { "click": function click($event) {
  92894. return _vm.prevMonth('right');
  92895. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1) : _vm._e(), _vm._v(" "), _c('date-panel-label', { attrs: { "date-panel-label": _vm.rightDatePanelLabel, "current-view": _vm.rightDatePanelView, "date-prefix-cls": _vm.datePrefixCls } }), _vm._v(" "), _c('span', { class: _vm.iconBtnCls('next', '-double'), on: { "click": function click($event) {
  92896. return _vm.nextYear('right');
  92897. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _vm.rightPickerTable === 'date-table' ? _c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentView === 'date', expression: "currentView === 'date'" }], class: _vm.iconBtnCls('next'), on: { "click": function click($event) {
  92898. return _vm.nextMonth('right');
  92899. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1) : _vm._e()], 1), _vm._v(" "), _vm.currentView !== 'time' ? _c(_vm.rightPickerTable, { ref: "rightYearTable", tag: "component", attrs: { "table-date": _vm.rightPanelDate, "selection-mode": "range", "range-state": _vm.rangeState, "disabled-date": _vm.disabledDate, "show-week-numbers": _vm.showWeekNumbers, "value": _vm.preSelecting.right ? [_vm.dates[_vm.dates.length - 1]] : _vm.dates, "focused-date": _vm.focusedDate }, on: { "on-change-range": _vm.handleChangeRange, "on-pick": _vm.panelPickerHandlers.right, "on-pick-click": _vm.handlePickClick } }) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.isTime, expression: "isTime" }], class: [_vm.prefixCls + '-content'] }, [_vm.currentView === 'time' ? _c('time-picker', _vm._b({ ref: "timePicker", attrs: { "value": _vm.dates, "format": _vm.format, "time-disabled": _vm.timeDisabled }, on: { "on-pick": _vm.handleRangePick, "on-pick-click": _vm.handlePickClick, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess, "on-pick-toggle-time": _vm.handleToggleTime } }, 'time-picker', _vm.timePickerOptions, false)) : _vm._e()], 1), _vm._v(" "), _vm.confirm ? _c('Confirm', { attrs: { "show-time": _vm.showTime, "is-time": _vm.isTime, "time-disabled": _vm.timeDisabled }, on: { "on-pick-toggle-time": _vm.handleToggleTime, "on-pick-clear": _vm.handlePickClear, "on-pick-success": _vm.handlePickSuccess } }) : _vm._e()], 1)]);
  92900. };
  92901. var staticRenderFns = [];
  92902. exports.render = render;
  92903. exports.staticRenderFns = staticRenderFns;
  92904. /***/ }),
  92905. /* 425 */
  92906. /***/ (function(module, exports, __webpack_require__) {
  92907. "use strict";
  92908. Object.defineProperty(exports, "__esModule", {
  92909. value: true
  92910. });
  92911. var _divider = __webpack_require__(426);
  92912. var _divider2 = _interopRequireDefault(_divider);
  92913. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  92914. exports.default = _divider2.default;
  92915. /***/ }),
  92916. /* 426 */
  92917. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92918. "use strict";
  92919. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  92920. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__ = __webpack_require__(177);
  92921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__);
  92922. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  92923. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__ = __webpack_require__(427);
  92924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__);
  92925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  92926. /* script */
  92927. /* template */
  92928. /* template functional */
  92929. var __vue_template_functional__ = false
  92930. /* styles */
  92931. var __vue_styles__ = null
  92932. /* scopeId */
  92933. var __vue_scopeId__ = null
  92934. /* moduleIdentifier (server only) */
  92935. var __vue_module_identifier__ = null
  92936. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  92937. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_divider_vue___default.a,
  92938. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__["render"],
  92939. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_79adba88_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_divider_vue__["staticRenderFns"],
  92940. __vue_template_functional__,
  92941. __vue_styles__,
  92942. __vue_scopeId__,
  92943. __vue_module_identifier__
  92944. )
  92945. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  92946. /***/ }),
  92947. /* 427 */
  92948. /***/ (function(module, exports, __webpack_require__) {
  92949. "use strict";
  92950. Object.defineProperty(exports, "__esModule", {
  92951. value: true
  92952. });
  92953. var render = function render() {
  92954. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.hasSlot ? _c('span', { class: _vm.slotClasses }, [_vm._t("default")], 2) : _vm._e()]);
  92955. };
  92956. var staticRenderFns = [];
  92957. exports.render = render;
  92958. exports.staticRenderFns = staticRenderFns;
  92959. /***/ }),
  92960. /* 428 */
  92961. /***/ (function(module, exports, __webpack_require__) {
  92962. "use strict";
  92963. Object.defineProperty(exports, "__esModule", {
  92964. value: true
  92965. });
  92966. var _drawer = __webpack_require__(429);
  92967. var _drawer2 = _interopRequireDefault(_drawer);
  92968. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  92969. exports.default = _drawer2.default;
  92970. /***/ }),
  92971. /* 429 */
  92972. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  92973. "use strict";
  92974. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  92975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__ = __webpack_require__(178);
  92976. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__);
  92977. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  92978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__ = __webpack_require__(430);
  92979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__);
  92980. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  92981. /* script */
  92982. /* template */
  92983. /* template functional */
  92984. var __vue_template_functional__ = false
  92985. /* styles */
  92986. var __vue_styles__ = null
  92987. /* scopeId */
  92988. var __vue_scopeId__ = null
  92989. /* moduleIdentifier (server only) */
  92990. var __vue_module_identifier__ = null
  92991. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  92992. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_drawer_vue___default.a,
  92993. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__["render"],
  92994. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_131de97c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_drawer_vue__["staticRenderFns"],
  92995. __vue_template_functional__,
  92996. __vue_styles__,
  92997. __vue_scopeId__,
  92998. __vue_module_identifier__
  92999. )
  93000. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  93001. /***/ }),
  93002. /* 430 */
  93003. /***/ (function(module, exports, __webpack_require__) {
  93004. "use strict";
  93005. Object.defineProperty(exports, "__esModule", {
  93006. value: true
  93007. });
  93008. var render = function render() {
  93009. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }], attrs: { "data-transfer": _vm.transfer } }, [_c('transition', { attrs: { "name": "fade" } }, [_vm.mask ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.maskClasses, style: _vm.maskStyle, on: { "click": _vm.handleMask } }) : _vm._e()]), _vm._v(" "), _c('div', { class: _vm.wrapClasses, on: { "click": _vm.handleWrapClick } }, [_c('transition', { attrs: { "name": _vm.transitionName } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.classes, style: _vm.mainStyles }, [_c('div', { ref: "content", class: _vm.contentClasses }, [_vm.closable ? _c('a', { staticClass: "ivu-drawer-close", on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e(), _vm._v(" "), _vm.showHead ? _c('div', { class: [_vm.prefixCls + '-header'] }, [_vm._t("header", [_c('div', { class: [_vm.prefixCls + '-header-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'], style: _vm.styles }, [_vm._t("default")], 2)]), _vm._v(" "), _vm.draggable && (_vm.placement === 'left' || _vm.placement === 'right') ? _c('div', { staticClass: "ivu-drawer-drag", class: 'ivu-drawer-drag-' + _vm.placement, on: { "mousedown": _vm.handleTriggerMousedown } }, [_vm._t("trigger", [_c('div', { staticClass: "ivu-drawer-drag-move-trigger" }, [_c('div', { staticClass: "ivu-drawer-drag-move-trigger-point" }, [_c('i'), _c('i'), _c('i'), _c('i'), _c('i')])])])], 2) : _vm._e()])])], 1)], 1);
  93010. };
  93011. var staticRenderFns = [];
  93012. exports.render = render;
  93013. exports.staticRenderFns = staticRenderFns;
  93014. /***/ }),
  93015. /* 431 */
  93016. /***/ (function(module, exports, __webpack_require__) {
  93017. "use strict";
  93018. Object.defineProperty(exports, "__esModule", {
  93019. value: true
  93020. });
  93021. var _dropdown = __webpack_require__(61);
  93022. var _dropdown2 = _interopRequireDefault(_dropdown);
  93023. var _dropdownMenu = __webpack_require__(62);
  93024. var _dropdownMenu2 = _interopRequireDefault(_dropdownMenu);
  93025. var _dropdownItem = __webpack_require__(434);
  93026. var _dropdownItem2 = _interopRequireDefault(_dropdownItem);
  93027. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  93028. _dropdown2.default.Menu = _dropdownMenu2.default;
  93029. _dropdown2.default.Item = _dropdownItem2.default;
  93030. exports.default = _dropdown2.default;
  93031. /***/ }),
  93032. /* 432 */
  93033. /***/ (function(module, exports, __webpack_require__) {
  93034. "use strict";
  93035. Object.defineProperty(exports, "__esModule", {
  93036. value: true
  93037. });
  93038. var render = function render() {
  93039. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.onClickoutside, expression: "onClickoutside" }], class: [_vm.prefixCls], on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: _vm.relClasses, on: { "click": _vm.handleClick, "contextmenu": function contextmenu($event) {
  93040. $event.preventDefault();return _vm.handleRightClick($event);
  93041. } } }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "transition-drop" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentVisible, expression: "currentVisible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "drop", class: _vm.dropdownCls, attrs: { "placement": _vm.placement, "eventsEnabled": _vm.eventsEnabled, "data-transfer": _vm.transfer, "transfer": _vm.transfer }, nativeOn: { "mouseenter": function mouseenter($event) {
  93042. return _vm.handleMouseenter($event);
  93043. }, "mouseleave": function mouseleave($event) {
  93044. return _vm.handleMouseleave($event);
  93045. } } }, [_vm._t("list")], 2)], 1)], 1);
  93046. };
  93047. var staticRenderFns = [];
  93048. exports.render = render;
  93049. exports.staticRenderFns = staticRenderFns;
  93050. /***/ }),
  93051. /* 433 */
  93052. /***/ (function(module, exports, __webpack_require__) {
  93053. "use strict";
  93054. Object.defineProperty(exports, "__esModule", {
  93055. value: true
  93056. });
  93057. var render = function render() {
  93058. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { staticClass: "ivu-dropdown-menu" }, [_vm._t("default")], 2);
  93059. };
  93060. var staticRenderFns = [];
  93061. exports.render = render;
  93062. exports.staticRenderFns = staticRenderFns;
  93063. /***/ }),
  93064. /* 434 */
  93065. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93066. "use strict";
  93067. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  93068. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__ = __webpack_require__(181);
  93069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__);
  93070. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  93071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__ = __webpack_require__(435);
  93072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__);
  93073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  93074. /* script */
  93075. /* template */
  93076. /* template functional */
  93077. var __vue_template_functional__ = false
  93078. /* styles */
  93079. var __vue_styles__ = null
  93080. /* scopeId */
  93081. var __vue_scopeId__ = null
  93082. /* moduleIdentifier (server only) */
  93083. var __vue_module_identifier__ = null
  93084. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  93085. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_dropdown_item_vue___default.a,
  93086. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__["render"],
  93087. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3a5fd88a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_dropdown_item_vue__["staticRenderFns"],
  93088. __vue_template_functional__,
  93089. __vue_styles__,
  93090. __vue_scopeId__,
  93091. __vue_module_identifier__
  93092. )
  93093. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  93094. /***/ }),
  93095. /* 435 */
  93096. /***/ (function(module, exports, __webpack_require__) {
  93097. "use strict";
  93098. Object.defineProperty(exports, "__esModule", {
  93099. value: true
  93100. });
  93101. var render = function render() {
  93102. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "click": _vm.handleClick } }, [_vm._t("default")], 2);
  93103. };
  93104. var staticRenderFns = [];
  93105. exports.render = render;
  93106. exports.staticRenderFns = staticRenderFns;
  93107. /***/ }),
  93108. /* 436 */
  93109. /***/ (function(module, exports, __webpack_require__) {
  93110. "use strict";
  93111. Object.defineProperty(exports, "__esModule", {
  93112. value: true
  93113. });
  93114. var _footer = __webpack_require__(182);
  93115. var _footer2 = _interopRequireDefault(_footer);
  93116. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  93117. exports.default = _footer2.default;
  93118. /***/ }),
  93119. /* 437 */
  93120. /***/ (function(module, exports, __webpack_require__) {
  93121. "use strict";
  93122. Object.defineProperty(exports, "__esModule", {
  93123. value: true
  93124. });
  93125. var render = function render() {
  93126. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
  93127. };
  93128. var staticRenderFns = [];
  93129. exports.render = render;
  93130. exports.staticRenderFns = staticRenderFns;
  93131. /***/ }),
  93132. /* 438 */
  93133. /***/ (function(module, exports, __webpack_require__) {
  93134. "use strict";
  93135. Object.defineProperty(exports, "__esModule", {
  93136. value: true
  93137. });
  93138. var _form = __webpack_require__(439);
  93139. var _form2 = _interopRequireDefault(_form);
  93140. var _formItem = __webpack_require__(448);
  93141. var _formItem2 = _interopRequireDefault(_formItem);
  93142. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  93143. _form2.default.Item = _formItem2.default;
  93144. exports.default = _form2.default;
  93145. /***/ }),
  93146. /* 439 */
  93147. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93148. "use strict";
  93149. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  93150. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__ = __webpack_require__(184);
  93151. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__);
  93152. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  93153. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__ = __webpack_require__(447);
  93154. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__);
  93155. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  93156. /* script */
  93157. /* template */
  93158. /* template functional */
  93159. var __vue_template_functional__ = false
  93160. /* styles */
  93161. var __vue_styles__ = null
  93162. /* scopeId */
  93163. var __vue_scopeId__ = null
  93164. /* moduleIdentifier (server only) */
  93165. var __vue_module_identifier__ = null
  93166. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  93167. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_vue___default.a,
  93168. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__["render"],
  93169. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_09971178_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_vue__["staticRenderFns"],
  93170. __vue_template_functional__,
  93171. __vue_styles__,
  93172. __vue_scopeId__,
  93173. __vue_module_identifier__
  93174. )
  93175. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  93176. /***/ }),
  93177. /* 440 */
  93178. /***/ (function(module, exports, __webpack_require__) {
  93179. __webpack_require__(80);
  93180. __webpack_require__(35);
  93181. __webpack_require__(46);
  93182. __webpack_require__(441);
  93183. __webpack_require__(445);
  93184. __webpack_require__(446);
  93185. module.exports = __webpack_require__(5).Promise;
  93186. /***/ }),
  93187. /* 441 */
  93188. /***/ (function(module, exports, __webpack_require__) {
  93189. "use strict";
  93190. var LIBRARY = __webpack_require__(42);
  93191. var global = __webpack_require__(9);
  93192. var ctx = __webpack_require__(24);
  93193. var classof = __webpack_require__(56);
  93194. var $export = __webpack_require__(7);
  93195. var isObject = __webpack_require__(18);
  93196. var aFunction = __webpack_require__(43);
  93197. var anInstance = __webpack_require__(88);
  93198. var forOf = __webpack_require__(51);
  93199. var speciesConstructor = __webpack_require__(186);
  93200. var task = __webpack_require__(187).set;
  93201. var microtask = __webpack_require__(443)();
  93202. var newPromiseCapabilityModule = __webpack_require__(89);
  93203. var perform = __webpack_require__(188);
  93204. var userAgent = __webpack_require__(444);
  93205. var promiseResolve = __webpack_require__(189);
  93206. var PROMISE = 'Promise';
  93207. var TypeError = global.TypeError;
  93208. var process = global.process;
  93209. var versions = process && process.versions;
  93210. var v8 = versions && versions.v8 || '';
  93211. var $Promise = global[PROMISE];
  93212. var isNode = classof(process) == 'process';
  93213. var empty = function () { /* empty */ };
  93214. var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  93215. var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
  93216. var USE_NATIVE = !!function () {
  93217. try {
  93218. // correct subclassing with @@species support
  93219. var promise = $Promise.resolve(1);
  93220. var FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function (exec) {
  93221. exec(empty, empty);
  93222. };
  93223. // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
  93224. return (isNode || typeof PromiseRejectionEvent == 'function')
  93225. && promise.then(empty) instanceof FakePromise
  93226. // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
  93227. // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
  93228. // we can't detect it synchronously, so just check versions
  93229. && v8.indexOf('6.6') !== 0
  93230. && userAgent.indexOf('Chrome/66') === -1;
  93231. } catch (e) { /* empty */ }
  93232. }();
  93233. // helpers
  93234. var isThenable = function (it) {
  93235. var then;
  93236. return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  93237. };
  93238. var notify = function (promise, isReject) {
  93239. if (promise._n) return;
  93240. promise._n = true;
  93241. var chain = promise._c;
  93242. microtask(function () {
  93243. var value = promise._v;
  93244. var ok = promise._s == 1;
  93245. var i = 0;
  93246. var run = function (reaction) {
  93247. var handler = ok ? reaction.ok : reaction.fail;
  93248. var resolve = reaction.resolve;
  93249. var reject = reaction.reject;
  93250. var domain = reaction.domain;
  93251. var result, then, exited;
  93252. try {
  93253. if (handler) {
  93254. if (!ok) {
  93255. if (promise._h == 2) onHandleUnhandled(promise);
  93256. promise._h = 1;
  93257. }
  93258. if (handler === true) result = value;
  93259. else {
  93260. if (domain) domain.enter();
  93261. result = handler(value); // may throw
  93262. if (domain) {
  93263. domain.exit();
  93264. exited = true;
  93265. }
  93266. }
  93267. if (result === reaction.promise) {
  93268. reject(TypeError('Promise-chain cycle'));
  93269. } else if (then = isThenable(result)) {
  93270. then.call(result, resolve, reject);
  93271. } else resolve(result);
  93272. } else reject(value);
  93273. } catch (e) {
  93274. if (domain && !exited) domain.exit();
  93275. reject(e);
  93276. }
  93277. };
  93278. while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
  93279. promise._c = [];
  93280. promise._n = false;
  93281. if (isReject && !promise._h) onUnhandled(promise);
  93282. });
  93283. };
  93284. var onUnhandled = function (promise) {
  93285. task.call(global, function () {
  93286. var value = promise._v;
  93287. var unhandled = isUnhandled(promise);
  93288. var result, handler, console;
  93289. if (unhandled) {
  93290. result = perform(function () {
  93291. if (isNode) {
  93292. process.emit('unhandledRejection', value, promise);
  93293. } else if (handler = global.onunhandledrejection) {
  93294. handler({ promise: promise, reason: value });
  93295. } else if ((console = global.console) && console.error) {
  93296. console.error('Unhandled promise rejection', value);
  93297. }
  93298. });
  93299. // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
  93300. promise._h = isNode || isUnhandled(promise) ? 2 : 1;
  93301. } promise._a = undefined;
  93302. if (unhandled && result.e) throw result.v;
  93303. });
  93304. };
  93305. var isUnhandled = function (promise) {
  93306. return promise._h !== 1 && (promise._a || promise._c).length === 0;
  93307. };
  93308. var onHandleUnhandled = function (promise) {
  93309. task.call(global, function () {
  93310. var handler;
  93311. if (isNode) {
  93312. process.emit('rejectionHandled', promise);
  93313. } else if (handler = global.onrejectionhandled) {
  93314. handler({ promise: promise, reason: promise._v });
  93315. }
  93316. });
  93317. };
  93318. var $reject = function (value) {
  93319. var promise = this;
  93320. if (promise._d) return;
  93321. promise._d = true;
  93322. promise = promise._w || promise; // unwrap
  93323. promise._v = value;
  93324. promise._s = 2;
  93325. if (!promise._a) promise._a = promise._c.slice();
  93326. notify(promise, true);
  93327. };
  93328. var $resolve = function (value) {
  93329. var promise = this;
  93330. var then;
  93331. if (promise._d) return;
  93332. promise._d = true;
  93333. promise = promise._w || promise; // unwrap
  93334. try {
  93335. if (promise === value) throw TypeError("Promise can't be resolved itself");
  93336. if (then = isThenable(value)) {
  93337. microtask(function () {
  93338. var wrapper = { _w: promise, _d: false }; // wrap
  93339. try {
  93340. then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
  93341. } catch (e) {
  93342. $reject.call(wrapper, e);
  93343. }
  93344. });
  93345. } else {
  93346. promise._v = value;
  93347. promise._s = 1;
  93348. notify(promise, false);
  93349. }
  93350. } catch (e) {
  93351. $reject.call({ _w: promise, _d: false }, e); // wrap
  93352. }
  93353. };
  93354. // constructor polyfill
  93355. if (!USE_NATIVE) {
  93356. // 25.4.3.1 Promise(executor)
  93357. $Promise = function Promise(executor) {
  93358. anInstance(this, $Promise, PROMISE, '_h');
  93359. aFunction(executor);
  93360. Internal.call(this);
  93361. try {
  93362. executor(ctx($resolve, this, 1), ctx($reject, this, 1));
  93363. } catch (err) {
  93364. $reject.call(this, err);
  93365. }
  93366. };
  93367. // eslint-disable-next-line no-unused-vars
  93368. Internal = function Promise(executor) {
  93369. this._c = []; // <- awaiting reactions
  93370. this._a = undefined; // <- checked in isUnhandled reactions
  93371. this._s = 0; // <- state
  93372. this._d = false; // <- done
  93373. this._v = undefined; // <- value
  93374. this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
  93375. this._n = false; // <- notify
  93376. };
  93377. Internal.prototype = __webpack_require__(90)($Promise.prototype, {
  93378. // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
  93379. then: function then(onFulfilled, onRejected) {
  93380. var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
  93381. reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
  93382. reaction.fail = typeof onRejected == 'function' && onRejected;
  93383. reaction.domain = isNode ? process.domain : undefined;
  93384. this._c.push(reaction);
  93385. if (this._a) this._a.push(reaction);
  93386. if (this._s) notify(this, false);
  93387. return reaction.promise;
  93388. },
  93389. // 25.4.5.1 Promise.prototype.catch(onRejected)
  93390. 'catch': function (onRejected) {
  93391. return this.then(undefined, onRejected);
  93392. }
  93393. });
  93394. OwnPromiseCapability = function () {
  93395. var promise = new Internal();
  93396. this.promise = promise;
  93397. this.resolve = ctx($resolve, promise, 1);
  93398. this.reject = ctx($reject, promise, 1);
  93399. };
  93400. newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
  93401. return C === $Promise || C === Wrapper
  93402. ? new OwnPromiseCapability(C)
  93403. : newGenericPromiseCapability(C);
  93404. };
  93405. }
  93406. $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
  93407. __webpack_require__(47)($Promise, PROMISE);
  93408. __webpack_require__(190)(PROMISE);
  93409. Wrapper = __webpack_require__(5)[PROMISE];
  93410. // statics
  93411. $export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  93412. // 25.4.4.5 Promise.reject(r)
  93413. reject: function reject(r) {
  93414. var capability = newPromiseCapability(this);
  93415. var $$reject = capability.reject;
  93416. $$reject(r);
  93417. return capability.promise;
  93418. }
  93419. });
  93420. $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  93421. // 25.4.4.6 Promise.resolve(x)
  93422. resolve: function resolve(x) {
  93423. return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  93424. }
  93425. });
  93426. $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(114)(function (iter) {
  93427. $Promise.all(iter)['catch'](empty);
  93428. })), PROMISE, {
  93429. // 25.4.4.1 Promise.all(iterable)
  93430. all: function all(iterable) {
  93431. var C = this;
  93432. var capability = newPromiseCapability(C);
  93433. var resolve = capability.resolve;
  93434. var reject = capability.reject;
  93435. var result = perform(function () {
  93436. var values = [];
  93437. var index = 0;
  93438. var remaining = 1;
  93439. forOf(iterable, false, function (promise) {
  93440. var $index = index++;
  93441. var alreadyCalled = false;
  93442. values.push(undefined);
  93443. remaining++;
  93444. C.resolve(promise).then(function (value) {
  93445. if (alreadyCalled) return;
  93446. alreadyCalled = true;
  93447. values[$index] = value;
  93448. --remaining || resolve(values);
  93449. }, reject);
  93450. });
  93451. --remaining || resolve(values);
  93452. });
  93453. if (result.e) reject(result.v);
  93454. return capability.promise;
  93455. },
  93456. // 25.4.4.4 Promise.race(iterable)
  93457. race: function race(iterable) {
  93458. var C = this;
  93459. var capability = newPromiseCapability(C);
  93460. var reject = capability.reject;
  93461. var result = perform(function () {
  93462. forOf(iterable, false, function (promise) {
  93463. C.resolve(promise).then(capability.resolve, reject);
  93464. });
  93465. });
  93466. if (result.e) reject(result.v);
  93467. return capability.promise;
  93468. }
  93469. });
  93470. /***/ }),
  93471. /* 442 */
  93472. /***/ (function(module, exports) {
  93473. // fast apply, http://jsperf.lnkit.com/fast-apply/5
  93474. module.exports = function (fn, args, that) {
  93475. var un = that === undefined;
  93476. switch (args.length) {
  93477. case 0: return un ? fn()
  93478. : fn.call(that);
  93479. case 1: return un ? fn(args[0])
  93480. : fn.call(that, args[0]);
  93481. case 2: return un ? fn(args[0], args[1])
  93482. : fn.call(that, args[0], args[1]);
  93483. case 3: return un ? fn(args[0], args[1], args[2])
  93484. : fn.call(that, args[0], args[1], args[2]);
  93485. case 4: return un ? fn(args[0], args[1], args[2], args[3])
  93486. : fn.call(that, args[0], args[1], args[2], args[3]);
  93487. } return fn.apply(that, args);
  93488. };
  93489. /***/ }),
  93490. /* 443 */
  93491. /***/ (function(module, exports, __webpack_require__) {
  93492. var global = __webpack_require__(9);
  93493. var macrotask = __webpack_require__(187).set;
  93494. var Observer = global.MutationObserver || global.WebKitMutationObserver;
  93495. var process = global.process;
  93496. var Promise = global.Promise;
  93497. var isNode = __webpack_require__(41)(process) == 'process';
  93498. module.exports = function () {
  93499. var head, last, notify;
  93500. var flush = function () {
  93501. var parent, fn;
  93502. if (isNode && (parent = process.domain)) parent.exit();
  93503. while (head) {
  93504. fn = head.fn;
  93505. head = head.next;
  93506. try {
  93507. fn();
  93508. } catch (e) {
  93509. if (head) notify();
  93510. else last = undefined;
  93511. throw e;
  93512. }
  93513. } last = undefined;
  93514. if (parent) parent.enter();
  93515. };
  93516. // Node.js
  93517. if (isNode) {
  93518. notify = function () {
  93519. process.nextTick(flush);
  93520. };
  93521. // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  93522. } else if (Observer && !(global.navigator && global.navigator.standalone)) {
  93523. var toggle = true;
  93524. var node = document.createTextNode('');
  93525. new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
  93526. notify = function () {
  93527. node.data = toggle = !toggle;
  93528. };
  93529. // environments with maybe non-completely correct, but existent Promise
  93530. } else if (Promise && Promise.resolve) {
  93531. // Promise.resolve without an argument throws an error in LG WebOS 2
  93532. var promise = Promise.resolve(undefined);
  93533. notify = function () {
  93534. promise.then(flush);
  93535. };
  93536. // for other environments - macrotask based on:
  93537. // - setImmediate
  93538. // - MessageChannel
  93539. // - window.postMessag
  93540. // - onreadystatechange
  93541. // - setTimeout
  93542. } else {
  93543. notify = function () {
  93544. // strange IE + webpack dev server bug - use .call(global)
  93545. macrotask.call(global, flush);
  93546. };
  93547. }
  93548. return function (fn) {
  93549. var task = { fn: fn, next: undefined };
  93550. if (last) last.next = task;
  93551. if (!head) {
  93552. head = task;
  93553. notify();
  93554. } last = task;
  93555. };
  93556. };
  93557. /***/ }),
  93558. /* 444 */
  93559. /***/ (function(module, exports, __webpack_require__) {
  93560. var global = __webpack_require__(9);
  93561. var navigator = global.navigator;
  93562. module.exports = navigator && navigator.userAgent || '';
  93563. /***/ }),
  93564. /* 445 */
  93565. /***/ (function(module, exports, __webpack_require__) {
  93566. "use strict";
  93567. // https://github.com/tc39/proposal-promise-finally
  93568. var $export = __webpack_require__(7);
  93569. var core = __webpack_require__(5);
  93570. var global = __webpack_require__(9);
  93571. var speciesConstructor = __webpack_require__(186);
  93572. var promiseResolve = __webpack_require__(189);
  93573. $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  93574. var C = speciesConstructor(this, core.Promise || global.Promise);
  93575. var isFunction = typeof onFinally == 'function';
  93576. return this.then(
  93577. isFunction ? function (x) {
  93578. return promiseResolve(C, onFinally()).then(function () { return x; });
  93579. } : onFinally,
  93580. isFunction ? function (e) {
  93581. return promiseResolve(C, onFinally()).then(function () { throw e; });
  93582. } : onFinally
  93583. );
  93584. } });
  93585. /***/ }),
  93586. /* 446 */
  93587. /***/ (function(module, exports, __webpack_require__) {
  93588. "use strict";
  93589. // https://github.com/tc39/proposal-promise-try
  93590. var $export = __webpack_require__(7);
  93591. var newPromiseCapability = __webpack_require__(89);
  93592. var perform = __webpack_require__(188);
  93593. $export($export.S, 'Promise', { 'try': function (callbackfn) {
  93594. var promiseCapability = newPromiseCapability.f(this);
  93595. var result = perform(callbackfn);
  93596. (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  93597. return promiseCapability.promise;
  93598. } });
  93599. /***/ }),
  93600. /* 447 */
  93601. /***/ (function(module, exports, __webpack_require__) {
  93602. "use strict";
  93603. Object.defineProperty(exports, "__esModule", {
  93604. value: true
  93605. });
  93606. var render = function render() {
  93607. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('form', { class: _vm.classes, attrs: { "autocomplete": _vm.autocomplete } }, [_vm._t("default")], 2);
  93608. };
  93609. var staticRenderFns = [];
  93610. exports.render = render;
  93611. exports.staticRenderFns = staticRenderFns;
  93612. /***/ }),
  93613. /* 448 */
  93614. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93615. "use strict";
  93616. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  93617. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__ = __webpack_require__(191);
  93618. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__);
  93619. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  93620. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__ = __webpack_require__(451);
  93621. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__);
  93622. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  93623. /* script */
  93624. /* template */
  93625. /* template functional */
  93626. var __vue_template_functional__ = false
  93627. /* styles */
  93628. var __vue_styles__ = null
  93629. /* scopeId */
  93630. var __vue_scopeId__ = null
  93631. /* moduleIdentifier (server only) */
  93632. var __vue_module_identifier__ = null
  93633. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  93634. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_form_item_vue___default.a,
  93635. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__["render"],
  93636. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_771964ee_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_form_item_vue__["staticRenderFns"],
  93637. __vue_template_functional__,
  93638. __vue_styles__,
  93639. __vue_scopeId__,
  93640. __vue_module_identifier__
  93641. )
  93642. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  93643. /***/ }),
  93644. /* 449 */
  93645. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  93646. "use strict";
  93647. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  93648. /* WEBPACK VAR INJECTION */(function(process) {function _extends() {
  93649. _extends = Object.assign || function (target) {
  93650. for (var i = 1; i < arguments.length; i++) {
  93651. var source = arguments[i];
  93652. for (var key in source) {
  93653. if (Object.prototype.hasOwnProperty.call(source, key)) {
  93654. target[key] = source[key];
  93655. }
  93656. }
  93657. }
  93658. return target;
  93659. };
  93660. return _extends.apply(this, arguments);
  93661. }
  93662. function _inheritsLoose(subClass, superClass) {
  93663. subClass.prototype = Object.create(superClass.prototype);
  93664. subClass.prototype.constructor = subClass;
  93665. subClass.__proto__ = superClass;
  93666. }
  93667. function _getPrototypeOf(o) {
  93668. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  93669. return o.__proto__ || Object.getPrototypeOf(o);
  93670. };
  93671. return _getPrototypeOf(o);
  93672. }
  93673. function _setPrototypeOf(o, p) {
  93674. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  93675. o.__proto__ = p;
  93676. return o;
  93677. };
  93678. return _setPrototypeOf(o, p);
  93679. }
  93680. function _isNativeReflectConstruct() {
  93681. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  93682. if (Reflect.construct.sham) return false;
  93683. if (typeof Proxy === "function") return true;
  93684. try {
  93685. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  93686. return true;
  93687. } catch (e) {
  93688. return false;
  93689. }
  93690. }
  93691. function _construct(Parent, args, Class) {
  93692. if (_isNativeReflectConstruct()) {
  93693. _construct = Reflect.construct;
  93694. } else {
  93695. _construct = function _construct(Parent, args, Class) {
  93696. var a = [null];
  93697. a.push.apply(a, args);
  93698. var Constructor = Function.bind.apply(Parent, a);
  93699. var instance = new Constructor();
  93700. if (Class) _setPrototypeOf(instance, Class.prototype);
  93701. return instance;
  93702. };
  93703. }
  93704. return _construct.apply(null, arguments);
  93705. }
  93706. function _isNativeFunction(fn) {
  93707. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  93708. }
  93709. function _wrapNativeSuper(Class) {
  93710. var _cache = typeof Map === "function" ? new Map() : undefined;
  93711. _wrapNativeSuper = function _wrapNativeSuper(Class) {
  93712. if (Class === null || !_isNativeFunction(Class)) return Class;
  93713. if (typeof Class !== "function") {
  93714. throw new TypeError("Super expression must either be null or a function");
  93715. }
  93716. if (typeof _cache !== "undefined") {
  93717. if (_cache.has(Class)) return _cache.get(Class);
  93718. _cache.set(Class, Wrapper);
  93719. }
  93720. function Wrapper() {
  93721. return _construct(Class, arguments, _getPrototypeOf(this).constructor);
  93722. }
  93723. Wrapper.prototype = Object.create(Class.prototype, {
  93724. constructor: {
  93725. value: Wrapper,
  93726. enumerable: false,
  93727. writable: true,
  93728. configurable: true
  93729. }
  93730. });
  93731. return _setPrototypeOf(Wrapper, Class);
  93732. };
  93733. return _wrapNativeSuper(Class);
  93734. }
  93735. /* eslint no-console:0 */
  93736. var formatRegExp = /%[sdj%]/g;
  93737. var warning = function warning() {}; // don't print warning message when in production env or node runtime
  93738. if (typeof process !== 'undefined' && Object({"NODE_ENV":"production"}) && "production" !== 'production' && typeof window !== 'undefined' && typeof document !== 'undefined') {
  93739. warning = function warning(type, errors) {
  93740. if (typeof console !== 'undefined' && console.warn) {
  93741. if (errors.every(function (e) {
  93742. return typeof e === 'string';
  93743. })) {
  93744. console.warn(type, errors);
  93745. }
  93746. }
  93747. };
  93748. }
  93749. function convertFieldsError(errors) {
  93750. if (!errors || !errors.length) return null;
  93751. var fields = {};
  93752. errors.forEach(function (error) {
  93753. var field = error.field;
  93754. fields[field] = fields[field] || [];
  93755. fields[field].push(error);
  93756. });
  93757. return fields;
  93758. }
  93759. function format() {
  93760. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  93761. args[_key] = arguments[_key];
  93762. }
  93763. var i = 1;
  93764. var f = args[0];
  93765. var len = args.length;
  93766. if (typeof f === 'function') {
  93767. return f.apply(null, args.slice(1));
  93768. }
  93769. if (typeof f === 'string') {
  93770. var str = String(f).replace(formatRegExp, function (x) {
  93771. if (x === '%%') {
  93772. return '%';
  93773. }
  93774. if (i >= len) {
  93775. return x;
  93776. }
  93777. switch (x) {
  93778. case '%s':
  93779. return String(args[i++]);
  93780. case '%d':
  93781. return Number(args[i++]);
  93782. case '%j':
  93783. try {
  93784. return JSON.stringify(args[i++]);
  93785. } catch (_) {
  93786. return '[Circular]';
  93787. }
  93788. break;
  93789. default:
  93790. return x;
  93791. }
  93792. });
  93793. for (var arg = args[i]; i < len; arg = args[++i]) {
  93794. str += " " + arg;
  93795. }
  93796. return str;
  93797. }
  93798. return f;
  93799. }
  93800. function isNativeStringType(type) {
  93801. return type === 'string' || type === 'url' || type === 'hex' || type === 'email' || type === 'pattern';
  93802. }
  93803. function isEmptyValue(value, type) {
  93804. if (value === undefined || value === null) {
  93805. return true;
  93806. }
  93807. if (type === 'array' && Array.isArray(value) && !value.length) {
  93808. return true;
  93809. }
  93810. if (isNativeStringType(type) && typeof value === 'string' && !value) {
  93811. return true;
  93812. }
  93813. return false;
  93814. }
  93815. function asyncParallelArray(arr, func, callback) {
  93816. var results = [];
  93817. var total = 0;
  93818. var arrLength = arr.length;
  93819. function count(errors) {
  93820. results.push.apply(results, errors);
  93821. total++;
  93822. if (total === arrLength) {
  93823. callback(results);
  93824. }
  93825. }
  93826. arr.forEach(function (a) {
  93827. func(a, count);
  93828. });
  93829. }
  93830. function asyncSerialArray(arr, func, callback) {
  93831. var index = 0;
  93832. var arrLength = arr.length;
  93833. function next(errors) {
  93834. if (errors && errors.length) {
  93835. callback(errors);
  93836. return;
  93837. }
  93838. var original = index;
  93839. index = index + 1;
  93840. if (original < arrLength) {
  93841. func(arr[original], next);
  93842. } else {
  93843. callback([]);
  93844. }
  93845. }
  93846. next([]);
  93847. }
  93848. function flattenObjArr(objArr) {
  93849. var ret = [];
  93850. Object.keys(objArr).forEach(function (k) {
  93851. ret.push.apply(ret, objArr[k]);
  93852. });
  93853. return ret;
  93854. }
  93855. var AsyncValidationError = /*#__PURE__*/function (_Error) {
  93856. _inheritsLoose(AsyncValidationError, _Error);
  93857. function AsyncValidationError(errors, fields) {
  93858. var _this;
  93859. _this = _Error.call(this, 'Async Validation Error') || this;
  93860. _this.errors = errors;
  93861. _this.fields = fields;
  93862. return _this;
  93863. }
  93864. return AsyncValidationError;
  93865. }( /*#__PURE__*/_wrapNativeSuper(Error));
  93866. function asyncMap(objArr, option, func, callback) {
  93867. if (option.first) {
  93868. var _pending = new Promise(function (resolve, reject) {
  93869. var next = function next(errors) {
  93870. callback(errors);
  93871. return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve();
  93872. };
  93873. var flattenArr = flattenObjArr(objArr);
  93874. asyncSerialArray(flattenArr, func, next);
  93875. });
  93876. _pending["catch"](function (e) {
  93877. return e;
  93878. });
  93879. return _pending;
  93880. }
  93881. var firstFields = option.firstFields || [];
  93882. if (firstFields === true) {
  93883. firstFields = Object.keys(objArr);
  93884. }
  93885. var objArrKeys = Object.keys(objArr);
  93886. var objArrLength = objArrKeys.length;
  93887. var total = 0;
  93888. var results = [];
  93889. var pending = new Promise(function (resolve, reject) {
  93890. var next = function next(errors) {
  93891. results.push.apply(results, errors);
  93892. total++;
  93893. if (total === objArrLength) {
  93894. callback(results);
  93895. return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve();
  93896. }
  93897. };
  93898. if (!objArrKeys.length) {
  93899. callback(results);
  93900. resolve();
  93901. }
  93902. objArrKeys.forEach(function (key) {
  93903. var arr = objArr[key];
  93904. if (firstFields.indexOf(key) !== -1) {
  93905. asyncSerialArray(arr, func, next);
  93906. } else {
  93907. asyncParallelArray(arr, func, next);
  93908. }
  93909. });
  93910. });
  93911. pending["catch"](function (e) {
  93912. return e;
  93913. });
  93914. return pending;
  93915. }
  93916. function complementError(rule) {
  93917. return function (oe) {
  93918. if (oe && oe.message) {
  93919. oe.field = oe.field || rule.fullField;
  93920. return oe;
  93921. }
  93922. return {
  93923. message: typeof oe === 'function' ? oe() : oe,
  93924. field: oe.field || rule.fullField
  93925. };
  93926. };
  93927. }
  93928. function deepMerge(target, source) {
  93929. if (source) {
  93930. for (var s in source) {
  93931. if (source.hasOwnProperty(s)) {
  93932. var value = source[s];
  93933. if (typeof value === 'object' && typeof target[s] === 'object') {
  93934. target[s] = _extends(_extends({}, target[s]), value);
  93935. } else {
  93936. target[s] = value;
  93937. }
  93938. }
  93939. }
  93940. }
  93941. return target;
  93942. }
  93943. /**
  93944. * Rule for validating required fields.
  93945. *
  93946. * @param rule The validation rule.
  93947. * @param value The value of the field on the source object.
  93948. * @param source The source object being validated.
  93949. * @param errors An array of errors that this rule may add
  93950. * validation errors to.
  93951. * @param options The validation options.
  93952. * @param options.messages The validation messages.
  93953. */
  93954. function required(rule, value, source, errors, options, type) {
  93955. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) {
  93956. errors.push(format(options.messages.required, rule.fullField));
  93957. }
  93958. }
  93959. /**
  93960. * Rule for validating whitespace.
  93961. *
  93962. * @param rule The validation rule.
  93963. * @param value The value of the field on the source object.
  93964. * @param source The source object being validated.
  93965. * @param errors An array of errors that this rule may add
  93966. * validation errors to.
  93967. * @param options The validation options.
  93968. * @param options.messages The validation messages.
  93969. */
  93970. function whitespace(rule, value, source, errors, options) {
  93971. if (/^\s+$/.test(value) || value === '') {
  93972. errors.push(format(options.messages.whitespace, rule.fullField));
  93973. }
  93974. }
  93975. /* eslint max-len:0 */
  93976. var pattern = {
  93977. // http://emailregex.com/
  93978. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
  93979. url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", 'i'),
  93980. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  93981. };
  93982. var types = {
  93983. integer: function integer(value) {
  93984. return types.number(value) && parseInt(value, 10) === value;
  93985. },
  93986. "float": function float(value) {
  93987. return types.number(value) && !types.integer(value);
  93988. },
  93989. array: function array(value) {
  93990. return Array.isArray(value);
  93991. },
  93992. regexp: function regexp(value) {
  93993. if (value instanceof RegExp) {
  93994. return true;
  93995. }
  93996. try {
  93997. return !!new RegExp(value);
  93998. } catch (e) {
  93999. return false;
  94000. }
  94001. },
  94002. date: function date(value) {
  94003. return typeof value.getTime === 'function' && typeof value.getMonth === 'function' && typeof value.getYear === 'function';
  94004. },
  94005. number: function number(value) {
  94006. if (isNaN(value)) {
  94007. return false;
  94008. }
  94009. return typeof value === 'number';
  94010. },
  94011. object: function object(value) {
  94012. return typeof value === 'object' && !types.array(value);
  94013. },
  94014. method: function method(value) {
  94015. return typeof value === 'function';
  94016. },
  94017. email: function email(value) {
  94018. return typeof value === 'string' && !!value.match(pattern.email) && value.length < 255;
  94019. },
  94020. url: function url(value) {
  94021. return typeof value === 'string' && !!value.match(pattern.url);
  94022. },
  94023. hex: function hex(value) {
  94024. return typeof value === 'string' && !!value.match(pattern.hex);
  94025. }
  94026. };
  94027. /**
  94028. * Rule for validating the type of a value.
  94029. *
  94030. * @param rule The validation rule.
  94031. * @param value The value of the field on the source object.
  94032. * @param source The source object being validated.
  94033. * @param errors An array of errors that this rule may add
  94034. * validation errors to.
  94035. * @param options The validation options.
  94036. * @param options.messages The validation messages.
  94037. */
  94038. function type(rule, value, source, errors, options) {
  94039. if (rule.required && value === undefined) {
  94040. required(rule, value, source, errors, options);
  94041. return;
  94042. }
  94043. var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];
  94044. var ruleType = rule.type;
  94045. if (custom.indexOf(ruleType) > -1) {
  94046. if (!types[ruleType](value)) {
  94047. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  94048. } // straight typeof check
  94049. } else if (ruleType && typeof value !== rule.type) {
  94050. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  94051. }
  94052. }
  94053. /**
  94054. * Rule for validating minimum and maximum allowed values.
  94055. *
  94056. * @param rule The validation rule.
  94057. * @param value The value of the field on the source object.
  94058. * @param source The source object being validated.
  94059. * @param errors An array of errors that this rule may add
  94060. * validation errors to.
  94061. * @param options The validation options.
  94062. * @param options.messages The validation messages.
  94063. */
  94064. function range(rule, value, source, errors, options) {
  94065. var len = typeof rule.len === 'number';
  94066. var min = typeof rule.min === 'number';
  94067. var max = typeof rule.max === 'number'; // 正则匹配码点范围从U+010000一直到U+10FFFF的文字(补充平面Supplementary Plane)
  94068. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  94069. var val = value;
  94070. var key = null;
  94071. var num = typeof value === 'number';
  94072. var str = typeof value === 'string';
  94073. var arr = Array.isArray(value);
  94074. if (num) {
  94075. key = 'number';
  94076. } else if (str) {
  94077. key = 'string';
  94078. } else if (arr) {
  94079. key = 'array';
  94080. } // if the value is not of a supported type for range validation
  94081. // the validation rule rule should use the
  94082. // type property to also test for a particular type
  94083. if (!key) {
  94084. return false;
  94085. }
  94086. if (arr) {
  94087. val = value.length;
  94088. }
  94089. if (str) {
  94090. // 处理码点大于U+010000的文字length属性不准确的bug,如"𠮷𠮷𠮷".lenght !== 3
  94091. val = value.replace(spRegexp, '_').length;
  94092. }
  94093. if (len) {
  94094. if (val !== rule.len) {
  94095. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  94096. }
  94097. } else if (min && !max && val < rule.min) {
  94098. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  94099. } else if (max && !min && val > rule.max) {
  94100. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  94101. } else if (min && max && (val < rule.min || val > rule.max)) {
  94102. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  94103. }
  94104. }
  94105. var ENUM = 'enum';
  94106. /**
  94107. * Rule for validating a value exists in an enumerable list.
  94108. *
  94109. * @param rule The validation rule.
  94110. * @param value The value of the field on the source object.
  94111. * @param source The source object being validated.
  94112. * @param errors An array of errors that this rule may add
  94113. * validation errors to.
  94114. * @param options The validation options.
  94115. * @param options.messages The validation messages.
  94116. */
  94117. function enumerable(rule, value, source, errors, options) {
  94118. rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : [];
  94119. if (rule[ENUM].indexOf(value) === -1) {
  94120. errors.push(format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')));
  94121. }
  94122. }
  94123. /**
  94124. * Rule for validating a regular expression pattern.
  94125. *
  94126. * @param rule The validation rule.
  94127. * @param value The value of the field on the source object.
  94128. * @param source The source object being validated.
  94129. * @param errors An array of errors that this rule may add
  94130. * validation errors to.
  94131. * @param options The validation options.
  94132. * @param options.messages The validation messages.
  94133. */
  94134. function pattern$1(rule, value, source, errors, options) {
  94135. if (rule.pattern) {
  94136. if (rule.pattern instanceof RegExp) {
  94137. // if a RegExp instance is passed, reset `lastIndex` in case its `global`
  94138. // flag is accidentally set to `true`, which in a validation scenario
  94139. // is not necessary and the result might be misleading
  94140. rule.pattern.lastIndex = 0;
  94141. if (!rule.pattern.test(value)) {
  94142. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  94143. }
  94144. } else if (typeof rule.pattern === 'string') {
  94145. var _pattern = new RegExp(rule.pattern);
  94146. if (!_pattern.test(value)) {
  94147. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  94148. }
  94149. }
  94150. }
  94151. }
  94152. var rules = {
  94153. required: required,
  94154. whitespace: whitespace,
  94155. type: type,
  94156. range: range,
  94157. "enum": enumerable,
  94158. pattern: pattern$1
  94159. };
  94160. /**
  94161. * Performs validation for string types.
  94162. *
  94163. * @param rule The validation rule.
  94164. * @param value The value of the field on the source object.
  94165. * @param callback The callback function.
  94166. * @param source The source object being validated.
  94167. * @param options The validation options.
  94168. * @param options.messages The validation messages.
  94169. */
  94170. function string(rule, value, callback, source, options) {
  94171. var errors = [];
  94172. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94173. if (validate) {
  94174. if (isEmptyValue(value, 'string') && !rule.required) {
  94175. return callback();
  94176. }
  94177. rules.required(rule, value, source, errors, options, 'string');
  94178. if (!isEmptyValue(value, 'string')) {
  94179. rules.type(rule, value, source, errors, options);
  94180. rules.range(rule, value, source, errors, options);
  94181. rules.pattern(rule, value, source, errors, options);
  94182. if (rule.whitespace === true) {
  94183. rules.whitespace(rule, value, source, errors, options);
  94184. }
  94185. }
  94186. }
  94187. callback(errors);
  94188. }
  94189. /**
  94190. * Validates a function.
  94191. *
  94192. * @param rule The validation rule.
  94193. * @param value The value of the field on the source object.
  94194. * @param callback The callback function.
  94195. * @param source The source object being validated.
  94196. * @param options The validation options.
  94197. * @param options.messages The validation messages.
  94198. */
  94199. function method(rule, value, callback, source, options) {
  94200. var errors = [];
  94201. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94202. if (validate) {
  94203. if (isEmptyValue(value) && !rule.required) {
  94204. return callback();
  94205. }
  94206. rules.required(rule, value, source, errors, options);
  94207. if (value !== undefined) {
  94208. rules.type(rule, value, source, errors, options);
  94209. }
  94210. }
  94211. callback(errors);
  94212. }
  94213. /**
  94214. * Validates a number.
  94215. *
  94216. * @param rule The validation rule.
  94217. * @param value The value of the field on the source object.
  94218. * @param callback The callback function.
  94219. * @param source The source object being validated.
  94220. * @param options The validation options.
  94221. * @param options.messages The validation messages.
  94222. */
  94223. function number(rule, value, callback, source, options) {
  94224. var errors = [];
  94225. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94226. if (validate) {
  94227. if (value === '') {
  94228. value = undefined;
  94229. }
  94230. if (isEmptyValue(value) && !rule.required) {
  94231. return callback();
  94232. }
  94233. rules.required(rule, value, source, errors, options);
  94234. if (value !== undefined) {
  94235. rules.type(rule, value, source, errors, options);
  94236. rules.range(rule, value, source, errors, options);
  94237. }
  94238. }
  94239. callback(errors);
  94240. }
  94241. /**
  94242. * Validates a boolean.
  94243. *
  94244. * @param rule The validation rule.
  94245. * @param value The value of the field on the source object.
  94246. * @param callback The callback function.
  94247. * @param source The source object being validated.
  94248. * @param options The validation options.
  94249. * @param options.messages The validation messages.
  94250. */
  94251. function _boolean(rule, value, callback, source, options) {
  94252. var errors = [];
  94253. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94254. if (validate) {
  94255. if (isEmptyValue(value) && !rule.required) {
  94256. return callback();
  94257. }
  94258. rules.required(rule, value, source, errors, options);
  94259. if (value !== undefined) {
  94260. rules.type(rule, value, source, errors, options);
  94261. }
  94262. }
  94263. callback(errors);
  94264. }
  94265. /**
  94266. * Validates the regular expression type.
  94267. *
  94268. * @param rule The validation rule.
  94269. * @param value The value of the field on the source object.
  94270. * @param callback The callback function.
  94271. * @param source The source object being validated.
  94272. * @param options The validation options.
  94273. * @param options.messages The validation messages.
  94274. */
  94275. function regexp(rule, value, callback, source, options) {
  94276. var errors = [];
  94277. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94278. if (validate) {
  94279. if (isEmptyValue(value) && !rule.required) {
  94280. return callback();
  94281. }
  94282. rules.required(rule, value, source, errors, options);
  94283. if (!isEmptyValue(value)) {
  94284. rules.type(rule, value, source, errors, options);
  94285. }
  94286. }
  94287. callback(errors);
  94288. }
  94289. /**
  94290. * Validates a number is an integer.
  94291. *
  94292. * @param rule The validation rule.
  94293. * @param value The value of the field on the source object.
  94294. * @param callback The callback function.
  94295. * @param source The source object being validated.
  94296. * @param options The validation options.
  94297. * @param options.messages The validation messages.
  94298. */
  94299. function integer(rule, value, callback, source, options) {
  94300. var errors = [];
  94301. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94302. if (validate) {
  94303. if (isEmptyValue(value) && !rule.required) {
  94304. return callback();
  94305. }
  94306. rules.required(rule, value, source, errors, options);
  94307. if (value !== undefined) {
  94308. rules.type(rule, value, source, errors, options);
  94309. rules.range(rule, value, source, errors, options);
  94310. }
  94311. }
  94312. callback(errors);
  94313. }
  94314. /**
  94315. * Validates a number is a floating point number.
  94316. *
  94317. * @param rule The validation rule.
  94318. * @param value The value of the field on the source object.
  94319. * @param callback The callback function.
  94320. * @param source The source object being validated.
  94321. * @param options The validation options.
  94322. * @param options.messages The validation messages.
  94323. */
  94324. function floatFn(rule, value, callback, source, options) {
  94325. var errors = [];
  94326. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94327. if (validate) {
  94328. if (isEmptyValue(value) && !rule.required) {
  94329. return callback();
  94330. }
  94331. rules.required(rule, value, source, errors, options);
  94332. if (value !== undefined) {
  94333. rules.type(rule, value, source, errors, options);
  94334. rules.range(rule, value, source, errors, options);
  94335. }
  94336. }
  94337. callback(errors);
  94338. }
  94339. /**
  94340. * Validates an array.
  94341. *
  94342. * @param rule The validation rule.
  94343. * @param value The value of the field on the source object.
  94344. * @param callback The callback function.
  94345. * @param source The source object being validated.
  94346. * @param options The validation options.
  94347. * @param options.messages The validation messages.
  94348. */
  94349. function array(rule, value, callback, source, options) {
  94350. var errors = [];
  94351. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94352. if (validate) {
  94353. if (isEmptyValue(value, 'array') && !rule.required) {
  94354. return callback();
  94355. }
  94356. rules.required(rule, value, source, errors, options, 'array');
  94357. if (!isEmptyValue(value, 'array')) {
  94358. rules.type(rule, value, source, errors, options);
  94359. rules.range(rule, value, source, errors, options);
  94360. }
  94361. }
  94362. callback(errors);
  94363. }
  94364. /**
  94365. * Validates an object.
  94366. *
  94367. * @param rule The validation rule.
  94368. * @param value The value of the field on the source object.
  94369. * @param callback The callback function.
  94370. * @param source The source object being validated.
  94371. * @param options The validation options.
  94372. * @param options.messages The validation messages.
  94373. */
  94374. function object(rule, value, callback, source, options) {
  94375. var errors = [];
  94376. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94377. if (validate) {
  94378. if (isEmptyValue(value) && !rule.required) {
  94379. return callback();
  94380. }
  94381. rules.required(rule, value, source, errors, options);
  94382. if (value !== undefined) {
  94383. rules.type(rule, value, source, errors, options);
  94384. }
  94385. }
  94386. callback(errors);
  94387. }
  94388. var ENUM$1 = 'enum';
  94389. /**
  94390. * Validates an enumerable list.
  94391. *
  94392. * @param rule The validation rule.
  94393. * @param value The value of the field on the source object.
  94394. * @param callback The callback function.
  94395. * @param source The source object being validated.
  94396. * @param options The validation options.
  94397. * @param options.messages The validation messages.
  94398. */
  94399. function enumerable$1(rule, value, callback, source, options) {
  94400. var errors = [];
  94401. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94402. if (validate) {
  94403. if (isEmptyValue(value) && !rule.required) {
  94404. return callback();
  94405. }
  94406. rules.required(rule, value, source, errors, options);
  94407. if (value !== undefined) {
  94408. rules[ENUM$1](rule, value, source, errors, options);
  94409. }
  94410. }
  94411. callback(errors);
  94412. }
  94413. /**
  94414. * Validates a regular expression pattern.
  94415. *
  94416. * Performs validation when a rule only contains
  94417. * a pattern property but is not declared as a string type.
  94418. *
  94419. * @param rule The validation rule.
  94420. * @param value The value of the field on the source object.
  94421. * @param callback The callback function.
  94422. * @param source The source object being validated.
  94423. * @param options The validation options.
  94424. * @param options.messages The validation messages.
  94425. */
  94426. function pattern$2(rule, value, callback, source, options) {
  94427. var errors = [];
  94428. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94429. if (validate) {
  94430. if (isEmptyValue(value, 'string') && !rule.required) {
  94431. return callback();
  94432. }
  94433. rules.required(rule, value, source, errors, options);
  94434. if (!isEmptyValue(value, 'string')) {
  94435. rules.pattern(rule, value, source, errors, options);
  94436. }
  94437. }
  94438. callback(errors);
  94439. }
  94440. function date(rule, value, callback, source, options) {
  94441. // console.log('integer rule called %j', rule);
  94442. var errors = [];
  94443. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field); // console.log('validate on %s value', value);
  94444. if (validate) {
  94445. if (isEmptyValue(value) && !rule.required) {
  94446. return callback();
  94447. }
  94448. rules.required(rule, value, source, errors, options);
  94449. if (!isEmptyValue(value)) {
  94450. var dateObject;
  94451. if (typeof value === 'number') {
  94452. dateObject = new Date(value);
  94453. } else {
  94454. dateObject = value;
  94455. }
  94456. rules.type(rule, dateObject, source, errors, options);
  94457. if (dateObject) {
  94458. rules.range(rule, dateObject.getTime(), source, errors, options);
  94459. }
  94460. }
  94461. }
  94462. callback(errors);
  94463. }
  94464. function required$1(rule, value, callback, source, options) {
  94465. var errors = [];
  94466. var type = Array.isArray(value) ? 'array' : typeof value;
  94467. rules.required(rule, value, source, errors, options, type);
  94468. callback(errors);
  94469. }
  94470. function type$1(rule, value, callback, source, options) {
  94471. var ruleType = rule.type;
  94472. var errors = [];
  94473. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94474. if (validate) {
  94475. if (isEmptyValue(value, ruleType) && !rule.required) {
  94476. return callback();
  94477. }
  94478. rules.required(rule, value, source, errors, options, ruleType);
  94479. if (!isEmptyValue(value, ruleType)) {
  94480. rules.type(rule, value, source, errors, options);
  94481. }
  94482. }
  94483. callback(errors);
  94484. }
  94485. /**
  94486. * Performs validation for any type.
  94487. *
  94488. * @param rule The validation rule.
  94489. * @param value The value of the field on the source object.
  94490. * @param callback The callback function.
  94491. * @param source The source object being validated.
  94492. * @param options The validation options.
  94493. * @param options.messages The validation messages.
  94494. */
  94495. function any(rule, value, callback, source, options) {
  94496. var errors = [];
  94497. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  94498. if (validate) {
  94499. if (isEmptyValue(value) && !rule.required) {
  94500. return callback();
  94501. }
  94502. rules.required(rule, value, source, errors, options);
  94503. }
  94504. callback(errors);
  94505. }
  94506. var validators = {
  94507. string: string,
  94508. method: method,
  94509. number: number,
  94510. "boolean": _boolean,
  94511. regexp: regexp,
  94512. integer: integer,
  94513. "float": floatFn,
  94514. array: array,
  94515. object: object,
  94516. "enum": enumerable$1,
  94517. pattern: pattern$2,
  94518. date: date,
  94519. url: type$1,
  94520. hex: type$1,
  94521. email: type$1,
  94522. required: required$1,
  94523. any: any
  94524. };
  94525. function newMessages() {
  94526. return {
  94527. "default": 'Validation error on field %s',
  94528. required: '%s is required',
  94529. "enum": '%s must be one of %s',
  94530. whitespace: '%s cannot be empty',
  94531. date: {
  94532. format: '%s date %s is invalid for format %s',
  94533. parse: '%s date could not be parsed, %s is invalid ',
  94534. invalid: '%s date %s is invalid'
  94535. },
  94536. types: {
  94537. string: '%s is not a %s',
  94538. method: '%s is not a %s (function)',
  94539. array: '%s is not an %s',
  94540. object: '%s is not an %s',
  94541. number: '%s is not a %s',
  94542. date: '%s is not a %s',
  94543. "boolean": '%s is not a %s',
  94544. integer: '%s is not an %s',
  94545. "float": '%s is not a %s',
  94546. regexp: '%s is not a valid %s',
  94547. email: '%s is not a valid %s',
  94548. url: '%s is not a valid %s',
  94549. hex: '%s is not a valid %s'
  94550. },
  94551. string: {
  94552. len: '%s must be exactly %s characters',
  94553. min: '%s must be at least %s characters',
  94554. max: '%s cannot be longer than %s characters',
  94555. range: '%s must be between %s and %s characters'
  94556. },
  94557. number: {
  94558. len: '%s must equal %s',
  94559. min: '%s cannot be less than %s',
  94560. max: '%s cannot be greater than %s',
  94561. range: '%s must be between %s and %s'
  94562. },
  94563. array: {
  94564. len: '%s must be exactly %s in length',
  94565. min: '%s cannot be less than %s in length',
  94566. max: '%s cannot be greater than %s in length',
  94567. range: '%s must be between %s and %s in length'
  94568. },
  94569. pattern: {
  94570. mismatch: '%s value %s does not match pattern %s'
  94571. },
  94572. clone: function clone() {
  94573. var cloned = JSON.parse(JSON.stringify(this));
  94574. cloned.clone = this.clone;
  94575. return cloned;
  94576. }
  94577. };
  94578. }
  94579. var messages = newMessages();
  94580. /**
  94581. * Encapsulates a validation schema.
  94582. *
  94583. * @param descriptor An object declaring validation rules
  94584. * for this schema.
  94585. */
  94586. function Schema(descriptor) {
  94587. this.rules = null;
  94588. this._messages = messages;
  94589. this.define(descriptor);
  94590. }
  94591. Schema.prototype = {
  94592. messages: function messages(_messages) {
  94593. if (_messages) {
  94594. this._messages = deepMerge(newMessages(), _messages);
  94595. }
  94596. return this._messages;
  94597. },
  94598. define: function define(rules) {
  94599. if (!rules) {
  94600. throw new Error('Cannot configure a schema with no rules');
  94601. }
  94602. if (typeof rules !== 'object' || Array.isArray(rules)) {
  94603. throw new Error('Rules must be an object');
  94604. }
  94605. this.rules = {};
  94606. var z;
  94607. var item;
  94608. for (z in rules) {
  94609. if (rules.hasOwnProperty(z)) {
  94610. item = rules[z];
  94611. this.rules[z] = Array.isArray(item) ? item : [item];
  94612. }
  94613. }
  94614. },
  94615. validate: function validate(source_, o, oc) {
  94616. var _this = this;
  94617. if (o === void 0) {
  94618. o = {};
  94619. }
  94620. if (oc === void 0) {
  94621. oc = function oc() {};
  94622. }
  94623. var source = source_;
  94624. var options = o;
  94625. var callback = oc;
  94626. if (typeof options === 'function') {
  94627. callback = options;
  94628. options = {};
  94629. }
  94630. if (!this.rules || Object.keys(this.rules).length === 0) {
  94631. if (callback) {
  94632. callback();
  94633. }
  94634. return Promise.resolve();
  94635. }
  94636. function complete(results) {
  94637. var i;
  94638. var errors = [];
  94639. var fields = {};
  94640. function add(e) {
  94641. if (Array.isArray(e)) {
  94642. var _errors;
  94643. errors = (_errors = errors).concat.apply(_errors, e);
  94644. } else {
  94645. errors.push(e);
  94646. }
  94647. }
  94648. for (i = 0; i < results.length; i++) {
  94649. add(results[i]);
  94650. }
  94651. if (!errors.length) {
  94652. errors = null;
  94653. fields = null;
  94654. } else {
  94655. fields = convertFieldsError(errors);
  94656. }
  94657. callback(errors, fields);
  94658. }
  94659. if (options.messages) {
  94660. var messages$1 = this.messages();
  94661. if (messages$1 === messages) {
  94662. messages$1 = newMessages();
  94663. }
  94664. deepMerge(messages$1, options.messages);
  94665. options.messages = messages$1;
  94666. } else {
  94667. options.messages = this.messages();
  94668. }
  94669. var arr;
  94670. var value;
  94671. var series = {};
  94672. var keys = options.keys || Object.keys(this.rules);
  94673. keys.forEach(function (z) {
  94674. arr = _this.rules[z];
  94675. value = source[z];
  94676. arr.forEach(function (r) {
  94677. var rule = r;
  94678. if (typeof rule.transform === 'function') {
  94679. if (source === source_) {
  94680. source = _extends({}, source);
  94681. }
  94682. value = source[z] = rule.transform(value);
  94683. }
  94684. if (typeof rule === 'function') {
  94685. rule = {
  94686. validator: rule
  94687. };
  94688. } else {
  94689. rule = _extends({}, rule);
  94690. }
  94691. rule.validator = _this.getValidationMethod(rule);
  94692. rule.field = z;
  94693. rule.fullField = rule.fullField || z;
  94694. rule.type = _this.getType(rule);
  94695. if (!rule.validator) {
  94696. return;
  94697. }
  94698. series[z] = series[z] || [];
  94699. series[z].push({
  94700. rule: rule,
  94701. value: value,
  94702. source: source,
  94703. field: z
  94704. });
  94705. });
  94706. });
  94707. var errorFields = {};
  94708. return asyncMap(series, options, function (data, doIt) {
  94709. var rule = data.rule;
  94710. var deep = (rule.type === 'object' || rule.type === 'array') && (typeof rule.fields === 'object' || typeof rule.defaultField === 'object');
  94711. deep = deep && (rule.required || !rule.required && data.value);
  94712. rule.field = data.field;
  94713. function addFullfield(key, schema) {
  94714. return _extends(_extends({}, schema), {}, {
  94715. fullField: rule.fullField + "." + key
  94716. });
  94717. }
  94718. function cb(e) {
  94719. if (e === void 0) {
  94720. e = [];
  94721. }
  94722. var errors = e;
  94723. if (!Array.isArray(errors)) {
  94724. errors = [errors];
  94725. }
  94726. if (!options.suppressWarning && errors.length) {
  94727. Schema.warning('async-validator:', errors);
  94728. }
  94729. if (errors.length && rule.message) {
  94730. errors = [].concat(rule.message);
  94731. }
  94732. errors = errors.map(complementError(rule));
  94733. if (options.first && errors.length) {
  94734. errorFields[rule.field] = 1;
  94735. return doIt(errors);
  94736. }
  94737. if (!deep) {
  94738. doIt(errors);
  94739. } else {
  94740. // if rule is required but the target object
  94741. // does not exist fail at the rule level and don't
  94742. // go deeper
  94743. if (rule.required && !data.value) {
  94744. if (rule.message) {
  94745. errors = [].concat(rule.message).map(complementError(rule));
  94746. } else if (options.error) {
  94747. errors = [options.error(rule, format(options.messages.required, rule.field))];
  94748. }
  94749. return doIt(errors);
  94750. }
  94751. var fieldsSchema = {};
  94752. if (rule.defaultField) {
  94753. for (var k in data.value) {
  94754. if (data.value.hasOwnProperty(k)) {
  94755. fieldsSchema[k] = rule.defaultField;
  94756. }
  94757. }
  94758. }
  94759. fieldsSchema = _extends(_extends({}, fieldsSchema), data.rule.fields);
  94760. for (var f in fieldsSchema) {
  94761. if (fieldsSchema.hasOwnProperty(f)) {
  94762. var fieldSchema = Array.isArray(fieldsSchema[f]) ? fieldsSchema[f] : [fieldsSchema[f]];
  94763. fieldsSchema[f] = fieldSchema.map(addFullfield.bind(null, f));
  94764. }
  94765. }
  94766. var schema = new Schema(fieldsSchema);
  94767. schema.messages(options.messages);
  94768. if (data.rule.options) {
  94769. data.rule.options.messages = options.messages;
  94770. data.rule.options.error = options.error;
  94771. }
  94772. schema.validate(data.value, data.rule.options || options, function (errs) {
  94773. var finalErrors = [];
  94774. if (errors && errors.length) {
  94775. finalErrors.push.apply(finalErrors, errors);
  94776. }
  94777. if (errs && errs.length) {
  94778. finalErrors.push.apply(finalErrors, errs);
  94779. }
  94780. doIt(finalErrors.length ? finalErrors : null);
  94781. });
  94782. }
  94783. }
  94784. var res;
  94785. if (rule.asyncValidator) {
  94786. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  94787. } else if (rule.validator) {
  94788. res = rule.validator(rule, data.value, cb, data.source, options);
  94789. if (res === true) {
  94790. cb();
  94791. } else if (res === false) {
  94792. cb(rule.message || rule.field + " fails");
  94793. } else if (res instanceof Array) {
  94794. cb(res);
  94795. } else if (res instanceof Error) {
  94796. cb(res.message);
  94797. }
  94798. }
  94799. if (res && res.then) {
  94800. res.then(function () {
  94801. return cb();
  94802. }, function (e) {
  94803. return cb(e);
  94804. });
  94805. }
  94806. }, function (results) {
  94807. complete(results);
  94808. });
  94809. },
  94810. getType: function getType(rule) {
  94811. if (rule.type === undefined && rule.pattern instanceof RegExp) {
  94812. rule.type = 'pattern';
  94813. }
  94814. if (typeof rule.validator !== 'function' && rule.type && !validators.hasOwnProperty(rule.type)) {
  94815. throw new Error(format('Unknown rule type %s', rule.type));
  94816. }
  94817. return rule.type || 'string';
  94818. },
  94819. getValidationMethod: function getValidationMethod(rule) {
  94820. if (typeof rule.validator === 'function') {
  94821. return rule.validator;
  94822. }
  94823. var keys = Object.keys(rule);
  94824. var messageIndex = keys.indexOf('message');
  94825. if (messageIndex !== -1) {
  94826. keys.splice(messageIndex, 1);
  94827. }
  94828. if (keys.length === 1 && keys[0] === 'required') {
  94829. return validators.required;
  94830. }
  94831. return validators[this.getType(rule)] || false;
  94832. }
  94833. };
  94834. Schema.register = function register(type, validator) {
  94835. if (typeof validator !== 'function') {
  94836. throw new Error('Cannot register a validator by type, validator is not a function');
  94837. }
  94838. validators[type] = validator;
  94839. };
  94840. Schema.warning = warning;
  94841. Schema.messages = messages;
  94842. Schema.validators = validators;
  94843. /* harmony default export */ __webpack_exports__["default"] = (Schema);
  94844. //# sourceMappingURL=index.js.map
  94845. /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(450)))
  94846. /***/ }),
  94847. /* 450 */
  94848. /***/ (function(module, exports) {
  94849. // shim for using process in browser
  94850. var process = module.exports = {};
  94851. // cached from whatever global is present so that test runners that stub it
  94852. // don't break things. But we need to wrap it in a try catch in case it is
  94853. // wrapped in strict mode code which doesn't define any globals. It's inside a
  94854. // function because try/catches deoptimize in certain engines.
  94855. var cachedSetTimeout;
  94856. var cachedClearTimeout;
  94857. function defaultSetTimout() {
  94858. throw new Error('setTimeout has not been defined');
  94859. }
  94860. function defaultClearTimeout () {
  94861. throw new Error('clearTimeout has not been defined');
  94862. }
  94863. (function () {
  94864. try {
  94865. if (typeof setTimeout === 'function') {
  94866. cachedSetTimeout = setTimeout;
  94867. } else {
  94868. cachedSetTimeout = defaultSetTimout;
  94869. }
  94870. } catch (e) {
  94871. cachedSetTimeout = defaultSetTimout;
  94872. }
  94873. try {
  94874. if (typeof clearTimeout === 'function') {
  94875. cachedClearTimeout = clearTimeout;
  94876. } else {
  94877. cachedClearTimeout = defaultClearTimeout;
  94878. }
  94879. } catch (e) {
  94880. cachedClearTimeout = defaultClearTimeout;
  94881. }
  94882. } ())
  94883. function runTimeout(fun) {
  94884. if (cachedSetTimeout === setTimeout) {
  94885. //normal enviroments in sane situations
  94886. return setTimeout(fun, 0);
  94887. }
  94888. // if setTimeout wasn't available but was latter defined
  94889. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  94890. cachedSetTimeout = setTimeout;
  94891. return setTimeout(fun, 0);
  94892. }
  94893. try {
  94894. // when when somebody has screwed with setTimeout but no I.E. maddness
  94895. return cachedSetTimeout(fun, 0);
  94896. } catch(e){
  94897. try {
  94898. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  94899. return cachedSetTimeout.call(null, fun, 0);
  94900. } catch(e){
  94901. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  94902. return cachedSetTimeout.call(this, fun, 0);
  94903. }
  94904. }
  94905. }
  94906. function runClearTimeout(marker) {
  94907. if (cachedClearTimeout === clearTimeout) {
  94908. //normal enviroments in sane situations
  94909. return clearTimeout(marker);
  94910. }
  94911. // if clearTimeout wasn't available but was latter defined
  94912. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  94913. cachedClearTimeout = clearTimeout;
  94914. return clearTimeout(marker);
  94915. }
  94916. try {
  94917. // when when somebody has screwed with setTimeout but no I.E. maddness
  94918. return cachedClearTimeout(marker);
  94919. } catch (e){
  94920. try {
  94921. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  94922. return cachedClearTimeout.call(null, marker);
  94923. } catch (e){
  94924. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  94925. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  94926. return cachedClearTimeout.call(this, marker);
  94927. }
  94928. }
  94929. }
  94930. var queue = [];
  94931. var draining = false;
  94932. var currentQueue;
  94933. var queueIndex = -1;
  94934. function cleanUpNextTick() {
  94935. if (!draining || !currentQueue) {
  94936. return;
  94937. }
  94938. draining = false;
  94939. if (currentQueue.length) {
  94940. queue = currentQueue.concat(queue);
  94941. } else {
  94942. queueIndex = -1;
  94943. }
  94944. if (queue.length) {
  94945. drainQueue();
  94946. }
  94947. }
  94948. function drainQueue() {
  94949. if (draining) {
  94950. return;
  94951. }
  94952. var timeout = runTimeout(cleanUpNextTick);
  94953. draining = true;
  94954. var len = queue.length;
  94955. while(len) {
  94956. currentQueue = queue;
  94957. queue = [];
  94958. while (++queueIndex < len) {
  94959. if (currentQueue) {
  94960. currentQueue[queueIndex].run();
  94961. }
  94962. }
  94963. queueIndex = -1;
  94964. len = queue.length;
  94965. }
  94966. currentQueue = null;
  94967. draining = false;
  94968. runClearTimeout(timeout);
  94969. }
  94970. process.nextTick = function (fun) {
  94971. var args = new Array(arguments.length - 1);
  94972. if (arguments.length > 1) {
  94973. for (var i = 1; i < arguments.length; i++) {
  94974. args[i - 1] = arguments[i];
  94975. }
  94976. }
  94977. queue.push(new Item(fun, args));
  94978. if (queue.length === 1 && !draining) {
  94979. runTimeout(drainQueue);
  94980. }
  94981. };
  94982. // v8 likes predictible objects
  94983. function Item(fun, array) {
  94984. this.fun = fun;
  94985. this.array = array;
  94986. }
  94987. Item.prototype.run = function () {
  94988. this.fun.apply(null, this.array);
  94989. };
  94990. process.title = 'browser';
  94991. process.browser = true;
  94992. process.env = {};
  94993. process.argv = [];
  94994. process.version = ''; // empty string to avoid regexp issues
  94995. process.versions = {};
  94996. function noop() {}
  94997. process.on = noop;
  94998. process.addListener = noop;
  94999. process.once = noop;
  95000. process.off = noop;
  95001. process.removeListener = noop;
  95002. process.removeAllListeners = noop;
  95003. process.emit = noop;
  95004. process.prependListener = noop;
  95005. process.prependOnceListener = noop;
  95006. process.listeners = function (name) { return [] }
  95007. process.binding = function (name) {
  95008. throw new Error('process.binding is not supported');
  95009. };
  95010. process.cwd = function () { return '/' };
  95011. process.chdir = function (dir) {
  95012. throw new Error('process.chdir is not supported');
  95013. };
  95014. process.umask = function() { return 0; };
  95015. /***/ }),
  95016. /* 451 */
  95017. /***/ (function(module, exports, __webpack_require__) {
  95018. "use strict";
  95019. Object.defineProperty(exports, "__esModule", {
  95020. value: true
  95021. });
  95022. var render = function render() {
  95023. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.label || _vm.$slots.label ? _c('label', { class: [_vm.prefixCls + '-label'], style: _vm.labelStyles, attrs: { "for": _vm.labelFor } }, [_vm._t("label", [_vm._v(_vm._s(_vm.label) + _vm._s(_vm.FormInstance.colon))])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-content'], style: _vm.contentStyles }, [_vm._t("default"), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_vm.validateState === 'error' && _vm.showMessage && _vm.FormInstance.showMessage ? _c('div', { class: [_vm.prefixCls + '-error-tip'] }, [_vm._v(_vm._s(_vm.validateMessage))]) : _vm._e()])], 2)]);
  95024. };
  95025. var staticRenderFns = [];
  95026. exports.render = render;
  95027. exports.staticRenderFns = staticRenderFns;
  95028. /***/ }),
  95029. /* 452 */
  95030. /***/ (function(module, exports, __webpack_require__) {
  95031. "use strict";
  95032. Object.defineProperty(exports, "__esModule", {
  95033. value: true
  95034. });
  95035. var _header = __webpack_require__(192);
  95036. var _header2 = _interopRequireDefault(_header);
  95037. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95038. exports.default = _header2.default;
  95039. /***/ }),
  95040. /* 453 */
  95041. /***/ (function(module, exports, __webpack_require__) {
  95042. "use strict";
  95043. Object.defineProperty(exports, "__esModule", {
  95044. value: true
  95045. });
  95046. var render = function render() {
  95047. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
  95048. };
  95049. var staticRenderFns = [];
  95050. exports.render = render;
  95051. exports.staticRenderFns = staticRenderFns;
  95052. /***/ }),
  95053. /* 454 */
  95054. /***/ (function(module, exports, __webpack_require__) {
  95055. "use strict";
  95056. Object.defineProperty(exports, "__esModule", {
  95057. value: true
  95058. });
  95059. var _input = __webpack_require__(38);
  95060. var _input2 = _interopRequireDefault(_input);
  95061. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95062. exports.default = _input2.default;
  95063. /***/ }),
  95064. /* 455 */
  95065. /***/ (function(module, exports, __webpack_require__) {
  95066. "use strict";
  95067. Object.defineProperty(exports, "__esModule", {
  95068. value: true
  95069. });
  95070. var _inputNumber = __webpack_require__(194);
  95071. var _inputNumber2 = _interopRequireDefault(_inputNumber);
  95072. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95073. exports.default = _inputNumber2.default;
  95074. /***/ }),
  95075. /* 456 */
  95076. /***/ (function(module, exports, __webpack_require__) {
  95077. "use strict";
  95078. Object.defineProperty(exports, "__esModule", {
  95079. value: true
  95080. });
  95081. var render = function render() {
  95082. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [!_vm.controlsOutside ? _c('div', { class: _vm.handlerClasses }, [_c('a', { class: _vm.upClasses, on: { "click": _vm.up } }, [_c('span', { class: _vm.innerUpClasses, on: { "click": _vm.preventDefault } })]), _vm._v(" "), _c('a', { class: _vm.downClasses, on: { "click": _vm.down } }, [_c('span', { class: _vm.innerDownClasses, on: { "click": _vm.preventDefault } })])]) : _vm._e(), _vm._v(" "), _vm.controlsOutside ? _c('div', { staticClass: "ivu-input-number-controls-outside-btn ivu-input-number-controls-outside-down", class: { 'ivu-input-number-controls-outside-btn-disabled': _vm.downDisabled }, on: { "click": _vm.down } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-remove" })]) : _vm._e(), _vm._v(" "), _vm.controlsOutside ? _c('div', { staticClass: "ivu-input-number-controls-outside-btn ivu-input-number-controls-outside-up", class: { 'ivu-input-number-controls-outside-btn-disabled': _vm.upDisabled }, on: { "click": _vm.up } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-add" })]) : _vm._e(), _vm._v(" "), _c('div', { class: _vm.inputWrapClasses }, [_c('input', { class: _vm.inputClasses, attrs: { "id": _vm.elementId, "disabled": _vm.itemDisabled, "autocomplete": "off", "spellcheck": "false", "autofocus": _vm.autofocus, "readonly": _vm.readonly || !_vm.editable, "name": _vm.name, "placeholder": _vm.placeholder }, domProps: { "value": _vm.formatterValue }, on: { "focus": _vm.focus, "blur": _vm.blur, "keydown": function keydown($event) {
  95083. $event.stopPropagation();return _vm.keyDown($event);
  95084. }, "input": _vm.change, "mouseup": _vm.preventDefault, "change": _vm.change } })])]);
  95085. };
  95086. var staticRenderFns = [];
  95087. exports.render = render;
  95088. exports.staticRenderFns = staticRenderFns;
  95089. /***/ }),
  95090. /* 457 */
  95091. /***/ (function(module, exports, __webpack_require__) {
  95092. "use strict";
  95093. Object.defineProperty(exports, "__esModule", {
  95094. value: true
  95095. });
  95096. var _scroll = __webpack_require__(458);
  95097. var _scroll2 = _interopRequireDefault(_scroll);
  95098. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95099. exports.default = _scroll2.default;
  95100. /***/ }),
  95101. /* 458 */
  95102. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95103. "use strict";
  95104. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95105. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__ = __webpack_require__(196);
  95106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__);
  95107. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__ = __webpack_require__(467);
  95109. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__);
  95110. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95111. /* script */
  95112. /* template */
  95113. /* template functional */
  95114. var __vue_template_functional__ = false
  95115. /* styles */
  95116. var __vue_styles__ = null
  95117. /* scopeId */
  95118. var __vue_scopeId__ = null
  95119. /* moduleIdentifier (server only) */
  95120. var __vue_module_identifier__ = null
  95121. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95122. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_scroll_vue___default.a,
  95123. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__["render"],
  95124. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8b51c556_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_scroll_vue__["staticRenderFns"],
  95125. __vue_template_functional__,
  95126. __vue_styles__,
  95127. __vue_scopeId__,
  95128. __vue_module_identifier__
  95129. )
  95130. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95131. /***/ }),
  95132. /* 459 */
  95133. /***/ (function(module, exports, __webpack_require__) {
  95134. module.exports = { "default": __webpack_require__(460), __esModule: true };
  95135. /***/ }),
  95136. /* 460 */
  95137. /***/ (function(module, exports, __webpack_require__) {
  95138. __webpack_require__(461);
  95139. module.exports = __webpack_require__(5).Math.sign;
  95140. /***/ }),
  95141. /* 461 */
  95142. /***/ (function(module, exports, __webpack_require__) {
  95143. // 20.2.2.28 Math.sign(x)
  95144. var $export = __webpack_require__(7);
  95145. $export($export.S, 'Math', { sign: __webpack_require__(462) });
  95146. /***/ }),
  95147. /* 462 */
  95148. /***/ (function(module, exports) {
  95149. // 20.2.2.28 Math.sign(x)
  95150. module.exports = Math.sign || function sign(x) {
  95151. // eslint-disable-next-line no-self-compare
  95152. return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
  95153. };
  95154. /***/ }),
  95155. /* 463 */
  95156. /***/ (function(module, exports, __webpack_require__) {
  95157. /* WEBPACK VAR INJECTION */(function(global) {/**
  95158. * lodash (Custom Build) <https://lodash.com/>
  95159. * Build: `lodash modularize exports="npm" -o ./`
  95160. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  95161. * Released under MIT license <https://lodash.com/license>
  95162. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  95163. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  95164. */
  95165. /** Used as the `TypeError` message for "Functions" methods. */
  95166. var FUNC_ERROR_TEXT = 'Expected a function';
  95167. /** Used as references for various `Number` constants. */
  95168. var NAN = 0 / 0;
  95169. /** `Object#toString` result references. */
  95170. var symbolTag = '[object Symbol]';
  95171. /** Used to match leading and trailing whitespace. */
  95172. var reTrim = /^\s+|\s+$/g;
  95173. /** Used to detect bad signed hexadecimal string values. */
  95174. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  95175. /** Used to detect binary string values. */
  95176. var reIsBinary = /^0b[01]+$/i;
  95177. /** Used to detect octal string values. */
  95178. var reIsOctal = /^0o[0-7]+$/i;
  95179. /** Built-in method references without a dependency on `root`. */
  95180. var freeParseInt = parseInt;
  95181. /** Detect free variable `global` from Node.js. */
  95182. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  95183. /** Detect free variable `self`. */
  95184. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  95185. /** Used as a reference to the global object. */
  95186. var root = freeGlobal || freeSelf || Function('return this')();
  95187. /** Used for built-in method references. */
  95188. var objectProto = Object.prototype;
  95189. /**
  95190. * Used to resolve the
  95191. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  95192. * of values.
  95193. */
  95194. var objectToString = objectProto.toString;
  95195. /* Built-in method references for those with the same name as other `lodash` methods. */
  95196. var nativeMax = Math.max,
  95197. nativeMin = Math.min;
  95198. /**
  95199. * Gets the timestamp of the number of milliseconds that have elapsed since
  95200. * the Unix epoch (1 January 1970 00:00:00 UTC).
  95201. *
  95202. * @static
  95203. * @memberOf _
  95204. * @since 2.4.0
  95205. * @category Date
  95206. * @returns {number} Returns the timestamp.
  95207. * @example
  95208. *
  95209. * _.defer(function(stamp) {
  95210. * console.log(_.now() - stamp);
  95211. * }, _.now());
  95212. * // => Logs the number of milliseconds it took for the deferred invocation.
  95213. */
  95214. var now = function() {
  95215. return root.Date.now();
  95216. };
  95217. /**
  95218. * Creates a debounced function that delays invoking `func` until after `wait`
  95219. * milliseconds have elapsed since the last time the debounced function was
  95220. * invoked. The debounced function comes with a `cancel` method to cancel
  95221. * delayed `func` invocations and a `flush` method to immediately invoke them.
  95222. * Provide `options` to indicate whether `func` should be invoked on the
  95223. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  95224. * with the last arguments provided to the debounced function. Subsequent
  95225. * calls to the debounced function return the result of the last `func`
  95226. * invocation.
  95227. *
  95228. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  95229. * invoked on the trailing edge of the timeout only if the debounced function
  95230. * is invoked more than once during the `wait` timeout.
  95231. *
  95232. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  95233. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  95234. *
  95235. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  95236. * for details over the differences between `_.debounce` and `_.throttle`.
  95237. *
  95238. * @static
  95239. * @memberOf _
  95240. * @since 0.1.0
  95241. * @category Function
  95242. * @param {Function} func The function to debounce.
  95243. * @param {number} [wait=0] The number of milliseconds to delay.
  95244. * @param {Object} [options={}] The options object.
  95245. * @param {boolean} [options.leading=false]
  95246. * Specify invoking on the leading edge of the timeout.
  95247. * @param {number} [options.maxWait]
  95248. * The maximum time `func` is allowed to be delayed before it's invoked.
  95249. * @param {boolean} [options.trailing=true]
  95250. * Specify invoking on the trailing edge of the timeout.
  95251. * @returns {Function} Returns the new debounced function.
  95252. * @example
  95253. *
  95254. * // Avoid costly calculations while the window size is in flux.
  95255. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  95256. *
  95257. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  95258. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  95259. * 'leading': true,
  95260. * 'trailing': false
  95261. * }));
  95262. *
  95263. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  95264. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  95265. * var source = new EventSource('/stream');
  95266. * jQuery(source).on('message', debounced);
  95267. *
  95268. * // Cancel the trailing debounced invocation.
  95269. * jQuery(window).on('popstate', debounced.cancel);
  95270. */
  95271. function debounce(func, wait, options) {
  95272. var lastArgs,
  95273. lastThis,
  95274. maxWait,
  95275. result,
  95276. timerId,
  95277. lastCallTime,
  95278. lastInvokeTime = 0,
  95279. leading = false,
  95280. maxing = false,
  95281. trailing = true;
  95282. if (typeof func != 'function') {
  95283. throw new TypeError(FUNC_ERROR_TEXT);
  95284. }
  95285. wait = toNumber(wait) || 0;
  95286. if (isObject(options)) {
  95287. leading = !!options.leading;
  95288. maxing = 'maxWait' in options;
  95289. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  95290. trailing = 'trailing' in options ? !!options.trailing : trailing;
  95291. }
  95292. function invokeFunc(time) {
  95293. var args = lastArgs,
  95294. thisArg = lastThis;
  95295. lastArgs = lastThis = undefined;
  95296. lastInvokeTime = time;
  95297. result = func.apply(thisArg, args);
  95298. return result;
  95299. }
  95300. function leadingEdge(time) {
  95301. // Reset any `maxWait` timer.
  95302. lastInvokeTime = time;
  95303. // Start the timer for the trailing edge.
  95304. timerId = setTimeout(timerExpired, wait);
  95305. // Invoke the leading edge.
  95306. return leading ? invokeFunc(time) : result;
  95307. }
  95308. function remainingWait(time) {
  95309. var timeSinceLastCall = time - lastCallTime,
  95310. timeSinceLastInvoke = time - lastInvokeTime,
  95311. result = wait - timeSinceLastCall;
  95312. return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
  95313. }
  95314. function shouldInvoke(time) {
  95315. var timeSinceLastCall = time - lastCallTime,
  95316. timeSinceLastInvoke = time - lastInvokeTime;
  95317. // Either this is the first call, activity has stopped and we're at the
  95318. // trailing edge, the system time has gone backwards and we're treating
  95319. // it as the trailing edge, or we've hit the `maxWait` limit.
  95320. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  95321. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  95322. }
  95323. function timerExpired() {
  95324. var time = now();
  95325. if (shouldInvoke(time)) {
  95326. return trailingEdge(time);
  95327. }
  95328. // Restart the timer.
  95329. timerId = setTimeout(timerExpired, remainingWait(time));
  95330. }
  95331. function trailingEdge(time) {
  95332. timerId = undefined;
  95333. // Only invoke if we have `lastArgs` which means `func` has been
  95334. // debounced at least once.
  95335. if (trailing && lastArgs) {
  95336. return invokeFunc(time);
  95337. }
  95338. lastArgs = lastThis = undefined;
  95339. return result;
  95340. }
  95341. function cancel() {
  95342. if (timerId !== undefined) {
  95343. clearTimeout(timerId);
  95344. }
  95345. lastInvokeTime = 0;
  95346. lastArgs = lastCallTime = lastThis = timerId = undefined;
  95347. }
  95348. function flush() {
  95349. return timerId === undefined ? result : trailingEdge(now());
  95350. }
  95351. function debounced() {
  95352. var time = now(),
  95353. isInvoking = shouldInvoke(time);
  95354. lastArgs = arguments;
  95355. lastThis = this;
  95356. lastCallTime = time;
  95357. if (isInvoking) {
  95358. if (timerId === undefined) {
  95359. return leadingEdge(lastCallTime);
  95360. }
  95361. if (maxing) {
  95362. // Handle invocations in a tight loop.
  95363. timerId = setTimeout(timerExpired, wait);
  95364. return invokeFunc(lastCallTime);
  95365. }
  95366. }
  95367. if (timerId === undefined) {
  95368. timerId = setTimeout(timerExpired, wait);
  95369. }
  95370. return result;
  95371. }
  95372. debounced.cancel = cancel;
  95373. debounced.flush = flush;
  95374. return debounced;
  95375. }
  95376. /**
  95377. * Creates a throttled function that only invokes `func` at most once per
  95378. * every `wait` milliseconds. The throttled function comes with a `cancel`
  95379. * method to cancel delayed `func` invocations and a `flush` method to
  95380. * immediately invoke them. Provide `options` to indicate whether `func`
  95381. * should be invoked on the leading and/or trailing edge of the `wait`
  95382. * timeout. The `func` is invoked with the last arguments provided to the
  95383. * throttled function. Subsequent calls to the throttled function return the
  95384. * result of the last `func` invocation.
  95385. *
  95386. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  95387. * invoked on the trailing edge of the timeout only if the throttled function
  95388. * is invoked more than once during the `wait` timeout.
  95389. *
  95390. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  95391. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  95392. *
  95393. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  95394. * for details over the differences between `_.throttle` and `_.debounce`.
  95395. *
  95396. * @static
  95397. * @memberOf _
  95398. * @since 0.1.0
  95399. * @category Function
  95400. * @param {Function} func The function to throttle.
  95401. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  95402. * @param {Object} [options={}] The options object.
  95403. * @param {boolean} [options.leading=true]
  95404. * Specify invoking on the leading edge of the timeout.
  95405. * @param {boolean} [options.trailing=true]
  95406. * Specify invoking on the trailing edge of the timeout.
  95407. * @returns {Function} Returns the new throttled function.
  95408. * @example
  95409. *
  95410. * // Avoid excessively updating the position while scrolling.
  95411. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  95412. *
  95413. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  95414. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  95415. * jQuery(element).on('click', throttled);
  95416. *
  95417. * // Cancel the trailing throttled invocation.
  95418. * jQuery(window).on('popstate', throttled.cancel);
  95419. */
  95420. function throttle(func, wait, options) {
  95421. var leading = true,
  95422. trailing = true;
  95423. if (typeof func != 'function') {
  95424. throw new TypeError(FUNC_ERROR_TEXT);
  95425. }
  95426. if (isObject(options)) {
  95427. leading = 'leading' in options ? !!options.leading : leading;
  95428. trailing = 'trailing' in options ? !!options.trailing : trailing;
  95429. }
  95430. return debounce(func, wait, {
  95431. 'leading': leading,
  95432. 'maxWait': wait,
  95433. 'trailing': trailing
  95434. });
  95435. }
  95436. /**
  95437. * Checks if `value` is the
  95438. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  95439. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  95440. *
  95441. * @static
  95442. * @memberOf _
  95443. * @since 0.1.0
  95444. * @category Lang
  95445. * @param {*} value The value to check.
  95446. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  95447. * @example
  95448. *
  95449. * _.isObject({});
  95450. * // => true
  95451. *
  95452. * _.isObject([1, 2, 3]);
  95453. * // => true
  95454. *
  95455. * _.isObject(_.noop);
  95456. * // => true
  95457. *
  95458. * _.isObject(null);
  95459. * // => false
  95460. */
  95461. function isObject(value) {
  95462. var type = typeof value;
  95463. return !!value && (type == 'object' || type == 'function');
  95464. }
  95465. /**
  95466. * Checks if `value` is object-like. A value is object-like if it's not `null`
  95467. * and has a `typeof` result of "object".
  95468. *
  95469. * @static
  95470. * @memberOf _
  95471. * @since 4.0.0
  95472. * @category Lang
  95473. * @param {*} value The value to check.
  95474. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  95475. * @example
  95476. *
  95477. * _.isObjectLike({});
  95478. * // => true
  95479. *
  95480. * _.isObjectLike([1, 2, 3]);
  95481. * // => true
  95482. *
  95483. * _.isObjectLike(_.noop);
  95484. * // => false
  95485. *
  95486. * _.isObjectLike(null);
  95487. * // => false
  95488. */
  95489. function isObjectLike(value) {
  95490. return !!value && typeof value == 'object';
  95491. }
  95492. /**
  95493. * Checks if `value` is classified as a `Symbol` primitive or object.
  95494. *
  95495. * @static
  95496. * @memberOf _
  95497. * @since 4.0.0
  95498. * @category Lang
  95499. * @param {*} value The value to check.
  95500. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  95501. * @example
  95502. *
  95503. * _.isSymbol(Symbol.iterator);
  95504. * // => true
  95505. *
  95506. * _.isSymbol('abc');
  95507. * // => false
  95508. */
  95509. function isSymbol(value) {
  95510. return typeof value == 'symbol' ||
  95511. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  95512. }
  95513. /**
  95514. * Converts `value` to a number.
  95515. *
  95516. * @static
  95517. * @memberOf _
  95518. * @since 4.0.0
  95519. * @category Lang
  95520. * @param {*} value The value to process.
  95521. * @returns {number} Returns the number.
  95522. * @example
  95523. *
  95524. * _.toNumber(3.2);
  95525. * // => 3.2
  95526. *
  95527. * _.toNumber(Number.MIN_VALUE);
  95528. * // => 5e-324
  95529. *
  95530. * _.toNumber(Infinity);
  95531. * // => Infinity
  95532. *
  95533. * _.toNumber('3.2');
  95534. * // => 3.2
  95535. */
  95536. function toNumber(value) {
  95537. if (typeof value == 'number') {
  95538. return value;
  95539. }
  95540. if (isSymbol(value)) {
  95541. return NAN;
  95542. }
  95543. if (isObject(value)) {
  95544. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  95545. value = isObject(other) ? (other + '') : other;
  95546. }
  95547. if (typeof value != 'string') {
  95548. return value === 0 ? value : +value;
  95549. }
  95550. value = value.replace(reTrim, '');
  95551. var isBinary = reIsBinary.test(value);
  95552. return (isBinary || reIsOctal.test(value))
  95553. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  95554. : (reIsBadHex.test(value) ? NAN : +value);
  95555. }
  95556. module.exports = throttle;
  95557. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(117)))
  95558. /***/ }),
  95559. /* 464 */
  95560. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95561. "use strict";
  95562. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95563. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__ = __webpack_require__(197);
  95564. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__);
  95565. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95566. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__ = __webpack_require__(466);
  95567. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__);
  95568. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95569. /* script */
  95570. /* template */
  95571. /* template functional */
  95572. var __vue_template_functional__ = false
  95573. /* styles */
  95574. var __vue_styles__ = null
  95575. /* scopeId */
  95576. var __vue_scopeId__ = null
  95577. /* moduleIdentifier (server only) */
  95578. var __vue_module_identifier__ = null
  95579. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95580. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_component_vue___default.a,
  95581. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__["render"],
  95582. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4cec29bd_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_component_vue__["staticRenderFns"],
  95583. __vue_template_functional__,
  95584. __vue_styles__,
  95585. __vue_scopeId__,
  95586. __vue_module_identifier__
  95587. )
  95588. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95589. /***/ }),
  95590. /* 465 */
  95591. /***/ (function(module, exports, __webpack_require__) {
  95592. "use strict";
  95593. Object.defineProperty(exports, "__esModule", {
  95594. value: true
  95595. });
  95596. var render = function render() {
  95597. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": "fade" } }, [_vm.fullscreenVisible ? _c('div', { class: _vm.classes }, [_c('div', { class: _vm.mainClasses }, [_c('span', { class: _vm.dotClasses }), _vm._v(" "), _c('div', { class: _vm.textClasses }, [_vm._t("default")], 2)])]) : _vm._e()]);
  95598. };
  95599. var staticRenderFns = [];
  95600. exports.render = render;
  95601. exports.staticRenderFns = staticRenderFns;
  95602. /***/ }),
  95603. /* 466 */
  95604. /***/ (function(module, exports, __webpack_require__) {
  95605. "use strict";
  95606. Object.defineProperty(exports, "__esModule", {
  95607. value: true
  95608. });
  95609. var render = function render() {
  95610. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapperClasses }, [_c('div', { class: _vm.spinnerClasses }, [_c('Spin', { attrs: { "fix": "" } }, [_c('Icon', { class: _vm.iconClasses, attrs: { "type": "ios-loading", "size": "18" } }), _vm._v(" "), _vm.text ? _c('div', { class: _vm.textClasses }, [_vm._v(_vm._s(_vm.text))]) : _vm._e()], 1)], 1)]);
  95611. };
  95612. var staticRenderFns = [];
  95613. exports.render = render;
  95614. exports.staticRenderFns = staticRenderFns;
  95615. /***/ }),
  95616. /* 467 */
  95617. /***/ (function(module, exports, __webpack_require__) {
  95618. "use strict";
  95619. Object.defineProperty(exports, "__esModule", {
  95620. value: true
  95621. });
  95622. var render = function render() {
  95623. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, staticStyle: { "touch-action": "none" } }, [_c('div', { ref: "scrollContainer", class: _vm.scrollContainerClasses, style: { height: _vm.height + 'px' }, on: { "scroll": _vm.handleScroll, "wheel": _vm.onWheel, "touchstart": _vm.onPointerDown } }, [_c('div', { ref: "toploader", class: _vm.loaderClasses, style: { paddingTop: _vm.wrapperPadding.paddingTop } }, [_c('loader', { attrs: { "text": _vm.localeLoadingText, "active": _vm.showTopLoader } })], 1), _vm._v(" "), _c('div', { ref: "scrollContent", class: _vm.slotContainerClasses }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { ref: "bottomLoader", class: _vm.loaderClasses, style: { paddingBottom: _vm.wrapperPadding.paddingBottom } }, [_c('loader', { attrs: { "text": _vm.localeLoadingText, "active": _vm.showBottomLoader } })], 1)])]);
  95624. };
  95625. var staticRenderFns = [];
  95626. exports.render = render;
  95627. exports.staticRenderFns = staticRenderFns;
  95628. /***/ }),
  95629. /* 468 */
  95630. /***/ (function(module, exports, __webpack_require__) {
  95631. "use strict";
  95632. Object.defineProperty(exports, "__esModule", {
  95633. value: true
  95634. });
  95635. var _split = __webpack_require__(469);
  95636. var _split2 = _interopRequireDefault(_split);
  95637. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95638. exports.default = _split2.default;
  95639. /***/ }),
  95640. /* 469 */
  95641. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95642. "use strict";
  95643. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__ = __webpack_require__(199);
  95645. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__);
  95646. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__ = __webpack_require__(472);
  95648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__);
  95649. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95650. /* script */
  95651. /* template */
  95652. /* template functional */
  95653. var __vue_template_functional__ = false
  95654. /* styles */
  95655. var __vue_styles__ = null
  95656. /* scopeId */
  95657. var __vue_scopeId__ = null
  95658. /* moduleIdentifier (server only) */
  95659. var __vue_module_identifier__ = null
  95660. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95661. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_split_vue___default.a,
  95662. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__["render"],
  95663. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_70c87a13_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_split_vue__["staticRenderFns"],
  95664. __vue_template_functional__,
  95665. __vue_styles__,
  95666. __vue_scopeId__,
  95667. __vue_module_identifier__
  95668. )
  95669. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95670. /***/ }),
  95671. /* 470 */
  95672. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95673. "use strict";
  95674. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95675. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__ = __webpack_require__(200);
  95676. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__);
  95677. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95678. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__ = __webpack_require__(471);
  95679. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__);
  95680. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95681. /* script */
  95682. /* template */
  95683. /* template functional */
  95684. var __vue_template_functional__ = false
  95685. /* styles */
  95686. var __vue_styles__ = null
  95687. /* scopeId */
  95688. var __vue_scopeId__ = null
  95689. /* moduleIdentifier (server only) */
  95690. var __vue_module_identifier__ = null
  95691. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95692. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_trigger_vue___default.a,
  95693. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__["render"],
  95694. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0291c3a0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_trigger_vue__["staticRenderFns"],
  95695. __vue_template_functional__,
  95696. __vue_styles__,
  95697. __vue_scopeId__,
  95698. __vue_module_identifier__
  95699. )
  95700. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95701. /***/ }),
  95702. /* 471 */
  95703. /***/ (function(module, exports, __webpack_require__) {
  95704. "use strict";
  95705. Object.defineProperty(exports, "__esModule", {
  95706. value: true
  95707. });
  95708. var render = function render() {
  95709. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_c('div', { class: _vm.barConClasses }, _vm._m(0), 0)]);
  95710. };
  95711. var staticRenderFns = [function () {
  95712. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm._l(8, function (i) {
  95713. return _c('i', { key: "trigger-" + i, class: _vm.prefix + "-bar" });
  95714. });
  95715. }];
  95716. exports.render = render;
  95717. exports.staticRenderFns = staticRenderFns;
  95718. /***/ }),
  95719. /* 472 */
  95720. /***/ (function(module, exports, __webpack_require__) {
  95721. "use strict";
  95722. Object.defineProperty(exports, "__esModule", {
  95723. value: true
  95724. });
  95725. var render = function render() {
  95726. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "outerWrapper", class: _vm.wrapperClasses }, [_vm.isHorizontal ? _c('div', { class: _vm.prefix + "-horizontal" }, [_c('div', { staticClass: "left-pane", class: _vm.paneClasses, style: { right: _vm.anotherOffset + "%" } }, [_vm._t("left")], 2), _vm._v(" "), _c('div', { class: _vm.prefix + "-trigger-con", style: { left: _vm.offset + "%" }, on: { "mousedown": _vm.handleMousedown } }, [_vm._t("trigger", [_c('trigger', { attrs: { "mode": "vertical" } })])], 2), _vm._v(" "), _c('div', { staticClass: "right-pane", class: _vm.paneClasses, style: { left: _vm.offset + "%" } }, [_vm._t("right")], 2)]) : _c('div', { class: _vm.prefix + "-vertical" }, [_c('div', { staticClass: "top-pane", class: _vm.paneClasses, style: { bottom: _vm.anotherOffset + "%" } }, [_vm._t("top")], 2), _vm._v(" "), _c('div', { class: _vm.prefix + "-trigger-con", style: { top: _vm.offset + "%" }, on: { "mousedown": _vm.handleMousedown } }, [_vm._t("trigger", [_c('trigger', { attrs: { "mode": "horizontal" } })])], 2), _vm._v(" "), _c('div', { staticClass: "bottom-pane", class: _vm.paneClasses, style: { top: _vm.offset + "%" } }, [_vm._t("bottom")], 2)])]);
  95727. };
  95728. var staticRenderFns = [];
  95729. exports.render = render;
  95730. exports.staticRenderFns = staticRenderFns;
  95731. /***/ }),
  95732. /* 473 */
  95733. /***/ (function(module, exports, __webpack_require__) {
  95734. "use strict";
  95735. Object.defineProperty(exports, "__esModule", {
  95736. value: true
  95737. });
  95738. var _layout = __webpack_require__(474);
  95739. var _layout2 = _interopRequireDefault(_layout);
  95740. var _header = __webpack_require__(192);
  95741. var _header2 = _interopRequireDefault(_header);
  95742. var _sider = __webpack_require__(202);
  95743. var _sider2 = _interopRequireDefault(_sider);
  95744. var _content = __webpack_require__(155);
  95745. var _content2 = _interopRequireDefault(_content);
  95746. var _footer = __webpack_require__(182);
  95747. var _footer2 = _interopRequireDefault(_footer);
  95748. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95749. _layout2.default.Header = _header2.default;
  95750. _layout2.default.Sider = _sider2.default;
  95751. _layout2.default.Content = _content2.default;
  95752. _layout2.default.Footer = _footer2.default;
  95753. exports.default = _layout2.default;
  95754. /***/ }),
  95755. /* 474 */
  95756. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95757. "use strict";
  95758. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95759. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__ = __webpack_require__(201);
  95760. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__);
  95761. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95762. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__ = __webpack_require__(475);
  95763. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__);
  95764. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95765. /* script */
  95766. /* template */
  95767. /* template functional */
  95768. var __vue_template_functional__ = false
  95769. /* styles */
  95770. var __vue_styles__ = null
  95771. /* scopeId */
  95772. var __vue_scopeId__ = null
  95773. /* moduleIdentifier (server only) */
  95774. var __vue_module_identifier__ = null
  95775. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95776. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_layout_vue___default.a,
  95777. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__["render"],
  95778. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_56315e54_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_layout_vue__["staticRenderFns"],
  95779. __vue_template_functional__,
  95780. __vue_styles__,
  95781. __vue_scopeId__,
  95782. __vue_module_identifier__
  95783. )
  95784. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95785. /***/ }),
  95786. /* 475 */
  95787. /***/ (function(module, exports, __webpack_require__) {
  95788. "use strict";
  95789. Object.defineProperty(exports, "__esModule", {
  95790. value: true
  95791. });
  95792. var render = function render() {
  95793. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_vm._t("default")], 2);
  95794. };
  95795. var staticRenderFns = [];
  95796. exports.render = render;
  95797. exports.staticRenderFns = staticRenderFns;
  95798. /***/ }),
  95799. /* 476 */
  95800. /***/ (function(module, exports, __webpack_require__) {
  95801. "use strict";
  95802. Object.defineProperty(exports, "__esModule", {
  95803. value: true
  95804. });
  95805. var render = function render() {
  95806. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses, style: _vm.wrapStyles }, [_c('span', { directives: [{ name: "show", rawName: "v-show", value: _vm.showZeroTrigger, expression: "showZeroTrigger" }], class: _vm.zeroWidthTriggerClasses, on: { "click": _vm.toggleCollapse } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-menu" })]), _vm._v(" "), _c('div', { class: _vm.childClasses }, [_vm._t("default")], 2), _vm._v(" "), _vm._t("trigger", [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showBottomTrigger, expression: "showBottomTrigger" }], class: _vm.triggerClasses, style: { width: _vm.siderWidth + 'px' }, on: { "click": _vm.toggleCollapse } }, [_c('i', { class: _vm.triggerIconClasses })])])], 2);
  95807. };
  95808. var staticRenderFns = [];
  95809. exports.render = render;
  95810. exports.staticRenderFns = staticRenderFns;
  95811. /***/ }),
  95812. /* 477 */
  95813. /***/ (function(module, exports, __webpack_require__) {
  95814. "use strict";
  95815. Object.defineProperty(exports, "__esModule", {
  95816. value: true
  95817. });
  95818. var _list = __webpack_require__(478);
  95819. var _list2 = _interopRequireDefault(_list);
  95820. var _listItem = __webpack_require__(480);
  95821. var _listItem2 = _interopRequireDefault(_listItem);
  95822. var _listItemMeta = __webpack_require__(482);
  95823. var _listItemMeta2 = _interopRequireDefault(_listItemMeta);
  95824. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95825. _list2.default.Item = _listItem2.default;
  95826. _list2.default.Item.Meta = _listItemMeta2.default;
  95827. exports.default = _list2.default;
  95828. /***/ }),
  95829. /* 478 */
  95830. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95831. "use strict";
  95832. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95833. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__ = __webpack_require__(204);
  95834. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__);
  95835. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95836. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__ = __webpack_require__(479);
  95837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__);
  95838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95839. /* script */
  95840. /* template */
  95841. /* template functional */
  95842. var __vue_template_functional__ = false
  95843. /* styles */
  95844. var __vue_styles__ = null
  95845. /* scopeId */
  95846. var __vue_scopeId__ = null
  95847. /* moduleIdentifier (server only) */
  95848. var __vue_module_identifier__ = null
  95849. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95850. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default.a,
  95851. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["render"],
  95852. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3c78b22c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["staticRenderFns"],
  95853. __vue_template_functional__,
  95854. __vue_styles__,
  95855. __vue_scopeId__,
  95856. __vue_module_identifier__
  95857. )
  95858. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95859. /***/ }),
  95860. /* 479 */
  95861. /***/ (function(module, exports, __webpack_require__) {
  95862. "use strict";
  95863. Object.defineProperty(exports, "__esModule", {
  95864. value: true
  95865. });
  95866. var render = function render() {
  95867. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm.header || _vm.$slots.header ? _c('div', { staticClass: "ivu-list-header" }, [_vm._t("header", [_vm._v(_vm._s(_vm.header))])], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-container" }, [_c('ul', { staticClass: "ivu-list-items" }, [_vm._t("default")], 2)]), _vm._v(" "), _vm.loading ? _c('Spin', { attrs: { "fix": "", "size": "large" } }, [_vm._t("spin")], 2) : _vm._e(), _vm._v(" "), _vm.footer || _vm.$slots.footer ? _c('div', { staticClass: "ivu-list-footer" }, [_vm._t("footer", [_vm._v(_vm._s(_vm.footer))])], 2) : _vm._e()], 1);
  95868. };
  95869. var staticRenderFns = [];
  95870. exports.render = render;
  95871. exports.staticRenderFns = staticRenderFns;
  95872. /***/ }),
  95873. /* 480 */
  95874. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95875. "use strict";
  95876. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95877. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__ = __webpack_require__(205);
  95878. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__);
  95879. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95880. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__ = __webpack_require__(481);
  95881. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__);
  95882. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95883. /* script */
  95884. /* template */
  95885. /* template functional */
  95886. var __vue_template_functional__ = false
  95887. /* styles */
  95888. var __vue_styles__ = null
  95889. /* scopeId */
  95890. var __vue_scopeId__ = null
  95891. /* moduleIdentifier (server only) */
  95892. var __vue_module_identifier__ = null
  95893. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95894. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_vue___default.a,
  95895. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__["render"],
  95896. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3e180205_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_vue__["staticRenderFns"],
  95897. __vue_template_functional__,
  95898. __vue_styles__,
  95899. __vue_scopeId__,
  95900. __vue_module_identifier__
  95901. )
  95902. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95903. /***/ }),
  95904. /* 481 */
  95905. /***/ (function(module, exports, __webpack_require__) {
  95906. "use strict";
  95907. Object.defineProperty(exports, "__esModule", {
  95908. value: true
  95909. });
  95910. var render = function render() {
  95911. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { staticClass: "ivu-list-item", class: _vm.classes }, [_vm.itemLayout === 'vertical' && _vm.$slots.extra ? [_c('div', { staticClass: "ivu-list-item-main" }, [_vm._t("default"), _vm._v(" "), _vm.$slots.action ? _c('ul', { staticClass: "ivu-list-item-action" }, [_vm._t("action")], 2) : _vm._e()], 2), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-extra" }, [_vm._t("extra")], 2)] : [_vm._t("default"), _vm._v(" "), _vm.$slots.action ? _c('ul', { staticClass: "ivu-list-item-action" }, [_vm._t("action")], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-extra" }, [_vm._t("extra")], 2)]], 2);
  95912. };
  95913. var staticRenderFns = [];
  95914. exports.render = render;
  95915. exports.staticRenderFns = staticRenderFns;
  95916. /***/ }),
  95917. /* 482 */
  95918. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  95919. "use strict";
  95920. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  95921. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__ = __webpack_require__(206);
  95922. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__);
  95923. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  95924. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__ = __webpack_require__(483);
  95925. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__);
  95926. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  95927. /* script */
  95928. /* template */
  95929. /* template functional */
  95930. var __vue_template_functional__ = false
  95931. /* styles */
  95932. var __vue_styles__ = null
  95933. /* scopeId */
  95934. var __vue_scopeId__ = null
  95935. /* moduleIdentifier (server only) */
  95936. var __vue_module_identifier__ = null
  95937. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  95938. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_item_meta_vue___default.a,
  95939. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__["render"],
  95940. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_52a75980_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_item_meta_vue__["staticRenderFns"],
  95941. __vue_template_functional__,
  95942. __vue_styles__,
  95943. __vue_scopeId__,
  95944. __vue_module_identifier__
  95945. )
  95946. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  95947. /***/ }),
  95948. /* 483 */
  95949. /***/ (function(module, exports, __webpack_require__) {
  95950. "use strict";
  95951. Object.defineProperty(exports, "__esModule", {
  95952. value: true
  95953. });
  95954. var render = function render() {
  95955. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticClass: "ivu-list-item-meta" }, [_vm.avatar || _vm.$slots.avatar ? _c('div', { staticClass: "ivu-list-item-meta-avatar" }, [_vm._t("avatar", [_c('Avatar', { attrs: { "src": _vm.avatar } })])], 2) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-list-item-meta-content" }, [_vm.title || _vm.$slots.title ? _c('div', { staticClass: "ivu-list-item-meta-title" }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2) : _vm._e(), _vm._v(" "), _vm.description || _vm.$slots.description ? _c('div', { staticClass: "ivu-list-item-meta-description" }, [_vm._t("description", [_vm._v(_vm._s(_vm.description))])], 2) : _vm._e()])]);
  95956. };
  95957. var staticRenderFns = [];
  95958. exports.render = render;
  95959. exports.staticRenderFns = staticRenderFns;
  95960. /***/ }),
  95961. /* 484 */
  95962. /***/ (function(module, exports, __webpack_require__) {
  95963. "use strict";
  95964. Object.defineProperty(exports, "__esModule", {
  95965. value: true
  95966. });
  95967. var _newArrowCheck2 = __webpack_require__(1);
  95968. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  95969. var _loadingBar = __webpack_require__(485);
  95970. var _loadingBar2 = _interopRequireDefault(_loadingBar);
  95971. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  95972. var loadingBarInstance = void 0;
  95973. var color = 'primary';
  95974. var duration = 800;
  95975. var failedColor = 'error';
  95976. var height = 2;
  95977. var timer = void 0;
  95978. function getLoadingBarInstance() {
  95979. loadingBarInstance = loadingBarInstance || _loadingBar2.default.newInstance({
  95980. color: color,
  95981. failedColor: failedColor,
  95982. height: height
  95983. });
  95984. return loadingBarInstance;
  95985. }
  95986. function _update(options) {
  95987. var instance = getLoadingBarInstance();
  95988. instance.update(options);
  95989. }
  95990. function hide() {
  95991. var _this = this;
  95992. setTimeout(function () {
  95993. (0, _newArrowCheck3.default)(this, _this);
  95994. _update({
  95995. show: false
  95996. });
  95997. setTimeout(function () {
  95998. (0, _newArrowCheck3.default)(this, _this);
  95999. _update({
  96000. percent: 0
  96001. });
  96002. }.bind(this), 200);
  96003. }.bind(this), duration);
  96004. }
  96005. function clearTimer() {
  96006. if (timer) {
  96007. clearInterval(timer);
  96008. timer = null;
  96009. }
  96010. }
  96011. exports.default = {
  96012. start: function start() {
  96013. var _this2 = this;
  96014. if (timer) return;
  96015. var percent = 0;
  96016. _update({
  96017. percent: percent,
  96018. status: 'success',
  96019. show: true
  96020. });
  96021. timer = setInterval(function () {
  96022. (0, _newArrowCheck3.default)(this, _this2);
  96023. percent += Math.floor(Math.random() * 3 + 1);
  96024. if (percent > 95) {
  96025. clearTimer();
  96026. }
  96027. _update({
  96028. percent: percent,
  96029. status: 'success',
  96030. show: true
  96031. });
  96032. }.bind(this), 200);
  96033. },
  96034. update: function update(percent) {
  96035. clearTimer();
  96036. _update({
  96037. percent: percent,
  96038. status: 'success',
  96039. show: true
  96040. });
  96041. },
  96042. finish: function finish() {
  96043. clearTimer();
  96044. _update({
  96045. percent: 100,
  96046. status: 'success',
  96047. show: true
  96048. });
  96049. hide();
  96050. },
  96051. error: function error() {
  96052. clearTimer();
  96053. _update({
  96054. percent: 100,
  96055. status: 'error',
  96056. show: true
  96057. });
  96058. hide();
  96059. },
  96060. config: function config(options) {
  96061. if (options.color) {
  96062. color = options.color;
  96063. }
  96064. if (options.duration) {
  96065. duration = options.duration;
  96066. }
  96067. if (options.failedColor) {
  96068. failedColor = options.failedColor;
  96069. }
  96070. if (options.height) {
  96071. height = options.height;
  96072. }
  96073. },
  96074. destroy: function destroy() {
  96075. clearTimer();
  96076. var instance = getLoadingBarInstance();
  96077. loadingBarInstance = null;
  96078. instance.destroy();
  96079. }
  96080. };
  96081. /***/ }),
  96082. /* 485 */
  96083. /***/ (function(module, exports, __webpack_require__) {
  96084. "use strict";
  96085. Object.defineProperty(exports, "__esModule", {
  96086. value: true
  96087. });
  96088. var _newArrowCheck2 = __webpack_require__(1);
  96089. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  96090. var _loadingBar = __webpack_require__(486);
  96091. var _loadingBar2 = _interopRequireDefault(_loadingBar);
  96092. var _vue = __webpack_require__(16);
  96093. var _vue2 = _interopRequireDefault(_vue);
  96094. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96095. _loadingBar2.default.newInstance = function (properties) {
  96096. (0, _newArrowCheck3.default)(undefined, undefined);
  96097. var _props = properties || {};
  96098. var Instance = new _vue2.default({
  96099. data: _props,
  96100. render: function render(h) {
  96101. return h(_loadingBar2.default, {
  96102. props: _props
  96103. });
  96104. }
  96105. });
  96106. var component = Instance.$mount();
  96107. document.body.appendChild(component.$el);
  96108. var loading_bar = Instance.$children[0];
  96109. return {
  96110. update: function update(options) {
  96111. if ('percent' in options) {
  96112. loading_bar.percent = options.percent;
  96113. }
  96114. if (options.status) {
  96115. loading_bar.status = options.status;
  96116. }
  96117. if ('show' in options) {
  96118. loading_bar.show = options.show;
  96119. }
  96120. },
  96121. component: loading_bar,
  96122. destroy: function destroy() {
  96123. document.body.removeChild(document.getElementsByClassName('ivu-loading-bar')[0]);
  96124. }
  96125. };
  96126. }.bind(undefined);
  96127. exports.default = _loadingBar2.default;
  96128. /***/ }),
  96129. /* 486 */
  96130. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96131. "use strict";
  96132. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96133. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__ = __webpack_require__(207);
  96134. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__);
  96135. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96136. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__ = __webpack_require__(487);
  96137. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__);
  96138. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96139. /* script */
  96140. /* template */
  96141. /* template functional */
  96142. var __vue_template_functional__ = false
  96143. /* styles */
  96144. var __vue_styles__ = null
  96145. /* scopeId */
  96146. var __vue_scopeId__ = null
  96147. /* moduleIdentifier (server only) */
  96148. var __vue_module_identifier__ = null
  96149. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96150. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_loading_bar_vue___default.a,
  96151. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__["render"],
  96152. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_538863ac_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_loading_bar_vue__["staticRenderFns"],
  96153. __vue_template_functional__,
  96154. __vue_styles__,
  96155. __vue_scopeId__,
  96156. __vue_module_identifier__
  96157. )
  96158. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96159. /***/ }),
  96160. /* 487 */
  96161. /***/ (function(module, exports, __webpack_require__) {
  96162. "use strict";
  96163. Object.defineProperty(exports, "__esModule", {
  96164. value: true
  96165. });
  96166. var render = function render() {
  96167. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.show, expression: "show" }], class: _vm.classes, style: _vm.outerStyles }, [_c('div', { class: _vm.innerClasses, style: _vm.styles })])]);
  96168. };
  96169. var staticRenderFns = [];
  96170. exports.render = render;
  96171. exports.staticRenderFns = staticRenderFns;
  96172. /***/ }),
  96173. /* 488 */
  96174. /***/ (function(module, exports, __webpack_require__) {
  96175. "use strict";
  96176. Object.defineProperty(exports, "__esModule", {
  96177. value: true
  96178. });
  96179. var _menu = __webpack_require__(489);
  96180. var _menu2 = _interopRequireDefault(_menu);
  96181. var _menuGroup = __webpack_require__(491);
  96182. var _menuGroup2 = _interopRequireDefault(_menuGroup);
  96183. var _menuItem = __webpack_require__(493);
  96184. var _menuItem2 = _interopRequireDefault(_menuItem);
  96185. var _submenu = __webpack_require__(495);
  96186. var _submenu2 = _interopRequireDefault(_submenu);
  96187. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96188. _menu2.default.Group = _menuGroup2.default;
  96189. _menu2.default.Item = _menuItem2.default;
  96190. _menu2.default.Sub = _submenu2.default;
  96191. exports.default = _menu2.default;
  96192. /***/ }),
  96193. /* 489 */
  96194. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96195. "use strict";
  96196. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96197. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__ = __webpack_require__(208);
  96198. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__);
  96199. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96200. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__ = __webpack_require__(490);
  96201. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__);
  96202. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96203. /* script */
  96204. /* template */
  96205. /* template functional */
  96206. var __vue_template_functional__ = false
  96207. /* styles */
  96208. var __vue_styles__ = null
  96209. /* scopeId */
  96210. var __vue_scopeId__ = null
  96211. /* moduleIdentifier (server only) */
  96212. var __vue_module_identifier__ = null
  96213. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96214. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_vue___default.a,
  96215. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__["render"],
  96216. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_16a703f2_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_vue__["staticRenderFns"],
  96217. __vue_template_functional__,
  96218. __vue_styles__,
  96219. __vue_scopeId__,
  96220. __vue_module_identifier__
  96221. )
  96222. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96223. /***/ }),
  96224. /* 490 */
  96225. /***/ (function(module, exports, __webpack_require__) {
  96226. "use strict";
  96227. Object.defineProperty(exports, "__esModule", {
  96228. value: true
  96229. });
  96230. var render = function render() {
  96231. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
  96232. };
  96233. var staticRenderFns = [];
  96234. exports.render = render;
  96235. exports.staticRenderFns = staticRenderFns;
  96236. /***/ }),
  96237. /* 491 */
  96238. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96239. "use strict";
  96240. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__ = __webpack_require__(209);
  96242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__);
  96243. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__ = __webpack_require__(492);
  96245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__);
  96246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96247. /* script */
  96248. /* template */
  96249. /* template functional */
  96250. var __vue_template_functional__ = false
  96251. /* styles */
  96252. var __vue_styles__ = null
  96253. /* scopeId */
  96254. var __vue_scopeId__ = null
  96255. /* moduleIdentifier (server only) */
  96256. var __vue_module_identifier__ = null
  96257. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96258. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_group_vue___default.a,
  96259. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__["render"],
  96260. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7e247e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_group_vue__["staticRenderFns"],
  96261. __vue_template_functional__,
  96262. __vue_styles__,
  96263. __vue_scopeId__,
  96264. __vue_module_identifier__
  96265. )
  96266. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96267. /***/ }),
  96268. /* 492 */
  96269. /***/ (function(module, exports, __webpack_require__) {
  96270. "use strict";
  96271. Object.defineProperty(exports, "__esModule", {
  96272. value: true
  96273. });
  96274. var render = function render() {
  96275. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: [_vm.prefixCls + '-item-group'] }, [_c('div', { class: [_vm.prefixCls + '-item-group-title'], style: _vm.groupStyle }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c('ul', [_vm._t("default")], 2)]);
  96276. };
  96277. var staticRenderFns = [];
  96278. exports.render = render;
  96279. exports.staticRenderFns = staticRenderFns;
  96280. /***/ }),
  96281. /* 493 */
  96282. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96283. "use strict";
  96284. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96285. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__ = __webpack_require__(210);
  96286. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__);
  96287. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96288. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__ = __webpack_require__(494);
  96289. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__);
  96290. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96291. /* script */
  96292. /* template */
  96293. /* template functional */
  96294. var __vue_template_functional__ = false
  96295. /* styles */
  96296. var __vue_styles__ = null
  96297. /* scopeId */
  96298. var __vue_scopeId__ = null
  96299. /* moduleIdentifier (server only) */
  96300. var __vue_module_identifier__ = null
  96301. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96302. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_menu_item_vue___default.a,
  96303. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__["render"],
  96304. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1709792e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_menu_item_vue__["staticRenderFns"],
  96305. __vue_template_functional__,
  96306. __vue_styles__,
  96307. __vue_scopeId__,
  96308. __vue_module_identifier__
  96309. )
  96310. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96311. /***/ }),
  96312. /* 494 */
  96313. /***/ (function(module, exports, __webpack_require__) {
  96314. "use strict";
  96315. Object.defineProperty(exports, "__esModule", {
  96316. value: true
  96317. });
  96318. var render = function render() {
  96319. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.to ? _c('a', { class: _vm.classes, style: _vm.itemStyle, attrs: { "href": _vm.linkUrl, "target": _vm.target }, on: { "click": [function ($event) {
  96320. if ($event.ctrlKey || $event.shiftKey || $event.altKey || $event.metaKey) {
  96321. return null;
  96322. }return _vm.handleClickItem($event, false);
  96323. }, function ($event) {
  96324. if (!$event.ctrlKey) {
  96325. return null;
  96326. }return _vm.handleClickItem($event, true);
  96327. }, function ($event) {
  96328. if (!$event.metaKey) {
  96329. return null;
  96330. }return _vm.handleClickItem($event, true);
  96331. }] } }, [_vm._t("default")], 2) : _c('li', { class: _vm.classes, style: _vm.itemStyle, on: { "click": function click($event) {
  96332. $event.stopPropagation();return _vm.handleClickItem($event);
  96333. } } }, [_vm._t("default")], 2);
  96334. };
  96335. var staticRenderFns = [];
  96336. exports.render = render;
  96337. exports.staticRenderFns = staticRenderFns;
  96338. /***/ }),
  96339. /* 495 */
  96340. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96341. "use strict";
  96342. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96343. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__ = __webpack_require__(211);
  96344. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__);
  96345. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96346. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__ = __webpack_require__(496);
  96347. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__);
  96348. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96349. /* script */
  96350. /* template */
  96351. /* template functional */
  96352. var __vue_template_functional__ = false
  96353. /* styles */
  96354. var __vue_styles__ = null
  96355. /* scopeId */
  96356. var __vue_scopeId__ = null
  96357. /* moduleIdentifier (server only) */
  96358. var __vue_module_identifier__ = null
  96359. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96360. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_submenu_vue___default.a,
  96361. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__["render"],
  96362. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a1f8bd1a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_submenu_vue__["staticRenderFns"],
  96363. __vue_template_functional__,
  96364. __vue_styles__,
  96365. __vue_scopeId__,
  96366. __vue_module_identifier__
  96367. )
  96368. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96369. /***/ }),
  96370. /* 496 */
  96371. /***/ (function(module, exports, __webpack_require__) {
  96372. "use strict";
  96373. Object.defineProperty(exports, "__esModule", {
  96374. value: true
  96375. });
  96376. var render = function render() {
  96377. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.classes, on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-submenu-title'], style: _vm.titleStyle, on: { "click": function click($event) {
  96378. $event.stopPropagation();return _vm.handleClick($event);
  96379. } } }, [_vm._t("title"), _vm._v(" "), _c('Icon', { class: [_vm.prefixCls + '-submenu-title-icon'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } })], 2), _vm._v(" "), _vm.mode === 'vertical' ? _c('collapse-transition', [_c('ul', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }], class: [_vm.prefixCls] }, [_vm._t("default")], 2)]) : _c('transition', { attrs: { "name": "slide-up" } }, [_c('Drop', { directives: [{ name: "show", rawName: "v-show", value: _vm.opened, expression: "opened" }], ref: "drop", style: _vm.dropStyle, attrs: { "placement": "bottom" } }, [_c('ul', { class: [_vm.prefixCls + '-drop-list'] }, [_vm._t("default")], 2)])], 1)], 1);
  96380. };
  96381. var staticRenderFns = [];
  96382. exports.render = render;
  96383. exports.staticRenderFns = staticRenderFns;
  96384. /***/ }),
  96385. /* 497 */
  96386. /***/ (function(module, exports, __webpack_require__) {
  96387. "use strict";
  96388. Object.defineProperty(exports, "__esModule", {
  96389. value: true
  96390. });
  96391. var _notification = __webpack_require__(212);
  96392. var _notification2 = _interopRequireDefault(_notification);
  96393. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96394. var prefixCls = 'ivu-message';
  96395. var iconPrefixCls = 'ivu-icon';
  96396. var prefixKey = 'ivu_message_key_';
  96397. var defaults = {
  96398. top: 24,
  96399. duration: 1.5
  96400. };
  96401. var messageInstance = void 0;
  96402. var name = 1;
  96403. var iconTypes = {
  96404. 'info': 'ios-information-circle',
  96405. 'success': 'ios-checkmark-circle',
  96406. 'warning': 'ios-alert',
  96407. 'error': 'ios-close-circle',
  96408. 'loading': 'ios-loading'
  96409. };
  96410. function getMessageInstance() {
  96411. messageInstance = messageInstance || _notification2.default.newInstance({
  96412. prefixCls: prefixCls,
  96413. styles: {
  96414. top: String(defaults.top) + 'px'
  96415. }
  96416. });
  96417. return messageInstance;
  96418. }
  96419. function notice() {
  96420. var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  96421. var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaults.duration;
  96422. var type = arguments[2];
  96423. var onClose = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {};
  96424. var closable = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  96425. var render = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : function () {};
  96426. var background = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
  96427. var iconType = iconTypes[type];
  96428. var loadCls = type === 'loading' ? ' ivu-load-loop' : '';
  96429. var instance = getMessageInstance();
  96430. instance.notice({
  96431. name: '' + prefixKey + name,
  96432. duration: duration,
  96433. styles: {},
  96434. transitionName: 'move-up',
  96435. content: '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-' + String(type) + '">\n <i class="' + iconPrefixCls + ' ' + iconPrefixCls + '-' + String(iconType) + ' ' + loadCls + '"></i>\n <span>' + String(content) + '</span>\n </div>\n ',
  96436. render: render,
  96437. onClose: onClose,
  96438. closable: closable,
  96439. type: 'message',
  96440. msgType: type,
  96441. background: background
  96442. });
  96443. return function () {
  96444. var target = name++;
  96445. return function () {
  96446. instance.remove('' + prefixKey + target);
  96447. };
  96448. }();
  96449. }
  96450. exports.default = {
  96451. name: 'Message',
  96452. info: function info(options) {
  96453. return this.message('info', options);
  96454. },
  96455. success: function success(options) {
  96456. return this.message('success', options);
  96457. },
  96458. warning: function warning(options) {
  96459. return this.message('warning', options);
  96460. },
  96461. error: function error(options) {
  96462. return this.message('error', options);
  96463. },
  96464. loading: function loading(options) {
  96465. return this.message('loading', options);
  96466. },
  96467. message: function message(type, options) {
  96468. if (typeof options === 'string') {
  96469. options = {
  96470. content: options
  96471. };
  96472. }
  96473. return notice(options.content, options.duration, type, options.onClose, options.closable, options.render, options.background);
  96474. },
  96475. config: function config(options) {
  96476. if (options.top || options.top === 0) {
  96477. defaults.top = options.top;
  96478. }
  96479. if (options.duration || options.duration === 0) {
  96480. defaults.duration = options.duration;
  96481. }
  96482. },
  96483. destroy: function destroy() {
  96484. var instance = getMessageInstance();
  96485. messageInstance = null;
  96486. instance.destroy('ivu-message');
  96487. }
  96488. };
  96489. /***/ }),
  96490. /* 498 */
  96491. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96492. "use strict";
  96493. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96494. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__ = __webpack_require__(213);
  96495. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__);
  96496. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96497. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__ = __webpack_require__(501);
  96498. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__);
  96499. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96500. /* script */
  96501. /* template */
  96502. /* template functional */
  96503. var __vue_template_functional__ = false
  96504. /* styles */
  96505. var __vue_styles__ = null
  96506. /* scopeId */
  96507. var __vue_scopeId__ = null
  96508. /* moduleIdentifier (server only) */
  96509. var __vue_module_identifier__ = null
  96510. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96511. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notification_vue___default.a,
  96512. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__["render"],
  96513. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_746d1da0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notification_vue__["staticRenderFns"],
  96514. __vue_template_functional__,
  96515. __vue_styles__,
  96516. __vue_scopeId__,
  96517. __vue_module_identifier__
  96518. )
  96519. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96520. /***/ }),
  96521. /* 499 */
  96522. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96523. "use strict";
  96524. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96525. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__ = __webpack_require__(214);
  96526. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__);
  96527. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96528. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__ = __webpack_require__(500);
  96529. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__);
  96530. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96531. /* script */
  96532. /* template */
  96533. /* template functional */
  96534. var __vue_template_functional__ = false
  96535. /* styles */
  96536. var __vue_styles__ = null
  96537. /* scopeId */
  96538. var __vue_scopeId__ = null
  96539. /* moduleIdentifier (server only) */
  96540. var __vue_module_identifier__ = null
  96541. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96542. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_notice_vue___default.a,
  96543. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__["render"],
  96544. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_067694d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_notice_vue__["staticRenderFns"],
  96545. __vue_template_functional__,
  96546. __vue_styles__,
  96547. __vue_scopeId__,
  96548. __vue_module_identifier__
  96549. )
  96550. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96551. /***/ }),
  96552. /* 500 */
  96553. /***/ (function(module, exports, __webpack_require__) {
  96554. "use strict";
  96555. Object.defineProperty(exports, "__esModule", {
  96556. value: true
  96557. });
  96558. var render = function render() {
  96559. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('transition', { attrs: { "name": _vm.transitionName, "appear": "" }, on: { "enter": _vm.handleEnter, "leave": _vm.handleLeave } }, [_c('div', { class: _vm.classes, style: _vm.styles }, [_vm.type === 'notice' ? [_c('div', { ref: "content", class: _vm.contentClasses, domProps: { "innerHTML": _vm._s(_vm.content) } }), _vm._v(" "), _c('div', { class: _vm.contentWithIcon }, [_c('render-cell', { attrs: { "render": _vm.renderFunc } })], 1), _vm._v(" "), _vm.closable ? _c('a', { class: [_vm.baseClass + '-close'], on: { "click": _vm.close } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-close" })]) : _vm._e()] : _vm._e(), _vm._v(" "), _vm.type === 'message' ? [_c('div', { ref: "content", class: _vm.messageContentClasses }, [_c('div', { class: [_vm.baseClass + '-content-text'], domProps: { "innerHTML": _vm._s(_vm.content) } }), _vm._v(" "), _c('div', { class: [_vm.baseClass + '-content-text'] }, [_c('render-cell', { attrs: { "render": _vm.renderFunc } })], 1), _vm._v(" "), _vm.closable ? _c('a', { class: [_vm.baseClass + '-close'], on: { "click": _vm.close } }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-close" })]) : _vm._e()])] : _vm._e()], 2)]);
  96560. };
  96561. var staticRenderFns = [];
  96562. exports.render = render;
  96563. exports.staticRenderFns = staticRenderFns;
  96564. /***/ }),
  96565. /* 501 */
  96566. /***/ (function(module, exports, __webpack_require__) {
  96567. "use strict";
  96568. Object.defineProperty(exports, "__esModule", {
  96569. value: true
  96570. });
  96571. var render = function render() {
  96572. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.wrapStyles }, _vm._l(_vm.notices, function (notice) {
  96573. return _c('Notice', { key: notice.name, attrs: { "prefix-cls": _vm.prefixCls, "styles": notice.styles, "type": notice.type, "content": notice.content, "duration": notice.duration, "render": notice.render, "has-title": notice.hasTitle, "withIcon": notice.withIcon, "closable": notice.closable, "name": notice.name, "transition-name": notice.transitionName, "background": notice.background, "msg-type": notice.msgType, "on-close": notice.onClose } });
  96574. }), 1);
  96575. };
  96576. var staticRenderFns = [];
  96577. exports.render = render;
  96578. exports.staticRenderFns = staticRenderFns;
  96579. /***/ }),
  96580. /* 502 */
  96581. /***/ (function(module, exports, __webpack_require__) {
  96582. "use strict";
  96583. Object.defineProperty(exports, "__esModule", {
  96584. value: true
  96585. });
  96586. var _confirm = __webpack_require__(503);
  96587. var _confirm2 = _interopRequireDefault(_confirm);
  96588. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96589. var modalInstance = void 0;
  96590. function getModalInstance() {
  96591. var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  96592. var lockScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  96593. modalInstance = modalInstance || _confirm2.default.newInstance({
  96594. closable: false,
  96595. maskClosable: false,
  96596. footerHide: true,
  96597. render: render,
  96598. lockScroll: lockScroll
  96599. });
  96600. return modalInstance;
  96601. }
  96602. function confirm(options) {
  96603. var render = 'render' in options ? options.render : undefined;
  96604. var lockScroll = 'lockScroll' in options ? options.lockScroll : true;
  96605. var instance = getModalInstance(render, lockScroll);
  96606. options.onRemove = function () {
  96607. modalInstance = null;
  96608. };
  96609. instance.show(options);
  96610. }
  96611. _confirm2.default.info = function () {
  96612. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  96613. props.icon = 'info';
  96614. props.showCancel = false;
  96615. return confirm(props);
  96616. };
  96617. _confirm2.default.success = function () {
  96618. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  96619. props.icon = 'success';
  96620. props.showCancel = false;
  96621. return confirm(props);
  96622. };
  96623. _confirm2.default.warning = function () {
  96624. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  96625. props.icon = 'warning';
  96626. props.showCancel = false;
  96627. return confirm(props);
  96628. };
  96629. _confirm2.default.error = function () {
  96630. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  96631. props.icon = 'error';
  96632. props.showCancel = false;
  96633. return confirm(props);
  96634. };
  96635. _confirm2.default.confirm = function () {
  96636. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  96637. props.icon = 'confirm';
  96638. props.showCancel = true;
  96639. return confirm(props);
  96640. };
  96641. _confirm2.default.remove = function () {
  96642. if (!modalInstance) {
  96643. return false;
  96644. }
  96645. var instance = getModalInstance();
  96646. instance.remove();
  96647. };
  96648. exports.default = _confirm2.default;
  96649. /***/ }),
  96650. /* 503 */
  96651. /***/ (function(module, exports, __webpack_require__) {
  96652. "use strict";
  96653. Object.defineProperty(exports, "__esModule", {
  96654. value: true
  96655. });
  96656. var _assign = __webpack_require__(15);
  96657. var _assign2 = _interopRequireDefault(_assign);
  96658. var _newArrowCheck2 = __webpack_require__(1);
  96659. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  96660. var _vue = __webpack_require__(16);
  96661. var _vue2 = _interopRequireDefault(_vue);
  96662. var _modal = __webpack_require__(504);
  96663. var _modal2 = _interopRequireDefault(_modal);
  96664. var _button = __webpack_require__(28);
  96665. var _button2 = _interopRequireDefault(_button);
  96666. var _locale = __webpack_require__(6);
  96667. var _locale2 = _interopRequireDefault(_locale);
  96668. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96669. var prefixCls = 'ivu-modal-confirm';
  96670. _modal2.default.newInstance = function (properties) {
  96671. (0, _newArrowCheck3.default)(undefined, undefined);
  96672. var _props = properties || {};
  96673. var Instance = new _vue2.default({
  96674. mixins: [_locale2.default],
  96675. data: (0, _assign2.default)({}, _props, {
  96676. visible: false,
  96677. width: 416,
  96678. title: '',
  96679. body: '',
  96680. iconType: '',
  96681. iconName: '',
  96682. okText: undefined,
  96683. cancelText: undefined,
  96684. showCancel: false,
  96685. loading: false,
  96686. buttonLoading: false,
  96687. scrollable: false,
  96688. closable: false,
  96689. closing: false }),
  96690. render: function render(h) {
  96691. var _this = this;
  96692. var footerVNodes = [];
  96693. if (this.showCancel) {
  96694. footerVNodes.push(h(_button2.default, {
  96695. props: {
  96696. type: 'text'
  96697. },
  96698. on: {
  96699. click: this.cancel
  96700. }
  96701. }, this.localeCancelText));
  96702. }
  96703. footerVNodes.push(h(_button2.default, {
  96704. props: {
  96705. type: 'primary',
  96706. loading: this.buttonLoading
  96707. },
  96708. on: {
  96709. click: this.ok
  96710. }
  96711. }, this.localeOkText));
  96712. var body_render = void 0;
  96713. if (this.render) {
  96714. body_render = h('div', {
  96715. attrs: {
  96716. class: prefixCls + '-body ' + prefixCls + '-body-render'
  96717. }
  96718. }, [this.render(h)]);
  96719. } else {
  96720. body_render = h('div', {
  96721. attrs: {
  96722. class: prefixCls + '-body'
  96723. }
  96724. }, [h('div', {
  96725. domProps: {
  96726. innerHTML: this.body
  96727. }
  96728. })]);
  96729. }
  96730. var head_render = void 0;
  96731. if (this.title) {
  96732. head_render = h('div', {
  96733. attrs: {
  96734. class: prefixCls + '-head'
  96735. }
  96736. }, [h('div', {
  96737. class: this.iconTypeCls
  96738. }, [h('i', {
  96739. class: this.iconNameCls
  96740. })]), h('div', {
  96741. attrs: {
  96742. class: prefixCls + '-head-title'
  96743. },
  96744. domProps: {
  96745. innerHTML: this.title
  96746. }
  96747. })]);
  96748. }
  96749. return h(_modal2.default, {
  96750. props: (0, _assign2.default)({}, _props, {
  96751. width: this.width,
  96752. scrollable: this.scrollable,
  96753. closable: this.closable
  96754. }),
  96755. domProps: {
  96756. value: this.visible
  96757. },
  96758. on: {
  96759. input: function input(status) {
  96760. (0, _newArrowCheck3.default)(this, _this);
  96761. this.visible = status;
  96762. }.bind(this),
  96763. 'on-cancel': this.cancel
  96764. }
  96765. }, [h('div', {
  96766. attrs: {
  96767. class: prefixCls
  96768. }
  96769. }, [head_render, body_render, h('div', {
  96770. attrs: {
  96771. class: prefixCls + '-footer'
  96772. }
  96773. }, footerVNodes)])]);
  96774. },
  96775. computed: {
  96776. iconTypeCls: function iconTypeCls() {
  96777. return [prefixCls + '-head-icon', prefixCls + '-head-icon-' + String(this.iconType)];
  96778. },
  96779. iconNameCls: function iconNameCls() {
  96780. return ['ivu-icon', 'ivu-icon-' + String(this.iconName)];
  96781. },
  96782. localeOkText: function localeOkText() {
  96783. if (this.okText) {
  96784. return this.okText;
  96785. } else {
  96786. return this.t('i.modal.okText');
  96787. }
  96788. },
  96789. localeCancelText: function localeCancelText() {
  96790. if (this.cancelText) {
  96791. return this.cancelText;
  96792. } else {
  96793. return this.t('i.modal.cancelText');
  96794. }
  96795. }
  96796. },
  96797. methods: {
  96798. cancel: function cancel() {
  96799. if (this.closing) return;
  96800. this.$children[0].visible = false;
  96801. this.buttonLoading = false;
  96802. this.onCancel();
  96803. this.remove();
  96804. },
  96805. ok: function ok() {
  96806. if (this.closing) return;
  96807. if (this.loading) {
  96808. this.buttonLoading = true;
  96809. } else {
  96810. this.$children[0].visible = false;
  96811. this.remove();
  96812. }
  96813. this.onOk();
  96814. },
  96815. remove: function remove() {
  96816. var _this2 = this;
  96817. this.closing = true;
  96818. setTimeout(function () {
  96819. (0, _newArrowCheck3.default)(this, _this2);
  96820. this.closing = false;
  96821. this.destroy();
  96822. }.bind(this), 300);
  96823. },
  96824. destroy: function destroy() {
  96825. this.$destroy();
  96826. if (this.$el) document.body.removeChild(this.$el);
  96827. this.onRemove();
  96828. },
  96829. onOk: function onOk() {},
  96830. onCancel: function onCancel() {},
  96831. onRemove: function onRemove() {}
  96832. }
  96833. });
  96834. var component = Instance.$mount();
  96835. document.body.appendChild(component.$el);
  96836. var modal = Instance.$children[0];
  96837. return {
  96838. show: function show(props) {
  96839. modal.$parent.showCancel = props.showCancel;
  96840. modal.$parent.iconType = props.icon;
  96841. switch (props.icon) {
  96842. case 'info':
  96843. modal.$parent.iconName = 'ios-information-circle';
  96844. break;
  96845. case 'success':
  96846. modal.$parent.iconName = 'ios-checkmark-circle';
  96847. break;
  96848. case 'warning':
  96849. modal.$parent.iconName = 'ios-alert';
  96850. break;
  96851. case 'error':
  96852. modal.$parent.iconName = 'ios-close-circle';
  96853. break;
  96854. case 'confirm':
  96855. modal.$parent.iconName = 'ios-help-circle';
  96856. break;
  96857. }
  96858. if ('width' in props) {
  96859. modal.$parent.width = props.width;
  96860. }
  96861. if ('closable' in props) {
  96862. modal.$parent.closable = props.closable;
  96863. }
  96864. if ('title' in props) {
  96865. modal.$parent.title = props.title;
  96866. }
  96867. if ('content' in props) {
  96868. modal.$parent.body = props.content;
  96869. }
  96870. if ('okText' in props) {
  96871. modal.$parent.okText = props.okText;
  96872. }
  96873. if ('cancelText' in props) {
  96874. modal.$parent.cancelText = props.cancelText;
  96875. }
  96876. if ('onCancel' in props) {
  96877. modal.$parent.onCancel = props.onCancel;
  96878. }
  96879. if ('onOk' in props) {
  96880. modal.$parent.onOk = props.onOk;
  96881. }
  96882. if ('loading' in props) {
  96883. modal.$parent.loading = props.loading;
  96884. }
  96885. if ('scrollable' in props) {
  96886. modal.$parent.scrollable = props.scrollable;
  96887. }
  96888. modal.$parent.onRemove = props.onRemove;
  96889. modal.visible = true;
  96890. },
  96891. remove: function remove() {
  96892. modal.visible = false;
  96893. modal.$parent.buttonLoading = false;
  96894. modal.$parent.remove();
  96895. },
  96896. component: modal
  96897. };
  96898. }.bind(undefined);
  96899. exports.default = _modal2.default;
  96900. /***/ }),
  96901. /* 504 */
  96902. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  96903. "use strict";
  96904. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  96905. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__ = __webpack_require__(216);
  96906. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__);
  96907. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  96908. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__ = __webpack_require__(505);
  96909. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__);
  96910. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  96911. /* script */
  96912. /* template */
  96913. /* template functional */
  96914. var __vue_template_functional__ = false
  96915. /* styles */
  96916. var __vue_styles__ = null
  96917. /* scopeId */
  96918. var __vue_scopeId__ = null
  96919. /* moduleIdentifier (server only) */
  96920. var __vue_module_identifier__ = null
  96921. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  96922. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_modal_vue___default.a,
  96923. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__["render"],
  96924. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_f1458b66_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_modal_vue__["staticRenderFns"],
  96925. __vue_template_functional__,
  96926. __vue_styles__,
  96927. __vue_scopeId__,
  96928. __vue_module_identifier__
  96929. )
  96930. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  96931. /***/ }),
  96932. /* 505 */
  96933. /***/ (function(module, exports, __webpack_require__) {
  96934. "use strict";
  96935. Object.defineProperty(exports, "__esModule", {
  96936. value: true
  96937. });
  96938. var render = function render() {
  96939. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "transfer-dom", rawName: "v-transfer-dom" }], attrs: { "data-transfer": _vm.transfer } }, [_c('transition', { attrs: { "name": _vm.transitionNames[1] } }, [_vm.showMask ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.maskClasses, style: _vm.wrapStyles, on: { "click": _vm.handleMask } }) : _vm._e()]), _vm._v(" "), _c('div', { class: _vm.wrapClasses, style: _vm.wrapStyles, on: { "click": _vm.handleWrapClick } }, [_c('transition', { attrs: { "name": _vm.transitionNames[0] }, on: { "after-leave": _vm.animationFinish } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }], class: _vm.classes, style: _vm.mainStyles, on: { "mousedown": _vm.handleMousedown } }, [_c('div', { ref: "content", class: _vm.contentClasses, style: _vm.contentStyles, on: { "click": _vm.handleClickModal } }, [_vm.closable ? _c('a', { class: [_vm.prefixCls + '-close'], on: { "click": _vm.close } }, [_vm._t("close", [_c('Icon', { attrs: { "type": "ios-close" } })])], 2) : _vm._e(), _vm._v(" "), _vm.showHead ? _c('div', { class: [_vm.prefixCls + '-header'], on: { "mousedown": _vm.handleMoveStart } }, [_vm._t("header", [_c('div', { class: [_vm.prefixCls + '-header-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'] }, [_vm._t("default")], 2), _vm._v(" "), !_vm.footerHide ? _c('div', { class: [_vm.prefixCls + '-footer'] }, [_vm._t("footer", [_c('i-button', { attrs: { "type": "text" }, nativeOn: { "click": function click($event) {
  96940. return _vm.cancel($event);
  96941. } } }, [_vm._v(_vm._s(_vm.localeCancelText))]), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "loading": _vm.buttonLoading }, nativeOn: { "click": function click($event) {
  96942. return _vm.ok($event);
  96943. } } }, [_vm._v(_vm._s(_vm.localeOkText))])])], 2) : _vm._e()])])])], 1)], 1);
  96944. };
  96945. var staticRenderFns = [];
  96946. exports.render = render;
  96947. exports.staticRenderFns = staticRenderFns;
  96948. /***/ }),
  96949. /* 506 */
  96950. /***/ (function(module, exports, __webpack_require__) {
  96951. "use strict";
  96952. Object.defineProperty(exports, "__esModule", {
  96953. value: true
  96954. });
  96955. var _notification = __webpack_require__(212);
  96956. var _notification2 = _interopRequireDefault(_notification);
  96957. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  96958. var prefixCls = 'ivu-notice';
  96959. var iconPrefixCls = 'ivu-icon';
  96960. var prefixKey = 'ivu_notice_key_';
  96961. var top = 24;
  96962. var defaultDuration = 4.5;
  96963. var noticeInstance = void 0;
  96964. var name = 1;
  96965. var iconTypes = {
  96966. 'info': 'ios-information-circle',
  96967. 'success': 'ios-checkmark-circle',
  96968. 'warning': 'ios-alert',
  96969. 'error': 'ios-close-circle'
  96970. };
  96971. function getNoticeInstance() {
  96972. noticeInstance = noticeInstance || _notification2.default.newInstance({
  96973. prefixCls: prefixCls,
  96974. styles: {
  96975. top: top + 'px',
  96976. right: 0
  96977. }
  96978. });
  96979. return noticeInstance;
  96980. }
  96981. function notice(type, options) {
  96982. var title = options.title || '';
  96983. var desc = options.desc || '';
  96984. var noticeKey = options.name || '' + prefixKey + name;
  96985. var onClose = options.onClose || function () {};
  96986. var render = options.render;
  96987. var duration = options.duration === 0 ? 0 : options.duration || defaultDuration;
  96988. name++;
  96989. var instance = getNoticeInstance();
  96990. var content = void 0;
  96991. var withIcon = void 0;
  96992. var with_desc = options.render && !title ? '' : desc || options.render ? ' ' + prefixCls + '-with-desc' : '';
  96993. if (type == 'normal') {
  96994. withIcon = false;
  96995. content = '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-with-normal ' + with_desc + '">\n <div class="' + prefixCls + '-title">' + String(title) + '</div>\n <div class="' + prefixCls + '-desc">' + String(desc) + '</div>\n </div>\n ';
  96996. } else {
  96997. var iconType = iconTypes[type];
  96998. var outlineIcon = with_desc === '' ? '' : '-outline';
  96999. withIcon = true;
  97000. content = '\n <div class="' + prefixCls + '-custom-content ' + prefixCls + '-with-icon ' + prefixCls + '-with-' + String(type) + ' ' + with_desc + '">\n <span class="' + prefixCls + '-icon ' + prefixCls + '-icon-' + String(type) + '">\n <i class="' + iconPrefixCls + ' ' + iconPrefixCls + '-' + String(iconType) + outlineIcon + '"></i>\n </span>\n <div class="' + prefixCls + '-title">' + String(title) + '</div>\n <div class="' + prefixCls + '-desc">' + String(desc) + '</div>\n </div>\n ';
  97001. }
  97002. instance.notice({
  97003. name: noticeKey.toString(),
  97004. duration: duration,
  97005. styles: {},
  97006. transitionName: 'move-notice',
  97007. content: content,
  97008. withIcon: withIcon,
  97009. render: render,
  97010. hasTitle: !!title,
  97011. onClose: onClose,
  97012. closable: true,
  97013. type: 'notice'
  97014. });
  97015. }
  97016. exports.default = {
  97017. open: function open(options) {
  97018. return notice('normal', options);
  97019. },
  97020. info: function info(options) {
  97021. return notice('info', options);
  97022. },
  97023. success: function success(options) {
  97024. return notice('success', options);
  97025. },
  97026. warning: function warning(options) {
  97027. return notice('warning', options);
  97028. },
  97029. error: function error(options) {
  97030. return notice('error', options);
  97031. },
  97032. config: function config(options) {
  97033. if (options.top) {
  97034. top = options.top;
  97035. }
  97036. if (options.duration || options.duration === 0) {
  97037. defaultDuration = options.duration;
  97038. }
  97039. },
  97040. close: function close(name) {
  97041. if (name) {
  97042. name = name.toString();
  97043. if (noticeInstance) {
  97044. noticeInstance.remove(name);
  97045. }
  97046. } else {
  97047. return false;
  97048. }
  97049. },
  97050. destroy: function destroy() {
  97051. var instance = getNoticeInstance();
  97052. noticeInstance = null;
  97053. instance.destroy('ivu-notice');
  97054. }
  97055. };
  97056. /***/ }),
  97057. /* 507 */
  97058. /***/ (function(module, exports, __webpack_require__) {
  97059. "use strict";
  97060. Object.defineProperty(exports, "__esModule", {
  97061. value: true
  97062. });
  97063. var _page = __webpack_require__(508);
  97064. var _page2 = _interopRequireDefault(_page);
  97065. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97066. exports.default = _page2.default;
  97067. /***/ }),
  97068. /* 508 */
  97069. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97070. "use strict";
  97071. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__ = __webpack_require__(217);
  97073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__);
  97074. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97075. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__ = __webpack_require__(511);
  97076. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__);
  97077. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97078. /* script */
  97079. /* template */
  97080. /* template functional */
  97081. var __vue_template_functional__ = false
  97082. /* styles */
  97083. var __vue_styles__ = null
  97084. /* scopeId */
  97085. var __vue_scopeId__ = null
  97086. /* moduleIdentifier (server only) */
  97087. var __vue_module_identifier__ = null
  97088. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97089. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_page_vue___default.a,
  97090. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__["render"],
  97091. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_e094ac82_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_page_vue__["staticRenderFns"],
  97092. __vue_template_functional__,
  97093. __vue_styles__,
  97094. __vue_scopeId__,
  97095. __vue_module_identifier__
  97096. )
  97097. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97098. /***/ }),
  97099. /* 509 */
  97100. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97101. "use strict";
  97102. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97103. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__ = __webpack_require__(218);
  97104. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__);
  97105. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97106. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__ = __webpack_require__(510);
  97107. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__);
  97108. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97109. /* script */
  97110. /* template */
  97111. /* template functional */
  97112. var __vue_template_functional__ = false
  97113. /* styles */
  97114. var __vue_styles__ = null
  97115. /* scopeId */
  97116. var __vue_scopeId__ = null
  97117. /* moduleIdentifier (server only) */
  97118. var __vue_module_identifier__ = null
  97119. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97120. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_options_vue___default.a,
  97121. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__["render"],
  97122. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_4c35237a_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_options_vue__["staticRenderFns"],
  97123. __vue_template_functional__,
  97124. __vue_styles__,
  97125. __vue_scopeId__,
  97126. __vue_module_identifier__
  97127. )
  97128. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97129. /***/ }),
  97130. /* 510 */
  97131. /***/ (function(module, exports, __webpack_require__) {
  97132. "use strict";
  97133. Object.defineProperty(exports, "__esModule", {
  97134. value: true
  97135. });
  97136. var render = function render() {
  97137. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.showSizer || _vm.showElevator ? _c('div', { class: _vm.optsClasses }, [_vm.showSizer ? _c('div', { class: _vm.sizerClasses }, [_c('i-select', { attrs: { "size": _vm.size, "placement": _vm.placement, "transfer": _vm.transfer, "disabled": _vm.disabled, "eventsEnabled": _vm.eventsEnabled }, on: { "on-change": _vm.changeSize }, model: { value: _vm.currentPageSize, callback: function callback($$v) {
  97138. _vm.currentPageSize = $$v;
  97139. }, expression: "currentPageSize" } }, _vm._l(_vm.pageSizeOpts, function (item) {
  97140. return _c('i-option', { key: item, staticStyle: { "text-align": "center" }, attrs: { "value": item } }, [_vm._v(_vm._s(item) + " " + _vm._s(_vm.t('i.page.page')))]);
  97141. }), 1)], 1) : _vm._e(), _vm._v(" "), _vm.showElevator ? _c('div', { class: _vm.ElevatorClasses }, [_vm._v("\n " + _vm._s(_vm.t('i.page.goto')) + "\n "), _c('input', { attrs: { "type": "text", "autocomplete": "off", "spellcheck": "false", "disabled": _vm.disabled }, domProps: { "value": _vm._current }, on: { "keyup": function keyup($event) {
  97142. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
  97143. return null;
  97144. }return _vm.changePage($event);
  97145. } } }), _vm._v("\n " + _vm._s(_vm.t('i.page.p')) + "\n ")]) : _vm._e()]) : _vm._e();
  97146. };
  97147. var staticRenderFns = [];
  97148. exports.render = render;
  97149. exports.staticRenderFns = staticRenderFns;
  97150. /***/ }),
  97151. /* 511 */
  97152. /***/ (function(module, exports, __webpack_require__) {
  97153. "use strict";
  97154. Object.defineProperty(exports, "__esModule", {
  97155. value: true
  97156. });
  97157. var render = function render() {
  97158. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.simple ? _c('ul', { class: _vm.simpleWrapClasses, style: _vm.styles }, [_c('li', { class: _vm.prevClasses, attrs: { "title": _vm.t('i.page.prev') }, on: { "click": _vm.prev } }, [_vm._m(0)]), _vm._v(" "), _c('div', { class: _vm.simplePagerClasses, attrs: { "title": _vm.currentPage + '/' + _vm.allPages } }, [_c('input', { attrs: { "type": "text", "autocomplete": "off", "spellcheck": "false", "disabled": _vm.disabled }, domProps: { "value": _vm.currentPage }, on: { "keydown": _vm.keyDown, "keyup": _vm.keyUp, "change": _vm.keyUp } }), _vm._v(" "), _c('span', [_vm._v("/")]), _vm._v("\n " + _vm._s(_vm.allPages) + "\n ")]), _vm._v(" "), _c('li', { class: _vm.nextClasses, attrs: { "title": _vm.t('i.page.next') }, on: { "click": _vm.next } }, [_vm._m(1)])]) : _c('ul', { class: _vm.wrapClasses, style: _vm.styles }, [_vm.showTotal ? _c('span', { class: [_vm.prefixCls + '-total'] }, [_vm._t("default", [_vm._v(_vm._s(_vm.t('i.page.total')) + " " + _vm._s(_vm.total) + " "), _vm.total <= 1 ? [_vm._v(_vm._s(_vm.t('i.page.item')))] : [_vm._v(_vm._s(_vm.t('i.page.items')))]])], 2) : _vm._e(), _vm._v(" "), _c('li', { class: _vm.prevClasses, attrs: { "title": _vm.t('i.page.prev') }, on: { "click": _vm.prev } }, [_c('a', [_vm.prevText !== '' ? [_vm._v(_vm._s(_vm.prevText))] : _c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" })], 2)]), _vm._v(" "), _c('li', { class: _vm.firstPageClasses, attrs: { "title": "1" }, on: { "click": function click($event) {
  97159. return _vm.changePage(1);
  97160. } } }, [_c('a', [_vm._v("1")])]), _vm._v(" "), _vm.currentPage > 5 ? _c('li', { class: [_vm.prefixCls + '-item-jump-prev'], attrs: { "title": _vm.t('i.page.prev5') }, on: { "click": _vm.fastPrev } }, [_vm._m(2)]) : _vm._e(), _vm._v(" "), _vm.currentPage === 5 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 3 }, on: { "click": function click($event) {
  97161. return _vm.changePage(_vm.currentPage - 3);
  97162. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 3))])]) : _vm._e(), _vm._v(" "), _vm.currentPage - 2 > 1 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 2 }, on: { "click": function click($event) {
  97163. return _vm.changePage(_vm.currentPage - 2);
  97164. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 2))])]) : _vm._e(), _vm._v(" "), _vm.currentPage - 1 > 1 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage - 1 }, on: { "click": function click($event) {
  97165. return _vm.changePage(_vm.currentPage - 1);
  97166. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage - 1))])]) : _vm._e(), _vm._v(" "), _vm.currentPage != 1 && _vm.currentPage != _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item', _vm.prefixCls + '-item-active'], attrs: { "title": _vm.currentPage } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage))])]) : _vm._e(), _vm._v(" "), _vm.currentPage + 1 < _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 1 }, on: { "click": function click($event) {
  97167. return _vm.changePage(_vm.currentPage + 1);
  97168. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 1))])]) : _vm._e(), _vm._v(" "), _vm.currentPage + 2 < _vm.allPages ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 2 }, on: { "click": function click($event) {
  97169. return _vm.changePage(_vm.currentPage + 2);
  97170. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 2))])]) : _vm._e(), _vm._v(" "), _vm.allPages - _vm.currentPage === 4 ? _c('li', { class: [_vm.prefixCls + '-item'], attrs: { "title": _vm.currentPage + 3 }, on: { "click": function click($event) {
  97171. return _vm.changePage(_vm.currentPage + 3);
  97172. } } }, [_c('a', [_vm._v(_vm._s(_vm.currentPage + 3))])]) : _vm._e(), _vm._v(" "), _vm.allPages - _vm.currentPage >= 5 ? _c('li', { class: [_vm.prefixCls + '-item-jump-next'], attrs: { "title": _vm.t('i.page.next5') }, on: { "click": _vm.fastNext } }, [_vm._m(3)]) : _vm._e(), _vm._v(" "), _vm.allPages > 1 ? _c('li', { class: _vm.lastPageClasses, attrs: { "title": _vm.allPages }, on: { "click": function click($event) {
  97173. return _vm.changePage(_vm.allPages);
  97174. } } }, [_c('a', [_vm._v(_vm._s(_vm.allPages))])]) : _vm._e(), _vm._v(" "), _c('li', { class: _vm.nextClasses, attrs: { "title": _vm.t('i.page.next') }, on: { "click": _vm.next } }, [_c('a', [_vm.nextText !== '' ? [_vm._v(_vm._s(_vm.nextText))] : _c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" })], 2)]), _vm._v(" "), _c('Options', { attrs: { "show-sizer": _vm.showSizer, "page-size": _vm.currentPageSize, "page-size-opts": _vm.pageSizeOpts, "placement": _vm.placement, "transfer": _vm.transfer, "show-elevator": _vm.showElevator, "_current": _vm.currentPage, "current": _vm.currentPage, "disabled": _vm.disabled, "all-pages": _vm.allPages, "is-small": _vm.isSmall, "eventsEnabled": _vm.eventsEnabled }, on: { "on-size": _vm.onSize, "on-page": _vm.onPage } })], 1);
  97175. };
  97176. var staticRenderFns = [function () {
  97177. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" })]);
  97178. }, function () {
  97179. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" })]);
  97180. }, function () {
  97181. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-back" }), _c('i', { staticClass: "ivu-icon ivu-icon-ios-more" })]);
  97182. }, function () {
  97183. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('a', [_c('i', { staticClass: "ivu-icon ivu-icon-ios-arrow-forward" }), _c('i', { staticClass: "ivu-icon ivu-icon-ios-more" })]);
  97184. }];
  97185. exports.render = render;
  97186. exports.staticRenderFns = staticRenderFns;
  97187. /***/ }),
  97188. /* 512 */
  97189. /***/ (function(module, exports, __webpack_require__) {
  97190. "use strict";
  97191. Object.defineProperty(exports, "__esModule", {
  97192. value: true
  97193. });
  97194. var _poptip = __webpack_require__(219);
  97195. var _poptip2 = _interopRequireDefault(_poptip);
  97196. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97197. exports.default = _poptip2.default;
  97198. /***/ }),
  97199. /* 513 */
  97200. /***/ (function(module, exports, __webpack_require__) {
  97201. "use strict";
  97202. Object.defineProperty(exports, "__esModule", {
  97203. value: true
  97204. });
  97205. var render = function render() {
  97206. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "click-outside", rawName: "v-click-outside", value: _vm.handleClose, expression: "handleClose" }], class: _vm.classes, on: { "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'], on: { "click": _vm.handleClick, "mousedown": function mousedown($event) {
  97207. return _vm.handleFocus(false);
  97208. }, "mouseup": function mouseup($event) {
  97209. return _vm.handleBlur(false);
  97210. } } }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.visible, expression: "visible" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "popper", class: _vm.popperClasses, style: _vm.styles, attrs: { "data-transfer": _vm.transfer }, on: { "click": _vm.handleTransferClick, "mouseenter": _vm.handleMouseenter, "mouseleave": _vm.handleMouseleave } }, [_c('div', { class: [_vm.prefixCls + '-content'] }, [_c('div', { class: [_vm.prefixCls + '-arrow'] }), _vm._v(" "), _vm.confirm ? _c('div', { class: [_vm.prefixCls + '-inner'] }, [_c('div', { class: [_vm.prefixCls + '-body'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-help-circle" }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body-message'] }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2)]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-footer'] }, [_c('i-button', { attrs: { "type": "text", "size": "small" }, nativeOn: { "click": function click($event) {
  97211. return _vm.cancel($event);
  97212. } } }, [_vm._v(_vm._s(_vm.localeCancelText))]), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small" }, nativeOn: { "click": function click($event) {
  97213. return _vm.ok($event);
  97214. } } }, [_vm._v(_vm._s(_vm.localeOkText))])], 1)]) : _vm._e(), _vm._v(" "), !_vm.confirm ? _c('div', { class: [_vm.prefixCls + '-inner'] }, [_vm.showTitle ? _c('div', { ref: "title", class: [_vm.prefixCls + '-title'], style: _vm.contentPaddingStyle }, [_vm._t("title", [_c('div', { class: [_vm.prefixCls + '-title-inner'] }, [_vm._v(_vm._s(_vm.title))])])], 2) : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-body'], style: _vm.contentPaddingStyle }, [_c('div', { class: _vm.contentClasses }, [_vm._t("content", [_c('div', { class: [_vm.prefixCls + '-body-content-inner'] }, [_vm._v(_vm._s(_vm.content))])])], 2)])]) : _vm._e()])])])], 1);
  97215. };
  97216. var staticRenderFns = [];
  97217. exports.render = render;
  97218. exports.staticRenderFns = staticRenderFns;
  97219. /***/ }),
  97220. /* 514 */
  97221. /***/ (function(module, exports, __webpack_require__) {
  97222. "use strict";
  97223. Object.defineProperty(exports, "__esModule", {
  97224. value: true
  97225. });
  97226. var _progress = __webpack_require__(222);
  97227. var _progress2 = _interopRequireDefault(_progress);
  97228. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97229. exports.default = _progress2.default;
  97230. /***/ }),
  97231. /* 515 */
  97232. /***/ (function(module, exports, __webpack_require__) {
  97233. "use strict";
  97234. Object.defineProperty(exports, "__esModule", {
  97235. value: true
  97236. });
  97237. var render = function render() {
  97238. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_c('div', { class: _vm.outerClasses }, [_c('div', { class: _vm.innerClasses }, [_c('div', { class: _vm.bgClasses, style: _vm.bgStyle }, [_vm.textInside ? _c('div', { staticClass: "ivu-progress-inner-text" }, [_vm._v(_vm._s(_vm.percent) + "%")]) : _vm._e()]), _c('div', { class: _vm.successBgClasses, style: _vm.successBgStyle })])]), _vm._v(" "), !_vm.hideInfo && !_vm.textInside ? _c('span', { class: _vm.textClasses }, [_vm._t("default", [_vm.isStatus ? _c('span', { class: _vm.textInnerClasses }, [_c('Icon', { attrs: { "type": _vm.statusIcon } })], 1) : _c('span', { class: _vm.textInnerClasses }, [_vm._v("\n " + _vm._s(_vm.percent) + "%\n ")])])], 2) : _vm._e()]);
  97239. };
  97240. var staticRenderFns = [];
  97241. exports.render = render;
  97242. exports.staticRenderFns = staticRenderFns;
  97243. /***/ }),
  97244. /* 516 */
  97245. /***/ (function(module, exports, __webpack_require__) {
  97246. "use strict";
  97247. Object.defineProperty(exports, "__esModule", {
  97248. value: true
  97249. });
  97250. var _radio = __webpack_require__(517);
  97251. var _radio2 = _interopRequireDefault(_radio);
  97252. var _radioGroup = __webpack_require__(519);
  97253. var _radioGroup2 = _interopRequireDefault(_radioGroup);
  97254. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97255. _radio2.default.Group = _radioGroup2.default;
  97256. exports.default = _radio2.default;
  97257. /***/ }),
  97258. /* 517 */
  97259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97260. "use strict";
  97261. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__ = __webpack_require__(224);
  97263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__);
  97264. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__ = __webpack_require__(518);
  97266. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__);
  97267. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97268. /* script */
  97269. /* template */
  97270. /* template functional */
  97271. var __vue_template_functional__ = false
  97272. /* styles */
  97273. var __vue_styles__ = null
  97274. /* scopeId */
  97275. var __vue_scopeId__ = null
  97276. /* moduleIdentifier (server only) */
  97277. var __vue_module_identifier__ = null
  97278. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97279. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_vue___default.a,
  97280. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__["render"],
  97281. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b634bcde_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_vue__["staticRenderFns"],
  97282. __vue_template_functional__,
  97283. __vue_styles__,
  97284. __vue_scopeId__,
  97285. __vue_module_identifier__
  97286. )
  97287. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97288. /***/ }),
  97289. /* 518 */
  97290. /***/ (function(module, exports, __webpack_require__) {
  97291. "use strict";
  97292. Object.defineProperty(exports, "__esModule", {
  97293. value: true
  97294. });
  97295. var render = function render() {
  97296. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('label', { class: _vm.wrapClasses }, [_c('span', { class: _vm.radioClasses }, [_c('span', { class: _vm.innerClasses }), _vm._v(" "), _c('input', { class: _vm.inputClasses, attrs: { "type": "radio", "disabled": _vm.itemDisabled, "name": _vm.groupName }, domProps: { "checked": _vm.currentValue }, on: { "change": _vm.change, "focus": _vm.onFocus, "blur": _vm.onBlur } })]), _vm._t("default", [_vm._v(_vm._s(_vm.label))])], 2);
  97297. };
  97298. var staticRenderFns = [];
  97299. exports.render = render;
  97300. exports.staticRenderFns = staticRenderFns;
  97301. /***/ }),
  97302. /* 519 */
  97303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97304. "use strict";
  97305. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__ = __webpack_require__(225);
  97307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__);
  97308. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__ = __webpack_require__(520);
  97310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__);
  97311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97312. /* script */
  97313. /* template */
  97314. /* template functional */
  97315. var __vue_template_functional__ = false
  97316. /* styles */
  97317. var __vue_styles__ = null
  97318. /* scopeId */
  97319. var __vue_scopeId__ = null
  97320. /* moduleIdentifier (server only) */
  97321. var __vue_module_identifier__ = null
  97322. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97323. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_radio_group_vue___default.a,
  97324. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__["render"],
  97325. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_5c606d93_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_radio_group_vue__["staticRenderFns"],
  97326. __vue_template_functional__,
  97327. __vue_styles__,
  97328. __vue_scopeId__,
  97329. __vue_module_identifier__
  97330. )
  97331. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97332. /***/ }),
  97333. /* 520 */
  97334. /***/ (function(module, exports, __webpack_require__) {
  97335. "use strict";
  97336. Object.defineProperty(exports, "__esModule", {
  97337. value: true
  97338. });
  97339. var render = function render() {
  97340. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, attrs: { "name": _vm.name } }, [_vm._t("default")], 2);
  97341. };
  97342. var staticRenderFns = [];
  97343. exports.render = render;
  97344. exports.staticRenderFns = staticRenderFns;
  97345. /***/ }),
  97346. /* 521 */
  97347. /***/ (function(module, exports, __webpack_require__) {
  97348. "use strict";
  97349. Object.defineProperty(exports, "__esModule", {
  97350. value: true
  97351. });
  97352. var _rate = __webpack_require__(522);
  97353. var _rate2 = _interopRequireDefault(_rate);
  97354. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97355. exports.default = _rate2.default;
  97356. /***/ }),
  97357. /* 522 */
  97358. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97359. "use strict";
  97360. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97361. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__ = __webpack_require__(226);
  97362. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__);
  97363. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97364. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__ = __webpack_require__(523);
  97365. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__);
  97366. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97367. /* script */
  97368. /* template */
  97369. /* template functional */
  97370. var __vue_template_functional__ = false
  97371. /* styles */
  97372. var __vue_styles__ = null
  97373. /* scopeId */
  97374. var __vue_scopeId__ = null
  97375. /* moduleIdentifier (server only) */
  97376. var __vue_module_identifier__ = null
  97377. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97378. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_rate_vue___default.a,
  97379. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__["render"],
  97380. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a2c4c6f4_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_rate_vue__["staticRenderFns"],
  97381. __vue_template_functional__,
  97382. __vue_styles__,
  97383. __vue_scopeId__,
  97384. __vue_module_identifier__
  97385. )
  97386. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97387. /***/ }),
  97388. /* 523 */
  97389. /***/ (function(module, exports, __webpack_require__) {
  97390. "use strict";
  97391. Object.defineProperty(exports, "__esModule", {
  97392. value: true
  97393. });
  97394. var render = function render() {
  97395. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, on: { "mouseleave": _vm.handleMouseleave } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _vm._l(_vm.count, function (item) {
  97396. return _c('div', { key: item, class: _vm.starCls(item), on: { "mousemove": function mousemove($event) {
  97397. return _vm.handleMousemove(item, $event);
  97398. }, "click": function click($event) {
  97399. return _vm.handleClick(item);
  97400. } } }, [!_vm.showCharacter ? [_c('span', { class: [_vm.prefixCls + '-star-content'], attrs: { "type": "half" } })] : [_c('span', { class: [_vm.prefixCls + '-star-first'], attrs: { "type": "half" } }, [_vm.character !== '' ? [_vm._v(_vm._s(_vm.character))] : _c('i', { class: _vm.iconClasses, attrs: { "type": "half" } })], 2), _vm._v(" "), _c('span', { class: [_vm.prefixCls + '-star-second'] }, [_vm.character !== '' ? [_vm._v(_vm._s(_vm.character))] : _c('i', { class: _vm.iconClasses })], 2)]], 2);
  97401. }), _vm._v(" "), _vm.showText ? _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.currentValue > 0, expression: "currentValue > 0" }], class: [_vm.prefixCls + '-text'] }, [_vm._t("default", [_c('span', [_vm._v(_vm._s(_vm.currentValue))]), _vm._v(" "), _vm.currentValue <= 1 ? _c('span', [_vm._v(_vm._s(_vm.t('i.rate.star')))]) : _c('span', [_vm._v(_vm._s(_vm.t('i.rate.stars')))])])], 2) : _vm._e()], 2);
  97402. };
  97403. var staticRenderFns = [];
  97404. exports.render = render;
  97405. exports.staticRenderFns = staticRenderFns;
  97406. /***/ }),
  97407. /* 524 */
  97408. /***/ (function(module, exports, __webpack_require__) {
  97409. "use strict";
  97410. Object.defineProperty(exports, "__esModule", {
  97411. value: true
  97412. });
  97413. var _sider = __webpack_require__(202);
  97414. var _sider2 = _interopRequireDefault(_sider);
  97415. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97416. exports.default = _sider2.default;
  97417. /***/ }),
  97418. /* 525 */
  97419. /***/ (function(module, exports, __webpack_require__) {
  97420. "use strict";
  97421. Object.defineProperty(exports, "__esModule", {
  97422. value: true
  97423. });
  97424. var _slider = __webpack_require__(526);
  97425. var _slider2 = _interopRequireDefault(_slider);
  97426. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  97427. exports.default = _slider2.default;
  97428. /***/ }),
  97429. /* 526 */
  97430. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  97431. "use strict";
  97432. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  97433. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__ = __webpack_require__(227);
  97434. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__);
  97435. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  97436. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__ = __webpack_require__(539);
  97437. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__);
  97438. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  97439. /* script */
  97440. /* template */
  97441. /* template functional */
  97442. var __vue_template_functional__ = false
  97443. /* styles */
  97444. var __vue_styles__ = null
  97445. /* scopeId */
  97446. var __vue_scopeId__ = null
  97447. /* moduleIdentifier (server only) */
  97448. var __vue_module_identifier__ = null
  97449. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  97450. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_slider_vue___default.a,
  97451. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__["render"],
  97452. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_3cedd8c5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_slider_vue__["staticRenderFns"],
  97453. __vue_template_functional__,
  97454. __vue_styles__,
  97455. __vue_scopeId__,
  97456. __vue_module_identifier__
  97457. )
  97458. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  97459. /***/ }),
  97460. /* 527 */
  97461. /***/ (function(module, exports, __webpack_require__) {
  97462. "use strict";
  97463. Object.defineProperty(exports, "__esModule", {
  97464. value: true
  97465. });
  97466. var render = function render() {
  97467. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls], on: { "mouseenter": _vm.handleShowPopper, "mouseleave": _vm.handleClosePopper } }, [_c('div', { ref: "reference", class: [_vm.prefixCls + '-rel'] }, [_vm._t("default")], 2), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [_c('div', { directives: [{ name: "show", rawName: "v-show", value: !_vm.disabled && (_vm.visible || _vm.always), expression: "!disabled && (visible || always)" }, { name: "transfer-dom", rawName: "v-transfer-dom" }], ref: "popper", class: _vm.dropdownCls, style: _vm.dropStyles, attrs: { "data-transfer": _vm.transfer }, on: { "mouseenter": _vm.handleShowPopper, "mouseleave": _vm.handleClosePopper } }, [_c('div', { class: [_vm.prefixCls + '-content'] }, [_c('div', { class: [_vm.prefixCls + '-arrow'] }), _vm._v(" "), _c('div', { class: _vm.innerClasses, style: _vm.innerStyles }, [_vm._t("content", [_vm._v(_vm._s(_vm.content))])], 2)])])])], 1);
  97468. };
  97469. var staticRenderFns = [];
  97470. exports.render = render;
  97471. exports.staticRenderFns = staticRenderFns;
  97472. /***/ }),
  97473. /* 528 */
  97474. /***/ (function(module, exports, __webpack_require__) {
  97475. "use strict";
  97476. Object.defineProperty(exports, "__esModule", {
  97477. value: true
  97478. });
  97479. exports.default = {
  97480. name: 'SliderMarker',
  97481. props: {
  97482. mark: {
  97483. type: [String, Object]
  97484. }
  97485. },
  97486. render: function render(h) {
  97487. var label = typeof this.mark === 'string' ? this.mark : [this.mark.label];
  97488. return h('div', {
  97489. class: 'ivu-slider-marks-item',
  97490. style: this.mark.style || {}
  97491. }, label);
  97492. }
  97493. };
  97494. /***/ }),
  97495. /* 529 */
  97496. /***/ (function(module, exports, __webpack_require__) {
  97497. "use strict";
  97498. module.exports = function(options) {
  97499. var getState = options.stateHandler.getState;
  97500. /**
  97501. * Tells if the element has been made detectable and ready to be listened for resize events.
  97502. * @public
  97503. * @param {element} The element to check.
  97504. * @returns {boolean} True or false depending on if the element is detectable or not.
  97505. */
  97506. function isDetectable(element) {
  97507. var state = getState(element);
  97508. return state && !!state.isDetectable;
  97509. }
  97510. /**
  97511. * Marks the element that it has been made detectable and ready to be listened for resize events.
  97512. * @public
  97513. * @param {element} The element to mark.
  97514. */
  97515. function markAsDetectable(element) {
  97516. getState(element).isDetectable = true;
  97517. }
  97518. /**
  97519. * Tells if the element is busy or not.
  97520. * @public
  97521. * @param {element} The element to check.
  97522. * @returns {boolean} True or false depending on if the element is busy or not.
  97523. */
  97524. function isBusy(element) {
  97525. return !!getState(element).busy;
  97526. }
  97527. /**
  97528. * Marks the object is busy and should not be made detectable.
  97529. * @public
  97530. * @param {element} element The element to mark.
  97531. * @param {boolean} busy If the element is busy or not.
  97532. */
  97533. function markBusy(element, busy) {
  97534. getState(element).busy = !!busy;
  97535. }
  97536. return {
  97537. isDetectable: isDetectable,
  97538. markAsDetectable: markAsDetectable,
  97539. isBusy: isBusy,
  97540. markBusy: markBusy
  97541. };
  97542. };
  97543. /***/ }),
  97544. /* 530 */
  97545. /***/ (function(module, exports, __webpack_require__) {
  97546. "use strict";
  97547. module.exports = function(idHandler) {
  97548. var eventListeners = {};
  97549. /**
  97550. * Gets all listeners for the given element.
  97551. * @public
  97552. * @param {element} element The element to get all listeners for.
  97553. * @returns All listeners for the given element.
  97554. */
  97555. function getListeners(element) {
  97556. var id = idHandler.get(element);
  97557. if (id === undefined) {
  97558. return [];
  97559. }
  97560. return eventListeners[id] || [];
  97561. }
  97562. /**
  97563. * Stores the given listener for the given element. Will not actually add the listener to the element.
  97564. * @public
  97565. * @param {element} element The element that should have the listener added.
  97566. * @param {function} listener The callback that the element has added.
  97567. */
  97568. function addListener(element, listener) {
  97569. var id = idHandler.get(element);
  97570. if(!eventListeners[id]) {
  97571. eventListeners[id] = [];
  97572. }
  97573. eventListeners[id].push(listener);
  97574. }
  97575. function removeListener(element, listener) {
  97576. var listeners = getListeners(element);
  97577. for (var i = 0, len = listeners.length; i < len; ++i) {
  97578. if (listeners[i] === listener) {
  97579. listeners.splice(i, 1);
  97580. break;
  97581. }
  97582. }
  97583. }
  97584. function removeAllListeners(element) {
  97585. var listeners = getListeners(element);
  97586. if (!listeners) { return; }
  97587. listeners.length = 0;
  97588. }
  97589. return {
  97590. get: getListeners,
  97591. add: addListener,
  97592. removeListener: removeListener,
  97593. removeAllListeners: removeAllListeners
  97594. };
  97595. };
  97596. /***/ }),
  97597. /* 531 */
  97598. /***/ (function(module, exports, __webpack_require__) {
  97599. "use strict";
  97600. module.exports = function() {
  97601. var idCount = 1;
  97602. /**
  97603. * Generates a new unique id in the context.
  97604. * @public
  97605. * @returns {number} A unique id in the context.
  97606. */
  97607. function generate() {
  97608. return idCount++;
  97609. }
  97610. return {
  97611. generate: generate
  97612. };
  97613. };
  97614. /***/ }),
  97615. /* 532 */
  97616. /***/ (function(module, exports, __webpack_require__) {
  97617. "use strict";
  97618. module.exports = function(options) {
  97619. var idGenerator = options.idGenerator;
  97620. var getState = options.stateHandler.getState;
  97621. /**
  97622. * Gets the resize detector id of the element.
  97623. * @public
  97624. * @param {element} element The target element to get the id of.
  97625. * @returns {string|number|null} The id of the element. Null if it has no id.
  97626. */
  97627. function getId(element) {
  97628. var state = getState(element);
  97629. if (state && state.id !== undefined) {
  97630. return state.id;
  97631. }
  97632. return null;
  97633. }
  97634. /**
  97635. * Sets the resize detector id of the element. Requires the element to have a resize detector state initialized.
  97636. * @public
  97637. * @param {element} element The target element to set the id of.
  97638. * @returns {string|number|null} The id of the element.
  97639. */
  97640. function setId(element) {
  97641. var state = getState(element);
  97642. if (!state) {
  97643. throw new Error("setId required the element to have a resize detection state.");
  97644. }
  97645. var id = idGenerator.generate();
  97646. state.id = id;
  97647. return id;
  97648. }
  97649. return {
  97650. get: getId,
  97651. set: setId
  97652. };
  97653. };
  97654. /***/ }),
  97655. /* 533 */
  97656. /***/ (function(module, exports, __webpack_require__) {
  97657. "use strict";
  97658. /* global console: false */
  97659. /**
  97660. * Reporter that handles the reporting of logs, warnings and errors.
  97661. * @public
  97662. * @param {boolean} quiet Tells if the reporter should be quiet or not.
  97663. */
  97664. module.exports = function(quiet) {
  97665. function noop() {
  97666. //Does nothing.
  97667. }
  97668. var reporter = {
  97669. log: noop,
  97670. warn: noop,
  97671. error: noop
  97672. };
  97673. if(!quiet && window.console) {
  97674. var attachFunction = function(reporter, name) {
  97675. //The proxy is needed to be able to call the method with the console context,
  97676. //since we cannot use bind.
  97677. reporter[name] = function reporterProxy() {
  97678. var f = console[name];
  97679. if (f.apply) { //IE9 does not support console.log.apply :)
  97680. f.apply(console, arguments);
  97681. } else {
  97682. for (var i = 0; i < arguments.length; i++) {
  97683. f(arguments[i]);
  97684. }
  97685. }
  97686. };
  97687. };
  97688. attachFunction(reporter, "log");
  97689. attachFunction(reporter, "warn");
  97690. attachFunction(reporter, "error");
  97691. }
  97692. return reporter;
  97693. };
  97694. /***/ }),
  97695. /* 534 */
  97696. /***/ (function(module, exports, __webpack_require__) {
  97697. "use strict";
  97698. var utils = __webpack_require__(535);
  97699. module.exports = function batchProcessorMaker(options) {
  97700. options = options || {};
  97701. var reporter = options.reporter;
  97702. var asyncProcess = utils.getOption(options, "async", true);
  97703. var autoProcess = utils.getOption(options, "auto", true);
  97704. if(autoProcess && !asyncProcess) {
  97705. reporter && reporter.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true.");
  97706. asyncProcess = true;
  97707. }
  97708. var batch = Batch();
  97709. var asyncFrameHandler;
  97710. var isProcessing = false;
  97711. function addFunction(level, fn) {
  97712. if(!isProcessing && autoProcess && asyncProcess && batch.size() === 0) {
  97713. // Since this is async, it is guaranteed to be executed after that the fn is added to the batch.
  97714. // This needs to be done before, since we're checking the size of the batch to be 0.
  97715. processBatchAsync();
  97716. }
  97717. batch.add(level, fn);
  97718. }
  97719. function processBatch() {
  97720. // Save the current batch, and create a new batch so that incoming functions are not added into the currently processing batch.
  97721. // Continue processing until the top-level batch is empty (functions may be added to the new batch while processing, and so on).
  97722. isProcessing = true;
  97723. while (batch.size()) {
  97724. var processingBatch = batch;
  97725. batch = Batch();
  97726. processingBatch.process();
  97727. }
  97728. isProcessing = false;
  97729. }
  97730. function forceProcessBatch(localAsyncProcess) {
  97731. if (isProcessing) {
  97732. return;
  97733. }
  97734. if(localAsyncProcess === undefined) {
  97735. localAsyncProcess = asyncProcess;
  97736. }
  97737. if(asyncFrameHandler) {
  97738. cancelFrame(asyncFrameHandler);
  97739. asyncFrameHandler = null;
  97740. }
  97741. if(localAsyncProcess) {
  97742. processBatchAsync();
  97743. } else {
  97744. processBatch();
  97745. }
  97746. }
  97747. function processBatchAsync() {
  97748. asyncFrameHandler = requestFrame(processBatch);
  97749. }
  97750. function clearBatch() {
  97751. batch = {};
  97752. batchSize = 0;
  97753. topLevel = 0;
  97754. bottomLevel = 0;
  97755. }
  97756. function cancelFrame(listener) {
  97757. // var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.clearTimeout;
  97758. var cancel = clearTimeout;
  97759. return cancel(listener);
  97760. }
  97761. function requestFrame(callback) {
  97762. // var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || function(fn) { return window.setTimeout(fn, 20); };
  97763. var raf = function(fn) { return setTimeout(fn, 0); };
  97764. return raf(callback);
  97765. }
  97766. return {
  97767. add: addFunction,
  97768. force: forceProcessBatch
  97769. };
  97770. };
  97771. function Batch() {
  97772. var batch = {};
  97773. var size = 0;
  97774. var topLevel = 0;
  97775. var bottomLevel = 0;
  97776. function add(level, fn) {
  97777. if(!fn) {
  97778. fn = level;
  97779. level = 0;
  97780. }
  97781. if(level > topLevel) {
  97782. topLevel = level;
  97783. } else if(level < bottomLevel) {
  97784. bottomLevel = level;
  97785. }
  97786. if(!batch[level]) {
  97787. batch[level] = [];
  97788. }
  97789. batch[level].push(fn);
  97790. size++;
  97791. }
  97792. function process() {
  97793. for(var level = bottomLevel; level <= topLevel; level++) {
  97794. var fns = batch[level];
  97795. for(var i = 0; i < fns.length; i++) {
  97796. var fn = fns[i];
  97797. fn();
  97798. }
  97799. }
  97800. }
  97801. function getSize() {
  97802. return size;
  97803. }
  97804. return {
  97805. add: add,
  97806. process: process,
  97807. size: getSize
  97808. };
  97809. }
  97810. /***/ }),
  97811. /* 535 */
  97812. /***/ (function(module, exports, __webpack_require__) {
  97813. "use strict";
  97814. var utils = module.exports = {};
  97815. utils.getOption = getOption;
  97816. function getOption(options, name, defaultValue) {
  97817. var value = options[name];
  97818. if((value === undefined || value === null) && defaultValue !== undefined) {
  97819. return defaultValue;
  97820. }
  97821. return value;
  97822. }
  97823. /***/ }),
  97824. /* 536 */
  97825. /***/ (function(module, exports, __webpack_require__) {
  97826. "use strict";
  97827. var prop = "_erd";
  97828. function initState(element) {
  97829. element[prop] = {};
  97830. return getState(element);
  97831. }
  97832. function getState(element) {
  97833. return element[prop];
  97834. }
  97835. function cleanState(element) {
  97836. delete element[prop];
  97837. }
  97838. module.exports = {
  97839. initState: initState,
  97840. getState: getState,
  97841. cleanState: cleanState
  97842. };
  97843. /***/ }),
  97844. /* 537 */
  97845. /***/ (function(module, exports, __webpack_require__) {
  97846. "use strict";
  97847. /**
  97848. * Resize detection strategy that injects objects to elements in order to detect resize events.
  97849. * Heavily inspired by: http://www.backalleycoder.com/2013/03/18/cross-browser-event-based-element-resize-detection/
  97850. */
  97851. var browserDetector = __webpack_require__(230);
  97852. module.exports = function(options) {
  97853. options = options || {};
  97854. var reporter = options.reporter;
  97855. var batchProcessor = options.batchProcessor;
  97856. var getState = options.stateHandler.getState;
  97857. if(!reporter) {
  97858. throw new Error("Missing required dependency: reporter.");
  97859. }
  97860. /**
  97861. * Adds a resize event listener to the element.
  97862. * @public
  97863. * @param {element} element The element that should have the listener added.
  97864. * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
  97865. */
  97866. function addListener(element, listener) {
  97867. function listenerProxy() {
  97868. listener(element);
  97869. }
  97870. if(browserDetector.isIE(8)) {
  97871. //IE 8 does not support object, but supports the resize event directly on elements.
  97872. getState(element).object = {
  97873. proxy: listenerProxy
  97874. };
  97875. element.attachEvent("onresize", listenerProxy);
  97876. } else {
  97877. var object = getObject(element);
  97878. if(!object) {
  97879. throw new Error("Element is not detectable by this strategy.");
  97880. }
  97881. object.contentDocument.defaultView.addEventListener("resize", listenerProxy);
  97882. }
  97883. }
  97884. function buildCssTextString(rules) {
  97885. var seperator = options.important ? " !important; " : "; ";
  97886. return (rules.join(seperator) + seperator).trim();
  97887. }
  97888. /**
  97889. * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
  97890. * @private
  97891. * @param {object} options Optional options object.
  97892. * @param {element} element The element to make detectable
  97893. * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
  97894. */
  97895. function makeDetectable(options, element, callback) {
  97896. if (!callback) {
  97897. callback = element;
  97898. element = options;
  97899. options = null;
  97900. }
  97901. options = options || {};
  97902. var debug = options.debug;
  97903. function injectObject(element, callback) {
  97904. var OBJECT_STYLE = buildCssTextString(["display: block", "position: absolute", "top: 0", "left: 0", "width: 100%", "height: 100%", "border: none", "padding: 0", "margin: 0", "opacity: 0", "z-index: -1000", "pointer-events: none"]);
  97905. //The target element needs to be positioned (everything except static) so the absolute positioned object will be positioned relative to the target element.
  97906. // Position altering may be performed directly or on object load, depending on if style resolution is possible directly or not.
  97907. var positionCheckPerformed = false;
  97908. // The element may not yet be attached to the DOM, and therefore the style object may be empty in some browsers.
  97909. // Since the style object is a reference, it will be updated as soon as the element is attached to the DOM.
  97910. var style = window.getComputedStyle(element);
  97911. var width = element.offsetWidth;
  97912. var height = element.offsetHeight;
  97913. getState(element).startSize = {
  97914. width: width,
  97915. height: height
  97916. };
  97917. function mutateDom() {
  97918. function alterPositionStyles() {
  97919. if(style.position === "static") {
  97920. element.style.setProperty("position", "relative", options.important ? "important" : "");
  97921. var removeRelativeStyles = function(reporter, element, style, property) {
  97922. function getNumericalValue(value) {
  97923. return value.replace(/[^-\d\.]/g, "");
  97924. }
  97925. var value = style[property];
  97926. if(value !== "auto" && getNumericalValue(value) !== "0") {
  97927. reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
  97928. element.style.setProperty(property, "0", options.important ? "important" : "");
  97929. }
  97930. };
  97931. //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
  97932. //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
  97933. removeRelativeStyles(reporter, element, style, "top");
  97934. removeRelativeStyles(reporter, element, style, "right");
  97935. removeRelativeStyles(reporter, element, style, "bottom");
  97936. removeRelativeStyles(reporter, element, style, "left");
  97937. }
  97938. }
  97939. function onObjectLoad() {
  97940. // The object has been loaded, which means that the element now is guaranteed to be attached to the DOM.
  97941. if (!positionCheckPerformed) {
  97942. alterPositionStyles();
  97943. }
  97944. /*jshint validthis: true */
  97945. function getDocument(element, callback) {
  97946. //Opera 12 seem to call the object.onload before the actual document has been created.
  97947. //So if it is not present, poll it with an timeout until it is present.
  97948. //TODO: Could maybe be handled better with object.onreadystatechange or similar.
  97949. if(!element.contentDocument) {
  97950. setTimeout(function checkForObjectDocument() {
  97951. getDocument(element, callback);
  97952. }, 100);
  97953. return;
  97954. }
  97955. callback(element.contentDocument);
  97956. }
  97957. //Mutating the object element here seems to fire another load event.
  97958. //Mutating the inner document of the object element is fine though.
  97959. var objectElement = this;
  97960. //Create the style element to be added to the object.
  97961. getDocument(objectElement, function onObjectDocumentReady(objectDocument) {
  97962. //Notify that the element is ready to be listened to.
  97963. callback(element);
  97964. });
  97965. }
  97966. // The element may be detached from the DOM, and some browsers does not support style resolving of detached elements.
  97967. // The alterPositionStyles needs to be delayed until we know the element has been attached to the DOM (which we are sure of when the onObjectLoad has been fired), if style resolution is not possible.
  97968. if (style.position !== "") {
  97969. alterPositionStyles(style);
  97970. positionCheckPerformed = true;
  97971. }
  97972. //Add an object element as a child to the target element that will be listened to for resize events.
  97973. var object = document.createElement("object");
  97974. object.style.cssText = OBJECT_STYLE;
  97975. object.tabIndex = -1;
  97976. object.type = "text/html";
  97977. object.onload = onObjectLoad;
  97978. //Safari: This must occur before adding the object to the DOM.
  97979. //IE: Does not like that this happens before, even if it is also added after.
  97980. if(!browserDetector.isIE()) {
  97981. object.data = "about:blank";
  97982. }
  97983. if (!getState(element)) {
  97984. // The element has been uninstalled before the actual loading happened.
  97985. return;
  97986. }
  97987. element.appendChild(object);
  97988. getState(element).object = object;
  97989. //IE: This must occur after adding the object to the DOM.
  97990. if(browserDetector.isIE()) {
  97991. object.data = "about:blank";
  97992. }
  97993. }
  97994. if(batchProcessor) {
  97995. batchProcessor.add(mutateDom);
  97996. } else {
  97997. mutateDom();
  97998. }
  97999. }
  98000. if(browserDetector.isIE(8)) {
  98001. //IE 8 does not support objects properly. Luckily they do support the resize event.
  98002. //So do not inject the object and notify that the element is already ready to be listened to.
  98003. //The event handler for the resize event is attached in the utils.addListener instead.
  98004. callback(element);
  98005. } else {
  98006. injectObject(element, callback);
  98007. }
  98008. }
  98009. /**
  98010. * Returns the child object of the target element.
  98011. * @private
  98012. * @param {element} element The target element.
  98013. * @returns The object element of the target.
  98014. */
  98015. function getObject(element) {
  98016. return getState(element).object;
  98017. }
  98018. function uninstall(element) {
  98019. if (!getState(element)) {
  98020. return;
  98021. }
  98022. var object = getObject(element);
  98023. if (!object) {
  98024. return;
  98025. }
  98026. if (browserDetector.isIE(8)) {
  98027. element.detachEvent("onresize", object.proxy);
  98028. } else {
  98029. element.removeChild(object);
  98030. }
  98031. delete getState(element).object;
  98032. }
  98033. return {
  98034. makeDetectable: makeDetectable,
  98035. addListener: addListener,
  98036. uninstall: uninstall
  98037. };
  98038. };
  98039. /***/ }),
  98040. /* 538 */
  98041. /***/ (function(module, exports, __webpack_require__) {
  98042. "use strict";
  98043. /**
  98044. * Resize detection strategy that injects divs to elements in order to detect resize events on scroll events.
  98045. * Heavily inspired by: https://github.com/marcj/css-element-queries/blob/master/src/ResizeSensor.js
  98046. */
  98047. var forEach = __webpack_require__(229).forEach;
  98048. module.exports = function(options) {
  98049. options = options || {};
  98050. var reporter = options.reporter;
  98051. var batchProcessor = options.batchProcessor;
  98052. var getState = options.stateHandler.getState;
  98053. var hasState = options.stateHandler.hasState;
  98054. var idHandler = options.idHandler;
  98055. if (!batchProcessor) {
  98056. throw new Error("Missing required dependency: batchProcessor");
  98057. }
  98058. if (!reporter) {
  98059. throw new Error("Missing required dependency: reporter.");
  98060. }
  98061. //TODO: Could this perhaps be done at installation time?
  98062. var scrollbarSizes = getScrollbarSizes();
  98063. var styleId = "erd_scroll_detection_scrollbar_style";
  98064. var detectionContainerClass = "erd_scroll_detection_container";
  98065. function initDocument(targetDocument) {
  98066. // Inject the scrollbar styling that prevents them from appearing sometimes in Chrome.
  98067. // The injected container needs to have a class, so that it may be styled with CSS (pseudo elements).
  98068. injectScrollStyle(targetDocument, styleId, detectionContainerClass);
  98069. }
  98070. initDocument(window.document);
  98071. function buildCssTextString(rules) {
  98072. var seperator = options.important ? " !important; " : "; ";
  98073. return (rules.join(seperator) + seperator).trim();
  98074. }
  98075. function getScrollbarSizes() {
  98076. var width = 500;
  98077. var height = 500;
  98078. var child = document.createElement("div");
  98079. child.style.cssText = buildCssTextString(["position: absolute", "width: " + width*2 + "px", "height: " + height*2 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
  98080. var container = document.createElement("div");
  98081. container.style.cssText = buildCssTextString(["position: absolute", "width: " + width + "px", "height: " + height + "px", "overflow: scroll", "visibility: none", "top: " + -width*3 + "px", "left: " + -height*3 + "px", "visibility: hidden", "margin: 0", "padding: 0"]);
  98082. container.appendChild(child);
  98083. document.body.insertBefore(container, document.body.firstChild);
  98084. var widthSize = width - container.clientWidth;
  98085. var heightSize = height - container.clientHeight;
  98086. document.body.removeChild(container);
  98087. return {
  98088. width: widthSize,
  98089. height: heightSize
  98090. };
  98091. }
  98092. function injectScrollStyle(targetDocument, styleId, containerClass) {
  98093. function injectStyle(style, method) {
  98094. method = method || function (element) {
  98095. targetDocument.head.appendChild(element);
  98096. };
  98097. var styleElement = targetDocument.createElement("style");
  98098. styleElement.innerHTML = style;
  98099. styleElement.id = styleId;
  98100. method(styleElement);
  98101. return styleElement;
  98102. }
  98103. if (!targetDocument.getElementById(styleId)) {
  98104. var containerAnimationClass = containerClass + "_animation";
  98105. var containerAnimationActiveClass = containerClass + "_animation_active";
  98106. var style = "/* Created by the element-resize-detector library. */\n";
  98107. style += "." + containerClass + " > div::-webkit-scrollbar { " + buildCssTextString(["display: none"]) + " }\n\n";
  98108. style += "." + containerAnimationActiveClass + " { " + buildCssTextString(["-webkit-animation-duration: 0.1s", "animation-duration: 0.1s", "-webkit-animation-name: " + containerAnimationClass, "animation-name: " + containerAnimationClass]) + " }\n";
  98109. style += "@-webkit-keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n";
  98110. style += "@keyframes " + containerAnimationClass + " { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }";
  98111. injectStyle(style);
  98112. }
  98113. }
  98114. function addAnimationClass(element) {
  98115. element.className += " " + detectionContainerClass + "_animation_active";
  98116. }
  98117. function addEvent(el, name, cb) {
  98118. if (el.addEventListener) {
  98119. el.addEventListener(name, cb);
  98120. } else if(el.attachEvent) {
  98121. el.attachEvent("on" + name, cb);
  98122. } else {
  98123. return reporter.error("[scroll] Don't know how to add event listeners.");
  98124. }
  98125. }
  98126. function removeEvent(el, name, cb) {
  98127. if (el.removeEventListener) {
  98128. el.removeEventListener(name, cb);
  98129. } else if(el.detachEvent) {
  98130. el.detachEvent("on" + name, cb);
  98131. } else {
  98132. return reporter.error("[scroll] Don't know how to remove event listeners.");
  98133. }
  98134. }
  98135. function getExpandElement(element) {
  98136. return getState(element).container.childNodes[0].childNodes[0].childNodes[0];
  98137. }
  98138. function getShrinkElement(element) {
  98139. return getState(element).container.childNodes[0].childNodes[0].childNodes[1];
  98140. }
  98141. /**
  98142. * Adds a resize event listener to the element.
  98143. * @public
  98144. * @param {element} element The element that should have the listener added.
  98145. * @param {function} listener The listener callback to be called for each resize event of the element. The element will be given as a parameter to the listener callback.
  98146. */
  98147. function addListener(element, listener) {
  98148. var listeners = getState(element).listeners;
  98149. if (!listeners.push) {
  98150. throw new Error("Cannot add listener to an element that is not detectable.");
  98151. }
  98152. getState(element).listeners.push(listener);
  98153. }
  98154. /**
  98155. * Makes an element detectable and ready to be listened for resize events. Will call the callback when the element is ready to be listened for resize changes.
  98156. * @private
  98157. * @param {object} options Optional options object.
  98158. * @param {element} element The element to make detectable
  98159. * @param {function} callback The callback to be called when the element is ready to be listened for resize changes. Will be called with the element as first parameter.
  98160. */
  98161. function makeDetectable(options, element, callback) {
  98162. if (!callback) {
  98163. callback = element;
  98164. element = options;
  98165. options = null;
  98166. }
  98167. options = options || {};
  98168. function debug() {
  98169. if (options.debug) {
  98170. var args = Array.prototype.slice.call(arguments);
  98171. args.unshift(idHandler.get(element), "Scroll: ");
  98172. if (reporter.log.apply) {
  98173. reporter.log.apply(null, args);
  98174. } else {
  98175. for (var i = 0; i < args.length; i++) {
  98176. reporter.log(args[i]);
  98177. }
  98178. }
  98179. }
  98180. }
  98181. function isDetached(element) {
  98182. function isInDocument(element) {
  98183. return element === element.ownerDocument.body || element.ownerDocument.body.contains(element);
  98184. }
  98185. if (!isInDocument(element)) {
  98186. return true;
  98187. }
  98188. // FireFox returns null style in hidden iframes. See https://github.com/wnr/element-resize-detector/issues/68 and https://bugzilla.mozilla.org/show_bug.cgi?id=795520
  98189. if (window.getComputedStyle(element) === null) {
  98190. return true;
  98191. }
  98192. return false;
  98193. }
  98194. function isUnrendered(element) {
  98195. // Check the absolute positioned container since the top level container is display: inline.
  98196. var container = getState(element).container.childNodes[0];
  98197. var style = window.getComputedStyle(container);
  98198. return !style.width || style.width.indexOf("px") === -1; //Can only compute pixel value when rendered.
  98199. }
  98200. function getStyle() {
  98201. // Some browsers only force layouts when actually reading the style properties of the style object, so make sure that they are all read here,
  98202. // so that the user of the function can be sure that it will perform the layout here, instead of later (important for batching).
  98203. var elementStyle = window.getComputedStyle(element);
  98204. var style = {};
  98205. style.position = elementStyle.position;
  98206. style.width = element.offsetWidth;
  98207. style.height = element.offsetHeight;
  98208. style.top = elementStyle.top;
  98209. style.right = elementStyle.right;
  98210. style.bottom = elementStyle.bottom;
  98211. style.left = elementStyle.left;
  98212. style.widthCSS = elementStyle.width;
  98213. style.heightCSS = elementStyle.height;
  98214. return style;
  98215. }
  98216. function storeStartSize() {
  98217. var style = getStyle();
  98218. getState(element).startSize = {
  98219. width: style.width,
  98220. height: style.height
  98221. };
  98222. debug("Element start size", getState(element).startSize);
  98223. }
  98224. function initListeners() {
  98225. getState(element).listeners = [];
  98226. }
  98227. function storeStyle() {
  98228. debug("storeStyle invoked.");
  98229. if (!getState(element)) {
  98230. debug("Aborting because element has been uninstalled");
  98231. return;
  98232. }
  98233. var style = getStyle();
  98234. getState(element).style = style;
  98235. }
  98236. function storeCurrentSize(element, width, height) {
  98237. getState(element).lastWidth = width;
  98238. getState(element).lastHeight = height;
  98239. }
  98240. function getExpandChildElement(element) {
  98241. return getExpandElement(element).childNodes[0];
  98242. }
  98243. function getWidthOffset() {
  98244. return 2 * scrollbarSizes.width + 1;
  98245. }
  98246. function getHeightOffset() {
  98247. return 2 * scrollbarSizes.height + 1;
  98248. }
  98249. function getExpandWidth(width) {
  98250. return width + 10 + getWidthOffset();
  98251. }
  98252. function getExpandHeight(height) {
  98253. return height + 10 + getHeightOffset();
  98254. }
  98255. function getShrinkWidth(width) {
  98256. return width * 2 + getWidthOffset();
  98257. }
  98258. function getShrinkHeight(height) {
  98259. return height * 2 + getHeightOffset();
  98260. }
  98261. function positionScrollbars(element, width, height) {
  98262. var expand = getExpandElement(element);
  98263. var shrink = getShrinkElement(element);
  98264. var expandWidth = getExpandWidth(width);
  98265. var expandHeight = getExpandHeight(height);
  98266. var shrinkWidth = getShrinkWidth(width);
  98267. var shrinkHeight = getShrinkHeight(height);
  98268. expand.scrollLeft = expandWidth;
  98269. expand.scrollTop = expandHeight;
  98270. shrink.scrollLeft = shrinkWidth;
  98271. shrink.scrollTop = shrinkHeight;
  98272. }
  98273. function injectContainerElement() {
  98274. var container = getState(element).container;
  98275. if (!container) {
  98276. container = document.createElement("div");
  98277. container.className = detectionContainerClass;
  98278. container.style.cssText = buildCssTextString(["visibility: hidden", "display: inline", "width: 0px", "height: 0px", "z-index: -1", "overflow: hidden", "margin: 0", "padding: 0"]);
  98279. getState(element).container = container;
  98280. addAnimationClass(container);
  98281. element.appendChild(container);
  98282. var onAnimationStart = function () {
  98283. getState(element).onRendered && getState(element).onRendered();
  98284. };
  98285. addEvent(container, "animationstart", onAnimationStart);
  98286. // Store the event handler here so that they may be removed when uninstall is called.
  98287. // See uninstall function for an explanation why it is needed.
  98288. getState(element).onAnimationStart = onAnimationStart;
  98289. }
  98290. return container;
  98291. }
  98292. function injectScrollElements() {
  98293. function alterPositionStyles() {
  98294. var style = getState(element).style;
  98295. if(style.position === "static") {
  98296. element.style.setProperty("position", "relative",options.important ? "important" : "");
  98297. var removeRelativeStyles = function(reporter, element, style, property) {
  98298. function getNumericalValue(value) {
  98299. return value.replace(/[^-\d\.]/g, "");
  98300. }
  98301. var value = style[property];
  98302. if(value !== "auto" && getNumericalValue(value) !== "0") {
  98303. reporter.warn("An element that is positioned static has style." + property + "=" + value + " which is ignored due to the static positioning. The element will need to be positioned relative, so the style." + property + " will be set to 0. Element: ", element);
  98304. element.style[property] = 0;
  98305. }
  98306. };
  98307. //Check so that there are no accidental styles that will make the element styled differently now that is is relative.
  98308. //If there are any, set them to 0 (this should be okay with the user since the style properties did nothing before [since the element was positioned static] anyway).
  98309. removeRelativeStyles(reporter, element, style, "top");
  98310. removeRelativeStyles(reporter, element, style, "right");
  98311. removeRelativeStyles(reporter, element, style, "bottom");
  98312. removeRelativeStyles(reporter, element, style, "left");
  98313. }
  98314. }
  98315. function getLeftTopBottomRightCssText(left, top, bottom, right) {
  98316. left = (!left ? "0" : (left + "px"));
  98317. top = (!top ? "0" : (top + "px"));
  98318. bottom = (!bottom ? "0" : (bottom + "px"));
  98319. right = (!right ? "0" : (right + "px"));
  98320. return ["left: " + left, "top: " + top, "right: " + right, "bottom: " + bottom];
  98321. }
  98322. debug("Injecting elements");
  98323. if (!getState(element)) {
  98324. debug("Aborting because element has been uninstalled");
  98325. return;
  98326. }
  98327. alterPositionStyles();
  98328. var rootContainer = getState(element).container;
  98329. if (!rootContainer) {
  98330. rootContainer = injectContainerElement();
  98331. }
  98332. // Due to this WebKit bug https://bugs.webkit.org/show_bug.cgi?id=80808 (currently fixed in Blink, but still present in WebKit browsers such as Safari),
  98333. // we need to inject two containers, one that is width/height 100% and another that is left/top -1px so that the final container always is 1x1 pixels bigger than
  98334. // the targeted element.
  98335. // When the bug is resolved, "containerContainer" may be removed.
  98336. // The outer container can occasionally be less wide than the targeted when inside inline elements element in WebKit (see https://bugs.webkit.org/show_bug.cgi?id=152980).
  98337. // This should be no problem since the inner container either way makes sure the injected scroll elements are at least 1x1 px.
  98338. var scrollbarWidth = scrollbarSizes.width;
  98339. var scrollbarHeight = scrollbarSizes.height;
  98340. var containerContainerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%", "left: 0px", "top: 0px"]);
  98341. var containerStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: hidden", "z-index: -1", "visibility: hidden"].concat(getLeftTopBottomRightCssText(-(1 + scrollbarWidth), -(1 + scrollbarHeight), -scrollbarHeight, -scrollbarWidth)));
  98342. var expandStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
  98343. var shrinkStyle = buildCssTextString(["position: absolute", "flex: none", "overflow: scroll", "z-index: -1", "visibility: hidden", "width: 100%", "height: 100%"]);
  98344. var expandChildStyle = buildCssTextString(["position: absolute", "left: 0", "top: 0"]);
  98345. var shrinkChildStyle = buildCssTextString(["position: absolute", "width: 200%", "height: 200%"]);
  98346. var containerContainer = document.createElement("div");
  98347. var container = document.createElement("div");
  98348. var expand = document.createElement("div");
  98349. var expandChild = document.createElement("div");
  98350. var shrink = document.createElement("div");
  98351. var shrinkChild = document.createElement("div");
  98352. // Some browsers choke on the resize system being rtl, so force it to ltr. https://github.com/wnr/element-resize-detector/issues/56
  98353. // However, dir should not be set on the top level container as it alters the dimensions of the target element in some browsers.
  98354. containerContainer.dir = "ltr";
  98355. containerContainer.style.cssText = containerContainerStyle;
  98356. containerContainer.className = detectionContainerClass;
  98357. container.className = detectionContainerClass;
  98358. container.style.cssText = containerStyle;
  98359. expand.style.cssText = expandStyle;
  98360. expandChild.style.cssText = expandChildStyle;
  98361. shrink.style.cssText = shrinkStyle;
  98362. shrinkChild.style.cssText = shrinkChildStyle;
  98363. expand.appendChild(expandChild);
  98364. shrink.appendChild(shrinkChild);
  98365. container.appendChild(expand);
  98366. container.appendChild(shrink);
  98367. containerContainer.appendChild(container);
  98368. rootContainer.appendChild(containerContainer);
  98369. function onExpandScroll() {
  98370. getState(element).onExpand && getState(element).onExpand();
  98371. }
  98372. function onShrinkScroll() {
  98373. getState(element).onShrink && getState(element).onShrink();
  98374. }
  98375. addEvent(expand, "scroll", onExpandScroll);
  98376. addEvent(shrink, "scroll", onShrinkScroll);
  98377. // Store the event handlers here so that they may be removed when uninstall is called.
  98378. // See uninstall function for an explanation why it is needed.
  98379. getState(element).onExpandScroll = onExpandScroll;
  98380. getState(element).onShrinkScroll = onShrinkScroll;
  98381. }
  98382. function registerListenersAndPositionElements() {
  98383. function updateChildSizes(element, width, height) {
  98384. var expandChild = getExpandChildElement(element);
  98385. var expandWidth = getExpandWidth(width);
  98386. var expandHeight = getExpandHeight(height);
  98387. expandChild.style.setProperty("width", expandWidth + "px", options.important ? "important" : "");
  98388. expandChild.style.setProperty("height", expandHeight + "px", options.important ? "important" : "");
  98389. }
  98390. function updateDetectorElements(done) {
  98391. var width = element.offsetWidth;
  98392. var height = element.offsetHeight;
  98393. // Check whether the size has actually changed since last time the algorithm ran. If not, some steps may be skipped.
  98394. var sizeChanged = width !== getState(element).lastWidth || height !== getState(element).lastHeight;
  98395. debug("Storing current size", width, height);
  98396. // Store the size of the element sync here, so that multiple scroll events may be ignored in the event listeners.
  98397. // Otherwise the if-check in handleScroll is useless.
  98398. storeCurrentSize(element, width, height);
  98399. // Since we delay the processing of the batch, there is a risk that uninstall has been called before the batch gets to execute.
  98400. // Since there is no way to cancel the fn executions, we need to add an uninstall guard to all fns of the batch.
  98401. batchProcessor.add(0, function performUpdateChildSizes() {
  98402. if (!sizeChanged) {
  98403. return;
  98404. }
  98405. if (!getState(element)) {
  98406. debug("Aborting because element has been uninstalled");
  98407. return;
  98408. }
  98409. if (!areElementsInjected()) {
  98410. debug("Aborting because element container has not been initialized");
  98411. return;
  98412. }
  98413. if (options.debug) {
  98414. var w = element.offsetWidth;
  98415. var h = element.offsetHeight;
  98416. if (w !== width || h !== height) {
  98417. reporter.warn(idHandler.get(element), "Scroll: Size changed before updating detector elements.");
  98418. }
  98419. }
  98420. updateChildSizes(element, width, height);
  98421. });
  98422. batchProcessor.add(1, function updateScrollbars() {
  98423. // This function needs to be invoked event though the size is unchanged. The element could have been resized very quickly and then
  98424. // been restored to the original size, which will have changed the scrollbar positions.
  98425. if (!getState(element)) {
  98426. debug("Aborting because element has been uninstalled");
  98427. return;
  98428. }
  98429. if (!areElementsInjected()) {
  98430. debug("Aborting because element container has not been initialized");
  98431. return;
  98432. }
  98433. positionScrollbars(element, width, height);
  98434. });
  98435. if (sizeChanged && done) {
  98436. batchProcessor.add(2, function () {
  98437. if (!getState(element)) {
  98438. debug("Aborting because element has been uninstalled");
  98439. return;
  98440. }
  98441. if (!areElementsInjected()) {
  98442. debug("Aborting because element container has not been initialized");
  98443. return;
  98444. }
  98445. done();
  98446. });
  98447. }
  98448. }
  98449. function areElementsInjected() {
  98450. return !!getState(element).container;
  98451. }
  98452. function notifyListenersIfNeeded() {
  98453. function isFirstNotify() {
  98454. return getState(element).lastNotifiedWidth === undefined;
  98455. }
  98456. debug("notifyListenersIfNeeded invoked");
  98457. var state = getState(element);
  98458. // Don't notify if the current size is the start size, and this is the first notification.
  98459. if (isFirstNotify() && state.lastWidth === state.startSize.width && state.lastHeight === state.startSize.height) {
  98460. return debug("Not notifying: Size is the same as the start size, and there has been no notification yet.");
  98461. }
  98462. // Don't notify if the size already has been notified.
  98463. if (state.lastWidth === state.lastNotifiedWidth && state.lastHeight === state.lastNotifiedHeight) {
  98464. return debug("Not notifying: Size already notified");
  98465. }
  98466. debug("Current size not notified, notifying...");
  98467. state.lastNotifiedWidth = state.lastWidth;
  98468. state.lastNotifiedHeight = state.lastHeight;
  98469. forEach(getState(element).listeners, function (listener) {
  98470. listener(element);
  98471. });
  98472. }
  98473. function handleRender() {
  98474. debug("startanimation triggered.");
  98475. if (isUnrendered(element)) {
  98476. debug("Ignoring since element is still unrendered...");
  98477. return;
  98478. }
  98479. debug("Element rendered.");
  98480. var expand = getExpandElement(element);
  98481. var shrink = getShrinkElement(element);
  98482. if (expand.scrollLeft === 0 || expand.scrollTop === 0 || shrink.scrollLeft === 0 || shrink.scrollTop === 0) {
  98483. debug("Scrollbars out of sync. Updating detector elements...");
  98484. updateDetectorElements(notifyListenersIfNeeded);
  98485. }
  98486. }
  98487. function handleScroll() {
  98488. debug("Scroll detected.");
  98489. if (isUnrendered(element)) {
  98490. // Element is still unrendered. Skip this scroll event.
  98491. debug("Scroll event fired while unrendered. Ignoring...");
  98492. return;
  98493. }
  98494. updateDetectorElements(notifyListenersIfNeeded);
  98495. }
  98496. debug("registerListenersAndPositionElements invoked.");
  98497. if (!getState(element)) {
  98498. debug("Aborting because element has been uninstalled");
  98499. return;
  98500. }
  98501. getState(element).onRendered = handleRender;
  98502. getState(element).onExpand = handleScroll;
  98503. getState(element).onShrink = handleScroll;
  98504. var style = getState(element).style;
  98505. updateChildSizes(element, style.width, style.height);
  98506. }
  98507. function finalizeDomMutation() {
  98508. debug("finalizeDomMutation invoked.");
  98509. if (!getState(element)) {
  98510. debug("Aborting because element has been uninstalled");
  98511. return;
  98512. }
  98513. var style = getState(element).style;
  98514. storeCurrentSize(element, style.width, style.height);
  98515. positionScrollbars(element, style.width, style.height);
  98516. }
  98517. function ready() {
  98518. callback(element);
  98519. }
  98520. function install() {
  98521. debug("Installing...");
  98522. initListeners();
  98523. storeStartSize();
  98524. batchProcessor.add(0, storeStyle);
  98525. batchProcessor.add(1, injectScrollElements);
  98526. batchProcessor.add(2, registerListenersAndPositionElements);
  98527. batchProcessor.add(3, finalizeDomMutation);
  98528. batchProcessor.add(4, ready);
  98529. }
  98530. debug("Making detectable...");
  98531. if (isDetached(element)) {
  98532. debug("Element is detached");
  98533. injectContainerElement();
  98534. debug("Waiting until element is attached...");
  98535. getState(element).onRendered = function () {
  98536. debug("Element is now attached");
  98537. install();
  98538. };
  98539. } else {
  98540. install();
  98541. }
  98542. }
  98543. function uninstall(element) {
  98544. var state = getState(element);
  98545. if (!state) {
  98546. // Uninstall has been called on a non-erd element.
  98547. return;
  98548. }
  98549. // Uninstall may have been called in the following scenarios:
  98550. // (1) Right between the sync code and async batch (here state.busy = true, but nothing have been registered or injected).
  98551. // (2) In the ready callback of the last level of the batch by another element (here, state.busy = true, but all the stuff has been injected).
  98552. // (3) After the installation process (here, state.busy = false and all the stuff has been injected).
  98553. // So to be on the safe side, let's check for each thing before removing.
  98554. // We need to remove the event listeners, because otherwise the event might fire on an uninstall element which results in an error when trying to get the state of the element.
  98555. state.onExpandScroll && removeEvent(getExpandElement(element), "scroll", state.onExpandScroll);
  98556. state.onShrinkScroll && removeEvent(getShrinkElement(element), "scroll", state.onShrinkScroll);
  98557. state.onAnimationStart && removeEvent(state.container, "animationstart", state.onAnimationStart);
  98558. state.container && element.removeChild(state.container);
  98559. }
  98560. return {
  98561. makeDetectable: makeDetectable,
  98562. addListener: addListener,
  98563. uninstall: uninstall,
  98564. initDocument: initDocument
  98565. };
  98566. };
  98567. /***/ }),
  98568. /* 539 */
  98569. /***/ (function(module, exports, __webpack_require__) {
  98570. "use strict";
  98571. Object.defineProperty(exports, "__esModule", {
  98572. value: true
  98573. });
  98574. var render = function render() {
  98575. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [!_vm.range && _vm.showInput ? _c('Input-number', { attrs: { "min": _vm.min, "size": _vm.inputSize, "max": _vm.max, "step": _vm.step, "value": _vm.exportValue[0], "disabled": _vm.itemDisabled, "active-change": _vm.activeChange }, on: { "on-change": _vm.handleInputChange } }) : _vm._e(), _vm._v(" "), _c('div', { ref: "slider", class: [_vm.prefixCls + '-wrap'], on: { "click": function click($event) {
  98576. if ($event.target !== $event.currentTarget) {
  98577. return null;
  98578. }return _vm.sliderClick($event);
  98579. } } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.exportValue } }), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-bar'], style: _vm.barStyle, on: { "click": function click($event) {
  98580. if ($event.target !== $event.currentTarget) {
  98581. return null;
  98582. }return _vm.sliderClick($event);
  98583. } } }), _vm._v(" "), _vm.showStops ? _vm._l(_vm.stops, function (item) {
  98584. return _c('div', { class: [_vm.prefixCls + '-stop'], style: { 'left': item + '%' }, on: { "click": function click($event) {
  98585. if ($event.target !== $event.currentTarget) {
  98586. return null;
  98587. }return _vm.sliderClick($event);
  98588. } } });
  98589. }) : _vm._e(), _vm._v(" "), _vm.markList.length > 0 ? [_vm._l(_vm.markList, function (item, key) {
  98590. return _c('div', { key: key, class: [_vm.prefixCls + '-stop'], style: { 'left': item.position + '%' }, on: { "click": function click($event) {
  98591. if ($event.target !== $event.currentTarget) {
  98592. return null;
  98593. }return _vm.sliderClick($event);
  98594. } } });
  98595. }), _vm._v(" "), _c('div', { staticClass: "ivu-slider-marks" }, _vm._l(_vm.markList, function (item, key) {
  98596. return _c('SliderMarker', { key: key, style: { 'left': item.position + '%' }, attrs: { "mark": item.mark }, nativeOn: { "click": function click($event) {
  98597. return _vm.sliderClick($event);
  98598. } } });
  98599. }), 1)] : _vm._e(), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-button-wrap'], style: { left: _vm.minPosition + '%' }, on: { "touchstart": function touchstart($event) {
  98600. return _vm.onPointerDown($event, 'min');
  98601. }, "mousedown": function mousedown($event) {
  98602. return _vm.onPointerDown($event, 'min');
  98603. } } }, [_c('Tooltip', { ref: "minTooltip", attrs: { "controlled": _vm.pointerDown === 'min', "placement": "top", "content": _vm.tipFormat(_vm.exportValue[0]), "disabled": _vm.tipDisabled, "always": _vm.showTip === 'always' } }, [_c('div', { class: _vm.minButtonClasses, attrs: { "tabindex": "0" }, on: { "focus": function focus($event) {
  98604. return _vm.handleFocus('min');
  98605. }, "blur": function blur($event) {
  98606. return _vm.handleBlur('min');
  98607. }, "keydown": [function ($event) {
  98608. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  98609. return null;
  98610. }if ('button' in $event && $event.button !== 0) {
  98611. return null;
  98612. }return _vm.onKeyLeft($event, 'min');
  98613. }, function ($event) {
  98614. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  98615. return null;
  98616. }return _vm.onKeyLeft($event, 'min');
  98617. }, function ($event) {
  98618. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  98619. return null;
  98620. }if ('button' in $event && $event.button !== 2) {
  98621. return null;
  98622. }return _vm.onKeyRight($event, 'min');
  98623. }, function ($event) {
  98624. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  98625. return null;
  98626. }return _vm.onKeyRight($event, 'min');
  98627. }] } })])], 1), _vm._v(" "), _vm.range ? _c('div', { class: [_vm.prefixCls + '-button-wrap'], style: { left: _vm.maxPosition + '%' }, on: { "touchstart": function touchstart($event) {
  98628. return _vm.onPointerDown($event, 'max');
  98629. }, "mousedown": function mousedown($event) {
  98630. return _vm.onPointerDown($event, 'max');
  98631. } } }, [_c('Tooltip', { ref: "maxTooltip", attrs: { "controlled": _vm.pointerDown === 'max', "placement": "top", "content": _vm.tipFormat(_vm.exportValue[1]), "disabled": _vm.tipDisabled, "always": _vm.showTip === 'always' } }, [_c('div', { class: _vm.maxButtonClasses, attrs: { "tabindex": "0" }, on: { "focus": function focus($event) {
  98632. return _vm.handleFocus('max');
  98633. }, "blur": function blur($event) {
  98634. return _vm.handleBlur('max');
  98635. }, "keydown": [function ($event) {
  98636. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "left", 37, $event.key, ["Left", "ArrowLeft"])) {
  98637. return null;
  98638. }if ('button' in $event && $event.button !== 0) {
  98639. return null;
  98640. }return _vm.onKeyLeft($event, 'max');
  98641. }, function ($event) {
  98642. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"])) {
  98643. return null;
  98644. }return _vm.onKeyLeft($event, 'max');
  98645. }, function ($event) {
  98646. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "right", 39, $event.key, ["Right", "ArrowRight"])) {
  98647. return null;
  98648. }if ('button' in $event && $event.button !== 2) {
  98649. return null;
  98650. }return _vm.onKeyRight($event, 'max');
  98651. }, function ($event) {
  98652. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"])) {
  98653. return null;
  98654. }return _vm.onKeyRight($event, 'max');
  98655. }] } })])], 1) : _vm._e()], 2)], 1);
  98656. };
  98657. var staticRenderFns = [];
  98658. exports.render = render;
  98659. exports.staticRenderFns = staticRenderFns;
  98660. /***/ }),
  98661. /* 540 */
  98662. /***/ (function(module, exports, __webpack_require__) {
  98663. "use strict";
  98664. Object.defineProperty(exports, "__esModule", {
  98665. value: true
  98666. });
  98667. var _newArrowCheck2 = __webpack_require__(1);
  98668. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  98669. var _spin = __webpack_require__(541);
  98670. var _spin2 = _interopRequireDefault(_spin);
  98671. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  98672. var spinInstance = void 0;
  98673. function getSpinInstance() {
  98674. var render = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  98675. spinInstance = spinInstance || _spin2.default.newInstance({
  98676. render: render
  98677. });
  98678. return spinInstance;
  98679. }
  98680. function loading(options) {
  98681. var render = 'render' in options ? options.render : undefined;
  98682. var instance = getSpinInstance(render);
  98683. instance.show(options);
  98684. }
  98685. _spin2.default.show = function () {
  98686. var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  98687. return loading(props);
  98688. };
  98689. _spin2.default.hide = function () {
  98690. var _this = this;
  98691. if (!spinInstance) return false;
  98692. var instance = getSpinInstance();
  98693. instance.remove(function () {
  98694. (0, _newArrowCheck3.default)(this, _this);
  98695. spinInstance = null;
  98696. }.bind(this));
  98697. };
  98698. exports.default = _spin2.default;
  98699. /***/ }),
  98700. /* 541 */
  98701. /***/ (function(module, exports, __webpack_require__) {
  98702. "use strict";
  98703. Object.defineProperty(exports, "__esModule", {
  98704. value: true
  98705. });
  98706. var _assign = __webpack_require__(15);
  98707. var _assign2 = _interopRequireDefault(_assign);
  98708. var _newArrowCheck2 = __webpack_require__(1);
  98709. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  98710. var _vue = __webpack_require__(16);
  98711. var _vue2 = _interopRequireDefault(_vue);
  98712. var _spin = __webpack_require__(91);
  98713. var _spin2 = _interopRequireDefault(_spin);
  98714. var _transferQueue = __webpack_require__(37);
  98715. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  98716. function handleGetIndex() {
  98717. (0, _transferQueue.transferIncrease)();
  98718. return _transferQueue.transferIndex;
  98719. }
  98720. var tIndex = handleGetIndex();
  98721. _spin2.default.newInstance = function (properties) {
  98722. (0, _newArrowCheck3.default)(undefined, undefined);
  98723. var _props = properties || {};
  98724. var Instance = new _vue2.default({
  98725. data: (0, _assign2.default)({}, _props, {}),
  98726. render: function render(h) {
  98727. var vnode = '';
  98728. if (this.render) {
  98729. vnode = h(_spin2.default, {
  98730. props: {
  98731. fix: true,
  98732. fullscreen: true
  98733. }
  98734. }, [this.render(h)]);
  98735. } else {
  98736. vnode = h(_spin2.default, {
  98737. props: {
  98738. size: 'large',
  98739. fix: true,
  98740. fullscreen: true
  98741. }
  98742. });
  98743. }
  98744. return h('div', {
  98745. 'class': 'ivu-spin-fullscreen ivu-spin-fullscreen-wrapper',
  98746. 'style': {
  98747. 'z-index': 2010 + tIndex
  98748. }
  98749. }, [vnode]);
  98750. }
  98751. });
  98752. var component = Instance.$mount();
  98753. document.body.appendChild(component.$el);
  98754. var spin = Instance.$children[0];
  98755. return {
  98756. show: function show() {
  98757. spin.visible = true;
  98758. tIndex = handleGetIndex();
  98759. },
  98760. remove: function remove(cb) {
  98761. spin.visible = false;
  98762. setTimeout(function () {
  98763. spin.$parent.$destroy();
  98764. if (document.getElementsByClassName('ivu-spin-fullscreen')[0] !== undefined) {
  98765. document.body.removeChild(document.getElementsByClassName('ivu-spin-fullscreen')[0]);
  98766. }
  98767. cb();
  98768. }, 500);
  98769. },
  98770. component: spin
  98771. };
  98772. }.bind(undefined);
  98773. exports.default = _spin2.default;
  98774. /***/ }),
  98775. /* 542 */
  98776. /***/ (function(module, exports, __webpack_require__) {
  98777. "use strict";
  98778. Object.defineProperty(exports, "__esModule", {
  98779. value: true
  98780. });
  98781. var _steps = __webpack_require__(543);
  98782. var _steps2 = _interopRequireDefault(_steps);
  98783. var _step = __webpack_require__(545);
  98784. var _step2 = _interopRequireDefault(_step);
  98785. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  98786. _steps2.default.Step = _step2.default;
  98787. exports.default = _steps2.default;
  98788. /***/ }),
  98789. /* 543 */
  98790. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98791. "use strict";
  98792. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  98793. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__ = __webpack_require__(231);
  98794. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__);
  98795. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  98796. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__ = __webpack_require__(544);
  98797. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__);
  98798. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  98799. /* script */
  98800. /* template */
  98801. /* template functional */
  98802. var __vue_template_functional__ = false
  98803. /* styles */
  98804. var __vue_styles__ = null
  98805. /* scopeId */
  98806. var __vue_scopeId__ = null
  98807. /* moduleIdentifier (server only) */
  98808. var __vue_module_identifier__ = null
  98809. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  98810. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_steps_vue___default.a,
  98811. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__["render"],
  98812. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_8443af9e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_steps_vue__["staticRenderFns"],
  98813. __vue_template_functional__,
  98814. __vue_styles__,
  98815. __vue_scopeId__,
  98816. __vue_module_identifier__
  98817. )
  98818. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  98819. /***/ }),
  98820. /* 544 */
  98821. /***/ (function(module, exports, __webpack_require__) {
  98822. "use strict";
  98823. Object.defineProperty(exports, "__esModule", {
  98824. value: true
  98825. });
  98826. var render = function render() {
  98827. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes }, [_vm._t("default")], 2);
  98828. };
  98829. var staticRenderFns = [];
  98830. exports.render = render;
  98831. exports.staticRenderFns = staticRenderFns;
  98832. /***/ }),
  98833. /* 545 */
  98834. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98835. "use strict";
  98836. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  98837. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__ = __webpack_require__(232);
  98838. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__);
  98839. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  98840. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__ = __webpack_require__(546);
  98841. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__);
  98842. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  98843. /* script */
  98844. /* template */
  98845. /* template functional */
  98846. var __vue_template_functional__ = false
  98847. /* styles */
  98848. var __vue_styles__ = null
  98849. /* scopeId */
  98850. var __vue_scopeId__ = null
  98851. /* moduleIdentifier (server only) */
  98852. var __vue_module_identifier__ = null
  98853. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  98854. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_step_vue___default.a,
  98855. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__["render"],
  98856. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_069bd654_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_step_vue__["staticRenderFns"],
  98857. __vue_template_functional__,
  98858. __vue_styles__,
  98859. __vue_scopeId__,
  98860. __vue_module_identifier__
  98861. )
  98862. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  98863. /***/ }),
  98864. /* 546 */
  98865. /***/ (function(module, exports, __webpack_require__) {
  98866. "use strict";
  98867. Object.defineProperty(exports, "__esModule", {
  98868. value: true
  98869. });
  98870. var render = function render() {
  98871. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.wrapClasses }, [_c('div', { class: [_vm.prefixCls + '-tail'] }, [_c('i')]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-head'] }, [_c('div', { class: [_vm.prefixCls + '-head-inner'] }, [!_vm.icon && !_vm.$slots.icon && _vm.currentStatus !== 'finish' && _vm.currentStatus !== 'error' ? _c('span', [_vm._v(_vm._s(_vm.stepNumber))]) : _vm.$slots.icon ? _c('span', { staticClass: "ivu-steps-icon" }, [_vm._t("icon")], 2) : _c('span', { class: _vm.iconClasses })])]), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-main'] }, [_c('div', { class: [_vm.prefixCls + '-title'] }, [_vm._t("title", [_vm._v(_vm._s(_vm.title))])], 2), _vm._v(" "), _vm.content || _vm.$slots.content ? _c('div', { class: [_vm.prefixCls + '-content'] }, [_vm._t("content", [_vm._v(_vm._s(_vm.content))])], 2) : _vm._e()])]);
  98872. };
  98873. var staticRenderFns = [];
  98874. exports.render = render;
  98875. exports.staticRenderFns = staticRenderFns;
  98876. /***/ }),
  98877. /* 547 */
  98878. /***/ (function(module, exports, __webpack_require__) {
  98879. "use strict";
  98880. Object.defineProperty(exports, "__esModule", {
  98881. value: true
  98882. });
  98883. var _switch = __webpack_require__(548);
  98884. var _switch2 = _interopRequireDefault(_switch);
  98885. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  98886. exports.default = _switch2.default;
  98887. /***/ }),
  98888. /* 548 */
  98889. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98890. "use strict";
  98891. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  98892. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__ = __webpack_require__(233);
  98893. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__);
  98894. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  98895. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__ = __webpack_require__(549);
  98896. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__);
  98897. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  98898. /* script */
  98899. /* template */
  98900. /* template functional */
  98901. var __vue_template_functional__ = false
  98902. /* styles */
  98903. var __vue_styles__ = null
  98904. /* scopeId */
  98905. var __vue_scopeId__ = null
  98906. /* moduleIdentifier (server only) */
  98907. var __vue_module_identifier__ = null
  98908. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  98909. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_switch_vue___default.a,
  98910. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__["render"],
  98911. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_08098bc5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_switch_vue__["staticRenderFns"],
  98912. __vue_template_functional__,
  98913. __vue_styles__,
  98914. __vue_scopeId__,
  98915. __vue_module_identifier__
  98916. )
  98917. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  98918. /***/ }),
  98919. /* 549 */
  98920. /***/ (function(module, exports, __webpack_require__) {
  98921. "use strict";
  98922. Object.defineProperty(exports, "__esModule", {
  98923. value: true
  98924. });
  98925. var render = function render() {
  98926. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.wrapClasses, style: _vm.wrapStyles, attrs: { "tabindex": "0" }, on: { "click": _vm.toggle, "keydown": function keydown($event) {
  98927. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])) {
  98928. return null;
  98929. }return _vm.toggle($event);
  98930. } } }, [_c('input', { attrs: { "type": "hidden", "name": _vm.name }, domProps: { "value": _vm.currentValue } }), _vm._v(" "), _c('span', { class: _vm.innerClasses }, [_vm.currentValue === _vm.trueValue ? _vm._t("open") : _vm._e(), _vm._v(" "), _vm.currentValue === _vm.falseValue ? _vm._t("close") : _vm._e()], 2)]);
  98931. };
  98932. var staticRenderFns = [];
  98933. exports.render = render;
  98934. exports.staticRenderFns = staticRenderFns;
  98935. /***/ }),
  98936. /* 550 */
  98937. /***/ (function(module, exports, __webpack_require__) {
  98938. "use strict";
  98939. Object.defineProperty(exports, "__esModule", {
  98940. value: true
  98941. });
  98942. var _table = __webpack_require__(551);
  98943. var _table2 = _interopRequireDefault(_table);
  98944. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  98945. exports.default = _table2.default;
  98946. /***/ }),
  98947. /* 551 */
  98948. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  98949. "use strict";
  98950. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  98951. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__ = __webpack_require__(234);
  98952. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__);
  98953. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  98954. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__ = __webpack_require__(581);
  98955. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__);
  98956. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  98957. /* script */
  98958. /* template */
  98959. /* template functional */
  98960. var __vue_template_functional__ = false
  98961. /* styles */
  98962. var __vue_styles__ = null
  98963. /* scopeId */
  98964. var __vue_scopeId__ = null
  98965. /* moduleIdentifier (server only) */
  98966. var __vue_module_identifier__ = null
  98967. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  98968. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_vue___default.a,
  98969. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__["render"],
  98970. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_429b3321_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_vue__["staticRenderFns"],
  98971. __vue_template_functional__,
  98972. __vue_styles__,
  98973. __vue_scopeId__,
  98974. __vue_module_identifier__
  98975. )
  98976. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  98977. /***/ }),
  98978. /* 552 */
  98979. /***/ (function(module, exports, __webpack_require__) {
  98980. module.exports = { "default": __webpack_require__(553), __esModule: true };
  98981. /***/ }),
  98982. /* 553 */
  98983. /***/ (function(module, exports, __webpack_require__) {
  98984. __webpack_require__(80);
  98985. __webpack_require__(35);
  98986. __webpack_require__(46);
  98987. __webpack_require__(554);
  98988. __webpack_require__(560);
  98989. __webpack_require__(563);
  98990. __webpack_require__(565);
  98991. module.exports = __webpack_require__(5).Set;
  98992. /***/ }),
  98993. /* 554 */
  98994. /***/ (function(module, exports, __webpack_require__) {
  98995. "use strict";
  98996. var strong = __webpack_require__(555);
  98997. var validate = __webpack_require__(235);
  98998. var SET = 'Set';
  98999. // 23.2 Set Objects
  99000. module.exports = __webpack_require__(556)(SET, function (get) {
  99001. return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
  99002. }, {
  99003. // 23.2.3.1 Set.prototype.add(value)
  99004. add: function add(value) {
  99005. return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
  99006. }
  99007. }, strong);
  99008. /***/ }),
  99009. /* 555 */
  99010. /***/ (function(module, exports, __webpack_require__) {
  99011. "use strict";
  99012. var dP = __webpack_require__(14).f;
  99013. var create = __webpack_require__(55);
  99014. var redefineAll = __webpack_require__(90);
  99015. var ctx = __webpack_require__(24);
  99016. var anInstance = __webpack_require__(88);
  99017. var forOf = __webpack_require__(51);
  99018. var $iterDefine = __webpack_require__(72);
  99019. var step = __webpack_require__(102);
  99020. var setSpecies = __webpack_require__(190);
  99021. var DESCRIPTORS = __webpack_require__(13);
  99022. var fastKey = __webpack_require__(78).fastKey;
  99023. var validate = __webpack_require__(235);
  99024. var SIZE = DESCRIPTORS ? '_s' : 'size';
  99025. var getEntry = function (that, key) {
  99026. // fast case
  99027. var index = fastKey(key);
  99028. var entry;
  99029. if (index !== 'F') return that._i[index];
  99030. // frozen object case
  99031. for (entry = that._f; entry; entry = entry.n) {
  99032. if (entry.k == key) return entry;
  99033. }
  99034. };
  99035. module.exports = {
  99036. getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
  99037. var C = wrapper(function (that, iterable) {
  99038. anInstance(that, C, NAME, '_i');
  99039. that._t = NAME; // collection type
  99040. that._i = create(null); // index
  99041. that._f = undefined; // first entry
  99042. that._l = undefined; // last entry
  99043. that[SIZE] = 0; // size
  99044. if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
  99045. });
  99046. redefineAll(C.prototype, {
  99047. // 23.1.3.1 Map.prototype.clear()
  99048. // 23.2.3.2 Set.prototype.clear()
  99049. clear: function clear() {
  99050. for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
  99051. entry.r = true;
  99052. if (entry.p) entry.p = entry.p.n = undefined;
  99053. delete data[entry.i];
  99054. }
  99055. that._f = that._l = undefined;
  99056. that[SIZE] = 0;
  99057. },
  99058. // 23.1.3.3 Map.prototype.delete(key)
  99059. // 23.2.3.4 Set.prototype.delete(value)
  99060. 'delete': function (key) {
  99061. var that = validate(this, NAME);
  99062. var entry = getEntry(that, key);
  99063. if (entry) {
  99064. var next = entry.n;
  99065. var prev = entry.p;
  99066. delete that._i[entry.i];
  99067. entry.r = true;
  99068. if (prev) prev.n = next;
  99069. if (next) next.p = prev;
  99070. if (that._f == entry) that._f = next;
  99071. if (that._l == entry) that._l = prev;
  99072. that[SIZE]--;
  99073. } return !!entry;
  99074. },
  99075. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  99076. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  99077. forEach: function forEach(callbackfn /* , that = undefined */) {
  99078. validate(this, NAME);
  99079. var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
  99080. var entry;
  99081. while (entry = entry ? entry.n : this._f) {
  99082. f(entry.v, entry.k, this);
  99083. // revert to the last existing entry
  99084. while (entry && entry.r) entry = entry.p;
  99085. }
  99086. },
  99087. // 23.1.3.7 Map.prototype.has(key)
  99088. // 23.2.3.7 Set.prototype.has(value)
  99089. has: function has(key) {
  99090. return !!getEntry(validate(this, NAME), key);
  99091. }
  99092. });
  99093. if (DESCRIPTORS) dP(C.prototype, 'size', {
  99094. get: function () {
  99095. return validate(this, NAME)[SIZE];
  99096. }
  99097. });
  99098. return C;
  99099. },
  99100. def: function (that, key, value) {
  99101. var entry = getEntry(that, key);
  99102. var prev, index;
  99103. // change existing entry
  99104. if (entry) {
  99105. entry.v = value;
  99106. // create new entry
  99107. } else {
  99108. that._l = entry = {
  99109. i: index = fastKey(key, true), // <- index
  99110. k: key, // <- key
  99111. v: value, // <- value
  99112. p: prev = that._l, // <- previous entry
  99113. n: undefined, // <- next entry
  99114. r: false // <- removed
  99115. };
  99116. if (!that._f) that._f = entry;
  99117. if (prev) prev.n = entry;
  99118. that[SIZE]++;
  99119. // add to index
  99120. if (index !== 'F') that._i[index] = entry;
  99121. } return that;
  99122. },
  99123. getEntry: getEntry,
  99124. setStrong: function (C, NAME, IS_MAP) {
  99125. // add .keys, .values, .entries, [@@iterator]
  99126. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  99127. $iterDefine(C, NAME, function (iterated, kind) {
  99128. this._t = validate(iterated, NAME); // target
  99129. this._k = kind; // kind
  99130. this._l = undefined; // previous
  99131. }, function () {
  99132. var that = this;
  99133. var kind = that._k;
  99134. var entry = that._l;
  99135. // revert to the last existing entry
  99136. while (entry && entry.r) entry = entry.p;
  99137. // get next entry
  99138. if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
  99139. // or finish the iteration
  99140. that._t = undefined;
  99141. return step(1);
  99142. }
  99143. // return step by kind
  99144. if (kind == 'keys') return step(0, entry.k);
  99145. if (kind == 'values') return step(0, entry.v);
  99146. return step(0, [entry.k, entry.v]);
  99147. }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
  99148. // add [@@species], 23.1.2.2, 23.2.2.2
  99149. setSpecies(NAME);
  99150. }
  99151. };
  99152. /***/ }),
  99153. /* 556 */
  99154. /***/ (function(module, exports, __webpack_require__) {
  99155. "use strict";
  99156. var global = __webpack_require__(9);
  99157. var $export = __webpack_require__(7);
  99158. var meta = __webpack_require__(78);
  99159. var fails = __webpack_require__(31);
  99160. var hide = __webpack_require__(25);
  99161. var redefineAll = __webpack_require__(90);
  99162. var forOf = __webpack_require__(51);
  99163. var anInstance = __webpack_require__(88);
  99164. var isObject = __webpack_require__(18);
  99165. var setToStringTag = __webpack_require__(47);
  99166. var dP = __webpack_require__(14).f;
  99167. var each = __webpack_require__(557)(0);
  99168. var DESCRIPTORS = __webpack_require__(13);
  99169. module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
  99170. var Base = global[NAME];
  99171. var C = Base;
  99172. var ADDER = IS_MAP ? 'set' : 'add';
  99173. var proto = C && C.prototype;
  99174. var O = {};
  99175. if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
  99176. new C().entries().next();
  99177. }))) {
  99178. // create collection constructor
  99179. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  99180. redefineAll(C.prototype, methods);
  99181. meta.NEED = true;
  99182. } else {
  99183. C = wrapper(function (target, iterable) {
  99184. anInstance(target, C, NAME, '_c');
  99185. target._c = new Base();
  99186. if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
  99187. });
  99188. each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
  99189. var IS_ADDER = KEY == 'add' || KEY == 'set';
  99190. if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
  99191. anInstance(this, C, KEY);
  99192. if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
  99193. var result = this._c[KEY](a === 0 ? 0 : a, b);
  99194. return IS_ADDER ? this : result;
  99195. });
  99196. });
  99197. IS_WEAK || dP(C.prototype, 'size', {
  99198. get: function () {
  99199. return this._c.size;
  99200. }
  99201. });
  99202. }
  99203. setToStringTag(C, NAME);
  99204. O[NAME] = C;
  99205. $export($export.G + $export.W + $export.F, O);
  99206. if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
  99207. return C;
  99208. };
  99209. /***/ }),
  99210. /* 557 */
  99211. /***/ (function(module, exports, __webpack_require__) {
  99212. // 0 -> Array#forEach
  99213. // 1 -> Array#map
  99214. // 2 -> Array#filter
  99215. // 3 -> Array#some
  99216. // 4 -> Array#every
  99217. // 5 -> Array#find
  99218. // 6 -> Array#findIndex
  99219. var ctx = __webpack_require__(24);
  99220. var IObject = __webpack_require__(64);
  99221. var toObject = __webpack_require__(29);
  99222. var toLength = __webpack_require__(52);
  99223. var asc = __webpack_require__(558);
  99224. module.exports = function (TYPE, $create) {
  99225. var IS_MAP = TYPE == 1;
  99226. var IS_FILTER = TYPE == 2;
  99227. var IS_SOME = TYPE == 3;
  99228. var IS_EVERY = TYPE == 4;
  99229. var IS_FIND_INDEX = TYPE == 6;
  99230. var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
  99231. var create = $create || asc;
  99232. return function ($this, callbackfn, that) {
  99233. var O = toObject($this);
  99234. var self = IObject(O);
  99235. var f = ctx(callbackfn, that, 3);
  99236. var length = toLength(self.length);
  99237. var index = 0;
  99238. var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
  99239. var val, res;
  99240. for (;length > index; index++) if (NO_HOLES || index in self) {
  99241. val = self[index];
  99242. res = f(val, index, O);
  99243. if (TYPE) {
  99244. if (IS_MAP) result[index] = res; // map
  99245. else if (res) switch (TYPE) {
  99246. case 3: return true; // some
  99247. case 5: return val; // find
  99248. case 6: return index; // findIndex
  99249. case 2: result.push(val); // filter
  99250. } else if (IS_EVERY) return false; // every
  99251. }
  99252. }
  99253. return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
  99254. };
  99255. };
  99256. /***/ }),
  99257. /* 558 */
  99258. /***/ (function(module, exports, __webpack_require__) {
  99259. // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
  99260. var speciesConstructor = __webpack_require__(559);
  99261. module.exports = function (original, length) {
  99262. return new (speciesConstructor(original))(length);
  99263. };
  99264. /***/ }),
  99265. /* 559 */
  99266. /***/ (function(module, exports, __webpack_require__) {
  99267. var isObject = __webpack_require__(18);
  99268. var isArray = __webpack_require__(118);
  99269. var SPECIES = __webpack_require__(10)('species');
  99270. module.exports = function (original) {
  99271. var C;
  99272. if (isArray(original)) {
  99273. C = original.constructor;
  99274. // cross-realm fallback
  99275. if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
  99276. if (isObject(C)) {
  99277. C = C[SPECIES];
  99278. if (C === null) C = undefined;
  99279. }
  99280. } return C === undefined ? Array : C;
  99281. };
  99282. /***/ }),
  99283. /* 560 */
  99284. /***/ (function(module, exports, __webpack_require__) {
  99285. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  99286. var $export = __webpack_require__(7);
  99287. $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(561)('Set') });
  99288. /***/ }),
  99289. /* 561 */
  99290. /***/ (function(module, exports, __webpack_require__) {
  99291. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  99292. var classof = __webpack_require__(56);
  99293. var from = __webpack_require__(562);
  99294. module.exports = function (NAME) {
  99295. return function toJSON() {
  99296. if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
  99297. return from(this);
  99298. };
  99299. };
  99300. /***/ }),
  99301. /* 562 */
  99302. /***/ (function(module, exports, __webpack_require__) {
  99303. var forOf = __webpack_require__(51);
  99304. module.exports = function (iter, ITERATOR) {
  99305. var result = [];
  99306. forOf(iter, false, result.push, result, ITERATOR);
  99307. return result;
  99308. };
  99309. /***/ }),
  99310. /* 563 */
  99311. /***/ (function(module, exports, __webpack_require__) {
  99312. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
  99313. __webpack_require__(564)('Set');
  99314. /***/ }),
  99315. /* 564 */
  99316. /***/ (function(module, exports, __webpack_require__) {
  99317. "use strict";
  99318. // https://tc39.github.io/proposal-setmap-offrom/
  99319. var $export = __webpack_require__(7);
  99320. module.exports = function (COLLECTION) {
  99321. $export($export.S, COLLECTION, { of: function of() {
  99322. var length = arguments.length;
  99323. var A = new Array(length);
  99324. while (length--) A[length] = arguments[length];
  99325. return new this(A);
  99326. } });
  99327. };
  99328. /***/ }),
  99329. /* 565 */
  99330. /***/ (function(module, exports, __webpack_require__) {
  99331. // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
  99332. __webpack_require__(566)('Set');
  99333. /***/ }),
  99334. /* 566 */
  99335. /***/ (function(module, exports, __webpack_require__) {
  99336. "use strict";
  99337. // https://tc39.github.io/proposal-setmap-offrom/
  99338. var $export = __webpack_require__(7);
  99339. var aFunction = __webpack_require__(43);
  99340. var ctx = __webpack_require__(24);
  99341. var forOf = __webpack_require__(51);
  99342. module.exports = function (COLLECTION) {
  99343. $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
  99344. var mapFn = arguments[1];
  99345. var mapping, A, n, cb;
  99346. aFunction(this);
  99347. mapping = mapFn !== undefined;
  99348. if (mapping) aFunction(mapFn);
  99349. if (source == undefined) return new this();
  99350. A = [];
  99351. if (mapping) {
  99352. n = 0;
  99353. cb = ctx(mapFn, arguments[2], 2);
  99354. forOf(source, false, function (nextItem) {
  99355. A.push(cb(nextItem, n++));
  99356. });
  99357. } else {
  99358. forOf(source, false, A.push, A);
  99359. }
  99360. return new this(A);
  99361. } });
  99362. };
  99363. /***/ }),
  99364. /* 567 */
  99365. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99366. "use strict";
  99367. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99368. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__ = __webpack_require__(236);
  99369. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__);
  99370. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99371. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__ = __webpack_require__(569);
  99372. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__);
  99373. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99374. /* script */
  99375. /* template */
  99376. /* template functional */
  99377. var __vue_template_functional__ = false
  99378. /* styles */
  99379. var __vue_styles__ = null
  99380. /* scopeId */
  99381. var __vue_scopeId__ = null
  99382. /* moduleIdentifier (server only) */
  99383. var __vue_module_identifier__ = null
  99384. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99385. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_head_vue___default.a,
  99386. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__["render"],
  99387. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0b7aa13e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_head_vue__["staticRenderFns"],
  99388. __vue_template_functional__,
  99389. __vue_styles__,
  99390. __vue_scopeId__,
  99391. __vue_module_identifier__
  99392. )
  99393. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  99394. /***/ }),
  99395. /* 568 */
  99396. /***/ (function(module, exports, __webpack_require__) {
  99397. "use strict";
  99398. Object.defineProperty(exports, "__esModule", {
  99399. value: true
  99400. });
  99401. var _newArrowCheck2 = __webpack_require__(1);
  99402. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  99403. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  99404. exports.default = {
  99405. name: 'TableRenderHeader',
  99406. functional: true,
  99407. props: {
  99408. render: Function,
  99409. column: Object,
  99410. index: Number
  99411. },
  99412. render: function render(h, ctx) {
  99413. (0, _newArrowCheck3.default)(undefined, undefined);
  99414. var params = {
  99415. column: ctx.props.column,
  99416. index: ctx.props.index
  99417. };
  99418. return ctx.props.render(h, params);
  99419. }.bind(undefined)
  99420. };
  99421. /***/ }),
  99422. /* 569 */
  99423. /***/ (function(module, exports, __webpack_require__) {
  99424. "use strict";
  99425. Object.defineProperty(exports, "__esModule", {
  99426. value: true
  99427. });
  99428. var render = function render() {
  99429. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('table', { style: _vm.styles, attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('colgroup', [_vm._l(_vm.columns, function (column, index) {
  99430. return _c('col', { attrs: { "width": _vm.setCellWidth(column) } });
  99431. }), _vm._v(" "), _vm.$parent.showVerticalScrollBar ? _c('col', { attrs: { "width": _vm.$parent.scrollBarWidth } }) : _vm._e()], 2), _vm._v(" "), _c('thead', _vm._l(_vm.headRows, function (cols, rowIndex) {
  99432. return _c('tr', [_vm._l(cols, function (column, index) {
  99433. var _obj;
  99434. return _c('th', { class: _vm.alignCls(column), attrs: { "colspan": column.colSpan, "rowspan": column.rowSpan } }, [_c('div', { class: _vm.cellClasses(column) }, [column.type === 'expand' ? [!column.renderHeader ? _c('span', [_vm._v(_vm._s(column.title || ''))]) : _c('render-header', { attrs: { "render": column.renderHeader, "column": column, "index": index } })] : column.type === 'selection' ? [!column.hideSelectAll ? _c('Checkbox', { attrs: { "value": _vm.isSelectAll, "disabled": _vm.isSelectDisabled }, on: { "on-change": _vm.selectAll } }) : _vm._e()] : [!column.renderHeader ? _c('span', { class: (_obj = {}, _obj[_vm.prefixCls + '-cell-sort'] = column.sortable, _obj), on: { "click": function click($event) {
  99435. column.sortable && _vm.handleSortByHead(_vm.getColumn(rowIndex, index)._index);
  99436. } } }, [_vm._v(_vm._s(column.title || '#'))]) : _c('render-header', { attrs: { "render": column.renderHeader, "column": column, "index": index } }), _vm._v(" "), column.sortable ? _c('span', { class: [_vm.prefixCls + '-sort'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-md-arrow-dropup", class: { on: _vm.getColumn(rowIndex, index)._sortType === 'asc' }, on: { "click": function click($event) {
  99437. _vm.handleSort(_vm.getColumn(rowIndex, index)._index, 'asc');
  99438. } } }), _vm._v(" "), _c('i', { staticClass: "ivu-icon ivu-icon-md-arrow-dropdown", class: { on: _vm.getColumn(rowIndex, index)._sortType === 'desc' }, on: { "click": function click($event) {
  99439. _vm.handleSort(_vm.getColumn(rowIndex, index)._index, 'desc');
  99440. } } })]) : _vm._e(), _vm._v(" "), _vm.isPopperShow(column) ? _c('Poptip', { attrs: { "placement": "bottom", "popper-class": "ivu-table-popper", "transfer": "", "capture": false }, on: { "on-popper-hide": function onPopperHide($event) {
  99441. _vm.handleFilterHide(_vm.getColumn(rowIndex, index)._index);
  99442. } }, model: { value: _vm.getColumn(rowIndex, index)._filterVisible, callback: function callback($$v) {
  99443. _vm.$set(_vm.getColumn(rowIndex, index), "_filterVisible", $$v);
  99444. }, expression: "getColumn(rowIndex, index)._filterVisible" } }, [_c('span', { class: [_vm.prefixCls + '-filter'] }, [_c('i', { staticClass: "ivu-icon ivu-icon-ios-funnel", class: { on: _vm.getColumn(rowIndex, index)._isFiltered } })]), _vm._v(" "), _vm.getColumn(rowIndex, index)._filterMultiple ? _c('div', { class: [_vm.prefixCls + '-filter-list'], attrs: { "slot": "content" }, slot: "content" }, [_c('div', { class: [_vm.prefixCls + '-filter-list-item'] }, [_c('checkbox-group', { model: { value: _vm.getColumn(rowIndex, index)._filterChecked, callback: function callback($$v) {
  99445. _vm.$set(_vm.getColumn(rowIndex, index), "_filterChecked", $$v);
  99446. }, expression: "getColumn(rowIndex, index)._filterChecked" } }, _vm._l(column.filters, function (item, index) {
  99447. return _c('checkbox', { key: index, attrs: { "label": item.value } }, [_vm._v(_vm._s(item.label))]);
  99448. }), 1)], 1), _vm._v(" "), _c('div', { class: [_vm.prefixCls + '-filter-footer'] }, [_c('i-button', { attrs: { "type": "text", "size": "small", "disabled": !_vm.getColumn(rowIndex, index)._filterChecked.length }, nativeOn: { "click": function click($event) {
  99449. _vm.handleFilter(_vm.getColumn(rowIndex, index)._index);
  99450. } } }, [_vm._v(_vm._s(_vm.t('i.table.confirmFilter')))]), _vm._v(" "), _c('i-button', { attrs: { "type": "text", "size": "small" }, nativeOn: { "click": function click($event) {
  99451. _vm.handleReset(_vm.getColumn(rowIndex, index)._index);
  99452. } } }, [_vm._v(_vm._s(_vm.t('i.table.resetFilter')))])], 1)]) : _c('div', { class: [_vm.prefixCls + '-filter-list'], attrs: { "slot": "content" }, slot: "content" }, [_c('ul', { class: [_vm.prefixCls + '-filter-list-single'] }, [_c('li', { class: _vm.itemAllClasses(_vm.getColumn(rowIndex, index)), on: { "click": function click($event) {
  99453. _vm.handleReset(_vm.getColumn(rowIndex, index)._index);
  99454. } } }, [_vm._v(_vm._s(_vm.t('i.table.clearFilter')))]), _vm._v(" "), _vm._l(column.filters, function (item) {
  99455. return _c('li', { class: _vm.itemClasses(_vm.getColumn(rowIndex, index), item), on: { "click": function click($event) {
  99456. _vm.handleSelect(_vm.getColumn(rowIndex, index)._index, item.value);
  99457. } } }, [_vm._v(_vm._s(item.label))]);
  99458. })], 2)])]) : _vm._e()]], 2), _vm._v(" "), column.resizable ? _c('div', { staticClass: "ivu-table-header-resizable", on: { "mousedown": function mousedown($event) {
  99459. return _vm.handleMouseDown(column, $event);
  99460. }, "mousemove": function mousemove($event) {
  99461. return _vm.handleMouseMove(column, $event);
  99462. }, "mouseout": _vm.handleMouseOut } }) : _vm._e()]);
  99463. }), _vm._v(" "), _vm.$parent.showVerticalScrollBar && rowIndex === 0 ? _c('th', { class: _vm.scrollBarCellClass(), attrs: { "rowspan": _vm.headRows.length } }) : _vm._e()], 2);
  99464. }), 0)]);
  99465. };
  99466. var staticRenderFns = [];
  99467. exports.render = render;
  99468. exports.staticRenderFns = staticRenderFns;
  99469. /***/ }),
  99470. /* 570 */
  99471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99472. "use strict";
  99473. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__ = __webpack_require__(237);
  99475. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__);
  99476. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99477. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99478. /* script */
  99479. /* template */
  99480. var __vue_render__, __vue_static_render_fns__
  99481. /* template functional */
  99482. var __vue_template_functional__ = false
  99483. /* styles */
  99484. var __vue_styles__ = null
  99485. /* scopeId */
  99486. var __vue_scopeId__ = null
  99487. /* moduleIdentifier (server only) */
  99488. var __vue_module_identifier__ = null
  99489. var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99490. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_body_vue___default.a,
  99491. __vue_render__,
  99492. __vue_static_render_fns__,
  99493. __vue_template_functional__,
  99494. __vue_styles__,
  99495. __vue_scopeId__,
  99496. __vue_module_identifier__
  99497. )
  99498. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  99499. /***/ }),
  99500. /* 571 */
  99501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99502. "use strict";
  99503. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99504. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__ = __webpack_require__(238);
  99505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__);
  99506. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__ = __webpack_require__(572);
  99508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__);
  99509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99510. /* script */
  99511. /* template */
  99512. /* template functional */
  99513. var __vue_template_functional__ = false
  99514. /* styles */
  99515. var __vue_styles__ = null
  99516. /* scopeId */
  99517. var __vue_scopeId__ = null
  99518. /* moduleIdentifier (server only) */
  99519. var __vue_module_identifier__ = null
  99520. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99521. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_table_tr_vue___default.a,
  99522. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__["render"],
  99523. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_44e7e90c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_table_tr_vue__["staticRenderFns"],
  99524. __vue_template_functional__,
  99525. __vue_styles__,
  99526. __vue_scopeId__,
  99527. __vue_module_identifier__
  99528. )
  99529. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  99530. /***/ }),
  99531. /* 572 */
  99532. /***/ (function(module, exports, __webpack_require__) {
  99533. "use strict";
  99534. Object.defineProperty(exports, "__esModule", {
  99535. value: true
  99536. });
  99537. var render = function render() {
  99538. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.draggable ? _c('tr', { class: _vm.rowClasses(_vm.row._index), attrs: { "draggable": _vm.draggable }, on: { "dragstart": function dragstart($event) {
  99539. return _vm.onDrag($event, _vm.row._index);
  99540. }, "drop": function drop($event) {
  99541. return _vm.onDrop($event, _vm.row._index);
  99542. }, "dragover": function dragover($event) {
  99543. return _vm.allowDrop($event);
  99544. } } }, [_vm._t("default")], 2) : _c('tr', { class: _vm.rowClasses(_vm.row._index), attrs: { "draggable": false } }, [_vm._t("default")], 2);
  99545. };
  99546. var staticRenderFns = [];
  99547. exports.render = render;
  99548. exports.staticRenderFns = staticRenderFns;
  99549. /***/ }),
  99550. /* 573 */
  99551. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99552. "use strict";
  99553. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99554. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__ = __webpack_require__(239);
  99555. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__);
  99556. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99557. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__ = __webpack_require__(575);
  99558. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__);
  99559. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99560. /* script */
  99561. /* template */
  99562. /* template functional */
  99563. var __vue_template_functional__ = false
  99564. /* styles */
  99565. var __vue_styles__ = null
  99566. /* scopeId */
  99567. var __vue_scopeId__ = null
  99568. /* moduleIdentifier (server only) */
  99569. var __vue_module_identifier__ = null
  99570. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99571. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_cell_vue___default.a,
  99572. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["render"],
  99573. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_1c727cfe_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_cell_vue__["staticRenderFns"],
  99574. __vue_template_functional__,
  99575. __vue_styles__,
  99576. __vue_scopeId__,
  99577. __vue_module_identifier__
  99578. )
  99579. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  99580. /***/ }),
  99581. /* 574 */
  99582. /***/ (function(module, exports, __webpack_require__) {
  99583. "use strict";
  99584. Object.defineProperty(exports, "__esModule", {
  99585. value: true
  99586. });
  99587. var _newArrowCheck2 = __webpack_require__(1);
  99588. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  99589. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  99590. exports.default = {
  99591. name: 'TableSlot',
  99592. functional: true,
  99593. inject: ['tableRoot'],
  99594. props: {
  99595. row: Object,
  99596. index: Number,
  99597. column: {
  99598. type: Object,
  99599. default: null
  99600. },
  99601. display: {
  99602. type: String,
  99603. default: 'block'
  99604. }
  99605. },
  99606. render: function render(h, ctx) {
  99607. (0, _newArrowCheck3.default)(undefined, undefined);
  99608. return h('div', {
  99609. 'class': {
  99610. 'ivu-table-cell-slot': true,
  99611. 'ivu-table-cell-slot-inline': ctx.props.display === 'inline',
  99612. 'ivu-table-cell-slot-inline-block': ctx.props.display === 'inline-block'
  99613. }
  99614. }, ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot]({
  99615. row: ctx.props.row,
  99616. column: ctx.props.column,
  99617. index: ctx.props.index
  99618. }));
  99619. }.bind(undefined)
  99620. };
  99621. /***/ }),
  99622. /* 575 */
  99623. /***/ (function(module, exports, __webpack_require__) {
  99624. "use strict";
  99625. Object.defineProperty(exports, "__esModule", {
  99626. value: true
  99627. });
  99628. var render = function render() {
  99629. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "cell", class: _vm.classes }, [_vm.renderType === 'index' ? [_c('span', [_vm._v(_vm._s(_vm.column.indexMethod ? _vm.column.indexMethod(_vm.row, _vm.naturalIndex) : _vm.naturalIndex + 1))])] : _vm._e(), _vm._v(" "), _vm.renderType === 'selection' ? [_c('Checkbox', { attrs: { "value": _vm.checked, "disabled": _vm.disabled }, on: { "on-change": _vm.toggleSelect }, nativeOn: { "click": function click($event) {
  99630. $event.stopPropagation();return _vm.handleClick($event);
  99631. } } })] : _vm._e(), _vm._v(" "), _vm.showLevel ? _c('div', { staticClass: "ivu-table-cell-tree-level", style: _vm.treeLevelStyle }) : _vm._e(), _vm._v(" "), _vm.showChildren ? _c('div', { staticClass: "ivu-table-cell-tree", class: { 'ivu-table-cell-tree-loading': _vm.childrenLoading }, on: { "click": function click($event) {
  99632. $event.preventDefault();$event.stopPropagation();return _vm.handleToggleTree($event);
  99633. } } }, [_vm.childrenLoading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : !_vm.childrenExpand ? _c('Icon', { attrs: { "type": "ios-add" } }) : _c('Icon', { attrs: { "type": "ios-remove" } })], 1) : _vm.showTreeNode ? _c('div', { staticClass: "ivu-table-cell-tree ivu-table-cell-tree-empty" }) : _vm._e(), _vm._v(" "), _vm.renderType === 'html' ? [_c('span', { domProps: { "innerHTML": _vm._s(_vm.row[_vm.column.key]) } })] : _vm._e(), _vm._v(" "), _vm.renderType === 'normal' ? [_vm.column.tooltip ? [_c('Tooltip', { staticClass: "ivu-table-cell-tooltip", attrs: { "transfer": "", "content": _vm.row[_vm.column.key], "theme": _vm.column.tooltipTheme ? _vm.column.tooltipTheme : _vm.tableRoot.tooltipTheme, "disabled": !_vm.showTooltip, "max-width": _vm.column.tooltipMaxWidth ? _vm.column.tooltipMaxWidth : _vm.tableRoot.tooltipMaxWidth } }, [_c('span', { ref: "content", staticClass: "ivu-table-cell-tooltip-content", on: { "mouseenter": _vm.handleTooltipIn } }, [_vm._v(_vm._s(_vm.row[_vm.column.key]))])])] : _c('span', [_vm._v(_vm._s(_vm.row[_vm.column.key]))])] : _vm._e(), _vm._v(" "), _vm.renderType === 'expand' && !_vm.row._disableExpand ? [_c('div', { class: _vm.expandCls, on: { "click": _vm.toggleExpand } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1)] : _vm._e(), _vm._v(" "), _vm.renderType === 'render' ? _c('table-expand', { attrs: { "row": _vm.row, "column": _vm.column, "index": _vm.index, "render": _vm.column.render } }) : _vm._e(), _vm._v(" "), _vm.renderType === 'slot' ? _c('table-slot', { attrs: { "row": _vm.row, "column": _vm.column, "display": _vm.column.display || 'block', "index": _vm.index } }) : _vm._e()], 2);
  99634. };
  99635. var staticRenderFns = [];
  99636. exports.render = render;
  99637. exports.staticRenderFns = staticRenderFns;
  99638. /***/ }),
  99639. /* 576 */
  99640. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99641. "use strict";
  99642. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99643. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__ = __webpack_require__(241);
  99644. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__);
  99645. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99646. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__ = __webpack_require__(577);
  99647. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__);
  99648. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99649. /* script */
  99650. /* template */
  99651. /* template functional */
  99652. var __vue_template_functional__ = false
  99653. /* styles */
  99654. var __vue_styles__ = null
  99655. /* scopeId */
  99656. var __vue_scopeId__ = null
  99657. /* moduleIdentifier (server only) */
  99658. var __vue_module_identifier__ = null
  99659. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99660. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_summary_vue___default.a,
  99661. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__["render"],
  99662. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6f7ddc60_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_summary_vue__["staticRenderFns"],
  99663. __vue_template_functional__,
  99664. __vue_styles__,
  99665. __vue_scopeId__,
  99666. __vue_module_identifier__
  99667. )
  99668. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  99669. /***/ }),
  99670. /* 577 */
  99671. /***/ (function(module, exports, __webpack_require__) {
  99672. "use strict";
  99673. Object.defineProperty(exports, "__esModule", {
  99674. value: true
  99675. });
  99676. var render = function render() {
  99677. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { staticStyle: { "overflow": "hidden" } }, [_c('table', { staticClass: "ivu-table-summary", style: _vm.styleObject, attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('colgroup', _vm._l(_vm.columns, function (column, index) {
  99678. return _c('col', { attrs: { "width": _vm.setCellWidth(column) } });
  99679. }), 0), _vm._v(" "), _c('tbody', { class: [_vm.prefixCls + '-tbody'] }, [_c('tr', { staticClass: "ivu-table-row" }, _vm._l(_vm.columns, function (column, index) {
  99680. return _c('td', { class: _vm.alignCls(column) }, [_c('div', { staticClass: "ivu-table-cell", class: _vm.cellCls(column) }, [_c('span', [_vm._v(_vm._s(_vm.data[column.key].value))])])]);
  99681. }), 0)])])]);
  99682. };
  99683. var staticRenderFns = [];
  99684. exports.render = render;
  99685. exports.staticRenderFns = staticRenderFns;
  99686. /***/ }),
  99687. /* 578 */
  99688. /***/ (function(module, exports, __webpack_require__) {
  99689. "use strict";
  99690. Object.defineProperty(exports, "__esModule", {
  99691. value: true
  99692. });
  99693. var _keys = __webpack_require__(21);
  99694. var _keys2 = _interopRequireDefault(_keys);
  99695. var _assign = __webpack_require__(15);
  99696. var _assign2 = _interopRequireDefault(_assign);
  99697. var _newArrowCheck2 = __webpack_require__(1);
  99698. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  99699. exports.default = csv;
  99700. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  99701. var newLine = '\r\n';
  99702. var appendLine = function (content, row, _ref) {
  99703. var separator = _ref.separator,
  99704. quoted = _ref.quoted;
  99705. (0, _newArrowCheck3.default)(undefined, undefined);
  99706. var line = row.map(function (data) {
  99707. (0, _newArrowCheck3.default)(undefined, undefined);
  99708. if (!quoted) return data;
  99709. data = typeof data === 'string' ? data.replace(/"/g, '"') : data;
  99710. return '"' + String(data) + '"';
  99711. }.bind(undefined));
  99712. content.push(line.join(separator));
  99713. }.bind(undefined);
  99714. var defaults = {
  99715. separator: ',',
  99716. quoted: false
  99717. };
  99718. function csv(columns, datas, options) {
  99719. var _this = this;
  99720. var noHeader = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  99721. options = (0, _assign2.default)({}, defaults, options);
  99722. var columnOrder = void 0;
  99723. var content = [];
  99724. var column = [];
  99725. if (columns) {
  99726. columnOrder = columns.map(function (v) {
  99727. (0, _newArrowCheck3.default)(this, _this);
  99728. if (typeof v === 'string') return v;
  99729. if (!noHeader) {
  99730. column.push(typeof v.title !== 'undefined' ? v.title : v.key);
  99731. }
  99732. return v.key;
  99733. }.bind(this));
  99734. if (column.length > 0) appendLine(content, column, options);
  99735. } else {
  99736. columnOrder = [];
  99737. datas.forEach(function (v) {
  99738. (0, _newArrowCheck3.default)(this, _this);
  99739. if (!Array.isArray(v)) {
  99740. columnOrder = columnOrder.concat((0, _keys2.default)(v));
  99741. }
  99742. }.bind(this));
  99743. if (columnOrder.length > 0) {
  99744. columnOrder = columnOrder.filter(function (value, index, self) {
  99745. (0, _newArrowCheck3.default)(this, _this);
  99746. return self.indexOf(value) === index;
  99747. }.bind(this));
  99748. if (!noHeader) appendLine(content, columnOrder, options);
  99749. }
  99750. }
  99751. if (Array.isArray(datas)) {
  99752. datas.forEach(function (row) {
  99753. (0, _newArrowCheck3.default)(this, _this);
  99754. if (!Array.isArray(row)) {
  99755. row = columnOrder.map(function (k) {
  99756. (0, _newArrowCheck3.default)(this, _this);
  99757. return typeof row[k] !== 'undefined' ? row[k] : '';
  99758. }.bind(this));
  99759. }
  99760. appendLine(content, row, options);
  99761. }.bind(this));
  99762. }
  99763. return content.join(newLine);
  99764. }
  99765. /***/ }),
  99766. /* 579 */
  99767. /***/ (function(module, exports, __webpack_require__) {
  99768. "use strict";
  99769. Object.defineProperty(exports, "__esModule", {
  99770. value: true
  99771. });
  99772. function has(browser) {
  99773. var ua = navigator.userAgent;
  99774. if (browser === 'ie') {
  99775. var isIE = ua.indexOf('compatible') > -1 && ua.indexOf('MSIE') > -1;
  99776. if (isIE) {
  99777. var reIE = new RegExp('MSIE (\\d+\\.\\d+);');
  99778. reIE.test(ua);
  99779. return parseFloat(RegExp['$1']);
  99780. } else {
  99781. return false;
  99782. }
  99783. } else {
  99784. return ua.indexOf(browser) > -1;
  99785. }
  99786. }
  99787. var csv = {
  99788. _isIE11: function _isIE11() {
  99789. var iev = 0;
  99790. var ieold = /MSIE (\d+\.\d+);/.test(navigator.userAgent);
  99791. var trident = !!navigator.userAgent.match(/Trident\/7.0/);
  99792. var rv = navigator.userAgent.indexOf('rv:11.0');
  99793. if (ieold) {
  99794. iev = Number(RegExp.$1);
  99795. }
  99796. if (navigator.appVersion.indexOf('MSIE 10') !== -1) {
  99797. iev = 10;
  99798. }
  99799. if (trident && rv !== -1) {
  99800. iev = 11;
  99801. }
  99802. return iev === 11;
  99803. },
  99804. _isEdge: function _isEdge() {
  99805. return (/Edge/.test(navigator.userAgent)
  99806. );
  99807. },
  99808. _getDownloadUrl: function _getDownloadUrl(text) {
  99809. var BOM = '\uFEFF';
  99810. if (window.Blob && window.URL && window.URL.createObjectURL) {
  99811. var csvData = new Blob([BOM + text], { type: 'text/csv' });
  99812. return URL.createObjectURL(csvData);
  99813. } else {
  99814. return 'data:attachment/csv;charset=utf-8,' + BOM + encodeURIComponent(text);
  99815. }
  99816. },
  99817. download: function download(filename, text) {
  99818. if (has('ie') && has('ie') < 10) {
  99819. var oWin = window.top.open('about:blank', '_blank');
  99820. oWin.document.charset = 'utf-8';
  99821. oWin.document.write(text);
  99822. oWin.document.close();
  99823. oWin.document.execCommand('SaveAs', filename);
  99824. oWin.close();
  99825. } else if (has('ie') === 10 || this._isIE11() || this._isEdge()) {
  99826. var BOM = '\uFEFF';
  99827. var csvData = new Blob([BOM + text], { type: 'text/csv' });
  99828. navigator.msSaveBlob(csvData, filename);
  99829. } else {
  99830. var link = document.createElement('a');
  99831. link.download = filename;
  99832. link.href = this._getDownloadUrl(text);
  99833. document.body.appendChild(link);
  99834. link.click();
  99835. document.body.removeChild(link);
  99836. }
  99837. }
  99838. };
  99839. exports.default = csv;
  99840. /***/ }),
  99841. /* 580 */
  99842. /***/ (function(module, exports, __webpack_require__) {
  99843. "use strict";
  99844. Object.defineProperty(exports, "__esModule", {
  99845. value: true
  99846. });
  99847. exports.getRandomStr = exports.convertToRows = exports.getAllColumns = exports.convertColumnOrder = undefined;
  99848. var _newArrowCheck2 = __webpack_require__(1);
  99849. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  99850. var _assist = __webpack_require__(3);
  99851. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  99852. var convertColumnOrder = function (columns, fixedType) {
  99853. (0, _newArrowCheck3.default)(undefined, undefined);
  99854. var list = [];
  99855. var other = [];
  99856. columns.forEach(function (col) {
  99857. (0, _newArrowCheck3.default)(undefined, undefined);
  99858. if (col.fixed && col.fixed === fixedType) {
  99859. list.push(col);
  99860. } else {
  99861. other.push(col);
  99862. }
  99863. }.bind(undefined));
  99864. return list.concat(other);
  99865. }.bind(undefined);
  99866. exports.convertColumnOrder = convertColumnOrder;
  99867. var getAllColumns = function (cols) {
  99868. var forTableHead = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  99869. (0, _newArrowCheck3.default)(undefined, undefined);
  99870. var columns = (0, _assist.deepCopy)(cols);
  99871. var result = [];
  99872. columns.forEach(function (column) {
  99873. (0, _newArrowCheck3.default)(undefined, undefined);
  99874. if (column.children) {
  99875. if (forTableHead) result.push(column);
  99876. result.push.apply(result, getAllColumns(column.children, forTableHead));
  99877. } else {
  99878. result.push(column);
  99879. }
  99880. }.bind(undefined));
  99881. return result;
  99882. }.bind(undefined);
  99883. exports.getAllColumns = getAllColumns;
  99884. var convertToRows = function (columns) {
  99885. var fixedType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  99886. (0, _newArrowCheck3.default)(undefined, undefined);
  99887. var originColumns = fixedType ? fixedType === 'left' ? (0, _assist.deepCopy)(convertColumnOrder(columns, 'left')) : (0, _assist.deepCopy)(convertColumnOrder(columns, 'right')) : (0, _assist.deepCopy)(columns);
  99888. var maxLevel = 1;
  99889. var traverse = function (column, parent) {
  99890. (0, _newArrowCheck3.default)(undefined, undefined);
  99891. if (parent) {
  99892. column.level = parent.level + 1;
  99893. if (maxLevel < column.level) {
  99894. maxLevel = column.level;
  99895. }
  99896. }
  99897. if (column.children) {
  99898. var colSpan = 0;
  99899. column.children.forEach(function (subColumn) {
  99900. (0, _newArrowCheck3.default)(undefined, undefined);
  99901. traverse(subColumn, column);
  99902. colSpan += subColumn.colSpan;
  99903. }.bind(undefined));
  99904. column.colSpan = colSpan;
  99905. } else {
  99906. column.colSpan = 1;
  99907. }
  99908. }.bind(undefined);
  99909. originColumns.forEach(function (column) {
  99910. (0, _newArrowCheck3.default)(undefined, undefined);
  99911. column.level = 1;
  99912. traverse(column);
  99913. }.bind(undefined));
  99914. var rows = [];
  99915. for (var i = 0; i < maxLevel; i++) {
  99916. rows.push([]);
  99917. }
  99918. var allColumns = getAllColumns(originColumns, true);
  99919. allColumns.forEach(function (column) {
  99920. (0, _newArrowCheck3.default)(undefined, undefined);
  99921. if (!column.children) {
  99922. column.rowSpan = maxLevel - column.level + 1;
  99923. } else {
  99924. column.rowSpan = 1;
  99925. }
  99926. rows[column.level - 1].push(column);
  99927. }.bind(undefined));
  99928. return rows;
  99929. }.bind(undefined);
  99930. exports.convertToRows = convertToRows;
  99931. var getRandomStr = function getRandomStr() {
  99932. var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;
  99933. var $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
  99934. var maxPos = $chars.length;
  99935. var str = '';
  99936. for (var i = 0; i < len; i++) {
  99937. str += $chars.charAt(Math.floor(Math.random() * maxPos));
  99938. }
  99939. return str;
  99940. };
  99941. exports.getRandomStr = getRandomStr;
  99942. /***/ }),
  99943. /* 581 */
  99944. /***/ (function(module, exports, __webpack_require__) {
  99945. "use strict";
  99946. Object.defineProperty(exports, "__esModule", {
  99947. value: true
  99948. });
  99949. var render = function render() {
  99950. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "tableWrap", class: _vm.wrapClasses, style: _vm.styles }, [_c('div', { class: _vm.classes }, [_vm.showSlotHeader ? _c('div', { ref: "title", class: [_vm.prefixCls + '-title'] }, [_vm._t("header")], 2) : _vm._e(), _vm._v(" "), _vm.showHeader ? _c('div', { ref: "header", class: [_vm.prefixCls + '-header'], on: { "mousewheel": _vm.handleMouseWheel } }, [_c('table-head', { attrs: { "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableHeaderStyle, "columns": _vm.cloneColumns, "column-rows": _vm.columnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !(!!_vm.localeNoDataText && (!_vm.data || _vm.data.length === 0) || !!_vm.localeNoFilteredDataText && (!_vm.rebuildData || _vm.rebuildData.length === 0)), expression: "!((!!localeNoDataText && (!data || data.length === 0)) || (!!localeNoFilteredDataText && (!rebuildData || rebuildData.length === 0)))" }], ref: "body", class: [_vm.prefixCls + '-body'], style: _vm.bodyStyle, on: { "scroll": _vm.handleBodyScroll } }, [_c('table-body', { ref: "tbody", attrs: { "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableStyle, "columns": _vm.cloneColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { ref: "summary", attrs: { "prefix-cls": _vm.prefixCls, "styleObject": _vm.tableStyle, "columns": _vm.cloneColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e(), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: !!_vm.localeNoDataText && (!_vm.data || _vm.data.length === 0) || !!_vm.localeNoFilteredDataText && (!_vm.rebuildData || _vm.rebuildData.length === 0), expression: "((!!localeNoDataText && (!data || data.length === 0)) || (!!localeNoFilteredDataText && (!rebuildData || rebuildData.length === 0)))" }], class: [_vm.prefixCls + '-tip'], style: _vm.bodyStyle, on: { "scroll": _vm.handleBodyScroll } }, [_c('table', { attrs: { "cellspacing": "0", "cellpadding": "0", "border": "0" } }, [_c('tbody', [_c('tr', [_c('td', { style: { 'height': _vm.bodyStyle.height, 'width': this.headerWidth + "px" } }, [!_vm.data || _vm.data.length === 0 ? _c('span', { domProps: { "innerHTML": _vm._s(_vm.localeNoDataText) } }) : _c('span', { domProps: { "innerHTML": _vm._s(_vm.localeNoFilteredDataText) } })])])])])]), _vm._v(" "), _vm.isLeftFixed ? _c('div', { class: _vm.fixedTableClasses, style: _vm.fixedTableStyle }, [_vm.showHeader ? _c('div', { class: _vm.fixedHeaderClasses }, [_c('table-head', { attrs: { "fixed": "left", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "column-rows": _vm.columnRows, "fixed-column-rows": _vm.leftFixedColumnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { ref: "fixedBody", class: [_vm.prefixCls + '-fixed-body'], style: _vm.fixedBodyStyle, on: { "mousewheel": _vm.handleFixedMousewheel, "DOMMouseScroll": _vm.handleFixedMousewheel } }, [_c('table-body', { attrs: { "fixed": "left", "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { style: { 'margin-top': _vm.showHorizontalScrollBar ? _vm.scrollBarWidth + 'px' : 0 }, attrs: { "fixed": "left", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedTableStyle, "columns": _vm.leftFixedColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.isRightFixed ? _c('div', { class: _vm.fixedRightTableClasses, style: _vm.fixedRightTableStyle }, [_vm.showHeader ? _c('div', { class: _vm.fixedHeaderClasses }, [_c('table-head', { attrs: { "fixed": "right", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "column-rows": _vm.columnRows, "fixed-column-rows": _vm.rightFixedColumnRows, "obj-data": _vm.objData, "columns-width": _vm.columnsWidth, "data": _vm.rebuildData } })], 1) : _vm._e(), _vm._v(" "), _c('div', { ref: "fixedRightBody", class: [_vm.prefixCls + '-fixed-body'], style: _vm.fixedBodyStyle, on: { "mousewheel": _vm.handleFixedMousewheel, "DOMMouseScroll": _vm.handleFixedMousewheel } }, [_c('table-body', { attrs: { "fixed": "right", "draggable": _vm.draggable, "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "data": _vm.rebuildData, "row-key": _vm.rowKey, "columns-width": _vm.columnsWidth, "obj-data": _vm.objData } })], 1), _vm._v(" "), _vm.showSummary && _vm.data && _vm.data.length ? _c('table-summary', { style: { 'margin-top': _vm.showHorizontalScrollBar ? _vm.scrollBarWidth + 'px' : 0 }, attrs: { "fixed": "right", "prefix-cls": _vm.prefixCls, "styleObject": _vm.fixedRightTableStyle, "columns": _vm.rightFixedColumns, "data": _vm.summaryData, "columns-width": _vm.columnsWidth } }) : _vm._e()], 1) : _vm._e(), _vm._v(" "), _vm.isRightFixed ? _c('div', { class: [_vm.prefixCls + '-fixed-right-header'], style: _vm.fixedRightHeaderStyle }) : _vm._e(), _vm._v(" "), _vm.showSlotFooter ? _c('div', { ref: "footer", class: [_vm.prefixCls + '-footer'] }, [_vm._t("footer")], 2) : _vm._e()], 1), _vm._v(" "), _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.showResizeLine, expression: "showResizeLine" }], ref: "resizeLine", staticClass: "ivu-table-resize-line" }), _vm._v(" "), _vm.showContextMenu ? _c('div', { staticClass: "ivu-table-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1) : _vm._e(), _vm._v(" "), _vm.loading ? _c('Spin', { attrs: { "fix": "", "size": "large" } }, [_vm._t("loading")], 2) : _vm._e()], 1);
  99951. };
  99952. var staticRenderFns = [];
  99953. exports.render = render;
  99954. exports.staticRenderFns = staticRenderFns;
  99955. /***/ }),
  99956. /* 582 */
  99957. /***/ (function(module, exports, __webpack_require__) {
  99958. "use strict";
  99959. Object.defineProperty(exports, "__esModule", {
  99960. value: true
  99961. });
  99962. var _tabs = __webpack_require__(583);
  99963. var _tabs2 = _interopRequireDefault(_tabs);
  99964. var _pane = __webpack_require__(585);
  99965. var _pane2 = _interopRequireDefault(_pane);
  99966. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  99967. _tabs2.default.Pane = _pane2.default;
  99968. exports.default = _tabs2.default;
  99969. /***/ }),
  99970. /* 583 */
  99971. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  99972. "use strict";
  99973. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  99974. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__ = __webpack_require__(242);
  99975. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__);
  99976. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  99977. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__ = __webpack_require__(584);
  99978. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__);
  99979. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  99980. /* script */
  99981. /* template */
  99982. /* template functional */
  99983. var __vue_template_functional__ = false
  99984. /* styles */
  99985. var __vue_styles__ = null
  99986. /* scopeId */
  99987. var __vue_scopeId__ = null
  99988. /* moduleIdentifier (server only) */
  99989. var __vue_module_identifier__ = null
  99990. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  99991. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tabs_vue___default.a,
  99992. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__["render"],
  99993. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a114a97e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tabs_vue__["staticRenderFns"],
  99994. __vue_template_functional__,
  99995. __vue_styles__,
  99996. __vue_scopeId__,
  99997. __vue_module_identifier__
  99998. )
  99999. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100000. /***/ }),
  100001. /* 584 */
  100002. /***/ (function(module, exports, __webpack_require__) {
  100003. "use strict";
  100004. Object.defineProperty(exports, "__esModule", {
  100005. value: true
  100006. });
  100007. var render = function render() {
  100008. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "tabsWrap", class: _vm.classes }, [_c('div', { class: [_vm.prefixCls + '-bar'] }, [_vm.showSlot ? _c('div', { class: [_vm.prefixCls + '-nav-right'] }, [_vm._t("extra")], 2) : _vm._e(), _vm._v(" "), _c('div', { ref: "navContainer", class: [_vm.prefixCls + '-nav-container'], attrs: { "tabindex": "0" }, on: { "keydown": [_vm.handleTabKeyNavigation, function ($event) {
  100009. if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "space", 32, $event.key, [" ", "Spacebar"])) {
  100010. return null;
  100011. }$event.preventDefault();return _vm.handleTabKeyboardSelect(false);
  100012. }] } }, [_c('div', { ref: "navWrap", class: [_vm.prefixCls + '-nav-wrap', _vm.scrollable ? _vm.prefixCls + '-nav-scrollable' : ''] }, [_c('span', { class: [_vm.prefixCls + '-nav-prev', _vm.scrollable ? '' : _vm.prefixCls + '-nav-scroll-disabled'], on: { "click": _vm.scrollPrev } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } })], 1), _vm._v(" "), _c('span', { class: [_vm.prefixCls + '-nav-next', _vm.scrollable ? '' : _vm.prefixCls + '-nav-scroll-disabled'], on: { "click": _vm.scrollNext } }, [_c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('div', { ref: "navScroll", class: [_vm.prefixCls + '-nav-scroll'], on: { "DOMMouseScroll": _vm.handleScroll, "mousewheel": _vm.handleScroll } }, [_c('div', { ref: "nav", class: [_vm.prefixCls + '-nav'], style: _vm.navStyle }, [_c('div', { class: _vm.barClasses, style: _vm.barStyle }), _vm._v(" "), _vm._l(_vm.navList, function (item, index) {
  100013. return _c('div', { class: _vm.tabCls(item), attrs: { "draggable": _vm.draggable }, on: { "click": function click($event) {
  100014. return _vm.handleChange(index);
  100015. }, "dblclick": function dblclick($event) {
  100016. return _vm.handleDblclick(index);
  100017. }, "contextmenu": function contextmenu($event) {
  100018. $event.stopPropagation();return _vm.handleContextmenu(index, $event);
  100019. }, "selectstart": function selectstart($event) {
  100020. $event.stopPropagation();return _vm.handlePreventSelect(index, $event);
  100021. }, "dragstart": function dragstart($event) {
  100022. return _vm.handleDrag(index, $event);
  100023. }, "drop": function drop($event) {
  100024. return _vm.handleDrop(index, $event);
  100025. }, "dragover": function dragover($event) {
  100026. $event.preventDefault();
  100027. } } }, [item.icon !== '' ? _c('Icon', { attrs: { "type": item.icon } }) : _vm._e(), _vm._v(" "), item.labelType === 'function' ? _c('Render', { attrs: { "render": item.label } }) : [_vm._v(_vm._s(item.label))], _vm._v(" "), _vm.showClose(item) ? _c('Icon', { class: [_vm.prefixCls + '-close'], attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize }, nativeOn: { "click": function click($event) {
  100028. $event.stopPropagation();return _vm.handleRemove(index);
  100029. } } }) : _vm._e()], 2);
  100030. })], 2)])])])]), _vm._v(" "), _c('div', { ref: "panes", class: _vm.contentClasses, style: _vm.contentStyle }, [_vm._t("default")], 2), _vm._v(" "), _c('div', { staticClass: "ivu-tabs-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1)]);
  100031. };
  100032. var staticRenderFns = [];
  100033. exports.render = render;
  100034. exports.staticRenderFns = staticRenderFns;
  100035. /***/ }),
  100036. /* 585 */
  100037. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100038. "use strict";
  100039. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100040. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__ = __webpack_require__(243);
  100041. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__);
  100042. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100043. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__ = __webpack_require__(586);
  100044. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__);
  100045. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100046. /* script */
  100047. /* template */
  100048. /* template functional */
  100049. var __vue_template_functional__ = false
  100050. /* styles */
  100051. var __vue_styles__ = null
  100052. /* scopeId */
  100053. var __vue_scopeId__ = null
  100054. /* moduleIdentifier (server only) */
  100055. var __vue_module_identifier__ = null
  100056. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100057. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_pane_vue___default.a,
  100058. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__["render"],
  100059. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_0df6e880_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_pane_vue__["staticRenderFns"],
  100060. __vue_template_functional__,
  100061. __vue_styles__,
  100062. __vue_scopeId__,
  100063. __vue_module_identifier__
  100064. )
  100065. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100066. /***/ }),
  100067. /* 586 */
  100068. /***/ (function(module, exports, __webpack_require__) {
  100069. "use strict";
  100070. Object.defineProperty(exports, "__esModule", {
  100071. value: true
  100072. });
  100073. var render = function render() {
  100074. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "show", rawName: "v-show", value: _vm.show, expression: "show" }], class: _vm.prefixCls, style: _vm.contentStyle }, [_vm._t("default")], 2);
  100075. };
  100076. var staticRenderFns = [];
  100077. exports.render = render;
  100078. exports.staticRenderFns = staticRenderFns;
  100079. /***/ }),
  100080. /* 587 */
  100081. /***/ (function(module, exports, __webpack_require__) {
  100082. "use strict";
  100083. Object.defineProperty(exports, "__esModule", {
  100084. value: true
  100085. });
  100086. var _tag = __webpack_require__(588);
  100087. var _tag2 = _interopRequireDefault(_tag);
  100088. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100089. exports.default = _tag2.default;
  100090. /***/ }),
  100091. /* 588 */
  100092. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100093. "use strict";
  100094. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100095. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__ = __webpack_require__(244);
  100096. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__);
  100097. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100098. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__ = __webpack_require__(589);
  100099. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__);
  100100. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100101. /* script */
  100102. /* template */
  100103. /* template functional */
  100104. var __vue_template_functional__ = false
  100105. /* styles */
  100106. var __vue_styles__ = null
  100107. /* scopeId */
  100108. var __vue_scopeId__ = null
  100109. /* moduleIdentifier (server only) */
  100110. var __vue_module_identifier__ = null
  100111. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100112. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tag_vue___default.a,
  100113. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__["render"],
  100114. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_765e6050_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tag_vue__["staticRenderFns"],
  100115. __vue_template_functional__,
  100116. __vue_styles__,
  100117. __vue_scopeId__,
  100118. __vue_module_identifier__
  100119. )
  100120. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100121. /***/ }),
  100122. /* 589 */
  100123. /***/ (function(module, exports, __webpack_require__) {
  100124. "use strict";
  100125. Object.defineProperty(exports, "__esModule", {
  100126. value: true
  100127. });
  100128. var render = function render() {
  100129. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _vm.fade ? _c('transition', { attrs: { "name": "fade" } }, [_c('div', { class: _vm.classes, style: _vm.wraperStyles, on: { "click": function click($event) {
  100130. $event.stopPropagation();return _vm.check($event);
  100131. } } }, [_vm.showDot ? _c('span', { class: _vm.dotClasses, style: _vm.bgColorStyle }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.textClasses, style: _vm.textColorStyle }, [_vm._t("default")], 2), _vm._v(" "), _vm.closable ? _c('Icon', { class: _vm.iconClass, attrs: { "color": _vm.lineColor, "type": "ios-close" }, nativeOn: { "click": function click($event) {
  100132. $event.stopPropagation();return _vm.close($event);
  100133. } } }) : _vm._e()], 1)]) : _c('div', { class: _vm.classes, style: _vm.wraperStyles, on: { "click": function click($event) {
  100134. $event.stopPropagation();return _vm.check($event);
  100135. } } }, [_vm.showDot ? _c('span', { class: _vm.dotClasses, style: _vm.bgColorStyle }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.textClasses, style: _vm.textColorStyle }, [_vm._t("default")], 2), _vm._v(" "), _vm.closable ? _c('Icon', { class: _vm.iconClass, attrs: { "color": _vm.lineColor, "type": "ios-close" }, nativeOn: { "click": function click($event) {
  100136. $event.stopPropagation();return _vm.close($event);
  100137. } } }) : _vm._e()], 1);
  100138. };
  100139. var staticRenderFns = [];
  100140. exports.render = render;
  100141. exports.staticRenderFns = staticRenderFns;
  100142. /***/ }),
  100143. /* 590 */
  100144. /***/ (function(module, exports, __webpack_require__) {
  100145. "use strict";
  100146. Object.defineProperty(exports, "__esModule", {
  100147. value: true
  100148. });
  100149. var _time = __webpack_require__(591);
  100150. var _time2 = _interopRequireDefault(_time);
  100151. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100152. exports.default = _time2.default;
  100153. /***/ }),
  100154. /* 591 */
  100155. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100156. "use strict";
  100157. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100158. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__ = __webpack_require__(245);
  100159. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__);
  100160. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100161. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__ = __webpack_require__(593);
  100162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__);
  100163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100164. /* script */
  100165. /* template */
  100166. /* template functional */
  100167. var __vue_template_functional__ = false
  100168. /* styles */
  100169. var __vue_styles__ = null
  100170. /* scopeId */
  100171. var __vue_scopeId__ = null
  100172. /* moduleIdentifier (server only) */
  100173. var __vue_module_identifier__ = null
  100174. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100175. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_time_vue___default.a,
  100176. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["render"],
  100177. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_47132a92_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_time_vue__["staticRenderFns"],
  100178. __vue_template_functional__,
  100179. __vue_styles__,
  100180. __vue_scopeId__,
  100181. __vue_module_identifier__
  100182. )
  100183. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100184. /***/ }),
  100185. /* 592 */
  100186. /***/ (function(module, exports, __webpack_require__) {
  100187. "use strict";
  100188. Object.defineProperty(exports, "__esModule", {
  100189. value: true
  100190. });
  100191. exports.getRelativeTime = undefined;
  100192. var _newArrowCheck2 = __webpack_require__(1);
  100193. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  100194. exports.default = function (timestamp, locale) {
  100195. return getRelativeTime(timestamp, locale);
  100196. };
  100197. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100198. var isEarly = function (timeStamp, currentTime) {
  100199. (0, _newArrowCheck3.default)(undefined, undefined);
  100200. return timeStamp <= currentTime;
  100201. }.bind(undefined);
  100202. var getHandledValue = function (num) {
  100203. (0, _newArrowCheck3.default)(undefined, undefined);
  100204. return num < 10 ? '0' + num : num;
  100205. }.bind(undefined);
  100206. var getDate = function (timeStamp, startType) {
  100207. (0, _newArrowCheck3.default)(undefined, undefined);
  100208. var d = new Date(timeStamp);
  100209. var year = d.getFullYear();
  100210. var month = getHandledValue(d.getMonth() + 1);
  100211. var date = getHandledValue(d.getDate());
  100212. var hours = getHandledValue(d.getHours());
  100213. var minutes = getHandledValue(d.getMinutes());
  100214. var second = getHandledValue(d.getSeconds());
  100215. var resStr = '';
  100216. if (startType === 'year') resStr = year + '-' + month + '-' + date + ' ' + hours + ':' + minutes + ':' + second;else resStr = month + '-' + date + ' ' + hours + ':' + minutes;
  100217. return resStr;
  100218. }.bind(undefined);
  100219. var getRelativeTime = exports.getRelativeTime = function (timeStamp, locale) {
  100220. (0, _newArrowCheck3.default)(undefined, undefined);
  100221. var currentTime = new Date().getTime();
  100222. var IS_EARLY = isEarly(timeStamp, currentTime);
  100223. var diff = currentTime - timeStamp;
  100224. if (!IS_EARLY) diff = -diff;
  100225. var resStr = '';
  100226. var dirStr = IS_EARLY ? locale('i.time.before') || '前' : locale('i.time.after') || '后';
  100227. if (diff < 1000) resStr = locale('i.time.just') || '刚刚';else if (diff < 60000) resStr = parseInt(diff / 1000) + (locale('i.time.seconds') || '秒') + dirStr;else if (diff >= 60000 && diff < 3600000) resStr = Math.floor(diff / 60000) + (locale('i.time.minutes') || '分钟') + dirStr;else if (diff >= 3600000 && diff < 86400000) resStr = Math.floor(diff / 3600000) + (locale('i.time.hours') || '小时') + dirStr;else if (diff >= 86400000 && diff < 2623860000) resStr = Math.floor(diff / 86400000) + (locale('i.time.days') || '天') + dirStr;else if (diff >= 2623860000 && diff <= 31567860000 && IS_EARLY) resStr = getDate(timeStamp);else resStr = getDate(timeStamp, 'year');
  100228. return resStr;
  100229. }.bind(undefined);
  100230. /***/ }),
  100231. /* 593 */
  100232. /***/ (function(module, exports, __webpack_require__) {
  100233. "use strict";
  100234. Object.defineProperty(exports, "__esModule", {
  100235. value: true
  100236. });
  100237. var render = function render() {
  100238. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('span', { class: _vm.classes, on: { "click": _vm.handleClick } }, [_vm._v(_vm._s(_vm.date))]);
  100239. };
  100240. var staticRenderFns = [];
  100241. exports.render = render;
  100242. exports.staticRenderFns = staticRenderFns;
  100243. /***/ }),
  100244. /* 594 */
  100245. /***/ (function(module, exports, __webpack_require__) {
  100246. "use strict";
  100247. Object.defineProperty(exports, "__esModule", {
  100248. value: true
  100249. });
  100250. var _timeline = __webpack_require__(595);
  100251. var _timeline2 = _interopRequireDefault(_timeline);
  100252. var _timelineItem = __webpack_require__(597);
  100253. var _timelineItem2 = _interopRequireDefault(_timelineItem);
  100254. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100255. _timeline2.default.Item = _timelineItem2.default;
  100256. exports.default = _timeline2.default;
  100257. /***/ }),
  100258. /* 595 */
  100259. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100260. "use strict";
  100261. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100262. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__ = __webpack_require__(246);
  100263. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__);
  100264. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100265. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__ = __webpack_require__(596);
  100266. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__);
  100267. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100268. /* script */
  100269. /* template */
  100270. /* template functional */
  100271. var __vue_template_functional__ = false
  100272. /* styles */
  100273. var __vue_styles__ = null
  100274. /* scopeId */
  100275. var __vue_scopeId__ = null
  100276. /* moduleIdentifier (server only) */
  100277. var __vue_module_identifier__ = null
  100278. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100279. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_vue___default.a,
  100280. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__["render"],
  100281. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_af320bf0_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_vue__["staticRenderFns"],
  100282. __vue_template_functional__,
  100283. __vue_styles__,
  100284. __vue_scopeId__,
  100285. __vue_module_identifier__
  100286. )
  100287. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100288. /***/ }),
  100289. /* 596 */
  100290. /***/ (function(module, exports, __webpack_require__) {
  100291. "use strict";
  100292. Object.defineProperty(exports, "__esModule", {
  100293. value: true
  100294. });
  100295. var render = function render() {
  100296. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: _vm.classes }, [_vm._t("default")], 2);
  100297. };
  100298. var staticRenderFns = [];
  100299. exports.render = render;
  100300. exports.staticRenderFns = staticRenderFns;
  100301. /***/ }),
  100302. /* 597 */
  100303. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100304. "use strict";
  100305. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100306. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__ = __webpack_require__(247);
  100307. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__);
  100308. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100309. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__ = __webpack_require__(598);
  100310. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__);
  100311. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100312. /* script */
  100313. /* template */
  100314. /* template functional */
  100315. var __vue_template_functional__ = false
  100316. /* styles */
  100317. var __vue_styles__ = null
  100318. /* scopeId */
  100319. var __vue_scopeId__ = null
  100320. /* moduleIdentifier (server only) */
  100321. var __vue_module_identifier__ = null
  100322. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100323. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timeline_item_vue___default.a,
  100324. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__["render"],
  100325. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_cf28fc44_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timeline_item_vue__["staticRenderFns"],
  100326. __vue_template_functional__,
  100327. __vue_styles__,
  100328. __vue_scopeId__,
  100329. __vue_module_identifier__
  100330. )
  100331. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100332. /***/ }),
  100333. /* 598 */
  100334. /***/ (function(module, exports, __webpack_require__) {
  100335. "use strict";
  100336. Object.defineProperty(exports, "__esModule", {
  100337. value: true
  100338. });
  100339. var render = function render() {
  100340. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { class: _vm.itemClasses }, [_c('div', { class: _vm.tailClasses }), _vm._v(" "), _c('div', { ref: "dot", class: _vm.headClasses, style: _vm.customColor }, [_vm._t("dot")], 2), _vm._v(" "), _c('div', { class: _vm.contentClasses }, [_vm._t("default")], 2)]);
  100341. };
  100342. var staticRenderFns = [];
  100343. exports.render = render;
  100344. exports.staticRenderFns = staticRenderFns;
  100345. /***/ }),
  100346. /* 599 */
  100347. /***/ (function(module, exports, __webpack_require__) {
  100348. "use strict";
  100349. Object.defineProperty(exports, "__esModule", {
  100350. value: true
  100351. });
  100352. var _timePicker = __webpack_require__(600);
  100353. var _timePicker2 = _interopRequireDefault(_timePicker);
  100354. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100355. exports.default = _timePicker2.default;
  100356. /***/ }),
  100357. /* 600 */
  100358. /***/ (function(module, exports, __webpack_require__) {
  100359. "use strict";
  100360. Object.defineProperty(exports, "__esModule", {
  100361. value: true
  100362. });
  100363. var _newArrowCheck2 = __webpack_require__(1);
  100364. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  100365. var _picker = __webpack_require__(157);
  100366. var _picker2 = _interopRequireDefault(_picker);
  100367. var _time = __webpack_require__(166);
  100368. var _time2 = _interopRequireDefault(_time);
  100369. var _timeRange = __webpack_require__(175);
  100370. var _timeRange2 = _interopRequireDefault(_timeRange);
  100371. var _timeMixins = __webpack_require__(58);
  100372. var _timeMixins2 = _interopRequireDefault(_timeMixins);
  100373. var _assist = __webpack_require__(3);
  100374. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100375. exports.default = {
  100376. mixins: [_picker2.default, _timeMixins2.default],
  100377. components: { TimePickerPanel: _time2.default, RangeTimePickerPanel: _timeRange2.default },
  100378. props: {
  100379. type: {
  100380. validator: function validator(value) {
  100381. return (0, _assist.oneOf)(value, ['time', 'timerange']);
  100382. },
  100383. default: 'time'
  100384. }
  100385. },
  100386. computed: {
  100387. panel: function panel() {
  100388. var isRange = this.type === 'timerange';
  100389. return isRange ? 'RangeTimePickerPanel' : 'TimePickerPanel';
  100390. },
  100391. ownPickerProps: function ownPickerProps() {
  100392. return {
  100393. disabledHours: this.disabledHours,
  100394. disabledMinutes: this.disabledMinutes,
  100395. disabledSeconds: this.disabledSeconds,
  100396. hideDisabledOptions: this.hideDisabledOptions
  100397. };
  100398. }
  100399. },
  100400. watch: {
  100401. visible: function visible(_visible) {
  100402. var _this = this;
  100403. if (_visible) {
  100404. this.$nextTick(function () {
  100405. (0, _newArrowCheck3.default)(this, _this);
  100406. var spinners = (0, _assist.findComponentsDownward)(this, 'TimeSpinner');
  100407. spinners.forEach(function (instance) {
  100408. (0, _newArrowCheck3.default)(this, _this);
  100409. return instance.updateScroll();
  100410. }.bind(this));
  100411. }.bind(this));
  100412. }
  100413. }
  100414. }
  100415. };
  100416. /***/ }),
  100417. /* 601 */
  100418. /***/ (function(module, exports, __webpack_require__) {
  100419. "use strict";
  100420. Object.defineProperty(exports, "__esModule", {
  100421. value: true
  100422. });
  100423. var _tooltip = __webpack_require__(93);
  100424. var _tooltip2 = _interopRequireDefault(_tooltip);
  100425. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100426. exports.default = _tooltip2.default;
  100427. /***/ }),
  100428. /* 602 */
  100429. /***/ (function(module, exports, __webpack_require__) {
  100430. "use strict";
  100431. Object.defineProperty(exports, "__esModule", {
  100432. value: true
  100433. });
  100434. var _transfer = __webpack_require__(603);
  100435. var _transfer2 = _interopRequireDefault(_transfer);
  100436. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100437. exports.default = _transfer2.default;
  100438. /***/ }),
  100439. /* 603 */
  100440. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100441. "use strict";
  100442. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100443. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__ = __webpack_require__(248);
  100444. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__);
  100445. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100446. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100447. /* script */
  100448. /* template */
  100449. var __vue_render__, __vue_static_render_fns__
  100450. /* template functional */
  100451. var __vue_template_functional__ = false
  100452. /* styles */
  100453. var __vue_styles__ = null
  100454. /* scopeId */
  100455. var __vue_scopeId__ = null
  100456. /* moduleIdentifier (server only) */
  100457. var __vue_module_identifier__ = null
  100458. var Component = Object(__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100459. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default.a,
  100460. __vue_render__,
  100461. __vue_static_render_fns__,
  100462. __vue_template_functional__,
  100463. __vue_styles__,
  100464. __vue_scopeId__,
  100465. __vue_module_identifier__
  100466. )
  100467. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100468. /***/ }),
  100469. /* 604 */
  100470. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100471. "use strict";
  100472. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100473. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__ = __webpack_require__(249);
  100474. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__);
  100475. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100476. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__ = __webpack_require__(607);
  100477. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__);
  100478. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100479. /* script */
  100480. /* template */
  100481. /* template functional */
  100482. var __vue_template_functional__ = false
  100483. /* styles */
  100484. var __vue_styles__ = null
  100485. /* scopeId */
  100486. var __vue_scopeId__ = null
  100487. /* moduleIdentifier (server only) */
  100488. var __vue_module_identifier__ = null
  100489. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100490. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default.a,
  100491. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["render"],
  100492. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_00c5b8d8_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__["staticRenderFns"],
  100493. __vue_template_functional__,
  100494. __vue_styles__,
  100495. __vue_scopeId__,
  100496. __vue_module_identifier__
  100497. )
  100498. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100499. /***/ }),
  100500. /* 605 */
  100501. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100502. "use strict";
  100503. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100504. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__ = __webpack_require__(250);
  100505. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__);
  100506. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100507. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__ = __webpack_require__(606);
  100508. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__);
  100509. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100510. /* script */
  100511. /* template */
  100512. /* template functional */
  100513. var __vue_template_functional__ = false
  100514. /* styles */
  100515. var __vue_styles__ = null
  100516. /* scopeId */
  100517. var __vue_scopeId__ = null
  100518. /* moduleIdentifier (server only) */
  100519. var __vue_module_identifier__ = null
  100520. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100521. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_search_vue___default.a,
  100522. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__["render"],
  100523. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_a86e25ae_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_search_vue__["staticRenderFns"],
  100524. __vue_template_functional__,
  100525. __vue_styles__,
  100526. __vue_scopeId__,
  100527. __vue_module_identifier__
  100528. )
  100529. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100530. /***/ }),
  100531. /* 606 */
  100532. /***/ (function(module, exports, __webpack_require__) {
  100533. "use strict";
  100534. Object.defineProperty(exports, "__esModule", {
  100535. value: true
  100536. });
  100537. var render = function render() {
  100538. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls }, [_c('i-input', { attrs: { "size": "small", "icon": _vm.icon, "placeholder": _vm.placeholder }, on: { "on-click": _vm.handleClick }, model: { value: _vm.currentQuery, callback: function callback($$v) {
  100539. _vm.currentQuery = $$v;
  100540. }, expression: "currentQuery" } })], 1);
  100541. };
  100542. var staticRenderFns = [];
  100543. exports.render = render;
  100544. exports.staticRenderFns = staticRenderFns;
  100545. /***/ }),
  100546. /* 607 */
  100547. /***/ (function(module, exports, __webpack_require__) {
  100548. "use strict";
  100549. Object.defineProperty(exports, "__esModule", {
  100550. value: true
  100551. });
  100552. var render = function render() {
  100553. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.listStyle }, [_c('div', { class: _vm.prefixCls + '-header' }, [_c('Checkbox', { attrs: { "value": _vm.checkedAll, "disabled": _vm.checkedAllDisabled }, on: { "on-change": _vm.toggleSelectAll } }), _vm._v(" "), _c('span', { class: _vm.prefixCls + '-header-title', on: { "click": function click($event) {
  100554. return _vm.toggleSelectAll(!_vm.checkedAll);
  100555. } } }, [_vm._v(_vm._s(_vm.title))]), _vm._v(" "), _c('span', { class: _vm.prefixCls + '-header-count' }, [_vm._v(_vm._s(_vm.count))])], 1), _vm._v(" "), _c('div', { class: _vm.bodyClasses }, [_vm.filterable ? _c('div', { class: _vm.prefixCls + '-body-search-wrapper' }, [_c('Search', { attrs: { "prefix-cls": _vm.prefixCls + '-search', "query": _vm.query, "placeholder": _vm.filterPlaceholder }, on: { "on-query-clear": _vm.handleQueryClear, "on-query-change": _vm.handleQueryChange } })], 1) : _vm._e(), _vm._v(" "), _c('ul', { class: _vm.prefixCls + '-content' }, [_vm._l(_vm.filterData, function (item) {
  100556. return _c('li', { class: _vm.itemClasses(item), on: { "click": function click($event) {
  100557. $event.preventDefault();return _vm.select(item);
  100558. } } }, [_c('Checkbox', { attrs: { "value": _vm.isCheck(item), "disabled": item.disabled } }), _vm._v(" "), _c('span', { domProps: { "innerHTML": _vm._s(_vm.showLabel(item)) } })], 1);
  100559. }), _vm._v(" "), _c('li', { class: _vm.prefixCls + '-content-not-found' }, [_vm._v(_vm._s(_vm.notFoundText))])], 2)]), _vm._v(" "), _vm.showFooter ? _c('div', { class: _vm.prefixCls + '-footer' }, [_vm._t("default")], 2) : _vm._e()]);
  100560. };
  100561. var staticRenderFns = [];
  100562. exports.render = render;
  100563. exports.staticRenderFns = staticRenderFns;
  100564. /***/ }),
  100565. /* 608 */
  100566. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100567. "use strict";
  100568. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100569. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__ = __webpack_require__(251);
  100570. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__);
  100571. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100572. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__ = __webpack_require__(609);
  100573. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__);
  100574. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100575. /* script */
  100576. /* template */
  100577. /* template functional */
  100578. var __vue_template_functional__ = false
  100579. /* styles */
  100580. var __vue_styles__ = null
  100581. /* scopeId */
  100582. var __vue_scopeId__ = null
  100583. /* moduleIdentifier (server only) */
  100584. var __vue_module_identifier__ = null
  100585. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100586. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_operation_vue___default.a,
  100587. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__["render"],
  100588. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_c9576318_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_operation_vue__["staticRenderFns"],
  100589. __vue_template_functional__,
  100590. __vue_styles__,
  100591. __vue_scopeId__,
  100592. __vue_module_identifier__
  100593. )
  100594. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100595. /***/ }),
  100596. /* 609 */
  100597. /***/ (function(module, exports, __webpack_require__) {
  100598. "use strict";
  100599. Object.defineProperty(exports, "__esModule", {
  100600. value: true
  100601. });
  100602. var render = function render() {
  100603. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.prefixCls + '-operation' }, [_vm.reverseOperation ? [_c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.leftActive }, nativeOn: { "click": function click($event) {
  100604. return _vm.moveToRight($event);
  100605. } } }, [_c('span', [_vm._v(_vm._s(_vm.operations[1]))]), _vm._v(" "), _c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.rightActive }, nativeOn: { "click": function click($event) {
  100606. return _vm.moveToLeft($event);
  100607. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.operations[0]))])], 1)] : [_c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.rightActive }, nativeOn: { "click": function click($event) {
  100608. return _vm.moveToLeft($event);
  100609. } } }, [_c('Icon', { attrs: { "type": "ios-arrow-back" } }), _vm._v(" "), _c('span', [_vm._v(_vm._s(_vm.operations[0]))])], 1), _vm._v(" "), _c('i-button', { attrs: { "type": "primary", "size": "small", "disabled": !_vm.leftActive }, nativeOn: { "click": function click($event) {
  100610. return _vm.moveToRight($event);
  100611. } } }, [_c('span', [_vm._v(_vm._s(_vm.operations[1]))]), _vm._v(" "), _c('Icon', { attrs: { "type": "ios-arrow-forward" } })], 1)]], 2);
  100612. };
  100613. var staticRenderFns = [];
  100614. exports.render = render;
  100615. exports.staticRenderFns = staticRenderFns;
  100616. /***/ }),
  100617. /* 610 */
  100618. /***/ (function(module, exports, __webpack_require__) {
  100619. "use strict";
  100620. Object.defineProperty(exports, "__esModule", {
  100621. value: true
  100622. });
  100623. var _tree = __webpack_require__(611);
  100624. var _tree2 = _interopRequireDefault(_tree);
  100625. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100626. exports.default = _tree2.default;
  100627. /***/ }),
  100628. /* 611 */
  100629. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100630. "use strict";
  100631. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100632. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__ = __webpack_require__(252);
  100633. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__);
  100634. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100635. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__ = __webpack_require__(615);
  100636. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__);
  100637. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100638. /* script */
  100639. /* template */
  100640. /* template functional */
  100641. var __vue_template_functional__ = false
  100642. /* styles */
  100643. var __vue_styles__ = null
  100644. /* scopeId */
  100645. var __vue_scopeId__ = null
  100646. /* moduleIdentifier (server only) */
  100647. var __vue_module_identifier__ = null
  100648. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100649. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_tree_vue___default.a,
  100650. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__["render"],
  100651. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_7524cbf5_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_tree_vue__["staticRenderFns"],
  100652. __vue_template_functional__,
  100653. __vue_styles__,
  100654. __vue_scopeId__,
  100655. __vue_module_identifier__
  100656. )
  100657. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100658. /***/ }),
  100659. /* 612 */
  100660. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100661. "use strict";
  100662. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100663. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__ = __webpack_require__(253);
  100664. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__);
  100665. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100666. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__ = __webpack_require__(614);
  100667. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__);
  100668. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100669. /* script */
  100670. /* template */
  100671. /* template functional */
  100672. var __vue_template_functional__ = false
  100673. /* styles */
  100674. var __vue_styles__ = null
  100675. /* scopeId */
  100676. var __vue_scopeId__ = null
  100677. /* moduleIdentifier (server only) */
  100678. var __vue_module_identifier__ = null
  100679. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100680. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_node_vue___default.a,
  100681. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__["render"],
  100682. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_58a4fe4c_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_node_vue__["staticRenderFns"],
  100683. __vue_template_functional__,
  100684. __vue_styles__,
  100685. __vue_scopeId__,
  100686. __vue_module_identifier__
  100687. )
  100688. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100689. /***/ }),
  100690. /* 613 */
  100691. /***/ (function(module, exports, __webpack_require__) {
  100692. "use strict";
  100693. Object.defineProperty(exports, "__esModule", {
  100694. value: true
  100695. });
  100696. var _newArrowCheck2 = __webpack_require__(1);
  100697. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  100698. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100699. exports.default = {
  100700. name: 'RenderCell',
  100701. functional: true,
  100702. props: {
  100703. render: Function,
  100704. data: Object,
  100705. node: Array
  100706. },
  100707. render: function render(h, ctx) {
  100708. (0, _newArrowCheck3.default)(undefined, undefined);
  100709. var params = {
  100710. root: ctx.props.node[0],
  100711. node: ctx.props.node[1],
  100712. data: ctx.props.data
  100713. };
  100714. return ctx.props.render(h, params);
  100715. }.bind(undefined)
  100716. };
  100717. /***/ }),
  100718. /* 614 */
  100719. /***/ (function(module, exports, __webpack_require__) {
  100720. "use strict";
  100721. Object.defineProperty(exports, "__esModule", {
  100722. value: true
  100723. });
  100724. var render = function render() {
  100725. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('collapse-transition', { attrs: { "appear": _vm.appear } }, [_c('ul', { class: _vm.classes }, [_c('li', { on: { "contextmenu": function contextmenu($event) {
  100726. $event.stopPropagation();return _vm.handleContextmenu(_vm.data, $event);
  100727. }, "selectstart": function selectstart($event) {
  100728. $event.stopPropagation();return _vm.handlePreventSelect(_vm.data, $event);
  100729. } } }, [_c('span', { class: _vm.arrowClasses, on: { "click": _vm.handleExpand } }, [_vm.showArrow ? _c('Icon', { attrs: { "type": _vm.arrowType, "custom": _vm.customArrowType, "size": _vm.arrowSize } }) : _vm._e(), _vm._v(" "), _vm.showLoading ? _c('Icon', { staticClass: "ivu-load-loop", attrs: { "type": "ios-loading" } }) : _vm._e()], 1), _vm._v(" "), _vm.showCheckbox ? _c('Checkbox', { attrs: { "value": _vm.data.checked, "indeterminate": _vm.data.indeterminate, "disabled": _vm.data.disabled || _vm.data.disableCheckbox }, nativeOn: { "click": function click($event) {
  100730. $event.preventDefault();return _vm.handleCheck($event);
  100731. } } }) : _vm._e(), _vm._v(" "), _c('span', { class: _vm.titleClasses, on: { "click": _vm.handleClickNode } }, [_vm.data.render ? _c('Render', { attrs: { "render": _vm.data.render, "data": _vm.data, "node": _vm.node } }) : _vm.isParentRender ? _c('Render', { attrs: { "render": _vm.parentRender, "data": _vm.data, "node": _vm.node } }) : [_vm._v(_vm._s(_vm.data.title))]], 2), _vm._v(" "), _vm._l(_vm.children, function (item, i) {
  100732. return _vm.data.expand ? _c('Tree-node', { key: i, attrs: { "appear": _vm.appearByClickArrow, "data": item, "multiple": _vm.multiple, "show-checkbox": _vm.showCheckbox, "children-key": _vm.childrenKey } }) : _vm._e();
  100733. })], 2)])]);
  100734. };
  100735. var staticRenderFns = [];
  100736. exports.render = render;
  100737. exports.staticRenderFns = staticRenderFns;
  100738. /***/ }),
  100739. /* 615 */
  100740. /***/ (function(module, exports, __webpack_require__) {
  100741. "use strict";
  100742. Object.defineProperty(exports, "__esModule", {
  100743. value: true
  100744. });
  100745. var render = function render() {
  100746. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { ref: "treeWrap", class: _vm.prefixCls }, [_vm._l(_vm.stateTree, function (item, i) {
  100747. return _c('Tree-node', { key: i, attrs: { "data": item, "visible": "", "multiple": _vm.multiple, "show-checkbox": _vm.showCheckbox, "children-key": _vm.childrenKey } });
  100748. }), _vm._v(" "), !_vm.stateTree.length ? _c('div', { class: [_vm.prefixCls + '-empty'] }, [_vm._v(_vm._s(_vm.localeEmptyText))]) : _vm._e(), _vm._v(" "), _c('div', { staticClass: "ivu-tree-context-menu", style: _vm.contextMenuStyles }, [_c('Dropdown', { attrs: { "trigger": "custom", "visible": _vm.contextMenuVisible, "transfer": "" }, on: { "on-clickoutside": _vm.handleClickContextMenuOutside } }, [_c('DropdownMenu', { attrs: { "slot": "list" }, slot: "list" }, [_vm._t("contextMenu")], 2)], 1)], 1)], 2);
  100749. };
  100750. var staticRenderFns = [];
  100751. exports.render = render;
  100752. exports.staticRenderFns = staticRenderFns;
  100753. /***/ }),
  100754. /* 616 */
  100755. /***/ (function(module, exports, __webpack_require__) {
  100756. "use strict";
  100757. Object.defineProperty(exports, "__esModule", {
  100758. value: true
  100759. });
  100760. var _upload = __webpack_require__(617);
  100761. var _upload2 = _interopRequireDefault(_upload);
  100762. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100763. exports.default = _upload2.default;
  100764. /***/ }),
  100765. /* 617 */
  100766. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100767. "use strict";
  100768. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100769. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__ = __webpack_require__(254);
  100770. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__);
  100771. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100772. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__ = __webpack_require__(621);
  100773. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__);
  100774. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100775. /* script */
  100776. /* template */
  100777. /* template functional */
  100778. var __vue_template_functional__ = false
  100779. /* styles */
  100780. var __vue_styles__ = null
  100781. /* scopeId */
  100782. var __vue_scopeId__ = null
  100783. /* moduleIdentifier (server only) */
  100784. var __vue_module_identifier__ = null
  100785. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100786. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_vue___default.a,
  100787. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__["render"],
  100788. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_31b06543_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_vue__["staticRenderFns"],
  100789. __vue_template_functional__,
  100790. __vue_styles__,
  100791. __vue_scopeId__,
  100792. __vue_module_identifier__
  100793. )
  100794. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100795. /***/ }),
  100796. /* 618 */
  100797. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100798. "use strict";
  100799. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100800. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__ = __webpack_require__(255);
  100801. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__);
  100802. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100803. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__ = __webpack_require__(619);
  100804. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__);
  100805. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100806. /* script */
  100807. /* template */
  100808. /* template functional */
  100809. var __vue_template_functional__ = false
  100810. /* styles */
  100811. var __vue_styles__ = null
  100812. /* scopeId */
  100813. var __vue_scopeId__ = null
  100814. /* moduleIdentifier (server only) */
  100815. var __vue_module_identifier__ = null
  100816. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100817. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_upload_list_vue___default.a,
  100818. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__["render"],
  100819. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_50571a34_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_upload_list_vue__["staticRenderFns"],
  100820. __vue_template_functional__,
  100821. __vue_styles__,
  100822. __vue_scopeId__,
  100823. __vue_module_identifier__
  100824. )
  100825. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100826. /***/ }),
  100827. /* 619 */
  100828. /***/ (function(module, exports, __webpack_require__) {
  100829. "use strict";
  100830. Object.defineProperty(exports, "__esModule", {
  100831. value: true
  100832. });
  100833. var render = function render() {
  100834. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('ul', { class: [_vm.prefixCls + '-list'] }, _vm._l(_vm.files, function (file) {
  100835. return _c('li', { class: _vm.fileCls(file), on: { "click": function click($event) {
  100836. return _vm.handleClick(file);
  100837. } } }, [_c('span', { on: { "click": function click($event) {
  100838. return _vm.handlePreview(file);
  100839. } } }, [_c('Icon', { attrs: { "type": _vm.format(file) } }), _vm._v(" " + _vm._s(file.name) + "\n ")], 1), _vm._v(" "), _c('Icon', { directives: [{ name: "show", rawName: "v-show", value: file.status === 'finished', expression: "file.status === 'finished'" }], class: [_vm.prefixCls + '-list-remove'], attrs: { "type": "ios-close" }, nativeOn: { "click": function click($event) {
  100840. return _vm.handleRemove(file);
  100841. } } }), _vm._v(" "), _c('transition', { attrs: { "name": "fade" } }, [file.showProgress ? _c('i-progress', { attrs: { "stroke-width": 2, "percent": _vm.parsePercentage(file.percentage), "status": file.status === 'finished' && file.showProgress ? 'success' : 'normal' } }) : _vm._e()], 1)], 1);
  100842. }), 0);
  100843. };
  100844. var staticRenderFns = [];
  100845. exports.render = render;
  100846. exports.staticRenderFns = staticRenderFns;
  100847. /***/ }),
  100848. /* 620 */
  100849. /***/ (function(module, exports, __webpack_require__) {
  100850. "use strict";
  100851. Object.defineProperty(exports, "__esModule", {
  100852. value: true
  100853. });
  100854. var _newArrowCheck2 = __webpack_require__(1);
  100855. var _newArrowCheck3 = _interopRequireDefault(_newArrowCheck2);
  100856. var _keys = __webpack_require__(21);
  100857. var _keys2 = _interopRequireDefault(_keys);
  100858. exports.default = upload;
  100859. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100860. function getError(action, option, xhr) {
  100861. var msg = 'fail to post ' + String(action) + ' ' + String(xhr.status) + '\'';
  100862. var err = new Error(msg);
  100863. err.status = xhr.status;
  100864. err.method = 'post';
  100865. err.url = action;
  100866. return err;
  100867. }
  100868. function getBody(xhr) {
  100869. var text = xhr.responseText || xhr.response;
  100870. if (!text) {
  100871. return text;
  100872. }
  100873. try {
  100874. return JSON.parse(text);
  100875. } catch (e) {
  100876. return text;
  100877. }
  100878. }
  100879. function upload(option) {
  100880. var _this = this;
  100881. if (typeof XMLHttpRequest === 'undefined') {
  100882. return;
  100883. }
  100884. var xhr = new XMLHttpRequest();
  100885. var action = option.action;
  100886. if (xhr.upload) {
  100887. xhr.upload.onprogress = function progress(e) {
  100888. if (e.total > 0) {
  100889. e.percent = e.loaded / e.total * 100;
  100890. }
  100891. option.onProgress(e);
  100892. };
  100893. }
  100894. var formData = new FormData();
  100895. if (option.data) {
  100896. (0, _keys2.default)(option.data).map(function (key) {
  100897. (0, _newArrowCheck3.default)(this, _this);
  100898. formData.append(key, option.data[key]);
  100899. }.bind(this));
  100900. }
  100901. formData.append(option.filename, option.file);
  100902. xhr.onerror = function error(e) {
  100903. option.onError(e);
  100904. };
  100905. xhr.onload = function onload() {
  100906. if (xhr.status < 200 || xhr.status >= 300) {
  100907. return option.onError(getError(action, option, xhr), getBody(xhr));
  100908. }
  100909. option.onSuccess(getBody(xhr));
  100910. };
  100911. xhr.open('post', action, true);
  100912. if (option.withCredentials && 'withCredentials' in xhr) {
  100913. xhr.withCredentials = true;
  100914. }
  100915. var headers = option.headers || {};
  100916. for (var item in headers) {
  100917. if (headers.hasOwnProperty(item) && headers[item] !== null) {
  100918. xhr.setRequestHeader(item, headers[item]);
  100919. }
  100920. }
  100921. xhr.send(formData);
  100922. }
  100923. /***/ }),
  100924. /* 621 */
  100925. /***/ (function(module, exports, __webpack_require__) {
  100926. "use strict";
  100927. Object.defineProperty(exports, "__esModule", {
  100928. value: true
  100929. });
  100930. var render = function render() {
  100931. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: [_vm.prefixCls] }, [_c('div', { class: _vm.classes, on: { "click": _vm.handleClick, "drop": function drop($event) {
  100932. $event.preventDefault();return _vm.onDrop($event);
  100933. }, "paste": _vm.handlePaste, "dragover": function dragover($event) {
  100934. $event.preventDefault();_vm.dragOver = true;
  100935. }, "dragleave": function dragleave($event) {
  100936. $event.preventDefault();_vm.dragOver = false;
  100937. } } }, [_c('input', { ref: "input", class: [_vm.prefixCls + '-input'], attrs: { "type": "file", "multiple": _vm.multiple, "webkitdirectory": _vm.webkitdirectory, "accept": _vm.accept }, on: { "change": _vm.handleChange } }), _vm._v(" "), _vm._t("default")], 2), _vm._v(" "), _vm._t("tip"), _vm._v(" "), _vm.showUploadList ? _c('upload-list', { attrs: { "files": _vm.fileList }, on: { "on-file-remove": _vm.handleRemove, "on-file-preview": _vm.handlePreview } }) : _vm._e()], 2);
  100938. };
  100939. var staticRenderFns = [];
  100940. exports.render = render;
  100941. exports.staticRenderFns = staticRenderFns;
  100942. /***/ }),
  100943. /* 622 */
  100944. /***/ (function(module, exports, __webpack_require__) {
  100945. "use strict";
  100946. Object.defineProperty(exports, "__esModule", {
  100947. value: true
  100948. });
  100949. exports.Col = exports.Row = undefined;
  100950. var _row = __webpack_require__(623);
  100951. var _row2 = _interopRequireDefault(_row);
  100952. var _col = __webpack_require__(625);
  100953. var _col2 = _interopRequireDefault(_col);
  100954. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  100955. exports.Row = _row2.default;
  100956. exports.Col = _col2.default;
  100957. /***/ }),
  100958. /* 623 */
  100959. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  100960. "use strict";
  100961. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  100962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__ = __webpack_require__(256);
  100963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__);
  100964. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  100965. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__ = __webpack_require__(624);
  100966. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__);
  100967. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  100968. /* script */
  100969. /* template */
  100970. /* template functional */
  100971. var __vue_template_functional__ = false
  100972. /* styles */
  100973. var __vue_styles__ = null
  100974. /* scopeId */
  100975. var __vue_scopeId__ = null
  100976. /* moduleIdentifier (server only) */
  100977. var __vue_module_identifier__ = null
  100978. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  100979. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_row_vue___default.a,
  100980. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__["render"],
  100981. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_6520bda6_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_row_vue__["staticRenderFns"],
  100982. __vue_template_functional__,
  100983. __vue_styles__,
  100984. __vue_scopeId__,
  100985. __vue_module_identifier__
  100986. )
  100987. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  100988. /***/ }),
  100989. /* 624 */
  100990. /***/ (function(module, exports, __webpack_require__) {
  100991. "use strict";
  100992. Object.defineProperty(exports, "__esModule", {
  100993. value: true
  100994. });
  100995. var render = function render() {
  100996. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
  100997. };
  100998. var staticRenderFns = [];
  100999. exports.render = render;
  101000. exports.staticRenderFns = staticRenderFns;
  101001. /***/ }),
  101002. /* 625 */
  101003. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101004. "use strict";
  101005. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  101006. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__ = __webpack_require__(257);
  101007. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__);
  101008. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  101009. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__ = __webpack_require__(626);
  101010. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__);
  101011. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  101012. /* script */
  101013. /* template */
  101014. /* template functional */
  101015. var __vue_template_functional__ = false
  101016. /* styles */
  101017. var __vue_styles__ = null
  101018. /* scopeId */
  101019. var __vue_scopeId__ = null
  101020. /* moduleIdentifier (server only) */
  101021. var __vue_module_identifier__ = null
  101022. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  101023. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_col_vue___default.a,
  101024. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__["render"],
  101025. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_b6acf052_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_col_vue__["staticRenderFns"],
  101026. __vue_template_functional__,
  101027. __vue_styles__,
  101028. __vue_scopeId__,
  101029. __vue_module_identifier__
  101030. )
  101031. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  101032. /***/ }),
  101033. /* 626 */
  101034. /***/ (function(module, exports, __webpack_require__) {
  101035. "use strict";
  101036. Object.defineProperty(exports, "__esModule", {
  101037. value: true
  101038. });
  101039. var render = function render() {
  101040. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { class: _vm.classes, style: _vm.styles }, [_vm._t("default")], 2);
  101041. };
  101042. var staticRenderFns = [];
  101043. exports.render = render;
  101044. exports.staticRenderFns = staticRenderFns;
  101045. /***/ }),
  101046. /* 627 */
  101047. /***/ (function(module, exports, __webpack_require__) {
  101048. "use strict";
  101049. Object.defineProperty(exports, "__esModule", {
  101050. value: true
  101051. });
  101052. exports.OptionGroup = exports.Option = exports.Select = undefined;
  101053. var _select = __webpack_require__(74);
  101054. var _select2 = _interopRequireDefault(_select);
  101055. var _option = __webpack_require__(81);
  101056. var _option2 = _interopRequireDefault(_option);
  101057. var _optionGroup = __webpack_require__(628);
  101058. var _optionGroup2 = _interopRequireDefault(_optionGroup);
  101059. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  101060. exports.Select = _select2.default;
  101061. exports.Option = _option2.default;
  101062. exports.OptionGroup = _optionGroup2.default;
  101063. exports.default = _select2.default;
  101064. /***/ }),
  101065. /* 628 */
  101066. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101067. "use strict";
  101068. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  101069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__ = __webpack_require__(258);
  101070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__);
  101071. /* harmony namespace reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  101072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__ = __webpack_require__(629);
  101073. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__);
  101074. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__ = __webpack_require__(0);
  101075. /* script */
  101076. /* template */
  101077. /* template functional */
  101078. var __vue_template_functional__ = false
  101079. /* styles */
  101080. var __vue_styles__ = null
  101081. /* scopeId */
  101082. var __vue_scopeId__ = null
  101083. /* moduleIdentifier (server only) */
  101084. var __vue_module_identifier__ = null
  101085. var Component = Object(__WEBPACK_IMPORTED_MODULE_2__node_modules_vue_loader_lib_runtime_component_normalizer__["a" /* default */])(
  101086. __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_option_group_vue___default.a,
  101087. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__["render"],
  101088. __WEBPACK_IMPORTED_MODULE_1__babel_loader_sourceMap_node_modules_vue_loader_lib_template_compiler_index_id_data_v_267e9f7e_hasScoped_false_optionsId_0_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_option_group_vue__["staticRenderFns"],
  101089. __vue_template_functional__,
  101090. __vue_styles__,
  101091. __vue_scopeId__,
  101092. __vue_module_identifier__
  101093. )
  101094. /* harmony default export */ __webpack_exports__["default"] = (Component.exports);
  101095. /***/ }),
  101096. /* 629 */
  101097. /***/ (function(module, exports, __webpack_require__) {
  101098. "use strict";
  101099. Object.defineProperty(exports, "__esModule", {
  101100. value: true
  101101. });
  101102. var render = function render() {
  101103. var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('li', { directives: [{ name: "show", rawName: "v-show", value: !_vm.hidden, expression: "!hidden" }], class: [_vm.prefixCls + '-wrap'] }, [_c('div', { class: [_vm.prefixCls + '-title'] }, [_vm._v(_vm._s(_vm.label))]), _vm._v(" "), _c('ul', [_c('li', { ref: "options", class: [_vm.prefixCls] }, [_vm._t("default")], 2)])]);
  101104. };
  101105. var staticRenderFns = [];
  101106. exports.render = render;
  101107. exports.staticRenderFns = staticRenderFns;
  101108. /***/ })
  101109. /******/ ]);
  101110. });
  101111. //# sourceMappingURL=iview.js.map
  101112. /***/ }),
  101113. /* 195 */
  101114. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101115. "use strict";
  101116. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  101117. var languageListenerObjects = [];
  101118. /* harmony default export */ __webpack_exports__["a"] = ({
  101119. install: function install(Vue) {
  101120. Vue.mixin({
  101121. data: function data() {
  101122. return {
  101123. languageInit: false,
  101124. languageData: {},
  101125. languageType: window.localStorage['__language:type__'] || 'zh'
  101126. };
  101127. },
  101128. watch: {
  101129. languageType: {
  101130. handler: function handler(type) {
  101131. if (type && typeof this.initLanguage === "function") {
  101132. this.initLanguage();
  101133. }
  101134. },
  101135. immediate: true
  101136. }
  101137. },
  101138. methods: {
  101139. /**
  101140. * 初始化语言数据
  101141. * @private
  101142. */
  101143. __initLanguageData: function __initLanguageData() {
  101144. var _this = this;
  101145. if (this.languageInit === false) {
  101146. this.languageInit = true;
  101147. //
  101148. this.addLanguageData({
  101149. en: __webpack_require__(196).default,
  101150. zh: __webpack_require__(197).default
  101151. });
  101152. //
  101153. languageListenerObjects.push(function (lang) {
  101154. _this.languageType = lang;
  101155. });
  101156. }
  101157. },
  101158. /**
  101159. * 监听语言变化
  101160. * @param callback
  101161. */
  101162. setLanguageListener: function setLanguageListener(callback) {
  101163. if (typeof callback === 'function') {
  101164. languageListenerObjects.push(function (lang) {
  101165. callback(lang);
  101166. });
  101167. }
  101168. },
  101169. /**
  101170. * 语言包数据
  101171. * @param language
  101172. * @param data
  101173. */
  101174. addLanguageData: function addLanguageData(language, data) {
  101175. var _this2 = this;
  101176. if ((typeof language === 'undefined' ? 'undefined' : _typeof(language)) === 'object') {
  101177. Object.keys(language).forEach(function (key) {
  101178. _this2.addLanguageData(key, language[key]);
  101179. });
  101180. return;
  101181. }
  101182. if (!language || (typeof data === 'undefined' ? 'undefined' : _typeof(data)) !== "object") {
  101183. return;
  101184. }
  101185. this.__initLanguageData();
  101186. if (typeof this.languageData[language] === "undefined") {
  101187. this.languageData[language] = {};
  101188. }
  101189. Object.assign(this.languageData[language], data);
  101190. //
  101191. if (language === 'en') {
  101192. if (typeof this.languageData['zh'] === "undefined") {
  101193. this.languageData['zh'] = {};
  101194. }
  101195. var cnData = {};
  101196. for (var key in data) {
  101197. if (data.hasOwnProperty(key) && typeof this.languageData['zh'][data[key]] === 'undefined') {
  101198. cnData[data[key]] = key;
  101199. }
  101200. }
  101201. Object.assign(this.languageData['zh'], cnData);
  101202. } else if (language === 'zh') {
  101203. if (typeof this.languageData['en'] === "undefined") {
  101204. this.languageData['en'] = {};
  101205. }
  101206. var enData = {};
  101207. for (var _key in data) {
  101208. if (data.hasOwnProperty(_key) && typeof this.languageData['en'][data[_key]] === 'undefined') {
  101209. enData[data[_key]] = _key;
  101210. }
  101211. }
  101212. Object.assign(this.languageData['en'], enData);
  101213. }
  101214. },
  101215. /**
  101216. * 变化语言
  101217. * @param language
  101218. */
  101219. setLanguage: function setLanguage(language) {
  101220. this.__initLanguageData();
  101221. window.localStorage['__language:type__'] = language;
  101222. languageListenerObjects.forEach(function (call) {
  101223. if (typeof call === 'function') {
  101224. call(language);
  101225. }
  101226. });
  101227. },
  101228. /**
  101229. * 获取语言
  101230. * @returns {*}
  101231. */
  101232. getLanguage: function getLanguage() {
  101233. this.__initLanguageData();
  101234. return this.languageType;
  101235. },
  101236. /**
  101237. * 替换%遍历
  101238. * @param text
  101239. * @param objects
  101240. */
  101241. replaceArgumentsLanguage: function replaceArgumentsLanguage(text, objects) {
  101242. var j = 1;
  101243. while (text.indexOf("%") !== -1) {
  101244. if (_typeof(objects[j]) === "object") {
  101245. text = text.replace("%", "");
  101246. } else {
  101247. text = text.replace("%", objects[j]);
  101248. }
  101249. j++;
  101250. }
  101251. return text;
  101252. },
  101253. /**
  101254. * 显示语言
  101255. * @return {string}
  101256. */
  101257. $L: function $L(text) {
  101258. if (text) {
  101259. this.__initLanguageData();
  101260. //
  101261. if (_typeof(this.languageData[this.languageType]) === "object") {
  101262. var temp = this.languageData[this.languageType][text];
  101263. if (temp === null) {
  101264. return this.replaceArgumentsLanguage(text, arguments);
  101265. }
  101266. if (typeof temp !== 'undefined') {
  101267. return this.replaceArgumentsLanguage(temp, arguments);
  101268. }
  101269. }
  101270. //
  101271. try {
  101272. var key = '__language:Undefined__';
  101273. var tmpData = JSON.parse(window.localStorage[key] || '{}');
  101274. if (_typeof(tmpData[this.languageType]) !== "object") {
  101275. tmpData[this.languageType] = {};
  101276. }
  101277. tmpData[this.languageType][text] = "";
  101278. window.localStorage[key] = JSON.stringify(tmpData);
  101279. } catch (e) {
  101280. //
  101281. }
  101282. }
  101283. return this.replaceArgumentsLanguage(text, arguments);
  101284. }
  101285. }
  101286. });
  101287. }
  101288. });
  101289. /***/ }),
  101290. /* 196 */
  101291. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101292. "use strict";
  101293. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  101294. /* harmony default export */ __webpack_exports__["default"] = ({
  101295. "3天": "3 days",
  101296. "5天": "5 days",
  101297. "7天": "7 days",
  101298. "Github/Gitee图标": "Github/Gitee icon",
  101299. "MD编辑器": "Markdown Cell",
  101300. "[任务消息]": "[Task message]",
  101301. "[图片]": "[image]",
  101302. "[工作报告]": "[Work report]",
  101303. "[已超期]": "[Expired]",
  101304. "[文件]": "[file]",
  101305. "[未知类型]": "[Unknown type]",
  101306. "[来自关注任务]": "[Attention from the task]",
  101307. "[来自工作报告]": "[From work report]",
  101308. "[管理员]": "[Administrator]",
  101309. "[视频通话]": "[Video call]",
  101310. "[语音通话]": "[Voice call]",
  101311. "上传": "Upload",
  101312. "上传/浏览 图片": "Upload / browse pictures",
  101313. "上传图片": "Upload image",
  101314. "上传失败": "Upload failed",
  101315. "上传文件": "Upload files",
  101316. "上传时间": "Upload time",
  101317. "上传者": "Uploaded by",
  101318. "上午": "Morning",
  101319. "下午": "In the afternoon",
  101320. "下载": "Download",
  101321. "下载次数": "Download times",
  101322. "不重要不紧急": "Unimportant and not urgent",
  101323. "两次密码输入不一致!": "Inconsistent new passwords!",
  101324. "个人中心": "Personal Center",
  101325. "个人资料": "Personal information",
  101326. "产品开发": "Product development",
  101327. "产品规划": "Product Planning",
  101328. "产品计划": "Product plans",
  101329. "仅作者可以修改。": "Only the author can modify it.",
  101330. "仅作者可以阅读分享地址。": "Only the author can read the shared link.",
  101331. "仅作者和文档成员可以修改。": "Only authors and document members can modify it.",
  101332. "仅作者和文档成员可以阅读分享地址。": "Only authors and document members can read the shared link.",
  101333. "仅有修改权限的人员。": "Only personnel with modification authority.",
  101334. "仅项目负责人、任务创建人、任务负责人或任务关注人可查看任务详情。": "Only the project leader, task creator, task Leader, or task follower can view task details.",
  101335. "今天": "Today",
  101336. "以“http://”或“https://”开头": "Start with \"http: //\" or \"https: //\"",
  101337. "任务内容": "Summary",
  101338. "任务列表": "Task list",
  101339. "任务列表为空,请先添加任务。": "The task list is empty, please add the task first.",
  101340. "任务名称": "Task name",
  101341. "任务完成 % 天后自动归档。": "Tasks are automatically archived % days after completion.",
  101342. "任务已删除,点击确定关闭窗口。": "Task has been deleted, click OK to close the window.",
  101343. "任务权限": "Mandate",
  101344. "任务状态:": "Task Status:",
  101345. "任务等级": "Level",
  101346. "任务负责人": "Task leader",
  101347. "任务负责人已改变,点击确定关闭窗口。": "The person-in-charge has been changed, click OK to close the window.",
  101348. "企业版": "Enterprise Edition",
  101349. "优先级": "Priority",
  101350. "优先级:": "Priority:",
  101351. "会员信息": "Member information",
  101352. "你确定你要删除这个子任务吗?": "Are you sure you want to delete this subtask?",
  101353. "你确定修改负责人设置为“%”吗?": "Are you sure to modify the person-in-charge to \"%\"?",
  101354. "你确定取消管理员身份的操作吗?": "Are you sure to cancel the administrator?",
  101355. "你确定将任务计划时间取消吗?": "Are you sure to cancel the scheduled time?",
  101356. "你确定将任务计划时间设置为“%”吗?": "Are you sure to reschedule the task to \"%\" do?",
  101357. "你确定要删除%【%】吗?": "Are you sure you want to delete % [%]?",
  101358. "你确定要删除此列表吗?": "Are you sure to delete this list?",
  101359. "你确定要删除此团队成员吗?": "Are you sure you want to delete this team?",
  101360. "你确定要删除此对话吗?": "Are you sure you want to delete this conversation?",
  101361. "你确定要删除此文件吗?": "Are you sure to delete this file?",
  101362. "你确定要删除此文档吗?": "Are you sure you want to delete this document?",
  101363. "你确定要删除此知识库吗?": "Are you sure you want to delete this knowledge base it?",
  101364. "你确定要删除此项目吗?": "Are you sure you want to delete this project?",
  101365. "你确定要删除汇报吗?": "Are you sure to delete the report?",
  101366. "你确定要发送汇报吗?": "Are you sure to send the report?",
  101367. "你确定要取消归档吗?": "Are you sure you want to cancel the archive?",
  101368. "你确定要取消收藏此项目吗?": "Are you sure you want to unsubscribe this project?",
  101369. "你确定要将此成员移出项目吗?": "Are you sure you want to do this project out of the members?",
  101370. "你确定要将这些团队成员%[%]吗?": "Are you sure you want to these team members% [%] do?",
  101371. "你确定要清除聊天记录吗?": "Are you sure you want to clear the chat history?",
  101372. "你确定要解散群聊吗?": "Are you sure you want to disband a group chat?",
  101373. "你确定要退出此项目吗?": "Are you sure you want to quit this project?",
  101374. "你确定设置管理员的操作吗?": "Are you sure to set him/her as administrator?",
  101375. "使用我上次抄送的人": "Use the person I cc'd last time",
  101376. "使用换行添加多个子任务": "Add multiple subtasks using line feeds",
  101377. "保存": "Save",
  101378. "保存并发送": "Save and Send",
  101379. "保存并返回": "Save and Return",
  101380. "修改": "Modify",
  101381. "修改了工作报告": "Revised work report",
  101382. "修改任务": "Modify task",
  101383. "修改团队成员": "Modify team member",
  101384. "修改成功": "Successfully modified",
  101385. "修改成功,请重新登录!": "Modified successfully, please log in again!",
  101386. "修改成员信息": "Modify",
  101387. "修改文档标题": "Modify the document title",
  101388. "修改权限": "Modify permissions",
  101389. "修改标题": "Modify Title",
  101390. "修改群资料": "Modify group information",
  101391. "修改计划时间": "Modify the scheduled time",
  101392. "修改负责人": "Modify the person in charge",
  101393. "修改项目任务": "Modify the project tasks",
  101394. "偏好设置": "Preferences",
  101395. "允许": "Allowed",
  101396. "允许注册": "Allowed register",
  101397. "全局团队管理": "Global Management Team",
  101398. "全局知识库查看和管理": "View and manage the global knowledge base",
  101399. "全局项目查看和管理": "View and manage the overall project",
  101400. "全屏": "Full Screen",
  101401. "全部": "All",
  101402. "全部任务": "All tasks",
  101403. "关注人": "Subscribers ",
  101404. "关注任务": "Subscribe task",
  101405. "关注时间": "Attention time",
  101406. "关注的任务": "Task concern",
  101407. "关注者:": "Followers:",
  101408. "关键词": "Keywords",
  101409. "关闭": "Shut down",
  101410. "其它": "Other",
  101411. "内容加载中.....": "Content Loading .....",
  101412. "准备发布": "Ready for release",
  101413. "分享": "Share",
  101414. "分享文档": "Share documents",
  101415. "分组": "Packet",
  101416. "分组名称": "Group Name",
  101417. "列表": "List",
  101418. "列表开头": "Beginning of the list",
  101419. "列表结尾": "End of the list",
  101420. "创建于:": "Built in:",
  101421. "创建人": "Founder",
  101422. "创建日期": "Created Date",
  101423. "创建时间": "Created date",
  101424. "创建的任务": "Tasks created",
  101425. "删除": "Delete",
  101426. "删除任务": "Delete task",
  101427. "删除列表": "Delete List",
  101428. "删除团队成员": "Remove team members",
  101429. "删除对话": "Delete a conversation",
  101430. "删除成员": "Remove members",
  101431. "删除提示": "Delete Tip",
  101432. "删除文件": "Delete Files",
  101433. "删除文档": "Delete Document",
  101434. "删除汇报": "Delete report",
  101435. "删除知识库": "Delete repository",
  101436. "删除项目": "Remove project",
  101437. "删除项目任务": "Delete project tasks",
  101438. "刷新": "Refresh",
  101439. "刷新列表": "Refresh",
  101440. "刷新成功!": "Refresh success!",
  101441. "前一周": "Prev Week",
  101442. "前一天": "Prev Day",
  101443. "前端开发": "Front-end development",
  101444. "功能开启": "Feature is turned on",
  101445. "加入IP": "Join IP",
  101446. "加入分组": "Join Group",
  101447. "加入时间": "Joined date",
  101448. "加载下一页": "Next loading",
  101449. "加载下一页...": "Loads next ...",
  101450. "加载中...": "Loading...",
  101451. "加载更多": "Load more",
  101452. "加载更多...": "Load more...",
  101453. "加载组件中...": "Loading...",
  101454. "动态": "History",
  101455. "历史消息": "Message History",
  101456. "历史版本": "Historic version",
  101457. "原计划时间": "Original time",
  101458. "参与的项目": "Involved Projects",
  101459. "发布": "Release",
  101460. "发布成功": "Successfully posted",
  101461. "发起群聊": "Start a group chat",
  101462. "发送": "Send",
  101463. "发送了工作报告": "Send the work report",
  101464. "发送人": "Sender",
  101465. "发送汇报": "Send report",
  101466. "取消": "Cancel",
  101467. "取消关注": "Unsubscribe",
  101468. "取消归档": "Unarchiving",
  101469. "取消收藏": "Unfavorite",
  101470. "取消筛选": "Remove Filter",
  101471. "取消管理员": "Cancel administrator",
  101472. "取消计划时间": "Cancel a scheduled time",
  101473. "同修改权限": "Same as modify permissions",
  101474. "后一周": "Next Week",
  101475. "后一天": "Next Day",
  101476. "后端开发": "Back-end development",
  101477. "周报": "Weekly",
  101478. "周报/日报": "Weekly / Daily",
  101479. "周视图": "Week",
  101480. "呼叫失败!": "Call failed!",
  101481. "团队": "Team",
  101482. "团队分组管理": "Group Management Team",
  101483. "团队成员": "Team member",
  101484. "团队成员(%)更新了内容,<br/>更新时间:%。<br/><br/>点击【确定】加载最新内容。": "Team members (%) updated content, <br/> update time: %. <br/><br/> click \"ok\" to load the latest content.",
  101485. "图形": "Graph",
  101486. "图片": "Image",
  101487. "在线知识库": "Online Knowledge Base",
  101488. "在线知识库:在线流程图,在线文档,以及可视化的目录编排,文档管理无忧。": "Online Knowledge Base: Online flowchart, online documentation, and visualization of the catalog layout, document management worries.",
  101489. "在这里输入事项,回车即可保存": "Here input matters, Enter to save",
  101490. "基本信息": "Basic Information",
  101491. "复制失败!": "Copy failed!",
  101492. "复制成功!": "Copy successful!",
  101493. "复制链接": "Copy Link",
  101494. "大小": "Size",
  101495. "天": "Day",
  101496. "天空蓝": "Sky blue",
  101497. "天视图": "Day",
  101498. "头像": "Avatar",
  101499. "如果不指定任务负责人则项目所有成员均可领此任务。": "If you do not specify a task leader, all members of the project can take the task.",
  101500. "子任务": "Subtasks",
  101501. "子任务描述...": "Subtask description...",
  101502. "存档日期": "Archived Date",
  101503. "完全开放": "Open",
  101504. "完成": "Complete",
  101505. "完成并归档": "Complete and Archive",
  101506. "完成时间": "Complete time",
  101507. "完成自动归档": "Auto archiving",
  101508. "密码": "Password",
  101509. "密码错长度至少6位!": "Wrong password length of at least 6!",
  101510. "密码长度至少6位!": " Passwords must be at least 6 characters!",
  101511. "对方:": "Person: ",
  101512. "对方:拒绝接听": "Person: Refuse to answer",
  101513. "导出": "Export",
  101514. "导出CSV": "Export to CSV",
  101515. "导出JPG图片": "Export to JPG",
  101516. "导出PDF文件": "Export to PDF",
  101517. "导出PNG图片": "Export to PNG",
  101518. "导出TXT": "Export to TXT",
  101519. "导出XLS": "Export to XLS",
  101520. "导出XLSX": "Export to XLSX",
  101521. "导出任务": "Export Task",
  101522. "导出列表": "Export List",
  101523. "导出结果": "Export Results",
  101524. "将项目任务标记已完成": "The project marks the task has been completed",
  101525. "将项目任务标记归档或未归档": "The project task tag archive or archives",
  101526. "尊敬的会员": "Dear Member",
  101527. "小时": "Hour",
  101528. "居中": "Center",
  101529. "展开全部节点": "Expand all nodes",
  101530. "展开到一级节点": "Expand to a node",
  101531. "展开到三级节点": "Expand the node to three",
  101532. "展开到二级节点": "Expand the node to two",
  101533. "展开到五级节点": "Expand the node to five",
  101534. "展开到四级节点": "Expand to four nodes",
  101535. "已发送": "Sent",
  101536. "已完成": "Completed",
  101537. "已完成任务": "Completed tasks",
  101538. "已完成数": "Completed Number",
  101539. "已完成的任务": "Completed Tasks",
  101540. "已归档": "Archived",
  101541. "已归档任务": "Archived tasks",
  101542. "已签到": "Checked in",
  101543. "已超期": "Overdue",
  101544. "已锁定": "Locked",
  101545. "建议尺寸:%": "Suggested size: %",
  101546. "开启": "Open",
  101547. "开放任务": "Open task",
  101548. "归档": "Archive",
  101549. "归档任务": "Archive task",
  101550. "归档时间": "Archive Time",
  101551. "归档权限": "Archive Permissions",
  101552. "当前浏览器不支持音视频通话!": "Current browser does not support audio/video calls!",
  101553. "待办": "Pending",
  101554. "待办四象限": "Upcoming Quadrant",
  101555. "待办四象限:突出事情优先级,帮助员工合理安排时间,提高工作效率。": "Four quadrant to-do: highlight what priority, to help employees arrange your time, improve work efficiency.",
  101556. "待办日程": "Upcoming Schedule",
  101557. "必须指定负责人,负责人需确认接收任务。": "You must specify the person in charge, the responsible person to be confirmed receiving task.",
  101558. "恭喜你!已完成了所有待办": "Congratulations! You have completed all the to-do",
  101559. "恭喜您成为管理员。": "Congratulations on becoming an administrator.",
  101560. "您的帐号在其他地方(%)登录,您被迫退出,如果这不是您本人的操作,请注意帐号安全!": "Your account is logged in elsewhere (%), you are forced to log out, if this is not your own operation, please pay attention to account security!",
  101561. "您的管理员身份已被撤销。": "Your administrator status has been revoked.",
  101562. "您确定要删除此任务吗?": "Are you sure to delete this task?",
  101563. "您确定要退出登录吗?": "Are you sure you want to sign out?",
  101564. "成员": "Member",
  101565. "成员分组": "Members of the group",
  101566. "成员开放": "Members",
  101567. "成员管理": "Members Management",
  101568. "成员角色": "Member role",
  101569. "我关注的任务": "Concerned Tasks",
  101570. "我创建的任务": "Created tasks",
  101571. "我归档的任务": "Archived tasks",
  101572. "我的待办": "My to-do",
  101573. "我的汇报": "My report",
  101574. "我的知识库": "My Knowledge",
  101575. "我管理的项目": "Managed Projects",
  101576. "我负责的任务": "Tasks-in-charge",
  101577. "所属知识库": "Knowledge belongs",
  101578. "所属项目:": "View project:",
  101579. "所有人(含游客)都可以阅读分享地址。": "Everyone (including visitors) can read the shared link.",
  101580. "所有会员都可以修改。": "All members can modify it.",
  101581. "所有会员都可以阅读分享地址。": "All members can read the shared link.",
  101582. "手动": "Manually",
  101583. "打开": "Open",
  101584. "批量添加子任务": "Batch add subtasks",
  101585. "抄送人": "Cc",
  101586. "折叠": "Fold",
  101587. "拒绝": "Refused",
  101588. "拖动到这里发送给 %": "Send to drag%",
  101589. "拖动到这里添加附件至 %": "Drag here to add attachments to%",
  101590. "指定任务": "Specify the task",
  101591. "接受": "Accept",
  101592. "描述": "Description",
  101593. "提交": "Submit",
  101594. "搜索": "Search",
  101595. "搜索成员": "Search members",
  101596. "搜索知识库": "Search the Knowledge Base",
  101597. "搜索项目、任务": "Search projects, tasks",
  101598. "操作": "Operating",
  101599. "操作员": "Operator",
  101600. "操作记录": "Operation Records",
  101601. "收到的汇报": "Received reports",
  101602. "收藏": "Collect",
  101603. "收藏时间": "Favorite time",
  101604. "收藏的项目": "Favorite Projects",
  101605. "放弃保存": "Discard",
  101606. "敬请期待!": "Stay tuned!",
  101607. "数据加载中.....": "Loading....",
  101608. "数据加载失败!": "Loading failed!",
  101609. "文件": "File",
  101610. "文件 % 上传失败 %": "File upload failed%%",
  101611. "文件 % 上传失败,%": "File upload failed%,%",
  101612. "文件 % 太大,不能超过%。": "File % is too large to exceed %.",
  101613. "文件 % 格式不正确,仅支持上传:%": "% File format is not correct, only supports uploading:%",
  101614. "文件 % 格式不正确,请上传 jpg、jpeg、gif、png 格式的图片。": "% File format is incorrect, only jpg, jpeg, gif, png formats are supported.",
  101615. "文件/图片": "File / Picture",
  101616. "文件列表": "Document list",
  101617. "文件名": "File name",
  101618. "文件格式不正确": "File format is incorrect",
  101619. "文本": "Text",
  101620. "文本编辑器": "Text Cell",
  101621. "文档历史版本": "Historical versions",
  101622. "文档成员": "Members",
  101623. "文档标题": "Document Title",
  101624. "文档标题长度至少2位!": "Document title length of at least two!",
  101625. "文档类型": "Document Type",
  101626. "文档编辑": "Document editing",
  101627. "文档设置": "Settings",
  101628. "文档链接": "Links",
  101629. "新增章节": "New Chapter",
  101630. "新密码": "New password",
  101631. "新建文档": "New Document",
  101632. "新建汇报": "New report",
  101633. "新建知识库": "New Knowledge",
  101634. "新建项目": "New Project",
  101635. "新计划时间": "New time",
  101636. "无标题": "Untitled",
  101637. "日报": "Daily",
  101638. "日期": "Date",
  101639. "日期范围": "Date range",
  101640. "日程管理": "Calendar",
  101641. "日程管理:可视化日程管理,快速搞定工作计划,了解工作宏观安排。": "Calendar: visual schedule management, quick to get the work plan, understand the macro work arrangements.",
  101642. "旧密码": "Old password",
  101643. "明天": "Tomorrow",
  101644. "星期一": "Monday",
  101645. "星期三": "Wednesday",
  101646. "星期二": "Tuesday",
  101647. "星期五": "Friday",
  101648. "星期六": "Saturday",
  101649. "星期四": "Thursday",
  101650. "星期日": "Sunday",
  101651. "是否放弃保存修改的内容?": "Do you want to abandon the modified contents?",
  101652. "是否放弃修改的内容并返回?": "Whether to give up the modification and return?",
  101653. "昵称": "Nickname",
  101654. "昵称长度至少2位!": "Nicknames must be at least 2 characters!",
  101655. "显示": "Show",
  101656. "显示已完成": "Display completed",
  101657. "晚上": "At night",
  101658. "暂无子任务": "No subtasks",
  101659. "暂无群公告": "No group bulletin",
  101660. "更新提示": "Update",
  101661. "最后登录IP": "Last Login IP",
  101662. "最后登录时间": "Last login time",
  101663. "最多只能上传 % 张图片。": "Can only upload % pictures.",
  101664. "最多只能选择 % 张图片。": "Select at most % pictures.",
  101665. "最少6位数": "At least 6 digits",
  101666. "月视图": "Month",
  101667. "有%条新消息": "There are new messages%",
  101668. "未保存计划时间": "Unsaved planned time",
  101669. "未完成": "Unfinished",
  101670. "未完成任务": "Unfinished tasks",
  101671. "未完成数": "Uncompleted Number",
  101672. "未归档": "Unfiled",
  101673. "本周": "This week",
  101674. "本月": "This month",
  101675. "权限": "Competence",
  101676. "权限设置": "Permission Settings",
  101677. "来自关注任务": "Attention from the task",
  101678. "来自工作报告": "From work report",
  101679. "查看": "View",
  101680. "查看任务列表": "View Task List",
  101681. "查看及管理项目成员": "View and manage project members",
  101682. "查看图片": "View image",
  101683. "查看已归档任务": "View archived task",
  101684. "查看归档任务": "View archived task",
  101685. "查看成员统计页面": "View member statistics page",
  101686. "查看文件列表": "View File List",
  101687. "查看权限": "View permissions",
  101688. "查看甘特图": "View Gantt",
  101689. "查看项目动态": "View Project News",
  101690. "查看项目统计": "View project statistics",
  101691. "标记": "Mark",
  101692. "标记完成": "Mark completed",
  101693. "标记已完成": "Mark as completed",
  101694. "标记未完成": "Mark as unfinished",
  101695. "标题": "Title",
  101696. "样式": "Style",
  101697. "欢迎您": "Welcome",
  101698. "正在协作会员": "Collaborating member",
  101699. "正在研发": "Under developing",
  101700. "正在视频通话...": "On a video call...",
  101701. "正在设计": "Under designing",
  101702. "正在语音通话...": "On a voice call...",
  101703. "正在进行其他操作,请稍后重试...": "Other operations in progress, please try again later...",
  101704. "汇报标题": "Report title",
  101705. "没有任何修改!": "No changes!",
  101706. "没有相关内容": "No related content",
  101707. "没有相关的数据": "No record",
  101708. "没有相关的文件": "No related documents",
  101709. "注册": "Register",
  101710. "注册会员": "Registered",
  101711. "注册账号": "Register",
  101712. "注明:系统管理员拥有以下所有权限": "Note: Administrators have all of the following rights",
  101713. "注:将同时删除列表下所有任务": "Note: This will delete all tasks in the list",
  101714. "流程图": "Flow Chart",
  101715. "测试": "Test",
  101716. "浏览": "Browse",
  101717. "浏览器不支持音视频通话!": "The browser does not support audio and video calls!",
  101718. "浏览器阻止不是https的网站访问音视频,所以请尝试安装SSL!": "Browsers prevent sites that are not HTTPS from accessing audio and video, so try installing SSL!",
  101719. "浏览图片": "View picture",
  101720. "浏览图片空间的图片": "Browse pictures from Image Space",
  101721. "浏览文档": "View the document",
  101722. "添加": "Add",
  101723. "添加一个新列表": "Add a new list",
  101724. "添加任务": "Add a task",
  101725. "添加任务至": "Adding to the task",
  101726. "添加位置": "Add location",
  101727. "添加分组": "Adding Grouping",
  101728. "添加列表": "Add List",
  101729. "添加后不可修改,使用英文逗号添加多个。": "Do not modify after adding, use [,] to add multiple.",
  101730. "添加团队成员": "Add team members",
  101731. "添加子任务": "Add subtasks",
  101732. "添加成员": "Add Members",
  101733. "添加流程": "Adding Process",
  101734. "添加至列表结尾": "Add to the end of the list",
  101735. "添加详细描述...": "Add a detailed description ...",
  101736. "添加附件": "Add attachments",
  101737. "添加项目任务": "Add project tasks",
  101738. "清除聊天记录": "Clear chat history",
  101739. "清除记录": "Clear History",
  101740. "温柔冷光": "Gentle cold",
  101741. "温馨提示": "Tips",
  101742. "点击下载 (%)": "Click to download (%)",
  101743. "点击可快速添加需要处理的事项": "Click to quickly add items need to be addressed",
  101744. "点击弹出": "Click the pop-up",
  101745. "状态": "Status",
  101746. "现在": "Now",
  101747. "甘特图": "Gantt chart",
  101748. "用户名": "Username",
  101749. "用户名长度至少2位!": "Username length of at least two!",
  101750. "用户登录": "User login",
  101751. "留空不修改": "Does not modify the blank",
  101752. "留空默认: 自己": "Blank default: own",
  101753. "留空默认:WookTeam © 2018-2020": "Default:WookTeam © 2018-2020",
  101754. "登录": "Log in",
  101755. "登录密码": "Login password",
  101756. "登录成功": "Login successful",
  101757. "登录有效时间": "Log effective time",
  101758. "登录窗口": "Login window",
  101759. "登录身份 % 小时过期,过期后需要重新登录。": "Log on as% hours expired, you need to log in again after expired.",
  101760. "登录验证码": "Login verification code",
  101761. "目录": "Table of Contents",
  101762. "直接弹出": "Direct pop",
  101763. "相关任务": "Related Tasks",
  101764. "相关工作报告": "Related work report",
  101765. "相关知识库": "Related Knowledge",
  101766. "相关项目": "Related projects",
  101767. "知识库": "Knowledge",
  101768. "知识库名称": "Knowledge Name",
  101769. "知识库名称长度至少2位!": "Knowledge name must be at least 2 characters!",
  101770. "知识库目录": "Knowledge directory",
  101771. "确定": "Determine",
  101772. "确定操作": "Approve the operation",
  101773. "确定要修改任务【%】的计划时间吗?<br/>开始时间:%<br/>结束时间:%": "Are you sure you want to change the scheduled time for task [%]? <br/> start time: %<br/> end time: %",
  101774. "确认密码": "Confirm password",
  101775. "确认密码错长度至少6位!": "Make sure the password is at least 6 digits long!",
  101776. "确认操作": "Confirm the operation",
  101777. "确认新密码": "Confirm the new password",
  101778. "禁止": "Forbid",
  101779. "私有文库": "Private",
  101780. "移交项目": "Transfer",
  101781. "移出分组": "Out of the grouping",
  101782. "移出成员": "Members removed",
  101783. "移动": "Mobile",
  101784. "空白模板": "Blank template",
  101785. "立即登陆": "Sign in",
  101786. "第一次签到": "The first sign",
  101787. "第二次签到": "The second sign",
  101788. "等级": "Grade",
  101789. "筛选": "Filter",
  101790. "签到": "Attendance",
  101791. "签到弹窗": "Check-pop",
  101792. "签到时间时未签到时自动弹出签到窗口": "Automatic pop-up window when not in attendance when attendance time attendance",
  101793. "签到时间:": "Check-in time:",
  101794. "签到记录": "Attendance record",
  101795. "签到设置": "Set sign",
  101796. "管理权限": "Management permissions",
  101797. "管理的项目": "Managed Projects",
  101798. "类型": "Type",
  101799. "系统提示": "System prompt",
  101800. "系统皮肤": "Skin System",
  101801. "系统设置": "System Settings",
  101802. "紧凑冷光": "Compact cold light",
  101803. "紧凑天盘": "Compact disc days",
  101804. "紧凑经典": "Compact Classic",
  101805. "紧急不重要": "Emergency and unimportant",
  101806. "累计登陆次数": "Cumulative number of landing",
  101807. "级别": "Level",
  101808. "线框": "Wireframe",
  101809. "组员权限": "Crew permission",
  101810. "组长": "Leader",
  101811. "经典天盘": "Classic Tin plate",
  101812. "编辑": "Edit",
  101813. "缩放": "Scaling",
  101814. "网络繁忙,保存失败!": "The Internet is busy, save failed!",
  101815. "网络繁忙,请稍后再试!": "Internet is busy, please try again later!",
  101816. "群公告": "Group bulletin",
  101817. "群名": "Group name",
  101818. "群名称": "Group name",
  101819. "群头像": "Group picture",
  101820. "群聊": "Group chat",
  101821. "群聊名称": "Group chat name",
  101822. "职位/职称": "Position / Title",
  101823. "脑图": "Brain Mapping",
  101824. "脑图经典": "Figure classic brain",
  101825. "自动": "Automatic",
  101826. "自定义图片地址": "Custom Image URL",
  101827. "自定义地址": "Custom address",
  101828. "自己": "Own",
  101829. "至": "To",
  101830. "表情": "Emoji",
  101831. "表格": "Form",
  101832. "视频聊天": "Video chat",
  101833. "视频通话": "Video call",
  101834. "解散群聊": "Disbanded group chat",
  101835. "解锁文档": "Unlock",
  101836. "计划时间": "Schedule",
  101837. "计划时间:": "Planning time:",
  101838. "设为管理员": "Set as administrator",
  101839. "设置": "Settings",
  101840. "评论": "Comments",
  101841. "详细内容加载中.....": "Details Loading .....",
  101842. "语音聊天": "Voice chat",
  101843. "语音通话": "Voice call",
  101844. "请填写文档标题!": "Please fill out the document title!",
  101845. "请填写用户名!": "Please enter username!",
  101846. "请填写登录密码!": "Please fill in the login password!",
  101847. "请填写知识库名称!": "Please fill in the knowledge base name!",
  101848. "请填写确认密码!": "Please fill in the confirmation password!",
  101849. "请填写项目名称!": "Please fill in project name!",
  101850. "请稍候...": "Please wait...",
  101851. "请输入列表名称": "Please enter a list of names",
  101852. "请输入新密码!": "Please enter a new password!",
  101853. "请输入新的列表名称": "Enter a new list name",
  101854. "请输入新的文件名称": "Please enter a new file name",
  101855. "请输入新的项目名称": "Please enter a new project name",
  101856. "请输入旧密码!": "Please enter your old password!",
  101857. "请输入昵称/用户名搜索": "Search by nickname or username",
  101858. "请输入昵称!": "Please enter a nickname!",
  101859. "请输入流程名称,多个可用英文逗号分隔。": "Use [,] to add multiple.",
  101860. "请输入要发送的消息": "Please enter the message to be sent",
  101861. "请重新输入新密码!": "Please re-enter the new password!",
  101862. "负责人": "Principal",
  101863. "负责人:": "Principle:",
  101864. "负责的任务": "Responsible for tasks",
  101865. "账号": "Account",
  101866. "账号密码": "Account password",
  101867. "超出文件大小限制": "File size limit exceeded",
  101868. "超期": "Extended",
  101869. "超期任务": "Overdue tasks",
  101870. "软件开发": "Software Development",
  101871. "轻量级的团队在线协作": "Lightweight online teamwork ",
  101872. "输入任务,回车即可保存": "Enter the task, press Enter to save",
  101873. "输入关键词搜索": "Enter search keywords",
  101874. "输入评论,Enter发表评论,Shift+Enter换行": "Enter a comment, Enter comment, Shift + Enter Wrap",
  101875. "还原": "Restore",
  101876. "退出": "Drop out",
  101877. "退出全屏": "Exit Full Screen",
  101878. "退出登录": "Sign out",
  101879. "退出群聊": "Exit group chat",
  101880. "退出项目": "Quit Project",
  101881. "选中节点,按enter键添加同级节点,tab键添加子节点": "Select the node, press Enter to add siblings, and TAB to add children",
  101882. "选择关注人": "Select subscriber",
  101883. "选择日期范围": "Select a date range",
  101884. "选择负责人": "Select the person in charge",
  101885. "选择起止时间": "Select the starting and ending time",
  101886. "通话时长:%": "Length of call: %",
  101887. "邀请视频通话...": "Invite video calls...",
  101888. "邀请语音通话...": "Inviting voice calls...",
  101889. "酷团队协作工具就从这里开始": "Cool team collaboration tools from here",
  101890. "重命名": "Rename",
  101891. "重命名列表": "Rename list",
  101892. "重命名文件名": "Rename the file",
  101893. "重命名项目": "Rename the project",
  101894. "重置": "Reset",
  101895. "重要不紧急": "Important but not urgent",
  101896. "重要且紧急": "Important and urgent",
  101897. "锁定后其他会员将无法修改保存文档。": "After locking, other members will not be able to modify the saved document.",
  101898. "锁定文档": "Lock",
  101899. "错误详情": "Error Details",
  101900. "阅读权限": "Read permissions",
  101901. "阶段": "Stage",
  101902. "附件": "Attachments",
  101903. "隐藏": "Hidden",
  101904. "面板显示": "Panel displays",
  101905. "音视频通话": "Audio video call",
  101906. "项目": "Project",
  101907. "项目信息": "Project information",
  101908. "项目动态": "Project News",
  101909. "项目名称": "Project name",
  101910. "项目名称至少2个字!": "Project Name at least two words!",
  101911. "项目名称:": "Project name:",
  101912. "项目成员": "Project Members",
  101913. "项目成员均可查看任务详情。": "Project members can view task details.",
  101914. "项目权限": "Project Permissions",
  101915. "项目模板": "Project Templates",
  101916. "项目流程": "Project Flow",
  101917. "项目简介": "Project introduction",
  101918. "项目管理": "Project management",
  101919. "项目管理:自定义项目看板,可视化任务安排。": "Project Management: Project custom signage, visualization tasks scheduled.",
  101920. "项目统计": "Project Statistics",
  101921. "项目设置": "Project Settings",
  101922. "项目负责人": "Project leader",
  101923. "项目面板": "Project panel",
  101924. "项目面板是否显示已完成的任务": "Project panel for completed tasks",
  101925. "项目面板显示已完成的任务。": "The project panel displays the completed tasks.",
  101926. "项目面板隐藏已完成的任务。": "The project panel hides completed tasks.",
  101927. "首次登陆需修改密码": "Password must be changed for the first login",
  101928. "首页Logo": "Logo",
  101929. "鱼骨图": "Fishbone Diagram",
  101930. "默认节点": "The default node",
  101931. "个人总计": "Total personal",
  101932. "项目总任务数": "The total number of project tasks",
  101933. "项目已完成数": "Number of projects have been completed",
  101934. "项目未完成数": "The number of unfinished projects",
  101935. "发送日期": "Send date"
  101936. });
  101937. /***/ }),
  101938. /* 197 */
  101939. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101940. "use strict";
  101941. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  101942. /* harmony default export */ __webpack_exports__["default"] = ({});
  101943. /***/ }),
  101944. /* 198 */
  101945. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  101946. "use strict";
  101947. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  101948. /* harmony default export */ __webpack_exports__["a"] = ({
  101949. install: function install(Vue) {
  101950. Vue.mixin({
  101951. data: function data() {
  101952. return {
  101953. mixinId: 0,
  101954. //用户信息
  101955. usrLogin: false,
  101956. usrInfo: {},
  101957. usrName: '',
  101958. //浏览器宽度≤768返回true
  101959. windowMax768: window.innerWidth <= 768
  101960. };
  101961. },
  101962. mounted: function mounted() {
  101963. var _this = this;
  101964. if (typeof window.__mixinId != "number") window.__mixinId = 0;
  101965. this.mixinId = window.__mixinId++;
  101966. //
  101967. this.usrLogin = $A.getToken() !== false;
  101968. this.usrInfo = $A.getUserInfo();
  101969. this.usrName = this.usrInfo.username || '';
  101970. $A.setOnUserInfoListener('mixins_' + this.mixinId, function (data, isLogin) {
  101971. _this.usrLogin = isLogin;
  101972. _this.usrInfo = data;
  101973. _this.usrName = _this.usrInfo.username || '';
  101974. });
  101975. //
  101976. window.addEventListener('resize', this.windowMax768Listener);
  101977. },
  101978. beforeDestroy: function beforeDestroy() {
  101979. $A.removeUserInfoListener('mixins_' + this.mixinId);
  101980. window.removeEventListener('resize', this.windowMax768Listener);
  101981. },
  101982. methods: {
  101983. isArray: function isArray(obj) {
  101984. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == '[object array]' && typeof obj.length == "number";
  101985. },
  101986. isJson: function isJson(obj) {
  101987. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
  101988. },
  101989. windowMax768Listener: function windowMax768Listener() {
  101990. this.windowMax768 = window.innerWidth <= 768;
  101991. }
  101992. }
  101993. });
  101994. }
  101995. });
  101996. /***/ }),
  101997. /* 199 */
  101998. /***/ (function(module, exports) {
  101999. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  102000. function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
  102001. function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
  102002. /**
  102003. * 基础函数
  102004. */
  102005. (function (window, $, undefined) {
  102006. var _serverUrl = window.location.origin + '/';
  102007. /**
  102008. * =============================================================================
  102009. * ************************** 基础函数类 **************************
  102010. * =============================================================================
  102011. */
  102012. $.extend({
  102013. /**
  102014. * 身份识别码
  102015. * @param text
  102016. * @returns {*|string}
  102017. */
  102018. token: function token(text) {
  102019. var token = this.storage('token') || '';
  102020. if (typeof text === 'string') {
  102021. this.storage('token', text);
  102022. token = text;
  102023. }
  102024. return token;
  102025. },
  102026. /**
  102027. * 随机获取范围
  102028. * @param Min
  102029. * @param Max
  102030. * @returns {*}
  102031. */
  102032. randNum: function randNum(Min, Max) {
  102033. var Range = Max - Min;
  102034. var Rand = Math.random();
  102035. return Min + Math.round(Rand * Range); //四舍五入
  102036. },
  102037. /**
  102038. * 获取数组最后一个值
  102039. * @param array
  102040. * @returns {boolean}
  102041. */
  102042. last: function last(array) {
  102043. var str = false;
  102044. if ((typeof array === 'undefined' ? 'undefined' : _typeof(array)) === 'object' && array.length > 0) {
  102045. str = array[array.length - 1];
  102046. }
  102047. return str;
  102048. },
  102049. /**
  102050. * 字符串是否包含
  102051. * @param string
  102052. * @param find
  102053. * @param lower
  102054. * @returns {boolean}
  102055. */
  102056. strExists: function strExists(string, find) {
  102057. var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  102058. string += "";
  102059. find += "";
  102060. if (lower !== true) {
  102061. string = string.toLowerCase();
  102062. find = find.toLowerCase();
  102063. }
  102064. return string.indexOf(find) !== -1;
  102065. },
  102066. /**
  102067. * 字符串是否左边包含
  102068. * @param string
  102069. * @param find
  102070. * @param lower
  102071. * @returns {boolean}
  102072. */
  102073. leftExists: function leftExists(string, find) {
  102074. var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  102075. string += "";
  102076. find += "";
  102077. if (lower !== true) {
  102078. string = string.toLowerCase();
  102079. find = find.toLowerCase();
  102080. }
  102081. return string.substring(0, find.length) === find;
  102082. },
  102083. /**
  102084. * 删除左边字符串
  102085. * @param string
  102086. * @param find
  102087. * @param lower
  102088. * @returns {string}
  102089. */
  102090. leftDelete: function leftDelete(string, find) {
  102091. var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  102092. string += "";
  102093. find += "";
  102094. if (this.leftExists(string, find, lower)) {
  102095. string = string.substring(find.length);
  102096. }
  102097. return string ? string : '';
  102098. },
  102099. /**
  102100. * 字符串是否右边包含
  102101. * @param string
  102102. * @param find
  102103. * @param lower
  102104. * @returns {boolean}
  102105. */
  102106. rightExists: function rightExists(string, find) {
  102107. var lower = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  102108. string += "";
  102109. find += "";
  102110. if (lower !== true) {
  102111. string = string.toLowerCase();
  102112. find = find.toLowerCase();
  102113. }
  102114. return string.substring(string.length - find.length) === find;
  102115. },
  102116. /**
  102117. * 取字符串中间
  102118. * @param string
  102119. * @param start
  102120. * @param end
  102121. * @returns {*}
  102122. */
  102123. getMiddle: function getMiddle(string, start, end) {
  102124. string = string.toString();
  102125. if (this.ishave(start) && this.strExists(string, start)) {
  102126. string = string.substring(string.indexOf(start) + start.length);
  102127. }
  102128. if (this.ishave(end) && this.strExists(string, end)) {
  102129. string = string.substring(0, string.indexOf(end));
  102130. }
  102131. return string;
  102132. },
  102133. /**
  102134. * 截取字符串
  102135. * @param string
  102136. * @param start
  102137. * @param end
  102138. * @returns {string}
  102139. */
  102140. subString: function subString(string, start, end) {
  102141. string += "";
  102142. if (!this.ishave(end)) {
  102143. end = string.length;
  102144. }
  102145. return string.substring(start, end);
  102146. },
  102147. /**
  102148. * 随机字符
  102149. * @param len
  102150. * @returns {string}
  102151. */
  102152. randomString: function randomString(len) {
  102153. len = len || 32;
  102154. var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678oOLl9gqVvUuI1';
  102155. var maxPos = $chars.length;
  102156. var pwd = '';
  102157. for (var i = 0; i < len; i++) {
  102158. pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  102159. }
  102160. return pwd;
  102161. },
  102162. /**
  102163. * 判断是否有
  102164. * @param set
  102165. * @returns {boolean}
  102166. */
  102167. ishave: function ishave(set) {
  102168. return !!(set !== null && set !== "null" && set !== undefined && set !== "undefined" && set);
  102169. },
  102170. /**
  102171. * 相当于 intval
  102172. * @param str
  102173. * @param fixed
  102174. * @returns {number}
  102175. */
  102176. runNum: function runNum(str, fixed) {
  102177. var _s = Number(str);
  102178. if (_s + "" === "NaN") {
  102179. _s = 0;
  102180. }
  102181. if (/^[0-9]*[1-9][0-9]*$/.test(fixed)) {
  102182. _s = _s.toFixed(fixed);
  102183. var rs = _s.indexOf('.');
  102184. if (rs < 0) {
  102185. _s += ".";
  102186. for (var i = 0; i < fixed; i++) {
  102187. _s += "0";
  102188. }
  102189. }
  102190. }
  102191. return _s;
  102192. },
  102193. /**
  102194. * 服务器地址
  102195. * @param str
  102196. * @returns {string}
  102197. */
  102198. serverUrl: function serverUrl(str) {
  102199. if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
  102200. return str;
  102201. }
  102202. return _serverUrl + str;
  102203. },
  102204. /**
  102205. * 获取IP地址详情
  102206. * @param ip
  102207. * @param callback
  102208. */
  102209. getIpInfo: function getIpInfo(ip, callback) {
  102210. var _this = this;
  102211. if (!this.strExists(ip, ".")) {
  102212. return;
  102213. }
  102214. var keyName = '__ip' + ip.substring(0, 1) + '__';
  102215. var key = this.getMiddle(ip, '', '.');
  102216. var res = this.loadFromlLocal(key, ip, '', keyName);
  102217. if ((typeof res === 'undefined' ? 'undefined' : _typeof(res)) == "object") {
  102218. if (typeof callback == "function") {
  102219. callback(res);
  102220. }
  102221. return;
  102222. }
  102223. $A.ajax({
  102224. url: $A.serverUrl('api/system/get/ipinfo'),
  102225. data: { ip: ip },
  102226. timeout: 8000,
  102227. success: function success(res) {
  102228. _this.savaToLocal(key, ip, res, keyName);
  102229. if (typeof callback == "function") {
  102230. callback(res);
  102231. }
  102232. }
  102233. });
  102234. },
  102235. /**
  102236. * 新增&&获取缓存数据
  102237. * @param key
  102238. * @param value
  102239. * @returns {*}
  102240. */
  102241. storage: function storage(key, value) {
  102242. var keyName = 'app';
  102243. switch (window.location.pathname) {
  102244. case "/admin":
  102245. keyName += ":" + window.location.pathname.substr(1);
  102246. break;
  102247. }
  102248. if (typeof value === 'undefined') {
  102249. return this.loadFromlLocal('__::', key, '', '__' + keyName + '__');
  102250. } else {
  102251. this.savaToLocal('__::', key, value, '__' + keyName + '__');
  102252. }
  102253. },
  102254. /**
  102255. * 新增&&修改本地缓存
  102256. * @param {string} id 唯一id
  102257. * @param {string} key 标示
  102258. * @param value 新增&修改的值
  102259. * @param keyName 主键名称
  102260. */
  102261. savaToLocal: function savaToLocal(id, key, value, keyName) {
  102262. try {
  102263. if (typeof keyName === 'undefined') keyName = '__seller__';
  102264. var seller = window.localStorage[keyName];
  102265. if (!seller) {
  102266. seller = {};
  102267. seller[id] = {};
  102268. } else {
  102269. seller = JSON.parse(seller);
  102270. if (!seller[id]) {
  102271. seller[id] = {};
  102272. }
  102273. }
  102274. seller[id][key] = value;
  102275. window.localStorage[keyName] = JSON.stringify(seller);
  102276. } catch (e) {}
  102277. },
  102278. /**
  102279. * 查询本地缓存
  102280. * @param {string} id 唯一id
  102281. * @param {string} key 标示
  102282. * @param def 如果查询不到显示的值
  102283. * @param keyName 主键名称
  102284. */
  102285. loadFromlLocal: function loadFromlLocal(id, key, def, keyName) {
  102286. if (typeof keyName === 'undefined') keyName = '__seller__';
  102287. var seller = window.localStorage[keyName];
  102288. if (!seller) {
  102289. return def;
  102290. }
  102291. seller = JSON.parse(seller)[id];
  102292. if (!seller) {
  102293. return def;
  102294. }
  102295. var ret = seller[key];
  102296. return ret || def;
  102297. },
  102298. /**
  102299. * 补零
  102300. * @param str
  102301. * @param length
  102302. * @param after
  102303. * @returns {*}
  102304. */
  102305. zeroFill: function zeroFill(str, length, after) {
  102306. str += "";
  102307. if (str.length >= length) {
  102308. return str;
  102309. }
  102310. var _str = '',
  102311. _ret = '';
  102312. for (var i = 0; i < length; i++) {
  102313. _str += '0';
  102314. }
  102315. if (after || typeof after === 'undefined') {
  102316. _ret = (_str + "" + str).substr(length * -1);
  102317. } else {
  102318. _ret = (str + "" + _str).substr(0, length);
  102319. }
  102320. return _ret;
  102321. },
  102322. /**
  102323. * 时间戳转时间格式
  102324. * @param format
  102325. * @param v
  102326. * @returns {string}
  102327. */
  102328. formatDate: function formatDate(format, v) {
  102329. if (format === '') {
  102330. format = 'Y-m-d H:i:s';
  102331. }
  102332. var dateObj = void 0;
  102333. if (v instanceof Date) {
  102334. dateObj = v;
  102335. } else {
  102336. if (typeof v === 'undefined') {
  102337. v = new Date().getTime();
  102338. } else if (/^(-)?\d{1,10}$/.test(v)) {
  102339. v = v * 1000;
  102340. } else if (/^(-)?\d{1,13}$/.test(v)) {
  102341. v = v * 1000;
  102342. } else if (/^(-)?\d{1,14}$/.test(v)) {
  102343. v = v * 100;
  102344. } else if (/^(-)?\d{1,15}$/.test(v)) {
  102345. v = v * 10;
  102346. } else if (/^(-)?\d{1,16}$/.test(v)) {
  102347. v = v * 1;
  102348. } else {
  102349. return v;
  102350. }
  102351. dateObj = new Date(v);
  102352. }
  102353. //
  102354. format = format.replace(/Y/g, dateObj.getFullYear());
  102355. format = format.replace(/m/g, this.zeroFill(dateObj.getMonth() + 1, 2));
  102356. format = format.replace(/d/g, this.zeroFill(dateObj.getDate(), 2));
  102357. format = format.replace(/H/g, this.zeroFill(dateObj.getHours(), 2));
  102358. format = format.replace(/i/g, this.zeroFill(dateObj.getMinutes(), 2));
  102359. format = format.replace(/s/g, this.zeroFill(dateObj.getSeconds(), 2));
  102360. return format;
  102361. },
  102362. /**
  102363. * 租用时间差(不够1个小时算一个小时)
  102364. * @param s
  102365. * @param e
  102366. * @returns {*}
  102367. */
  102368. timeDiff: function timeDiff(s, e) {
  102369. if (typeof e === 'undefined') {
  102370. e = Math.round(new Date().getTime() / 1000);
  102371. }
  102372. var d = e - s;
  102373. if (d > 86400) {
  102374. var day = Math.floor(d / 86400);
  102375. var hour = Math.ceil((d - day * 86400) / 3600);
  102376. if (hour > 0) {
  102377. return day + '天' + hour + '小时';
  102378. } else {
  102379. return day + '天';
  102380. }
  102381. } else if (d > 3600) {
  102382. return Math.ceil(d / 3600) + '小时';
  102383. } else if (d > 60) {
  102384. return Math.ceil(d / 60) + '分钟';
  102385. } else if (d > 10) {
  102386. return d + '秒';
  102387. } else {
  102388. return '刚刚';
  102389. }
  102390. },
  102391. /**
  102392. * 检测手机号码格式
  102393. * @param str
  102394. * @returns {boolean}
  102395. */
  102396. isMobile: function isMobile(str) {
  102397. return (/^1([3456789])\d{9}$/.test(str)
  102398. );
  102399. },
  102400. /**
  102401. * 是否手机号码
  102402. * @param phone
  102403. * @returns {boolean}
  102404. */
  102405. isPhone: function isPhone(phone) {
  102406. return this.isMobile(phone);
  102407. },
  102408. /**
  102409. * 根据两点间的经纬度计算距离
  102410. * @param lng1
  102411. * @param lat1
  102412. * @param lng2
  102413. * @param lat2
  102414. * @returns {string|*}
  102415. */
  102416. getDistance: function getDistance(lng1, lat1, lng2, lat2) {
  102417. var DEF_PI = 3.14159265359; // PI
  102418. var DEF_2PI = 6.28318530712; // 2*PI
  102419. var DEF_PI180 = 0.01745329252; // PI/180.0
  102420. var DEF_R = 6370693.5; // radius of earth
  102421. //
  102422. var ew1 = void 0,
  102423. ns1 = void 0,
  102424. ew2 = void 0,
  102425. ns2 = void 0;
  102426. var dx = void 0,
  102427. dy = void 0,
  102428. dew = void 0;
  102429. var distance = void 0;
  102430. // 角度转换为弧度
  102431. ew1 = lng1 * DEF_PI180;
  102432. ns1 = lat1 * DEF_PI180;
  102433. ew2 = lng2 * DEF_PI180;
  102434. ns2 = lat2 * DEF_PI180;
  102435. // 经度差
  102436. dew = ew1 - ew2;
  102437. // 若跨东经和西经180 度,进行调整
  102438. if (dew > DEF_PI) dew = DEF_2PI - dew;else if (dew < -DEF_PI) dew = DEF_2PI + dew;
  102439. dx = DEF_R * Math.cos(ns1) * dew; // 东西方向长度(在纬度圈上的投影长度)
  102440. dy = DEF_R * (ns1 - ns2); // 南北方向长度(在经度圈上的投影长度)
  102441. // 勾股定理求斜边长
  102442. distance = Math.sqrt(dx * dx + dy * dy).toFixed(0);
  102443. return distance;
  102444. },
  102445. /**
  102446. * 设置网页标题
  102447. * @param title
  102448. */
  102449. setTile: function setTile(title) {
  102450. document.title = title;
  102451. var mobile = navigator.userAgent.toLowerCase();
  102452. if (/iphone|ipad|ipod/.test(mobile)) {
  102453. var iframe = document.createElement('iframe');
  102454. iframe.style.display = 'none';
  102455. iframe.setAttribute('src', '/favicon.ico');
  102456. var iframeCallback = function iframeCallback() {
  102457. setTimeout(function () {
  102458. iframe.removeEventListener('load', iframeCallback);
  102459. document.body.removeChild(iframe);
  102460. }, 0);
  102461. };
  102462. iframe.addEventListener('load', iframeCallback);
  102463. document.body.appendChild(iframe);
  102464. }
  102465. },
  102466. /**
  102467. * 克隆对象
  102468. * @param myObj
  102469. * @returns {*}
  102470. */
  102471. cloneData: function cloneData(myObj) {
  102472. if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) !== 'object') return myObj;
  102473. if (myObj === null) return myObj;
  102474. //
  102475. if (typeof myObj.length === 'number') {
  102476. var _myObj = _toArray(myObj),
  102477. myNewObj = _myObj.slice(0);
  102478. return myNewObj;
  102479. } else {
  102480. var _myNewObj = _objectWithoutProperties(myObj, []);
  102481. return _myNewObj;
  102482. }
  102483. },
  102484. /**
  102485. * 将一个 JSON 字符串转换为对象(已try)
  102486. * @param str
  102487. * @param defaultVal
  102488. * @returns {*}
  102489. */
  102490. jsonParse: function jsonParse(str, defaultVal) {
  102491. if (str === null) {
  102492. return defaultVal ? defaultVal : {};
  102493. }
  102494. if ((typeof str === 'undefined' ? 'undefined' : _typeof(str)) === "object") {
  102495. return str;
  102496. }
  102497. try {
  102498. return JSON.parse(str);
  102499. } catch (e) {
  102500. return defaultVal ? defaultVal : {};
  102501. }
  102502. },
  102503. /**
  102504. * 将 JavaScript 值转换为 JSON 字符串(已try)
  102505. * @param json
  102506. * @param defaultVal
  102507. * @returns {string}
  102508. */
  102509. jsonStringify: function jsonStringify(json, defaultVal) {
  102510. if ((typeof json === 'undefined' ? 'undefined' : _typeof(json)) !== 'object') {
  102511. return json;
  102512. }
  102513. try {
  102514. return JSON.stringify(json);
  102515. } catch (e) {
  102516. return defaultVal ? defaultVal : "";
  102517. }
  102518. },
  102519. /**
  102520. * 监听对象尺寸发生改变
  102521. * @param obj
  102522. * @param callback
  102523. */
  102524. resize: function resize(obj, callback) {
  102525. var myObj = $A(obj);
  102526. if (myObj.length === 0) return;
  102527. var height = parseInt(myObj.outerHeight()),
  102528. width = parseInt(myObj.outerWidth());
  102529. var inter = setInterval(function () {
  102530. if (myObj.length === 0) clearInterval(inter);
  102531. var tmpHeight = parseInt(myObj.outerHeight()),
  102532. tmpWidth = parseInt(myObj.outerWidth());
  102533. if (height !== tmpHeight || width !== tmpWidth) {
  102534. height = tmpHeight;
  102535. width = tmpWidth;
  102536. console.log(width, height);
  102537. if (typeof callback === 'function') callback();
  102538. }
  102539. }, 250);
  102540. },
  102541. /**
  102542. * 是否IOS
  102543. * @returns {boolean|string}
  102544. */
  102545. isIos: function isIos() {
  102546. var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
  102547. return ua && /iphone|ipad|ipod|ios/.test(ua);
  102548. },
  102549. /**
  102550. * 是否安卓
  102551. * @returns {boolean|string}
  102552. */
  102553. isAndroid: function isAndroid() {
  102554. var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
  102555. return ua && ua.indexOf('android') > 0;
  102556. },
  102557. /**
  102558. * 是否微信
  102559. * @returns {boolean}
  102560. */
  102561. isWeixin: function isWeixin() {
  102562. var ua = typeof window !== 'undefined' && window.navigator.userAgent.toLowerCase();
  102563. return ua.match(/MicroMessenger/i) + '' === 'micromessenger';
  102564. },
  102565. /**
  102566. * 获取对象
  102567. * @param obj
  102568. * @param keys
  102569. * @returns {string|*}
  102570. */
  102571. getObject: function getObject(obj, keys) {
  102572. var object = obj;
  102573. if (this.count(obj) === 0 || this.count(keys) === 0) {
  102574. return "";
  102575. }
  102576. var arr = keys.replace(/,/g, "|").replace(/\./g, "|").split("|");
  102577. $A.each(arr, function (index, key) {
  102578. object = typeof object[key] === "undefined" ? "" : object[key];
  102579. });
  102580. return object;
  102581. },
  102582. /**
  102583. * 统计数组或对象长度
  102584. * @param obj
  102585. * @returns {number}
  102586. */
  102587. count: function count(obj) {
  102588. try {
  102589. if (typeof obj === "undefined") {
  102590. return 0;
  102591. }
  102592. if (typeof obj === "number") {
  102593. obj += "";
  102594. }
  102595. if (typeof obj.length === 'number') {
  102596. return obj.length;
  102597. } else {
  102598. var i = 0,
  102599. key = void 0;
  102600. for (key in obj) {
  102601. i++;
  102602. }
  102603. return i;
  102604. }
  102605. } catch (e) {
  102606. return 0;
  102607. }
  102608. },
  102609. /**
  102610. * 将数组或对象内容部分拼成字符串
  102611. * @param obj
  102612. * @returns {string}
  102613. */
  102614. objImplode: function objImplode(obj) {
  102615. var _this2 = this;
  102616. if (obj === null) {
  102617. return "";
  102618. }
  102619. var str = "";
  102620. $A.each(obj, function (key, val) {
  102621. if (val !== null) {
  102622. if ((typeof val === 'undefined' ? 'undefined' : _typeof(val)) === "object" && _this2.count(val) > 0) {
  102623. str += _this2.objImplode(val);
  102624. } else {
  102625. str += String(val);
  102626. }
  102627. }
  102628. });
  102629. return str.replace(/\s/g, "").replace(/undefined/g, "");
  102630. },
  102631. /**
  102632. * 指定键获取url参数
  102633. * @param key
  102634. * @returns {*}
  102635. */
  102636. urlParameter: function urlParameter(key) {
  102637. var params = this.urlParameterAll();
  102638. return typeof key === "undefined" ? params : params[key];
  102639. },
  102640. urlParameterAll: function urlParameterAll() {
  102641. var search = window.location.search || "";
  102642. var arr = [];
  102643. if (this.strExists(search, "?")) {
  102644. arr = this.getMiddle(search, "?").split("&");
  102645. }
  102646. var params = {};
  102647. for (var i = 0; i < arr.length; i++) {
  102648. var data = arr[i].split("=");
  102649. if (data.length === 2) {
  102650. params[data[0]] = data[1];
  102651. }
  102652. }
  102653. return params;
  102654. },
  102655. /**
  102656. * 删除地址中的参数
  102657. * @param url
  102658. * @param parameter
  102659. * @returns {string|*}
  102660. */
  102661. removeURLParameter: function removeURLParameter(url, parameter) {
  102662. if (parameter instanceof Array) {
  102663. parameter.forEach(function (key) {
  102664. url = $A.removeURLParameter(url, key);
  102665. });
  102666. return url;
  102667. }
  102668. var urlparts = url.split('?');
  102669. if (urlparts.length >= 2) {
  102670. //参数名前缀
  102671. var prefix = encodeURIComponent(parameter) + '=';
  102672. var pars = urlparts[1].split(/[&;]/g);
  102673. //循环查找匹配参数
  102674. for (var i = pars.length; i-- > 0;) {
  102675. if (pars[i].lastIndexOf(prefix, 0) !== -1) {
  102676. //存在则删除
  102677. pars.splice(i, 1);
  102678. }
  102679. }
  102680. return urlparts[0] + (pars.length > 0 ? '?' + pars.join('&') : '');
  102681. }
  102682. return url;
  102683. },
  102684. /**
  102685. * 连接加上参数
  102686. * @param url
  102687. * @param params
  102688. * @returns {*}
  102689. */
  102690. urlAddParams: function urlAddParams(url, params) {
  102691. if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === "object" && params !== null) {
  102692. url += "";
  102693. url += url.indexOf("?") === -1 ? '?' : '';
  102694. for (var key in params) {
  102695. if (!params.hasOwnProperty(key)) {
  102696. continue;
  102697. }
  102698. url += '&' + key + '=' + params[key];
  102699. }
  102700. }
  102701. return url.replace("?&", "?");
  102702. },
  102703. /**
  102704. * 链接字符串
  102705. * @param value 第一个参数为连接符
  102706. * @returns {string}
  102707. */
  102708. stringConnect: function stringConnect() {
  102709. var s = null;
  102710. var text = "";
  102711. for (var _len = arguments.length, value = Array(_len), _key = 0; _key < _len; _key++) {
  102712. value[_key] = arguments[_key];
  102713. }
  102714. value.forEach(function (val) {
  102715. if (s === null) {
  102716. s = val;
  102717. } else if (val) {
  102718. if (val && text) text += s;
  102719. text += val;
  102720. }
  102721. });
  102722. return text;
  102723. },
  102724. /**
  102725. * 判断两个对象是否相等
  102726. * @param x
  102727. * @param y
  102728. * @returns {boolean}
  102729. */
  102730. objEquals: function objEquals(x, y) {
  102731. var f1 = x instanceof Object;
  102732. var f2 = y instanceof Object;
  102733. if (!f1 || !f2) {
  102734. return x === y;
  102735. }
  102736. if (Object.keys(x).length !== Object.keys(y).length) {
  102737. return false;
  102738. }
  102739. for (var p in x) {
  102740. if (x.hasOwnProperty(p)) {
  102741. var a = x[p] instanceof Object;
  102742. var b = y[p] instanceof Object;
  102743. if (a && b) {
  102744. if (!this.objEquals(x[p], y[p])) {
  102745. return false;
  102746. }
  102747. } else if (x[p] != y[p]) {
  102748. return false;
  102749. }
  102750. }
  102751. }
  102752. return true;
  102753. },
  102754. /**
  102755. * 输入框内插入文本
  102756. * @param object
  102757. * @param content
  102758. */
  102759. insert2Input: function insert2Input(object, content) {
  102760. if (object === null || (typeof object === 'undefined' ? 'undefined' : _typeof(object)) !== "object") return;
  102761. if (typeof object.length === 'number' && object.length > 0) object = object[0];
  102762. var ele = _typeof(object.$el) === "object" ? $A(object.$el) : $A(object);
  102763. if (ele.length === 0) return;
  102764. var eleDom = ele[0];
  102765. if (eleDom.tagName != "INPUT" && eleDom.tagName != "TEXTAREA") {
  102766. if (ele.find("input").length === 0) {
  102767. ele = ele.find("textarea");
  102768. } else {
  102769. ele = ele.find("input");
  102770. }
  102771. }
  102772. if (ele.length === 0) return;
  102773. eleDom = ele[0];
  102774. if (eleDom.tagName != "INPUT" && eleDom.tagName != "TEXTAREA") return;
  102775. var text = ele.val();
  102776. var _eleDom = eleDom,
  102777. selectionStart = _eleDom.selectionStart,
  102778. selectionEnd = _eleDom.selectionEnd;
  102779. ele.val('' + text.substring(0, selectionStart) + content + text.substring(selectionEnd, text.length));
  102780. eleDom.dispatchEvent(new Event('input'));
  102781. setTimeout(function () {
  102782. if (eleDom.setSelectionRange) {
  102783. var pos = text.substring(0, selectionStart).length + content.length;
  102784. eleDom.focus();
  102785. eleDom.setSelectionRange(pos, pos);
  102786. }
  102787. }, 10);
  102788. },
  102789. /**
  102790. * iOS上虚拟键盘引起的触控错位
  102791. */
  102792. iOSKeyboardFixer: function iOSKeyboardFixer() {
  102793. if (!this.isIos()) {
  102794. return;
  102795. }
  102796. document.body.scrollTop = document.body.scrollTop + 1;
  102797. document.body.scrollTop = document.body.scrollTop - 1;
  102798. },
  102799. autoDevwid: function autoDevwid(width) {
  102800. var _width = width || 640;
  102801. new function () {
  102802. var _self = this;
  102803. _self.width = _width; //设置默认最大宽度
  102804. _self.fontSize = 30; //默认字体大小
  102805. _self.widthProportion = function () {
  102806. var p = (document.body && document.body.clientWidth || document.getElementsByTagName("html")[0].offsetWidth) / _self.width;
  102807. return p > 1 ? 1 : p < 0.38 ? 0.38 : p;
  102808. };
  102809. _self.changePage = function () {
  102810. document.getElementsByTagName("html")[0].setAttribute("style", "font-size:" + _self.widthProportion() * _self.fontSize + "px !important");
  102811. };
  102812. _self.changePage();
  102813. window.addEventListener('resize', function () {
  102814. _self.changePage();
  102815. }, false);
  102816. }();
  102817. //
  102818. var scale = $A(window).width() / _width;
  102819. $A(".__auto").each(function () {
  102820. if ($A(this).attr("data-original") !== "1") {
  102821. $A(this).attr("data-original-top", parseInt($A(this).css("top")));
  102822. $A(this).attr("data-original-right", parseInt($A(this).css("right")));
  102823. $A(this).attr("data-original-bottom", parseInt($A(this).css("bottom")));
  102824. $A(this).attr("data-original-left", parseInt($A(this).css("left")));
  102825. $A(this).attr("data-original-width", parseInt($A(this).css("width")));
  102826. $A(this).attr("data-original-height", parseInt($A(this).css("height")));
  102827. $A(this).attr("data-original-line-height", parseInt($A(this).css("line-height")));
  102828. $A(this).attr("data-original", "1");
  102829. }
  102830. var _t = parseInt($A(this).attr("data-original-top"));
  102831. var _r = parseInt($A(this).attr("data-original-right"));
  102832. var _b = parseInt($A(this).attr("data-original-bottom"));
  102833. var _l = parseInt($A(this).attr("data-original-left"));
  102834. var _w = parseInt($A(this).attr("data-original-width"));
  102835. var _h = parseInt($A(this).attr("data-original-height"));
  102836. var _lh = parseInt($A(this).attr("data-original-line-height"));
  102837. //
  102838. var _css = {};
  102839. if (_t > 0) _css['top'] = _t * scale;
  102840. if (_r > 0) _css['right'] = _r * scale;
  102841. if (_b > 0) _css['bottom'] = _b * scale;
  102842. if (_l > 0) _css['left'] = _l * scale;
  102843. if (_w > 0) _css['width'] = _w * scale;
  102844. if (_h > 0) _css['height'] = _h * scale;
  102845. if (_lh > 0) _css['line-height'] = _lh * scale + 'px';
  102846. $A(this).css(_css);
  102847. });
  102848. return scale;
  102849. }
  102850. });
  102851. /**
  102852. * =============================================================================
  102853. * **************************** ihttp ****************************
  102854. * =============================================================================
  102855. */
  102856. $.extend({
  102857. serializeObject: function serializeObject(obj, parents) {
  102858. if (typeof obj === 'string') return obj;
  102859. var resultArray = [];
  102860. var separator = '&';
  102861. parents = parents || [];
  102862. var newParents = void 0;
  102863. function var_name(name) {
  102864. if (parents.length > 0) {
  102865. var _parents = '';
  102866. for (var j = 0; j < parents.length; j++) {
  102867. if (j === 0) _parents += parents[j];else _parents += '[' + encodeURIComponent(parents[j]) + ']';
  102868. }
  102869. return _parents + '[' + encodeURIComponent(name) + ']';
  102870. } else {
  102871. return encodeURIComponent(name);
  102872. }
  102873. }
  102874. function var_value(value) {
  102875. return encodeURIComponent(value);
  102876. }
  102877. for (var prop in obj) {
  102878. if (obj.hasOwnProperty(prop)) {
  102879. var toPush = void 0;
  102880. if (Array.isArray(obj[prop])) {
  102881. toPush = [];
  102882. for (var i = 0; i < obj[prop].length; i++) {
  102883. if (!Array.isArray(obj[prop][i]) && _typeof(obj[prop][i]) === 'object') {
  102884. newParents = parents.slice();
  102885. newParents.push(prop);
  102886. newParents.push(i + '');
  102887. toPush.push($.serializeObject(obj[prop][i], newParents));
  102888. } else {
  102889. toPush.push(var_name(prop) + '[]=' + var_value(obj[prop][i]));
  102890. }
  102891. }
  102892. if (toPush.length > 0) resultArray.push(toPush.join(separator));
  102893. } else if (obj[prop] === null) {
  102894. resultArray.push(var_name(prop) + '=');
  102895. } else if (_typeof(obj[prop]) === 'object') {
  102896. // Object, convert to named array
  102897. newParents = parents.slice();
  102898. newParents.push(prop);
  102899. toPush = $.serializeObject(obj[prop], newParents);
  102900. if (toPush !== '') resultArray.push(toPush);
  102901. } else if (typeof obj[prop] !== 'undefined' && obj[prop] !== '') {
  102902. // Should be string or plain value
  102903. resultArray.push(var_name(prop) + '=' + var_value(obj[prop]));
  102904. } else if (obj[prop] === '') resultArray.push(var_name(prop));
  102905. }
  102906. }
  102907. return resultArray.join(separator);
  102908. },
  102909. // Global Ajax Setup
  102910. globalAjaxOptions: {},
  102911. ajaxSetup: function ajaxSetup(options) {
  102912. if (options.type) options.method = options.type;
  102913. $.each(options, function (optionName, optionValue) {
  102914. $.globalAjaxOptions[optionName] = optionValue;
  102915. });
  102916. },
  102917. // Ajax
  102918. _jsonpRequests: 0,
  102919. ihttp: function ihttp(options) {
  102920. var defaults = {
  102921. method: 'GET',
  102922. data: false,
  102923. async: true,
  102924. cache: true,
  102925. user: '',
  102926. password: '',
  102927. headers: {},
  102928. xhrFields: {},
  102929. statusCode: {},
  102930. processData: true,
  102931. dataType: 'text',
  102932. contentType: 'application/x-www-form-urlencoded',
  102933. timeout: 0
  102934. };
  102935. var callbacks = ['beforeSend', 'error', 'complete', 'success', 'statusCode'];
  102936. //For jQuery guys
  102937. if (options.type) options.method = options.type;
  102938. // Merge global and defaults
  102939. $.each($.globalAjaxOptions, function (globalOptionName, globalOptionValue) {
  102940. if (callbacks.indexOf(globalOptionName) < 0) defaults[globalOptionName] = globalOptionValue;
  102941. });
  102942. // Function to run XHR callbacks and events
  102943. function fireAjaxCallback(eventName, eventData, callbackName) {
  102944. var a = arguments;
  102945. if (eventName) $(document).trigger(eventName, eventData);
  102946. if (callbackName) {
  102947. // Global callback
  102948. if (callbackName in $.globalAjaxOptions) $.globalAjaxOptions[callbackName](a[3], a[4], a[5], a[6]);
  102949. // Options callback
  102950. if (options[callbackName]) options[callbackName](a[3], a[4], a[5], a[6]);
  102951. }
  102952. }
  102953. // Merge options and defaults
  102954. $.each(defaults, function (prop, defaultValue) {
  102955. if (!(prop in options)) options[prop] = defaultValue;
  102956. });
  102957. // Default URL
  102958. if (!options.url) {
  102959. options.url = window.location.toString();
  102960. }
  102961. // Parameters Prefix
  102962. var paramsPrefix = options.url.indexOf('?') >= 0 ? '&' : '?';
  102963. // UC method
  102964. var _method = options.method.toUpperCase();
  102965. // Data to modify GET URL
  102966. if ((_method === 'GET' || _method === 'HEAD' || _method === 'OPTIONS' || _method === 'DELETE') && options.data) {
  102967. var stringData = void 0;
  102968. if (typeof options.data === 'string') {
  102969. // Should be key=value string
  102970. if (options.data.indexOf('?') >= 0) stringData = options.data.split('?')[1];else stringData = options.data;
  102971. } else {
  102972. // Should be key=value object
  102973. stringData = $.serializeObject(options.data);
  102974. }
  102975. if (stringData.length) {
  102976. options.url += paramsPrefix + stringData;
  102977. if (paramsPrefix === '?') paramsPrefix = '&';
  102978. }
  102979. }
  102980. // JSONP
  102981. if (options.dataType === 'json' && options.url.indexOf('callback=') >= 0) {
  102982. var callbackName = 'f7jsonp_' + Date.now() + $._jsonpRequests++;
  102983. var abortTimeout = void 0;
  102984. var callbackSplit = options.url.split('callback=');
  102985. var requestUrl = callbackSplit[0] + 'callback=' + callbackName;
  102986. if (callbackSplit[1].indexOf('&') >= 0) {
  102987. var addVars = callbackSplit[1].split('&').filter(function (el) {
  102988. return el.indexOf('=') > 0;
  102989. }).join('&');
  102990. if (addVars.length > 0) requestUrl += '&' + addVars;
  102991. }
  102992. // Create script
  102993. var script = document.createElement('script');
  102994. script.type = 'text/javascript';
  102995. script.onerror = function () {
  102996. clearTimeout(abortTimeout);
  102997. fireAjaxCallback(undefined, undefined, 'error', null, 'scripterror');
  102998. fireAjaxCallback('ajaxComplete ajax:complete', { scripterror: true }, 'complete', null, 'scripterror');
  102999. };
  103000. script.src = requestUrl;
  103001. // Handler
  103002. window[callbackName] = function (data) {
  103003. clearTimeout(abortTimeout);
  103004. fireAjaxCallback(undefined, undefined, 'success', data);
  103005. script.parentNode.removeChild(script);
  103006. script = null;
  103007. delete window[callbackName];
  103008. };
  103009. document.querySelector('head').appendChild(script);
  103010. if (options.timeout > 0) {
  103011. abortTimeout = setTimeout(function () {
  103012. script.parentNode.removeChild(script);
  103013. script = null;
  103014. fireAjaxCallback(undefined, undefined, 'error', null, 'timeout');
  103015. }, options.timeout);
  103016. }
  103017. return;
  103018. }
  103019. // Cache for GET/HEAD requests
  103020. if (_method === 'GET' || _method === 'HEAD' || _method === 'OPTIONS' || _method === 'DELETE') {
  103021. if (options.cache === false) {
  103022. options.url += paramsPrefix + '_nocache=' + Date.now();
  103023. }
  103024. }
  103025. // Create XHR
  103026. var xhr = new XMLHttpRequest();
  103027. // Save Request URL
  103028. xhr.requestUrl = options.url;
  103029. xhr.requestParameters = options;
  103030. // Open XHR
  103031. xhr.open(_method, options.url, options.async, options.user, options.password);
  103032. // Create POST Data
  103033. var postData = null;
  103034. if ((_method === 'POST' || _method === 'PUT' || _method === 'PATCH') && options.data) {
  103035. if (options.processData) {
  103036. var postDataInstances = [ArrayBuffer, Blob, Document, FormData];
  103037. // Post Data
  103038. if (postDataInstances.indexOf(options.data.constructor) >= 0) {
  103039. postData = options.data;
  103040. } else {
  103041. // POST Headers
  103042. var boundary = '---------------------------' + Date.now().toString(16);
  103043. if (options.contentType === 'multipart\/form-data') {
  103044. xhr.setRequestHeader('Content-Type', 'multipart\/form-data; boundary=' + boundary);
  103045. } else {
  103046. xhr.setRequestHeader('Content-Type', options.contentType);
  103047. }
  103048. postData = '';
  103049. var _data = $.serializeObject(options.data);
  103050. if (options.contentType === 'multipart\/form-data') {
  103051. boundary = '---------------------------' + Date.now().toString(16);
  103052. _data = _data.split('&');
  103053. var _newData = [];
  103054. for (var i = 0; i < _data.length; i++) {
  103055. _newData.push('Content-Disposition: form-data; name="' + _data[i].split('=')[0] + '"\r\n\r\n' + _data[i].split('=')[1] + '\r\n');
  103056. }
  103057. postData = '--' + boundary + '\r\n' + _newData.join('--' + boundary + '\r\n') + '--' + boundary + '--\r\n';
  103058. } else {
  103059. postData = _data;
  103060. }
  103061. }
  103062. } else {
  103063. postData = options.data;
  103064. }
  103065. }
  103066. // Additional headers
  103067. if (options.headers) {
  103068. $.each(options.headers, function (headerName, headerCallback) {
  103069. xhr.setRequestHeader(headerName, headerCallback);
  103070. });
  103071. }
  103072. // Check for crossDomain
  103073. if (typeof options.crossDomain === 'undefined') {
  103074. options.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(options.url) && RegExp.$2 !== window.location.host;
  103075. }
  103076. if (!options.crossDomain) {
  103077. xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
  103078. }
  103079. if (options.xhrFields) {
  103080. $.each(options.xhrFields, function (fieldName, fieldValue) {
  103081. xhr[fieldName] = fieldValue;
  103082. });
  103083. }
  103084. var xhrTimeout = void 0;
  103085. // Handle XHR
  103086. xhr.onload = function (e) {
  103087. if (xhrTimeout) clearTimeout(xhrTimeout);
  103088. if (xhr.status >= 200 && xhr.status < 300 || xhr.status === 0) {
  103089. var responseData = void 0;
  103090. if (options.dataType === 'json') {
  103091. try {
  103092. responseData = JSON.parse(xhr.responseText);
  103093. fireAjaxCallback('ajaxSuccess ajax:success', { xhr: xhr }, 'success', responseData, xhr.status, xhr);
  103094. } catch (err) {
  103095. fireAjaxCallback('ajaxError ajax:error', {
  103096. xhr: xhr,
  103097. parseerror: true
  103098. }, 'error', xhr, 'parseerror');
  103099. }
  103100. } else {
  103101. responseData = xhr.responseType === 'text' || xhr.responseType === '' ? xhr.responseText : xhr.response;
  103102. fireAjaxCallback('ajaxSuccess ajax:success', { xhr: xhr }, 'success', responseData, xhr.status, xhr);
  103103. }
  103104. } else {
  103105. fireAjaxCallback('ajaxError ajax:error', { xhr: xhr }, 'error', xhr, xhr.status);
  103106. }
  103107. if (options.statusCode) {
  103108. if ($.globalAjaxOptions.statusCode && $.globalAjaxOptions.statusCode[xhr.status]) $.globalAjaxOptions.statusCode[xhr.status](xhr);
  103109. if (options.statusCode[xhr.status]) options.statusCode[xhr.status](xhr);
  103110. }
  103111. fireAjaxCallback('ajaxComplete ajax:complete', { xhr: xhr }, 'complete', xhr, xhr.status);
  103112. };
  103113. xhr.onerror = function (e) {
  103114. if (xhrTimeout) clearTimeout(xhrTimeout);
  103115. fireAjaxCallback('ajaxError ajax:error', { xhr: xhr }, 'error', xhr, xhr.status);
  103116. fireAjaxCallback('ajaxComplete ajax:complete', { xhr: xhr, error: true }, 'complete', xhr, 'error');
  103117. };
  103118. // Ajax start callback
  103119. fireAjaxCallback('ajaxStart ajax:start', { xhr: xhr }, 'start', xhr);
  103120. fireAjaxCallback(undefined, undefined, 'beforeSend', xhr);
  103121. // Timeout
  103122. if (options.timeout > 0) {
  103123. xhr.onabort = function () {
  103124. if (xhrTimeout) clearTimeout(xhrTimeout);
  103125. };
  103126. xhrTimeout = setTimeout(function () {
  103127. xhr.abort();
  103128. fireAjaxCallback('ajaxError ajax:error', { xhr: xhr, timeout: true }, 'error', xhr, 'timeout');
  103129. fireAjaxCallback('ajaxComplete ajax:complete', {
  103130. xhr: xhr,
  103131. timeout: true
  103132. }, 'complete', xhr, 'timeout');
  103133. }, options.timeout);
  103134. }
  103135. // Send XHR
  103136. xhr.send(postData);
  103137. // Return XHR object
  103138. return xhr;
  103139. }
  103140. });
  103141. /**
  103142. * =============================================================================
  103143. * ************************* Bootstrap extend ************************
  103144. * =============================================================================
  103145. */
  103146. $.extend({
  103147. toast: function toast(params, timeout, template) {
  103148. var _bg = function _bg(num) {
  103149. var container = $A(".__bootstrap_toast_container");
  103150. if (container.length > 0) {
  103151. var bgobj = container.find(".alert-bg");
  103152. var bgnum = parseInt(bgobj.attr("data-num"));
  103153. bgnum += num;
  103154. bgobj.attr("data-num", bgnum);
  103155. if (bgnum > 0) {
  103156. bgobj.show();
  103157. } else {
  103158. bgobj.hide();
  103159. }
  103160. }
  103161. };
  103162. if (!params) return false;
  103163. if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === 'object' && params.length > 0) {
  103164. if (params.attr("data-show-bg") === "true") _bg(-1);
  103165. params.css({ width: Math.ceil(params.outerWidth()) });
  103166. params.addClass("leave");
  103167. setTimeout(function () {
  103168. params.remove();
  103169. }, 300);
  103170. return;
  103171. }
  103172. if (typeof timeout === 'string') {
  103173. template = timeout;
  103174. timeout = 2500;
  103175. }
  103176. if (typeof params === 'string') params = { title: params };
  103177. if (typeof params.timeout === 'undefined') params.timeout = 2500;
  103178. if (typeof params.template === 'undefined') params.template = 'success';
  103179. if (typeof params.fixed === 'undefined') params.fixed = false;
  103180. if (typeof params.close === 'undefined') params.close = true;
  103181. if (typeof timeout !== 'undefined') params.timeout = timeout;
  103182. if (typeof template !== 'undefined') params.template = template;
  103183. //
  103184. var container = $A(".__bootstrap_toast_container");
  103185. if (container.length === 0) {
  103186. $A("<style>").attr({ type: "text/css" }).html(".__bootstrap_toast_container{position:fixed;z-index:99999;top:5%;right:5%;padding:0;text-align:right;}" + ".__bootstrap_toast_container .alert-bg{position:fixed;display:none;z-index:1;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.6);}" + ".__bootstrap_toast_container .alert-body{position:relative;z-index:2;display:block;min-width:180px;text-align:left;opacity:0;transform:translate3d(0,100px,0);-webkit-transform:translate3d(0,100px,0);transition-duration:300ms;-webkit-transition-duration:300ms;}" + ".__bootstrap_toast_container .alert-body.enter{opacity:1;transform:translate3d(0,0,0);-webkit-transform:translate3d(0,0,0);}" + ".__bootstrap_toast_container .alert-body.leave{position:absolute;top:0;right:0;z-index:3;opacity:0;transform:translate3d(100%,0,0);-webkit-transform:translate3d(100%,0,0);transition-duration:200ms;-webkit-transition-duration:300ms;}" + "").appendTo("head");
  103187. $A("body").append("<div class='__bootstrap_toast_container'><div class='alert-bg' data-num='0'></div></div>");
  103188. container = $A(".__bootstrap_toast_container");
  103189. }
  103190. //
  103191. var $intemp = $A('<div class="alert-body alert alert-' + params.template + ' alert-dismissible" role="alert"><button type="button" class="close"><span aria-hidden="true">&times;</span></button>' + params.title + '</div>');
  103192. if (params.close === false) {
  103193. $intemp.removeClass("alert-dismissible");
  103194. $intemp.find(".close").remove();
  103195. } else {
  103196. $intemp.find(".close").click(function () {
  103197. $A.toast($intemp);
  103198. });
  103199. }
  103200. if (params.fixed === true) {
  103201. _bg(1);
  103202. $intemp.attr("data-show-bg", "true");
  103203. }
  103204. container.append($intemp);
  103205. //
  103206. if (typeof params.timeout === 'number') {
  103207. setTimeout(function () {
  103208. $A.toast($intemp);
  103209. }, params.timeout);
  103210. }
  103211. setTimeout(function () {
  103212. $intemp.addClass("enter");
  103213. }, 10);
  103214. //
  103215. return $intemp;
  103216. }
  103217. });
  103218. /**
  103219. * =============================================================================
  103220. * ***************************** ajax ****************************
  103221. * =============================================================================
  103222. */
  103223. $.extend({
  103224. ajax: function ajax(params) {
  103225. if (!params) return false;
  103226. if (typeof params.url === 'undefined') return false;
  103227. if (typeof params.data === 'undefined') params.data = {};
  103228. if (typeof params.cache === 'undefined') params.cache = false;
  103229. if (typeof params.method === 'undefined') params.method = 'GET';
  103230. if (typeof params.timeout === 'undefined') params.timeout = 30000;
  103231. if (typeof params.dataType === 'undefined') params.dataType = 'json';
  103232. if (typeof params.beforeSend === 'undefined') params.beforeSend = function () {};
  103233. if (typeof params.complete === 'undefined') params.complete = function () {};
  103234. if (typeof params.afterComplete === 'undefined') params.afterComplete = function () {};
  103235. if (typeof params.success === 'undefined') params.success = function () {};
  103236. if (typeof params.error === 'undefined') params.error = function () {};
  103237. //
  103238. var loadText = "数据加载中.....";
  103239. var busyNetwork = "网络繁忙,请稍后再试!";
  103240. if (_typeof($A.app) === 'object' && typeof $A.app.$L === 'function') {
  103241. loadText = $A.app.$L(loadText);
  103242. busyNetwork = $A.app.$L(busyNetwork);
  103243. }
  103244. //
  103245. var toastID = null,
  103246. beforeTitle = '',
  103247. errorTitle = '';
  103248. if (_typeof($A.app) === 'object' && _typeof($A.app.$Message) === 'object') {
  103249. if (typeof params.beforeSend === 'string') {
  103250. beforeTitle = params.beforeSend;
  103251. params.beforeSend = function () {
  103252. toastID = $A.app.$Message.loading({ content: beforeTitle, duration: 0 });
  103253. };
  103254. } else if (params.beforeSend === true) {
  103255. params.beforeSend = function () {
  103256. toastID = $A.app.$Message.loading({ content: loadText, duration: 0 });
  103257. };
  103258. }
  103259. if (typeof params.error === 'string') {
  103260. errorTitle = params.error;
  103261. params.error = function () {
  103262. $A.app.$Message.error({ content: errorTitle, duration: 5 });
  103263. };
  103264. } else if (params.error === true) {
  103265. params.error = function () {
  103266. $A.app.$Message.error({ content: busyNetwork, duration: 5 });
  103267. };
  103268. }
  103269. if (params.complete === true) {
  103270. params.complete = function () {
  103271. toastID ? toastID() : '';
  103272. };
  103273. }
  103274. } else {
  103275. if (typeof params.beforeSend === 'string') {
  103276. beforeTitle = params.beforeSend;
  103277. params.beforeSend = function () {
  103278. toastID = $A.toast({ title: beforeTitle, fixed: true, timeout: false });
  103279. };
  103280. } else if (params.beforeSend === true) {
  103281. params.beforeSend = function () {
  103282. toastID = $A.toast({ title: loadText, fixed: true, timeout: false });
  103283. };
  103284. }
  103285. if (typeof params.error === 'string') {
  103286. errorTitle = params.error;
  103287. params.error = function () {
  103288. $A.toast(errorTitle, "danger");
  103289. };
  103290. } else if (params.error === true) {
  103291. params.error = function () {
  103292. $A.toast(busyNetwork, "danger");
  103293. };
  103294. }
  103295. if (params.complete === true) {
  103296. params.complete = function () {
  103297. toastID ? $A.toast(toastID) : '';
  103298. };
  103299. }
  103300. }
  103301. //
  103302. if (_typeof(params.header) !== 'object') params.header = {};
  103303. params.header['Content-Type'] = 'application/json';
  103304. params.header['language'] = window.localStorage['__language:type__'] || 'zh';
  103305. params.header['token'] = $A.token();
  103306. //
  103307. params.data['__Access-Control-Allow-Origin'] = true;
  103308. params.beforeSend();
  103309. $A.ihttp({
  103310. url: params.url,
  103311. data: params.data,
  103312. cache: params.cache,
  103313. headers: params.header,
  103314. method: params.method.toUpperCase(),
  103315. contentType: "OPTIONS",
  103316. crossDomain: true,
  103317. dataType: params.dataType,
  103318. timeout: params.timeout,
  103319. success: function success(data, status, xhr) {
  103320. params.complete();
  103321. params.success(data, status, xhr);
  103322. params.afterComplete(true);
  103323. },
  103324. error: function error(xhr, status) {
  103325. params.complete();
  103326. params.error(xhr, status);
  103327. params.afterComplete(false);
  103328. }
  103329. });
  103330. }
  103331. });
  103332. /**
  103333. * =============================================================================
  103334. * ***************************** manage assist ****************************
  103335. * =============================================================================
  103336. */
  103337. $.extend({
  103338. /**
  103339. * 对象中有Date格式的转成指定格式
  103340. * @param myObj
  103341. * @param format 默认格式:Y-m-d
  103342. * @returns {*}
  103343. */
  103344. date2string: function date2string(myObj, format) {
  103345. if (myObj === null) {
  103346. return myObj;
  103347. }
  103348. if (typeof format === "undefined") {
  103349. format = "Y-m-d";
  103350. }
  103351. if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) === "object") {
  103352. if (myObj instanceof Date) {
  103353. return $A.formatDate(format, myObj);
  103354. }
  103355. $A.each(myObj, function (key, val) {
  103356. myObj[key] = $A.date2string(val, format);
  103357. });
  103358. return myObj;
  103359. }
  103360. return myObj;
  103361. },
  103362. /**
  103363. * 获取一些指定时间
  103364. * @param str
  103365. * @param retInt
  103366. * @returns {*|string}
  103367. */
  103368. getData: function getData(str) {
  103369. var retInt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  103370. var now = new Date(); //当前日期
  103371. var nowDayOfWeek = now.getDay(); //今天本周的第几天
  103372. var nowDay = now.getDate(); //当前日
  103373. var nowMonth = now.getMonth(); //当前月
  103374. var nowYear = now.getYear(); //当前年
  103375. nowYear += nowYear < 2000 ? 1900 : 0;
  103376. var lastMonthDate = new Date(); //上月日期
  103377. lastMonthDate.setDate(1);
  103378. lastMonthDate.setMonth(lastMonthDate.getMonth() - 1);
  103379. var lastMonth = lastMonthDate.getMonth();
  103380. var getQuarterStartMonth = function getQuarterStartMonth() {
  103381. var quarterStartMonth = 0;
  103382. if (nowMonth < 3) {
  103383. quarterStartMonth = 0;
  103384. }
  103385. if (2 < nowMonth && nowMonth < 6) {
  103386. quarterStartMonth = 3;
  103387. }
  103388. if (5 < nowMonth && nowMonth < 9) {
  103389. quarterStartMonth = 6;
  103390. }
  103391. if (nowMonth > 8) {
  103392. quarterStartMonth = 9;
  103393. }
  103394. return quarterStartMonth;
  103395. };
  103396. var getMonthDays = function getMonthDays(myMonth) {
  103397. var monthStartDate = new Date(nowYear, myMonth, 1);
  103398. var monthEndDate = new Date(nowYear, myMonth + 1, 1);
  103399. return (monthEndDate - monthStartDate) / (1000 * 60 * 60 * 24);
  103400. };
  103401. //
  103402. var time = now.getTime();
  103403. switch (str) {
  103404. case '今天':
  103405. time = now;
  103406. break;
  103407. case '昨天':
  103408. time = now - 86400000;
  103409. break;
  103410. case '前天':
  103411. time = now - 86400000 * 2;
  103412. break;
  103413. case '本周':
  103414. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek);
  103415. break;
  103416. case '本周结束':
  103417. time = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek));
  103418. break;
  103419. case '上周':
  103420. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7);
  103421. break;
  103422. case '上周结束':
  103423. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1);
  103424. break;
  103425. case '本周2':
  103426. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek + 1);
  103427. break;
  103428. case '本周结束2':
  103429. time = new Date(nowYear, nowMonth, nowDay + (6 - nowDayOfWeek) + 1);
  103430. break;
  103431. case '上周2':
  103432. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 7 + 1);
  103433. break;
  103434. case '上周结束2':
  103435. time = new Date(nowYear, nowMonth, nowDay - nowDayOfWeek - 1 + 1);
  103436. break;
  103437. case '本月':
  103438. time = new Date(nowYear, nowMonth, 1);
  103439. break;
  103440. case '本月结束':
  103441. time = new Date(nowYear, nowMonth, getMonthDays(nowMonth));
  103442. break;
  103443. case '上个月':
  103444. time = new Date(nowYear, lastMonth, 1);
  103445. break;
  103446. case '上个月结束':
  103447. time = new Date(nowYear, lastMonth, getMonthDays(lastMonth));
  103448. break;
  103449. case '本季度':
  103450. time = new Date(nowYear, getQuarterStartMonth(), 1);
  103451. break;
  103452. case '本季度结束':
  103453. var quarterEndMonth = getQuarterStartMonth() + 2;
  103454. time = new Date(nowYear, quarterEndMonth, getMonthDays(quarterEndMonth));
  103455. break;
  103456. }
  103457. if (retInt === true) {
  103458. return time;
  103459. }
  103460. return $A.formatDate("Y-m-d", parseInt(time / 1000));
  103461. },
  103462. /**
  103463. * 字节转换
  103464. * @param bytes
  103465. * @returns {string}
  103466. */
  103467. bytesToSize: function bytesToSize(bytes) {
  103468. if (bytes === 0) return '0 B';
  103469. var k = 1024;
  103470. var sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
  103471. var i = Math.floor(Math.log(bytes) / Math.log(k));
  103472. if (typeof sizes[i] === "undefined") {
  103473. return '0 B';
  103474. }
  103475. return $A.runNum(bytes / Math.pow(k, i), 2) + ' ' + sizes[i];
  103476. }
  103477. });
  103478. window.$A = $;
  103479. })(window, window.jQuery);
  103480. /***/ }),
  103481. /* 200 */
  103482. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  103483. "use strict";
  103484. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sass_main_scss__ = __webpack_require__(201);
  103485. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__sass_main_scss___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__sass_main_scss__);
  103486. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  103487. /**
  103488. * 页面专用
  103489. */
  103490. (function (window) {
  103491. var _apiUrl = window.location.origin + '/api/';
  103492. var $ = window.$A;
  103493. $.extend({
  103494. fillUrl: function fillUrl(str) {
  103495. if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
  103496. return str;
  103497. }
  103498. return window.location.origin + '/' + str;
  103499. },
  103500. webUrl: function webUrl(str) {
  103501. return $A.fillUrl(str || '');
  103502. },
  103503. apiUrl: function apiUrl(str) {
  103504. if (str.substring(0, 2) === "//" || str.substring(0, 7) === "http://" || str.substring(0, 8) === "https://" || str.substring(0, 6) === "ftp://" || str.substring(0, 1) === "/") {
  103505. return str;
  103506. }
  103507. return _apiUrl + str;
  103508. },
  103509. apiAjax: function apiAjax(params) {
  103510. if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) !== 'object') return false;
  103511. if (typeof params.success === 'undefined') params.success = function () {};
  103512. params.url = this.apiUrl(params.url);
  103513. //
  103514. var beforeCall = params.beforeSend;
  103515. params.beforeSend = function () {
  103516. $A.aAjaxLoad++;
  103517. $A(".w-spinner").show();
  103518. //
  103519. if (typeof beforeCall == "function") {
  103520. beforeCall();
  103521. }
  103522. };
  103523. //
  103524. var completeCall = params.complete;
  103525. params.complete = function () {
  103526. $A.aAjaxLoad--;
  103527. if ($A.aAjaxLoad <= 0) {
  103528. $A(".w-spinner").hide();
  103529. }
  103530. //
  103531. if (typeof completeCall == "function") {
  103532. completeCall();
  103533. }
  103534. };
  103535. //
  103536. var callback = params.success;
  103537. params.success = function (data, status, xhr) {
  103538. if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
  103539. if (data.ret === -1 && params.checkRole !== false) {
  103540. //身份丢失
  103541. $A.app.$Modal.error({
  103542. title: '温馨提示',
  103543. content: data.msg,
  103544. onOk: function onOk() {
  103545. $A.userLogout();
  103546. }
  103547. });
  103548. return;
  103549. }
  103550. if (data.ret === -2 && params.role !== false) {
  103551. //没有权限
  103552. $A.app.$Modal.error({
  103553. title: '权限不足',
  103554. content: data.msg ? data.msg : "你没有相关的权限查看或编辑!"
  103555. });
  103556. }
  103557. }
  103558. if (typeof callback === "function") {
  103559. callback(data, status, xhr);
  103560. }
  103561. };
  103562. //
  103563. $A.ajax(params);
  103564. },
  103565. aAjaxLoad: 0,
  103566. /**
  103567. * 编辑器参数配置
  103568. * @returns {{modules: {toolbar: *[]}}}
  103569. */
  103570. editorOption: function editorOption() {
  103571. return {
  103572. modules: {
  103573. toolbar: [['bold', 'italic'], [{ 'list': 'ordered' }, { 'list': 'bullet' }], [{ 'size': ['small', false, 'large', 'huge'] }], [{ 'header': [1, 2, 3, 4, 5, 6, false] }], [{ 'color': [] }, { 'background': [] }], [{ 'align': [] }]]
  103574. }
  103575. };
  103576. },
  103577. /**
  103578. * 获取token
  103579. * @returns {boolean}
  103580. */
  103581. getToken: function getToken() {
  103582. var token = $A.token();
  103583. return $A.count(token) < 10 ? false : token;
  103584. },
  103585. /**
  103586. * 设置token
  103587. * @param token
  103588. */
  103589. setToken: function setToken(token) {
  103590. $A.token(token);
  103591. },
  103592. /**
  103593. * 获取会员账号
  103594. * @returns string
  103595. */
  103596. getUserName: function getUserName() {
  103597. if ($A.getToken() === false) {
  103598. return "";
  103599. }
  103600. var userInfo = $A.getUserInfo();
  103601. return $A.ishave(userInfo.username) ? userInfo.username : '';
  103602. },
  103603. /**
  103604. * 获取会员昵称
  103605. * @param nullName
  103606. * @returns {string|*}
  103607. */
  103608. getNickName: function getNickName() {
  103609. var nullName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
  103610. if ($A.getToken() === false) {
  103611. return "";
  103612. }
  103613. var userInfo = $A.getUserInfo();
  103614. return $A.ishave(userInfo.nickname) ? userInfo.nickname : nullName ? $A.getUserName() : '';
  103615. },
  103616. /**
  103617. * 获取用户信息(并保存)
  103618. * @param callback 网络请求获取到用户信息回调(监听用户信息发生变化)
  103619. * @returns Object
  103620. */
  103621. getUserInfo: function getUserInfo(callback) {
  103622. if (typeof callback === 'function' || callback === true) {
  103623. $A.apiAjax({
  103624. url: 'users/info',
  103625. error: function error() {
  103626. $A.userLogout();
  103627. },
  103628. success: function success(res) {
  103629. if (res.ret === 1) {
  103630. $A.storage("userInfo", res.data);
  103631. $A.setToken(res.data.token);
  103632. $A.triggerUserInfoListener(res.data);
  103633. typeof callback === "function" && callback(res.data, $A.getToken() !== false);
  103634. }
  103635. }
  103636. });
  103637. }
  103638. return $A.jsonParse($A.storage("userInfo"));
  103639. },
  103640. /**
  103641. * 根据用户名获取用户基本信息
  103642. * @param username
  103643. * @param callback
  103644. * @param cacheTime
  103645. */
  103646. getUserBasic: function getUserBasic(username, callback) {
  103647. var cacheTime = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;
  103648. if (typeof callback !== "function") {
  103649. return;
  103650. }
  103651. if (!username) {
  103652. callback({}, false);
  103653. return;
  103654. }
  103655. //
  103656. var keyName = '__userBasic:' + username.substring(0, 1) + '__';
  103657. var localData = $A.jsonParse(window.localStorage[keyName]);
  103658. if ($A.getObject(localData, username + '.success') === true) {
  103659. callback(localData[username].data, true);
  103660. if (localData[username].update + cacheTime > Math.round(new Date().getTime() / 1000)) {
  103661. return;
  103662. }
  103663. }
  103664. //
  103665. $A.__userBasicObject.push({
  103666. username: username,
  103667. callback: callback
  103668. });
  103669. //
  103670. $A.__userBasicTimeout++;
  103671. var timeout = $A.__userBasicTimeout;
  103672. setTimeout(function () {
  103673. timeout === $A.__userBasicTimeout && $A.__userBasicEvent();
  103674. }, 100);
  103675. },
  103676. __userBasicEvent: function __userBasicEvent() {
  103677. if ($A.__userBasicLoading === true) {
  103678. return;
  103679. }
  103680. $A.__userBasicLoading = true;
  103681. //
  103682. var userArray = [];
  103683. $A.__userBasicObject.some(function (item) {
  103684. userArray.push(item.username);
  103685. if (userArray.length >= 30) {
  103686. return true;
  103687. }
  103688. });
  103689. //
  103690. $A.apiAjax({
  103691. url: 'users/basic',
  103692. data: {
  103693. username: $A.jsonStringify(userArray)
  103694. },
  103695. error: function error() {
  103696. userArray.forEach(function (username) {
  103697. var tmpLists = $A.__userBasicObject.filter(function (item) {
  103698. return item.username == username;
  103699. });
  103700. tmpLists.forEach(function (item) {
  103701. if (typeof item.callback === "function") {
  103702. item.callback({}, false);
  103703. item.callback = null;
  103704. }
  103705. });
  103706. });
  103707. //
  103708. $A.__userBasicLoading = false;
  103709. $A.__userBasicObject = $A.__userBasicObject.filter(function (item) {
  103710. return typeof item.callback === "function";
  103711. });
  103712. if ($A.__userBasicObject.length > 0) {
  103713. $A.__userBasicEvent();
  103714. }
  103715. },
  103716. success: function success(res) {
  103717. if (res.ret === 1) {
  103718. res.data.forEach(function (data) {
  103719. var keyName = '__userBasic:' + data.username.substring(0, 1) + '__';
  103720. var localData = $A.jsonParse(window.localStorage[keyName]);
  103721. localData[data.username] = {
  103722. success: true,
  103723. update: Math.round(new Date().getTime() / 1000),
  103724. data: data
  103725. };
  103726. window.localStorage[keyName] = $A.jsonStringify(localData);
  103727. });
  103728. }
  103729. userArray.forEach(function (username) {
  103730. var tmpLists = $A.__userBasicObject.filter(function (item) {
  103731. return item.username == username;
  103732. });
  103733. tmpLists.forEach(function (item) {
  103734. if (typeof item.callback === "function") {
  103735. var info = res.data.filter(function (data) {
  103736. return data.username == username;
  103737. });
  103738. if (info.length === 0) {
  103739. item.callback({}, false);
  103740. } else {
  103741. item.callback(info[0], true);
  103742. }
  103743. item.callback = null;
  103744. }
  103745. });
  103746. });
  103747. //
  103748. $A.__userBasicLoading = false;
  103749. $A.__userBasicObject = $A.__userBasicObject.filter(function (item) {
  103750. return typeof item.callback === "function";
  103751. });
  103752. if ($A.__userBasicObject.length > 0) {
  103753. $A.__userBasicEvent();
  103754. }
  103755. }
  103756. });
  103757. },
  103758. __userBasicTimeout: 0,
  103759. __userBasicLoading: false,
  103760. __userBasicObject: [],
  103761. /**
  103762. * 打开登录页面
  103763. */
  103764. userLogout: function userLogout() {
  103765. $A.token("");
  103766. $A.storage("userInfo", {});
  103767. $A.triggerUserInfoListener({});
  103768. var from = window.location.pathname == '/' ? '' : encodeURIComponent(window.location.href);
  103769. if (_typeof($A.app) === "object") {
  103770. $A.app.goForward({ path: '/', query: from ? { from: from } : {} }, true);
  103771. } else {
  103772. window.location.replace($A.webUrl() + (from ? '?from=' + from : ''));
  103773. }
  103774. },
  103775. /**
  103776. * 权限是否通过
  103777. * @param role
  103778. * @returns {boolean}
  103779. */
  103780. identity: function identity(role) {
  103781. var userInfo = $A.getUserInfo();
  103782. return $A.identityRaw(role, userInfo.identity);
  103783. },
  103784. /**
  103785. * 权限是否通过
  103786. * @param role
  103787. * @returns {boolean}
  103788. */
  103789. identityRaw: function identityRaw(role, identity) {
  103790. var isRole = false;
  103791. $A.each(identity, function (index, res) {
  103792. if (res === role) {
  103793. isRole = true;
  103794. }
  103795. });
  103796. return isRole;
  103797. },
  103798. /**
  103799. * 监听用户信息发生变化
  103800. * @param listenerName 监听标识
  103801. * @param callback 监听回调
  103802. */
  103803. setOnUserInfoListener: function setOnUserInfoListener(listenerName, callback) {
  103804. if (typeof listenerName != "string") {
  103805. return;
  103806. }
  103807. if (typeof callback === "function") {
  103808. $A.__userInfoListenerObject[listenerName] = {
  103809. callback: callback
  103810. };
  103811. }
  103812. },
  103813. removeUserInfoListener: function removeUserInfoListener(listenerName) {
  103814. if (typeof listenerName != "string") {
  103815. return;
  103816. }
  103817. if (typeof $A.__userInfoListenerObject[listenerName] != "undefined") {
  103818. delete $A.__userInfoListenerObject[listenerName];
  103819. }
  103820. },
  103821. triggerUserInfoListener: function triggerUserInfoListener(userInfo) {
  103822. var key = void 0,
  103823. item = void 0;
  103824. for (key in $A.__userInfoListenerObject) {
  103825. if (!$A.__userInfoListenerObject.hasOwnProperty(key)) continue;
  103826. item = $A.__userInfoListenerObject[key];
  103827. if (typeof item.callback === "function") {
  103828. item.callback(userInfo, $A.getToken() !== false);
  103829. }
  103830. }
  103831. },
  103832. __userInfoListenerObject: {},
  103833. /**
  103834. * 监听任务发生变化
  103835. * @param listenerName 监听标识
  103836. * @param callback 监听回调
  103837. * @param callSpecial 是否监听几种特殊事件(非操作任务的)
  103838. */
  103839. setOnTaskInfoListener: function setOnTaskInfoListener(listenerName, callback, callSpecial) {
  103840. if (typeof listenerName != "string") {
  103841. return;
  103842. }
  103843. if (typeof callback === "function") {
  103844. $A.__taskInfoListenerObject[listenerName] = {
  103845. special: callSpecial === true,
  103846. callback: callback
  103847. };
  103848. }
  103849. },
  103850. triggerTaskInfoListener: function triggerTaskInfoListener(act, taskDetail) {
  103851. var sendToWS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  103852. var key = void 0,
  103853. item = void 0;
  103854. for (key in $A.__taskInfoListenerObject) {
  103855. if (!$A.__taskInfoListenerObject.hasOwnProperty(key)) continue;
  103856. item = $A.__taskInfoListenerObject[key];
  103857. if (typeof item.callback === "function") {
  103858. if (['addlabel', 'deleteproject', 'deletelabel', 'labelsort', 'tasksort'].indexOf(act) === -1 || item.special === true) {
  103859. if (typeof taskDetail.__modifyUsername === "undefined") {
  103860. taskDetail.__modifyUsername = $A.getUserName();
  103861. }
  103862. item.callback(act, taskDetail);
  103863. }
  103864. }
  103865. }
  103866. if (sendToWS === true) {
  103867. $A.WSOB.sendTo('team', {
  103868. type: "taskA",
  103869. act: act,
  103870. taskDetail: taskDetail
  103871. });
  103872. }
  103873. },
  103874. __taskInfoListenerObject: {},
  103875. /**
  103876. * 获取待推送的日志并推送
  103877. * @param taskid
  103878. */
  103879. triggerTaskInfoChange: function triggerTaskInfoChange(taskid) {
  103880. $A.apiAjax({
  103881. url: 'project/task/pushlog',
  103882. data: {
  103883. taskid: taskid,
  103884. pagesize: 20
  103885. },
  103886. success: function success(res) {
  103887. if (res.ret === 1) {
  103888. res.data.lists.forEach(function (item) {
  103889. var msgData = {
  103890. type: 'taskB',
  103891. username: item.username,
  103892. userimg: item.userimg,
  103893. indate: item.indate,
  103894. text: item.detail,
  103895. other: item.other
  103896. };
  103897. res.data.follower.forEach(function (username) {
  103898. if (username != msgData.username && username != $A.getUserName()) {
  103899. $A.WSOB.sendTo('user', username, msgData, 'special');
  103900. }
  103901. });
  103902. });
  103903. }
  103904. }
  103905. });
  103906. },
  103907. /**
  103908. * 推送任务至钉钉
  103909. * @param taskid
  103910. */
  103911. triggerTaskDing: function triggerTaskDing(ajaxData) {
  103912. $A.apiAjax({
  103913. url: 'ding/notice/push',
  103914. method: 'post',
  103915. data: ajaxData,
  103916. success: function success(res) {}
  103917. });
  103918. }
  103919. });
  103920. /**
  103921. * =============================================================================
  103922. * ***************************** websocket assist ****************************
  103923. * =============================================================================
  103924. */
  103925. $.extend({
  103926. /**
  103927. * @param config {username, url, token, channel, logCallback}
  103928. */
  103929. WTWS: function WTWS(config) {
  103930. this.__instance = null;
  103931. this.__connected = false;
  103932. this.__callbackid = {};
  103933. this.__openNum = 0;
  103934. this.__autoNum = 0;
  103935. this.__autoLine = function (timeout) {
  103936. var tempNum = this.__autoNum;
  103937. var thas = this;
  103938. setTimeout(function () {
  103939. if (tempNum === thas.__autoNum) {
  103940. thas.__autoNum++;
  103941. if (!thas.__config.token) {
  103942. thas.__log("[WS] No token");
  103943. thas.__autoLine(timeout + 5);
  103944. } else {
  103945. thas.sendTo('refresh', function (res) {
  103946. thas.__log("[WS] Connection " + (res.status ? 'success' : 'error'));
  103947. thas.__autoLine(timeout + 5);
  103948. });
  103949. }
  103950. }
  103951. }, Math.min(timeout, 30) * 1000);
  103952. };
  103953. this.__log = function (text, event) {
  103954. typeof this.__config.logCallback === "function" && this.__config.logCallback(text, event);
  103955. };
  103956. this.__lExists = function (string, find, lower) {
  103957. string += "";
  103958. find += "";
  103959. if (lower !== true) {
  103960. string = string.toLowerCase();
  103961. find = find.toLowerCase();
  103962. }
  103963. return string.substring(0, find.length) === find;
  103964. };
  103965. this.__rNum = function (str, fixed) {
  103966. var _s = Number(str);
  103967. if (_s + "" === "NaN") {
  103968. _s = 0;
  103969. }
  103970. if (/^[0-9]*[1-9][0-9]*$/.test(fixed)) {
  103971. _s = _s.toFixed(fixed);
  103972. var rs = _s.indexOf('.');
  103973. if (rs < 0) {
  103974. _s += ".";
  103975. for (var i = 0; i < fixed; i++) {
  103976. _s += "0";
  103977. }
  103978. }
  103979. }
  103980. return _s;
  103981. };
  103982. this.__jParse = function (str, defaultVal) {
  103983. if (str === null) {
  103984. return defaultVal ? defaultVal : {};
  103985. }
  103986. if ((typeof str === 'undefined' ? 'undefined' : _typeof(str)) === "object") {
  103987. return str;
  103988. }
  103989. try {
  103990. return JSON.parse(str);
  103991. } catch (e) {
  103992. return defaultVal ? defaultVal : {};
  103993. }
  103994. };
  103995. this.__randString = function (len) {
  103996. len = len || 32;
  103997. var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678oOLl9gqVvUuI1';
  103998. var maxPos = $chars.length;
  103999. var pwd = '';
  104000. for (var i = 0; i < len; i++) {
  104001. pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
  104002. }
  104003. return pwd;
  104004. };
  104005. this.__urlParams = function (url, params) {
  104006. if ((typeof params === 'undefined' ? 'undefined' : _typeof(params)) === "object" && params !== null) {
  104007. url += "";
  104008. url += url.indexOf("?") === -1 ? '?' : '';
  104009. for (var key in params) {
  104010. if (!params.hasOwnProperty(key)) {
  104011. continue;
  104012. }
  104013. url += '&' + key + '=' + params[key];
  104014. }
  104015. }
  104016. return url.replace("?&", "?");
  104017. };
  104018. this.__isArr = function (obj) {
  104019. return Object.prototype.toString.call(obj) == '[object Array]';
  104020. };
  104021. /**
  104022. * 设置参数
  104023. * @param config
  104024. */
  104025. this.config = function (config) {
  104026. if ((typeof config === 'undefined' ? 'undefined' : _typeof(config)) !== "object" || config === null) {
  104027. config = {};
  104028. }
  104029. config.username = config.username || '';
  104030. config.url = config.url || '';
  104031. config.token = config.token || '';
  104032. config.channel = config.channel || '';
  104033. config.logCallback = config.logCallback || null;
  104034. this.__config = config;
  104035. return this;
  104036. };
  104037. /**
  104038. * 连接
  104039. * @param force
  104040. */
  104041. this.connection = function (force) {
  104042. if (!this.__lExists(this.__config.url, "ws://") && !this.__lExists(this.__config.url, "wss://")) {
  104043. this.__log("[WS] No connection address");
  104044. return this;
  104045. }
  104046. if (!this.__config.token) {
  104047. this.__log("[WS] No connected token");
  104048. return this;
  104049. }
  104050. if (this.__instance !== null && force !== true) {
  104051. this.__log("[WS] Connection exists");
  104052. return this;
  104053. }
  104054. var thas = this;
  104055. // 初始化客户端套接字并建立连接
  104056. this.__instance = new WebSocket(this.__urlParams(this.__config.url, {
  104057. token: this.__config.token,
  104058. channel: this.__config.channel
  104059. }));
  104060. // 连接建立时触发
  104061. this.__instance.onopen = function (event) {
  104062. thas.__log("[WS] Connection opened", event);
  104063. };
  104064. // 接收到服务端推送时执行
  104065. this.__instance.onmessage = function (event) {
  104066. var msgDetail = thas.__jParse(event.data);
  104067. if (msgDetail.messageType === 'open') {
  104068. thas.__log("[WS] Connection connected");
  104069. msgDetail.openNum = thas.__openNum;
  104070. msgDetail.config = thas.__config;
  104071. thas.__openNum++;
  104072. thas.__connected = true;
  104073. thas.__autoLine(30);
  104074. } else if (msgDetail.messageType === 'back') {
  104075. typeof thas.__callbackid[msgDetail.messageId] === "function" && thas.__callbackid[msgDetail.messageId](msgDetail.body);
  104076. delete thas.__callbackid[msgDetail.messageId];
  104077. return;
  104078. }
  104079. if (thas.__rNum(msgDetail.contentId) > 0) {
  104080. thas.sendTo('roger', msgDetail.contentId);
  104081. }
  104082. thas.triggerMsgListener(msgDetail);
  104083. };
  104084. // 连接关闭时触发
  104085. this.__instance.onclose = function (event) {
  104086. thas.__log("[WS] Connection closed", event);
  104087. thas.__connected = false;
  104088. thas.__instance = null;
  104089. thas.__autoLine(5);
  104090. };
  104091. // 连接出错
  104092. this.__instance.onerror = function (event) {
  104093. thas.__log("[WS] Connection error", event);
  104094. thas.__connected = false;
  104095. thas.__instance = null;
  104096. thas.__autoLine(5);
  104097. };
  104098. return this;
  104099. };
  104100. /**
  104101. * 添加消息监听
  104102. * @param listenerName
  104103. * @param listenerType
  104104. * @param callback
  104105. */
  104106. this.setOnMsgListener = function (listenerName, listenerType, callback) {
  104107. if (typeof listenerName != "string") {
  104108. return this;
  104109. }
  104110. if (typeof listenerType === "function") {
  104111. callback = listenerType;
  104112. listenerType = [];
  104113. }
  104114. if (!this.__isArr(listenerType)) {
  104115. listenerType = [listenerType];
  104116. }
  104117. if (typeof callback === "function") {
  104118. this.__msgListenerObject[listenerName] = {
  104119. callback: callback,
  104120. listenerType: listenerType
  104121. };
  104122. }
  104123. return this;
  104124. };
  104125. this.triggerMsgListener = function (msgDetail) {
  104126. var key, item;
  104127. for (key in this.__msgListenerObject) {
  104128. if (!this.__msgListenerObject.hasOwnProperty(key)) {
  104129. continue;
  104130. }
  104131. item = this.__msgListenerObject[key];
  104132. if (item.listenerType.length > 0 && item.listenerType.indexOf(msgDetail.messageType) === -1) {
  104133. continue;
  104134. }
  104135. if (typeof item.callback === "function") {
  104136. item.callback(msgDetail);
  104137. }
  104138. }
  104139. };
  104140. this.__msgListenerObject = {};
  104141. /**
  104142. * 添加特殊监听
  104143. * @param listenerName
  104144. * @param callback
  104145. */
  104146. this.setOnSpecialListener = function (listenerName, callback) {
  104147. if (typeof listenerName != "string") {
  104148. return this;
  104149. }
  104150. if (typeof callback === "function") {
  104151. this.__specialListenerObject[listenerName] = {
  104152. callback: callback
  104153. };
  104154. }
  104155. return this;
  104156. };
  104157. this.triggerSpecialListener = function (simpleMsg) {
  104158. var key, item;
  104159. for (key in this.__specialListenerObject) {
  104160. if (!this.__specialListenerObject.hasOwnProperty(key)) {
  104161. continue;
  104162. }
  104163. item = this.__specialListenerObject[key];
  104164. if (typeof item.callback === "function") {
  104165. item.callback(simpleMsg);
  104166. }
  104167. }
  104168. };
  104169. this.__specialListenerObject = {};
  104170. /**
  104171. * 发送消息
  104172. * @param messageType 会话类型
  104173. * - refresh: 刷新
  104174. * - unread: 未读信息总数量
  104175. * - read: 已读会员信息
  104176. * - roger: 收到信息回执
  104177. * - user: 发送消息,指定target
  104178. * - info: 发送消息(不保存),指定target
  104179. * - team: 团队会员
  104180. * - docs: 知识库
  104181. * @param target 发送目标
  104182. * @param body 发送内容(对象或数组)
  104183. * @param callback 发送回调
  104184. * @param againNum
  104185. */
  104186. this.sendTo = function (messageType, target, body, callback) {
  104187. var againNum = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
  104188. if ((typeof target === 'undefined' ? 'undefined' : _typeof(target)) === "object" && typeof body === "undefined") {
  104189. body = target;
  104190. target = null;
  104191. }
  104192. if (typeof target === "function") {
  104193. body = target;
  104194. target = null;
  104195. }
  104196. if (typeof body === "function") {
  104197. callback = body;
  104198. body = null;
  104199. }
  104200. if (body === null || (typeof body === 'undefined' ? 'undefined' : _typeof(body)) !== "object") {
  104201. body = {};
  104202. }
  104203. //
  104204. var thas = this;
  104205. if (this.__instance === null || this.__connected === false) {
  104206. if (againNum < 10 && messageType != 'team') {
  104207. setTimeout(function () {
  104208. thas.sendTo(messageType, target, body, callback, thas.__rNum(againNum) + 1);
  104209. }, 600);
  104210. if (againNum === 0) {
  104211. this.connection();
  104212. }
  104213. } else {
  104214. if (this.__instance === null) {
  104215. this.__log("[WS] Service not connected");
  104216. typeof callback === "function" && callback({ status: 0, message: '服务未连接' });
  104217. } else {
  104218. this.__log("[WS] Failed connection");
  104219. typeof callback === "function" && callback({ status: 0, message: '未连接成功' });
  104220. }
  104221. }
  104222. return this;
  104223. }
  104224. if (['refresh', 'unread', 'read', 'roger', 'user', 'info', 'team', 'docs'].indexOf(messageType) === -1) {
  104225. this.__log("[WS] Wrong message messageType: " + messageType);
  104226. typeof callback === "function" && callback({ status: 0, message: '错误的消息类型: ' + messageType });
  104227. return this;
  104228. }
  104229. //
  104230. var contentId = 0;
  104231. if (messageType === 'roger') {
  104232. contentId = target;
  104233. target = null;
  104234. }
  104235. var messageId = '';
  104236. if (typeof callback === "string" && callback === 'special') {
  104237. callback = function callback(res) {
  104238. res.status === 1 && thas.triggerSpecialListener({
  104239. target: target,
  104240. body: body
  104241. });
  104242. };
  104243. }
  104244. if (typeof callback === "function") {
  104245. messageId = this.__randString(16);
  104246. this.__callbackid[messageId] = callback;
  104247. }
  104248. this.__instance.send(JSON.stringify({
  104249. messageType: messageType,
  104250. messageId: messageId,
  104251. contentId: contentId,
  104252. channel: this.__config.channel,
  104253. username: this.__config.username,
  104254. target: target,
  104255. body: body,
  104256. time: Math.round(new Date().getTime() / 1000)
  104257. }));
  104258. return this;
  104259. };
  104260. /**
  104261. * 关闭连接
  104262. */
  104263. this.close = function () {
  104264. if (this.__instance === null) {
  104265. this.__log("[WS] Service not connected");
  104266. return this;
  104267. }
  104268. if (this.__connected === false) {
  104269. this.__log("[WS] Failed connection");
  104270. return this;
  104271. }
  104272. this.__instance.close();
  104273. return this;
  104274. };
  104275. return this.config(config);
  104276. },
  104277. WSOB: {
  104278. instance: null,
  104279. isClose: false,
  104280. /**
  104281. * 初始化
  104282. */
  104283. initialize: function initialize() {
  104284. var url = $A.getObject(window.webSocketConfig, 'URL');
  104285. if (!url) {
  104286. url = window.location.origin;
  104287. url = url.replace("https://", "wss://");
  104288. url = url.replace("http://", "ws://");
  104289. url += "/ws";
  104290. }
  104291. var config = {
  104292. username: $A.getUserName(),
  104293. url: url,
  104294. token: $A.getToken(),
  104295. channel: 'web'
  104296. };
  104297. if (this.instance === null) {
  104298. this.instance = new $A.WTWS(config);
  104299. this.instance.connection();
  104300. } else if (this.isClose) {
  104301. this.isClose = false;
  104302. this.instance.config(config);
  104303. this.instance.connection();
  104304. }
  104305. },
  104306. /**
  104307. * 主动连接
  104308. */
  104309. connection: function connection() {
  104310. this.initialize();
  104311. this.instance.connection();
  104312. },
  104313. /**
  104314. * 监听消息
  104315. * @param listenerName
  104316. * @param listenerType
  104317. * @param callback
  104318. */
  104319. setOnMsgListener: function setOnMsgListener(listenerName, listenerType, callback) {
  104320. this.initialize();
  104321. this.instance.setOnMsgListener(listenerName, listenerType, callback);
  104322. },
  104323. /**
  104324. * 添加特殊监听
  104325. * @param listenerName
  104326. * @param callback
  104327. */
  104328. setOnSpecialListener: function setOnSpecialListener(listenerName, callback) {
  104329. this.initialize();
  104330. this.instance.setOnSpecialListener(listenerName, callback);
  104331. },
  104332. /**
  104333. * 发送消息
  104334. * @param messageType
  104335. * @param target
  104336. * @param body
  104337. * @param callback
  104338. */
  104339. sendTo: function sendTo(messageType, target, body, callback) {
  104340. this.initialize();
  104341. this.instance.sendTo(messageType, target, body, callback);
  104342. },
  104343. /**
  104344. * 关闭连接
  104345. */
  104346. close: function close() {
  104347. if (this.instance === null) {
  104348. return;
  104349. }
  104350. this.isClose = true;
  104351. this.instance.config(null).close();
  104352. },
  104353. /**
  104354. * 获取消息描述
  104355. * @param content
  104356. * @returns {string}
  104357. */
  104358. getMsgDesc: function getMsgDesc(content) {
  104359. var desc = void 0;
  104360. switch (content.type) {
  104361. case 'text':
  104362. desc = content.text;
  104363. break;
  104364. case 'image':
  104365. desc = $A.app.$L('[图片]');
  104366. break;
  104367. case 'file':
  104368. desc = $A.app.$L('[文件]');
  104369. break;
  104370. case 'taskB':
  104371. desc = content.text + " " + $A.app.$L("[来自关注任务]");
  104372. break;
  104373. case 'report':
  104374. desc = content.text + " " + $A.app.$L("[来自工作报告]");
  104375. break;
  104376. case 'video':
  104377. desc = $A.app.$L('[视频通话]');
  104378. break;
  104379. case 'voice':
  104380. desc = $A.app.$L('[语音通话]');
  104381. break;
  104382. default:
  104383. desc = $A.app.$L('[未知类型]');
  104384. break;
  104385. }
  104386. return desc;
  104387. }
  104388. }
  104389. });
  104390. window.$A = $;
  104391. })(window);
  104392. /***/ }),
  104393. /* 201 */
  104394. /***/ (function(module, exports, __webpack_require__) {
  104395. // style-loader: Adds some css to the DOM by adding a <style> tag
  104396. // load the styles
  104397. var content = __webpack_require__(202);
  104398. if(typeof content === 'string') content = [[module.i, content, '']];
  104399. // Prepare cssTransformation
  104400. var transform;
  104401. var options = {}
  104402. options.transform = transform
  104403. // add the styles to the DOM
  104404. var update = __webpack_require__(50)(content, options);
  104405. if(content.locals) module.exports = content.locals;
  104406. // Hot Module Replacement
  104407. if(false) {
  104408. // When the styles change, update the <style> tags
  104409. if(!content.locals) {
  104410. module.hot.accept("!!../../../node_modules/css-loader/index.js!../../../node_modules/sass-loader/lib/loader.js!./main.scss", function() {
  104411. var newContent = require("!!../../../node_modules/css-loader/index.js!../../../node_modules/sass-loader/lib/loader.js!./main.scss");
  104412. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  104413. update(newContent);
  104414. });
  104415. }
  104416. // When the module is disposed, remove the <style> tags
  104417. module.hot.dispose(function() { update(); });
  104418. }
  104419. /***/ }),
  104420. /* 202 */
  104421. /***/ (function(module, exports, __webpack_require__) {
  104422. exports = module.exports = __webpack_require__(0)(false);
  104423. // imports
  104424. // module
  104425. exports.push([module.i, "*[hidden=\"hidden\"] {\n display: none !important; }\n\n.z-row {\n text-rendering: optimizespeed;\n display: flex;\n align-items: stretch;\n flex-flow: row wrap; }\n\n.z-row.gap .z-1, .z-row.gap .z-3, .z-row.gap .z-4, .z-row.gap .z-6, .z-row.gap .z-8, .z-row.gap .z-12, .z-row.gap .z-16, .z-row.gap .z-18, .z-row.gap .z-20, .z-row.gap .z-21, .z-row.gap .z-col {\n padding: .35rem .5rem; }\n\n.z-row > .z-row {\n width: 100%; }\n\n.z-1, .z-3, .z-4, .z-6, .z-8, .z-12, .z-16, .z-18, .z-20, .z-21, .z-col {\n display: inline-block;\n zoom: 1;\n box-sizing: border-box;\n vertical-align: top;\n text-rendering: auto; }\n\n.z-1 {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0;\n max-width: 100%; }\n\n.z-3 {\n width: 12.5%;\n max-width: 12.5%; }\n\n.z-4 {\n width: 16.6667%;\n max-width: 16.6667%; }\n\n.z-6 {\n width: 25%; }\n\n.z-8 {\n width: 33.3333%; }\n\n.z-12 {\n width: 50%; }\n\n.z-16 {\n width: 66.6667%; }\n\n.z-18 {\n width: 75%; }\n\n.z-20 {\n width: 83.3333%; }\n\n.z-21 {\n width: 87.5%; }\n\n.f-12 {\n font-size: 12px !important; }\n\n.f-14 {\n font-size: 14px !important; }\n\n.f-16 {\n font-size: 16px !important; }\n\n.w-box {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n .w-box * {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n\n.w-main {\n position: absolute;\n color: #000000;\n top: 0;\n left: 0;\n min-width: 100%;\n min-height: 100%;\n padding: 0;\n margin: 0; }\n .w-main .w-nav {\n position: fixed;\n left: 0;\n right: 0;\n top: 40px;\n font-size: 14px;\n z-index: 12;\n color: #606266;\n height: 32px;\n line-height: 34px;\n background-color: rgba(255, 255, 255, 0.9);\n box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.1); }\n .w-main .w-nav .nav-row {\n margin: 0 32px;\n display: flex;\n flex-direction: row;\n align-items: center; }\n .w-main .w-nav .nav-row:before, .w-main .w-nav .nav-row:after {\n display: table;\n content: \"\"; }\n .w-main .w-nav .nav-row:after {\n clear: both; }\n .w-main .w-nav .nav-row span {\n margin: 0 12px 0 0;\n cursor: pointer; }\n .w-main .w-nav .nav-row span.active {\n color: #0285d7;\n font-weight: 500; }\n .w-main .w-nav .nav-row span + span {\n padding-left: 12px;\n border-left: 1px solid #ccc; }\n .w-main .w-nav .nav-row .icon {\n font-size: 16px;\n margin-right: 2px; }\n .w-main .w-nav .nav-row .w-nav-left {\n white-space: nowrap;\n padding-right: 24px; }\n .w-main .w-nav .nav-row .w-nav-flex {\n flex: 1; }\n .w-main .w-nav .nav-row .w-nav-right {\n margin-top: -2px;\n white-space: nowrap;\n overflow: hidden;\n overflow-x: auto;\n -webkit-backface-visibility: hidden;\n -webkit-overflow-scrolling: touch; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper {\n margin-top: -2px;\n width: auto; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input {\n padding: 0 26px 0 6px;\n font-size: 14px;\n width: 140px;\n height: 24px;\n line-height: 24px;\n border: none;\n box-shadow: none;\n transition: all 0.2s;\n transform: translateZ(0); }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input:focus {\n width: 180px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.substantial input {\n width: 180px;\n background-color: #eeeeee; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.showclose input {\n padding-right: 48px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix {\n display: flex;\n align-items: center;\n margin: 0 6px 0 0;\n width: auto; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix .nav-sreach-loading {\n display: flex;\n align-items: center;\n margin-right: 6px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix .nav-sreach-loading .w-loading {\n width: 12px;\n height: 12px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix i {\n font-size: 16px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-suffix i.suffix-close {\n font-size: 22px; }\n .w-main .w-nav .nav-row .page-nav-left {\n display: flex;\n flex-direction: row;\n align-items: center;\n min-width: 138px; }\n .w-main .w-nav .nav-row .page-nav-left:hover .page-nav-refresh em {\n display: block; }\n .w-main .w-nav .nav-row .page-nav-left > span {\n margin-right: 8px; }\n .w-main .w-nav .nav-row .page-nav-left > span.bold {\n font-weight: bold; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-loading {\n width: 18px;\n height: 18px;\n display: flex; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh {\n min-width: 36px;\n height: 100%;\n display: flex;\n flex-direction: row;\n align-items: center; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh em {\n display: none;\n padding-left: 4px;\n padding-right: 4px;\n color: #048be0;\n cursor: pointer; }\n .w-main .w-nav .nav-row .page-nav-left .page-nav-refresh em:hover {\n text-decoration: underline; }\n @media (max-width: 768px) {\n .w-main .w-nav .nav-row {\n margin: 0 16px; }\n .w-main .w-nav .nav-row span {\n margin: 0 8px 0 0; }\n .w-main .w-nav .nav-row span + span {\n margin: 0;\n padding-left: 8px; }\n .w-main .w-nav .nav-row .w-nav-left {\n padding-right: 12px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input {\n width: 140px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper input:focus {\n width: 140px; }\n .w-main .w-nav .nav-row .nav-sreach .ivu-input-wrapper.substantial input {\n width: 140px; } }\n\n.w-sreach-main {\n position: fixed;\n top: 76px;\n right: 6px;\n left: 0;\n bottom: 0;\n z-index: 20; }\n .w-sreach-main .w-sreach-box {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n align-items: flex-end; }\n .w-sreach-main .sreach-none,\n .w-sreach-main .sreach-ul {\n background: #ffffff;\n border-radius: 4px;\n box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2); }\n .w-sreach-main .sreach-none {\n text-align: center;\n color: #666;\n padding: 16px 32px; }\n .w-sreach-main .sreach-ul {\n width: 480px;\n max-width: 96%;\n max-height: 100%;\n padding: 16px 12px;\n margin: 0 0 6px 0;\n overflow: auto;\n opacity: 0;\n transform: translate(50%, 0);\n transition: all 0.2s; }\n .w-sreach-main .sreach-ul.sreach-enter {\n opacity: 1;\n transform: translate(0, 0); }\n .w-sreach-main .sreach-ul > li {\n list-style-type: none;\n padding: 6px 12px;\n margin: 0; }\n .w-sreach-main .sreach-ul > li.sreach-result {\n font-size: 12px;\n color: #999; }\n .w-sreach-main .sreach-ul > li:last-child {\n border-bottom: 0; }\n .w-sreach-main .sreach-ul > li .sreach-title {\n font-size: 14px;\n color: #555555;\n font-weight: 400;\n cursor: pointer;\n border-bottom: 1px solid #eeeeee;\n padding-bottom: 6px; }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag {\n background-color: #cccccc;\n display: inline-block;\n padding: 0 3px;\n color: #ffffff;\n border-radius: 2px;\n transform: scale(0.96);\n font-size: 12px; }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p1 {\n background: rgba(248, 14, 21, 0.6); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p2 {\n background: rgba(236, 196, 2, 0.5); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p3 {\n background: rgba(0, 159, 227, 0.7); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.p4 {\n background: rgba(121, 170, 28, 0.7); }\n .w-sreach-main .sreach-ul > li .sreach-title .sreach-tag.overdue {\n background: #ff0000; }\n .w-sreach-main .sreach-ul > li .sreach-title:hover {\n color: #333333; }\n .w-sreach-main .sreach-ul > li .sreach-text {\n font-size: 13px;\n color: #888888;\n font-weight: 400;\n cursor: pointer;\n padding-top: 4px; }\n .w-sreach-main .sreach-ul > li .sreach-text:hover {\n color: #333333; }\n .w-sreach-main .sreach-ul > li > ul {\n padding-top: 3px;\n padding-left: 24px; }\n .w-sreach-main .sreach-ul > li > ul > li {\n padding: 6px 0;\n border-bottom: 1px dotted #eeeeee; }\n .w-sreach-main .sreach-ul > li > ul > li .sreach-title {\n font-size: 13px;\n border-bottom: 0;\n padding-bottom: 0; }\n\n.tableFill .ivu-table table {\n width: 100% !important; }\n .tableFill .ivu-table table .ivu-table-cell {\n display: block;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n padding-left: 12px;\n padding-right: 12px; }\n .tableFill .ivu-table table .ivu-table-cell > div {\n max-width: 100%;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n vertical-align: middle; }\n .tableFill .ivu-table table .ivu-table-cell > div .ivu-tooltip-rel {\n vertical-align: middle; }\n\n.tableFill .ivu-table:before {\n background-color: #efefef; }\n\n.tableFlex .ivu-table {\n display: flex;\n flex-direction: column; }\n .tableFlex .ivu-table .ivu-table-header {\n flex-grow: 0;\n flex-shrink: 0; }\n .tableFlex .ivu-table .ivu-table-body {\n overflow-y: auto; }\n\n.tableSelection .ivu-table .ivu-table-cell {\n padding-left: 12px;\n padding-right: 12px; }\n .tableSelection .ivu-table .ivu-table-cell.ivu-table-cell-with-selection {\n padding-right: 2px; }\n\n.pageBox {\n text-align: center;\n margin-bottom: 12px; }\n\n.sreachBox > .item {\n margin-bottom: 8px; }\n\n.sreachBox .item > div {\n display: block;\n float: left;\n padding-right: 10px; }\n .sreachBox .item > div:last-child {\n padding-right: 0; }\n .sreachBox .item > div .ivu-input-wrapper, .sreachBox .item > div .ivu-select {\n margin-top: 2px; }\n .sreachBox .item > div input, .sreachBox .item > div .ivu-select-placeholder {\n font-weight: normal; }\n\n.sreachBox .item .item-1 {\n width: 100%; }\n\n.sreachBox .item .item-2 {\n width: 50%; }\n\n.sreachBox .item .item-3 {\n width: 33.33%; }\n\n.sreachBox .item .item-4 {\n width: 25%; }\n\n.sreachBox .item .item-5 {\n width: 20%; }\n\n.sreachBox .item:after {\n content: '';\n display: block;\n height: 0;\n clear: both;\n visibility: hidden; }\n\n.sreachBox .item-title,\n.sreachBox .item-title-active {\n display: block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 600; }\n\n.sreachBox .item-title-active {\n color: #ff0000; }\n\n.sreachBox .item-button {\n text-align: right;\n margin-top: 10px;\n margin-bottom: 0; }\n .sreachBox .item-button .ivu-input-wrapper {\n float: none;\n width: 150px;\n display: inline-block; }\n\n.sreachBox .ivu-date-picker {\n width: 100%;\n position: relative;\n vertical-align: middle; }\n\n.sreachBox .item-button .ivu-btn {\n margin-left: 8px; }\n\n.sreachBox .item-button .left-btn {\n float: left;\n margin-right: 8px;\n margin-left: 0; }\n\n.sreach-highlight {\n color: #c00; }\n\n.drawer-tabs .ivu-tabs-tabpane {\n position: relative; }\n\n.drawer-box {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column; }\n .drawer-box .drawer-content {\n flex: 1;\n width: 100%;\n overflow: auto;\n padding: 16px;\n position: relative;\n transform: translateZ(0); }\n .drawer-box .drawer-footer {\n width: 100%;\n border-top: 1px solid #e8e8e8;\n padding: 10px 16px;\n text-align: right;\n background: #fff; }\n\n.ivu-drawer-body .ivu-tabs-bar {\n padding-right: 32px; }\n\n.ivu-select-dropdown-max {\n max-height: 300px; }\n\n.ivu-modal-wrap.simple-modal .ivu-modal-header,\n.ivu-modal-wrap.simple-modal .ivu-modal-footer {\n border-color: transparent; }\n\n.ivu-dropdown-item.dropdown-active {\n color: #058ce4; }\n\n.upload-control-spin-icon-load {\n font-size: 18px;\n animation: upload-control-spin-icon-animation 1s linear infinite; }\n\n@keyframes upload-control-spin-icon-animation {\n from {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(180deg); }\n to {\n transform: rotate(360deg); } }\n\n.m768-show,\n.m768-show-i,\n.m768-show-ib {\n display: none; }\n\n.m768-hide {\n display: block; }\n\n.m768-hide-i {\n display: inline; }\n\n.m768-hide-ib {\n display: inline-block; }\n\n@media (max-width: 768px) {\n .m768-show {\n display: block; }\n .m768-show-i {\n display: inline; }\n .m768-show-ib {\n display: inline-block; }\n .m768-hide,\n .m768-hide-i,\n .m768-hide-ib {\n display: none; } }\n", ""]);
  104426. // exports
  104427. /***/ }),
  104428. /* 203 */
  104429. /***/ (function(module, exports, __webpack_require__) {
  104430. var disposed = false
  104431. var normalizeComponent = __webpack_require__(2)
  104432. /* script */
  104433. var __vue_script__ = __webpack_require__(204)
  104434. /* template */
  104435. var __vue_template__ = __webpack_require__(205)
  104436. /* template functional */
  104437. var __vue_template_functional__ = false
  104438. /* styles */
  104439. var __vue_styles__ = null
  104440. /* scopeId */
  104441. var __vue_scopeId__ = null
  104442. /* moduleIdentifier (server only) */
  104443. var __vue_module_identifier__ = null
  104444. var Component = normalizeComponent(
  104445. __vue_script__,
  104446. __vue_template__,
  104447. __vue_template_functional__,
  104448. __vue_styles__,
  104449. __vue_scopeId__,
  104450. __vue_module_identifier__
  104451. )
  104452. Component.options.__file = "resources/assets/js/_components/Title.vue"
  104453. /* hot reload */
  104454. if (false) {(function () {
  104455. var hotAPI = require("vue-hot-reload-api")
  104456. hotAPI.install(require("vue"), false)
  104457. if (!hotAPI.compatible) return
  104458. module.hot.accept()
  104459. if (!module.hot.data) {
  104460. hotAPI.createRecord("data-v-ada52cc8", Component.options)
  104461. } else {
  104462. hotAPI.reload("data-v-ada52cc8", Component.options)
  104463. }
  104464. module.hot.dispose(function (data) {
  104465. disposed = true
  104466. })
  104467. })()}
  104468. module.exports = Component.exports
  104469. /***/ }),
  104470. /* 204 */
  104471. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104472. "use strict";
  104473. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  104474. //
  104475. //
  104476. //
  104477. //
  104478. /* harmony default export */ __webpack_exports__["default"] = ({
  104479. name: 'v-title',
  104480. data: function data() {
  104481. return {};
  104482. },
  104483. mounted: function mounted() {
  104484. this.updateTitle();
  104485. },
  104486. beforeUpdate: function beforeUpdate() {
  104487. this.updateTitle();
  104488. },
  104489. activated: function activated() {
  104490. this.updateTitle();
  104491. },
  104492. methods: {
  104493. updateTitle: function updateTitle() {
  104494. var slots = this.$slots.default;
  104495. if (typeof slots === 'undefined' || slots.length < 1 || typeof slots[0].text !== 'string') {
  104496. return;
  104497. }
  104498. var text = slots[0].text;
  104499. var _document = document,
  104500. title = _document.title;
  104501. if (text !== title) this.setTile(text);
  104502. },
  104503. setTile: function setTile(title) {
  104504. document.title = title;
  104505. var mobile = navigator.userAgent.toLowerCase();
  104506. if (/iphone|ipad|ipod/.test(mobile)) {
  104507. var iframe = document.createElement('iframe');
  104508. iframe.style.display = 'none';
  104509. var iframeCallback = function iframeCallback() {
  104510. setTimeout(function () {
  104511. iframe.removeEventListener('load', iframeCallback);
  104512. document.body.removeChild(iframe);
  104513. }, 0);
  104514. };
  104515. iframe.addEventListener('load', iframeCallback);
  104516. document.body.appendChild(iframe);
  104517. }
  104518. }
  104519. }
  104520. });
  104521. /***/ }),
  104522. /* 205 */
  104523. /***/ (function(module, exports, __webpack_require__) {
  104524. var render = function() {
  104525. var _vm = this
  104526. var _h = _vm.$createElement
  104527. var _c = _vm._self._c || _h
  104528. return false ? _c("h1", [_vm._t("default")], 2) : _vm._e()
  104529. }
  104530. var staticRenderFns = []
  104531. render._withStripped = true
  104532. module.exports = { render: render, staticRenderFns: staticRenderFns }
  104533. if (false) {
  104534. module.hot.accept()
  104535. if (module.hot.data) {
  104536. require("vue-hot-reload-api") .rerender("data-v-ada52cc8", module.exports)
  104537. }
  104538. }
  104539. /***/ }),
  104540. /* 206 */
  104541. /***/ (function(module, exports, __webpack_require__) {
  104542. var disposed = false
  104543. var normalizeComponent = __webpack_require__(2)
  104544. /* script */
  104545. var __vue_script__ = __webpack_require__(207)
  104546. /* template */
  104547. var __vue_template__ = __webpack_require__(208)
  104548. /* template functional */
  104549. var __vue_template_functional__ = false
  104550. /* styles */
  104551. var __vue_styles__ = null
  104552. /* scopeId */
  104553. var __vue_scopeId__ = null
  104554. /* moduleIdentifier (server only) */
  104555. var __vue_module_identifier__ = null
  104556. var Component = normalizeComponent(
  104557. __vue_script__,
  104558. __vue_template__,
  104559. __vue_template_functional__,
  104560. __vue_styles__,
  104561. __vue_scopeId__,
  104562. __vue_module_identifier__
  104563. )
  104564. Component.options.__file = "resources/assets/js/_components/sreachTitle.vue"
  104565. /* hot reload */
  104566. if (false) {(function () {
  104567. var hotAPI = require("vue-hot-reload-api")
  104568. hotAPI.install(require("vue"), false)
  104569. if (!hotAPI.compatible) return
  104570. module.hot.accept()
  104571. if (!module.hot.data) {
  104572. hotAPI.createRecord("data-v-0e8d1888", Component.options)
  104573. } else {
  104574. hotAPI.reload("data-v-0e8d1888", Component.options)
  104575. }
  104576. module.hot.dispose(function (data) {
  104577. disposed = true
  104578. })
  104579. })()}
  104580. module.exports = Component.exports
  104581. /***/ }),
  104582. /* 207 */
  104583. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104584. "use strict";
  104585. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  104586. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  104587. //
  104588. //
  104589. //
  104590. //
  104591. /* harmony default export */ __webpack_exports__["default"] = ({
  104592. name: 'sreach-title',
  104593. props: {
  104594. val: {}
  104595. },
  104596. methods: {
  104597. count: function count(obj) {
  104598. var _this = this;
  104599. try {
  104600. if (typeof obj === "undefined") {
  104601. return 0;
  104602. }
  104603. if (typeof obj === "number" || obj instanceof Date) {
  104604. obj += "";
  104605. }
  104606. if (typeof obj.length === 'number') {
  104607. if ((typeof obj === "undefined" ? "undefined" : _typeof(obj)) === 'object') {
  104608. var i = 0;
  104609. $A.each(obj, function (key, val) {
  104610. if (_this.count(val) > 0) i++;
  104611. });
  104612. return i;
  104613. }
  104614. return obj.length;
  104615. } else {
  104616. var _i = 0,
  104617. key = void 0;
  104618. for (key in obj) {
  104619. if (this.count(obj) > 0) _i++;
  104620. }
  104621. return _i;
  104622. }
  104623. } catch (e) {
  104624. return 0;
  104625. }
  104626. }
  104627. }
  104628. });
  104629. /***/ }),
  104630. /* 208 */
  104631. /***/ (function(module, exports, __webpack_require__) {
  104632. var render = function() {
  104633. var _vm = this
  104634. var _h = _vm.$createElement
  104635. var _c = _vm._self._c || _h
  104636. return _c(
  104637. "div",
  104638. { class: [_vm.count(_vm.val) > 0 ? "item-title-active" : "item-title"] },
  104639. [_vm._t("default")],
  104640. 2
  104641. )
  104642. }
  104643. var staticRenderFns = []
  104644. render._withStripped = true
  104645. module.exports = { render: render, staticRenderFns: staticRenderFns }
  104646. if (false) {
  104647. module.hot.accept()
  104648. if (module.hot.data) {
  104649. require("vue-hot-reload-api") .rerender("data-v-0e8d1888", module.exports)
  104650. }
  104651. }
  104652. /***/ }),
  104653. /* 209 */
  104654. /***/ (function(module, exports, __webpack_require__) {
  104655. var disposed = false
  104656. function injectStyle (ssrContext) {
  104657. if (disposed) return
  104658. __webpack_require__(210)
  104659. __webpack_require__(212)
  104660. }
  104661. var normalizeComponent = __webpack_require__(2)
  104662. /* script */
  104663. var __vue_script__ = __webpack_require__(214)
  104664. /* template */
  104665. var __vue_template__ = __webpack_require__(219)
  104666. /* template functional */
  104667. var __vue_template_functional__ = false
  104668. /* styles */
  104669. var __vue_styles__ = injectStyle
  104670. /* scopeId */
  104671. var __vue_scopeId__ = "data-v-453021ba"
  104672. /* moduleIdentifier (server only) */
  104673. var __vue_module_identifier__ = null
  104674. var Component = normalizeComponent(
  104675. __vue_script__,
  104676. __vue_template__,
  104677. __vue_template_functional__,
  104678. __vue_styles__,
  104679. __vue_scopeId__,
  104680. __vue_module_identifier__
  104681. )
  104682. Component.options.__file = "resources/assets/js/main/components/UserInput.vue"
  104683. /* hot reload */
  104684. if (false) {(function () {
  104685. var hotAPI = require("vue-hot-reload-api")
  104686. hotAPI.install(require("vue"), false)
  104687. if (!hotAPI.compatible) return
  104688. module.hot.accept()
  104689. if (!module.hot.data) {
  104690. hotAPI.createRecord("data-v-453021ba", Component.options)
  104691. } else {
  104692. hotAPI.reload("data-v-453021ba", Component.options)
  104693. }
  104694. module.hot.dispose(function (data) {
  104695. disposed = true
  104696. })
  104697. })()}
  104698. module.exports = Component.exports
  104699. /***/ }),
  104700. /* 210 */
  104701. /***/ (function(module, exports, __webpack_require__) {
  104702. // style-loader: Adds some css to the DOM by adding a <style> tag
  104703. // load the styles
  104704. var content = __webpack_require__(211);
  104705. if(typeof content === 'string') content = [[module.i, content, '']];
  104706. if(content.locals) module.exports = content.locals;
  104707. // add the styles to the DOM
  104708. var update = __webpack_require__(1)("6a134112", content, false, {});
  104709. // Hot Module Replacement
  104710. if(false) {
  104711. // When the styles change, update the <style> tags
  104712. if(!content.locals) {
  104713. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserInput.vue", function() {
  104714. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserInput.vue");
  104715. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  104716. update(newContent);
  104717. });
  104718. }
  104719. // When the module is disposed, remove the <style> tags
  104720. module.hot.dispose(function() { update(); });
  104721. }
  104722. /***/ }),
  104723. /* 211 */
  104724. /***/ (function(module, exports, __webpack_require__) {
  104725. exports = module.exports = __webpack_require__(0)(false);
  104726. // imports
  104727. // module
  104728. exports.push([module.i, "\n.user-id-multiple[data-v-453021ba] {\n margin-bottom: 6px;\n overflow: auto;\n white-space: normal;\n}\n.user-id-multiple .ivu-tag[data-v-453021ba] {\n padding-left: 7px;\n}\n.user-id-multiple .user-id-multiple-item[data-v-453021ba] {\n display: inline-block;\n}\n.user-id-multiple .user-view-inline[data-v-453021ba] {\n height: 20px;\n line-height: 20px;\n vertical-align: top;\n}\n.user-id-input[data-v-453021ba] {\n display: inline-block;\n width: 100%;\n position: relative;\n vertical-align: middle;\n z-index: 5;\n}\n.user-id-input .user-id-subtitle[data-v-453021ba] {\n position: absolute;\n top: 2px;\n right: 32px;\n height: 30px;\n line-height: 30px;\n color: #cccccc;\n z-index: 2;\n}\n.user-id-input .user-id-spin[data-v-453021ba] {\n width: 14px;\n height: 14px;\n position: absolute;\n top: 50%;\n right: 34px;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.user-id-input .user-id-spin > div[data-v-453021ba] {\n width: 100%;\n height: 100%;\n}\n", ""]);
  104729. // exports
  104730. /***/ }),
  104731. /* 212 */
  104732. /***/ (function(module, exports, __webpack_require__) {
  104733. // style-loader: Adds some css to the DOM by adding a <style> tag
  104734. // load the styles
  104735. var content = __webpack_require__(213);
  104736. if(typeof content === 'string') content = [[module.i, content, '']];
  104737. if(content.locals) module.exports = content.locals;
  104738. // add the styles to the DOM
  104739. var update = __webpack_require__(1)("6fd99c4c", content, false, {});
  104740. // Hot Module Replacement
  104741. if(false) {
  104742. // When the styles change, update the <style> tags
  104743. if(!content.locals) {
  104744. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserInput.vue", function() {
  104745. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-453021ba\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserInput.vue");
  104746. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  104747. update(newContent);
  104748. });
  104749. }
  104750. // When the module is disposed, remove the <style> tags
  104751. module.hot.dispose(function() { update(); });
  104752. }
  104753. /***/ }),
  104754. /* 213 */
  104755. /***/ (function(module, exports, __webpack_require__) {
  104756. exports = module.exports = __webpack_require__(0)(false);
  104757. // imports
  104758. // module
  104759. exports.push([module.i, "\n.user-id-input-body {\n z-index: 99999;\n}\n.user-id-input-table {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n border-radius: 4px;\n overflow: hidden;\n -webkit-box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1);\n background-color: #ffffff;\n}\n.user-id-input-table .ivu-table table {\n width: 100% !important;\n}\n.user-id-input-table .ivu-table:before, .user-id-input-table .ivu-table:after {\n display: none !important;\n}\n.user-id-input-table .ivu-table-body {\n max-height: 180px;\n overflow: auto;\n}\n.user-id-input-table .ivu-table-small td {\n cursor: pointer;\n}\n.user-id-input-table .user-id-input-bottom {\n padding: 8px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: end;\n -ms-flex-pack: end;\n justify-content: flex-end;\n}\n.user-id-input-table .user-id-input-bottom > button {\n font-size: 13px;\n margin-left: 10px;\n}\n", ""]);
  104760. // exports
  104761. /***/ }),
  104762. /* 214 */
  104763. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  104764. "use strict";
  104765. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  104766. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__modules_directives_clickoutside__ = __webpack_require__(215);
  104767. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__modules_directives_transfer_dom__ = __webpack_require__(216);
  104768. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__modules_directives_popper_novalue__ = __webpack_require__(217);
  104769. //
  104770. //
  104771. //
  104772. //
  104773. //
  104774. //
  104775. //
  104776. //
  104777. //
  104778. //
  104779. //
  104780. //
  104781. //
  104782. //
  104783. //
  104784. //
  104785. //
  104786. //
  104787. //
  104788. //
  104789. //
  104790. //
  104791. //
  104792. //
  104793. //
  104794. //
  104795. //
  104796. //
  104797. //
  104798. //
  104799. //
  104800. //
  104801. //
  104802. //
  104803. //
  104804. //
  104805. //
  104806. //
  104807. //
  104808. //
  104809. //
  104810. //
  104811. //
  104812. //
  104813. //
  104814. //
  104815. //
  104816. //
  104817. //
  104818. //
  104819. //
  104820. //
  104821. //
  104822. //
  104823. //
  104824. //
  104825. //
  104826. //
  104827. //
  104828. //
  104829. //
  104830. //
  104831. //
  104832. //
  104833. //
  104834. //
  104835. //
  104836. //
  104837. //
  104838. //
  104839. //
  104840. //
  104841. //
  104842. //
  104843. //
  104844. //
  104845. //
  104846. //
  104847. //
  104848. //
  104849. //
  104850. //
  104851. //
  104852. //
  104853. //
  104854. //
  104855. //
  104856. //
  104857. //
  104858. //
  104859. //
  104860. //
  104861. //
  104862. //
  104863. //
  104864. //
  104865. //
  104866. //
  104867. //
  104868. //
  104869. //
  104870. //
  104871. //
  104872. //
  104873. //
  104874. //
  104875. //
  104876. //
  104877. //
  104878. //
  104879. //
  104880. //
  104881. //
  104882. //
  104883. //
  104884. //
  104885. //
  104886. //
  104887. //
  104888. //
  104889. //
  104890. //
  104891. //
  104892. //
  104893. //
  104894. //
  104895. //
  104896. //
  104897. //
  104898. //
  104899. //
  104900. //
  104901. //
  104902. //
  104903. //
  104904. //
  104905. //
  104906. //
  104907. //
  104908. //
  104909. //
  104910. //
  104911. //
  104912. //
  104913. //
  104914. //
  104915. /* harmony default export */ __webpack_exports__["default"] = ({
  104916. name: 'UserInput',
  104917. directives: { clickoutside: __WEBPACK_IMPORTED_MODULE_0__modules_directives_clickoutside__["a" /* default */], TransferDom: __WEBPACK_IMPORTED_MODULE_1__modules_directives_transfer_dom__["a" /* default */] },
  104918. mixins: [__WEBPACK_IMPORTED_MODULE_2__modules_directives_popper_novalue__["a" /* default */]],
  104919. props: {
  104920. placement: {
  104921. default: 'bottom'
  104922. },
  104923. value: {
  104924. default: ''
  104925. },
  104926. identity: {
  104927. default: ''
  104928. },
  104929. noidentity: {
  104930. default: ''
  104931. },
  104932. nousername: {
  104933. default: ''
  104934. },
  104935. noprojectid: {
  104936. default: ''
  104937. },
  104938. projectid: {
  104939. default: ''
  104940. },
  104941. nobookid: {
  104942. default: ''
  104943. },
  104944. nogroupid: {
  104945. default: ''
  104946. },
  104947. placeholder: {
  104948. default: ''
  104949. },
  104950. disabled: {
  104951. type: Boolean,
  104952. default: false
  104953. },
  104954. transfer: {
  104955. type: Boolean,
  104956. default: function _default() {
  104957. return true;
  104958. }
  104959. },
  104960. loadstatus: {
  104961. default: false
  104962. },
  104963. multiple: {
  104964. type: Boolean,
  104965. default: false
  104966. },
  104967. multipleDisabled: {
  104968. default: ''
  104969. }
  104970. },
  104971. data: function data() {
  104972. return {
  104973. multipleLists: [],
  104974. userName: '',
  104975. nickName: '',
  104976. nickName__: '',
  104977. seleName: '',
  104978. searchShow: false,
  104979. spinShow: false,
  104980. skipSearch: false,
  104981. isConfirm: false,
  104982. tempName: '',
  104983. winStyle: {},
  104984. columns: [],
  104985. userLists: [],
  104986. noDataText: ''
  104987. };
  104988. },
  104989. watch: {
  104990. value: function value(val) {
  104991. if (this.multiple) {
  104992. this.multipleLists = this.formatMultipleLists(val);
  104993. return;
  104994. }
  104995. this.userName = $A.cloneData(val);
  104996. },
  104997. userName: function userName(val) {
  104998. var _this = this;
  104999. if (this.skipSearch === true) {
  105000. this.skipSearch = false;
  105001. } else {
  105002. this.nickName = '';
  105003. if (val) {
  105004. var where = { usernameequal: val };
  105005. if (typeof this.identity === "string") {
  105006. where['identity'] = this.identity;
  105007. }
  105008. if (typeof this.noidentity === "string") {
  105009. where['noidentity'] = this.noidentity;
  105010. }
  105011. if (typeof this.nousername === "string") {
  105012. where['nousername'] = this.nousername;
  105013. }
  105014. if (this.noprojectid) {
  105015. where['noprojectid'] = this.noprojectid;
  105016. }
  105017. if (this.projectid) {
  105018. where['projectid'] = this.projectid;
  105019. }
  105020. if (this.nobookid) {
  105021. where['nobookid'] = this.nobookid;
  105022. }
  105023. if (this.nogroupid) {
  105024. where['nogroupid'] = this.nogroupid;
  105025. }
  105026. this.noDataText = this.$L("数据加载中.....");
  105027. $A.apiAjax({
  105028. url: 'users/searchinfo',
  105029. data: {
  105030. where: where,
  105031. take: 1
  105032. },
  105033. beforeSend: function beforeSend() {
  105034. _this.spinShow = true;
  105035. },
  105036. complete: function complete() {
  105037. _this.spinShow = false;
  105038. _this.noDataText = _this.$L("没有相关的数据");
  105039. },
  105040. error: function error() {
  105041. _this.noDataText = _this.$L("数据加载失败!");
  105042. },
  105043. success: function success(res) {
  105044. if (res.ret === 1 && $A.count(res.data) > 0) {
  105045. var tmpData = res.data[0];
  105046. if (_this.multiple) {
  105047. _this.addMultipleLists(tmpData);
  105048. } else {
  105049. _this.userName = tmpData.username;
  105050. _this.seleName = tmpData.nickname || tmpData.username;
  105051. _this.nickName = tmpData.nickname || tmpData.username;
  105052. _this.nickName__ = tmpData.nickname || tmpData.username;
  105053. _this.$emit('input', _this.userName);
  105054. _this.$emit('change', tmpData);
  105055. }
  105056. }
  105057. }
  105058. });
  105059. }
  105060. }
  105061. },
  105062. nickName: function nickName(val) {
  105063. if (val != this.seleName || val == '') {
  105064. this.userName = '';
  105065. if (!this.multiple) {
  105066. this.$emit('input', this.userName);
  105067. this.$emit('change', {});
  105068. }
  105069. }
  105070. },
  105071. spinShow: function spinShow(val) {
  105072. if (typeof this.loadstatus === 'number') {
  105073. this.$emit('update:loadstatus', val ? this.loadstatus + 1 : this.loadstatus - 1);
  105074. } else if (typeof this.loadstatus === 'boolean') {
  105075. this.$emit('update:loadstatus', val);
  105076. }
  105077. },
  105078. searchShow: function searchShow(val) {
  105079. if (val) {
  105080. this.handleShowPopper();
  105081. this.updateMultipleLists();
  105082. } else {
  105083. this.handleClosePopper();
  105084. }
  105085. },
  105086. multipleLists: {
  105087. handler: function handler() {
  105088. if (this.searchShow) {
  105089. this.updateMultipleLists();
  105090. }
  105091. this.emitMultipleLists();
  105092. },
  105093. deep: true
  105094. }
  105095. },
  105096. computed: {
  105097. tableStyle: function tableStyle() {
  105098. return this.winStyle;
  105099. }
  105100. },
  105101. methods: {
  105102. initLanguage: function initLanguage() {
  105103. this.columns = [{
  105104. "title": this.$L("头像"),
  105105. "width": 60,
  105106. "align": 'center',
  105107. render: function render(h, params) {
  105108. return h('UserImg', {
  105109. props: {
  105110. info: params.row
  105111. },
  105112. style: {
  105113. width: "26px",
  105114. height: "26px",
  105115. fontSize: "13px",
  105116. lineHeight: "26px",
  105117. borderRadius: "50%",
  105118. verticalAlign: "middle"
  105119. }
  105120. });
  105121. }
  105122. }, {
  105123. "title": this.$L("用户名"),
  105124. "key": "username",
  105125. "minWidth": 80,
  105126. "ellipsis": true
  105127. }, {
  105128. "title": this.$L("昵称"),
  105129. "key": "nickname",
  105130. "minWidth": 80,
  105131. "ellipsis": true,
  105132. render: function render(h, params) {
  105133. return h('span', params.row.nickname || '-');
  105134. }
  105135. }];
  105136. if (this.multiple) {
  105137. this.columns.unshift({
  105138. type: 'selection',
  105139. width: 30,
  105140. align: 'center'
  105141. });
  105142. }
  105143. this.noDataText = this.$L("数据加载中.....");
  105144. this.isConfirm = this.$listeners['on-confirm'];
  105145. },
  105146. inputChange: function inputChange() {
  105147. var _this2 = this;
  105148. var val = this.nickName;
  105149. this.spinShow = false;
  105150. this.tempName = '';
  105151. if (val != '') {
  105152. setTimeout(function () {
  105153. if (val == _this2.nickName && val != _this2.tempName) {
  105154. _this2.searchEnter(false, function (res) {
  105155. return val == _this2.nickName;
  105156. });
  105157. }
  105158. }, 500);
  105159. } else {
  105160. this.searchShow = false;
  105161. }
  105162. },
  105163. handleShowPopper: function handleShowPopper() {
  105164. var _this3 = this;
  105165. if (this.timeout) clearTimeout(this.timeout);
  105166. this.timeout = setTimeout(function () {
  105167. _this3.visible = true;
  105168. }, this.delay);
  105169. },
  105170. handleClosePopper: function handleClosePopper() {
  105171. var _this4 = this;
  105172. if (this.timeout) {
  105173. clearTimeout(this.timeout);
  105174. if (!this.controlled) {
  105175. this.timeout = setTimeout(function () {
  105176. _this4.visible = false;
  105177. }, 100);
  105178. }
  105179. }
  105180. },
  105181. updateStyle: function updateStyle() {
  105182. this.winStyle = {
  105183. width: Math.max(this.$el.offsetWidth, 230) + 'px'
  105184. };
  105185. },
  105186. emptyAll: function emptyAll() {
  105187. this.userName = '';
  105188. this.nickName = '';
  105189. this.nickName__ = '';
  105190. this.seleName = '';
  105191. this.searchShow = false;
  105192. this.spinShow = false;
  105193. },
  105194. searchEnter: function searchEnter(verify, callback) {
  105195. var _this5 = this;
  105196. if (this.disabled === true) {
  105197. return;
  105198. }
  105199. if (this.spinShow === true) {
  105200. return;
  105201. }
  105202. if (verify === true) {
  105203. if (this.nickName === '') {
  105204. this.nickName__ = this.nickName;
  105205. }
  105206. if (this.nickName__ === this.nickName) {
  105207. return;
  105208. }
  105209. }
  105210. this.updateStyle();
  105211. this.nickName__ = this.nickName;
  105212. //
  105213. var where = { username: this.nickName };
  105214. if (typeof this.identity === "string") {
  105215. where['identity'] = this.identity;
  105216. }
  105217. if (typeof this.noidentity === "string") {
  105218. where['noidentity'] = this.noidentity;
  105219. }
  105220. if (typeof this.nousername === "string") {
  105221. where['nousername'] = this.nousername;
  105222. }
  105223. if (this.noprojectid) {
  105224. where['noprojectid'] = this.noprojectid;
  105225. }
  105226. if (this.projectid) {
  105227. where['projectid'] = this.projectid;
  105228. }
  105229. if (this.nobookid) {
  105230. where['nobookid'] = this.nobookid;
  105231. }
  105232. if (this.nogroupid) {
  105233. where['nogroupid'] = this.nogroupid;
  105234. }
  105235. this.tempName = where.username;
  105236. this.noDataText = this.$L("数据加载中.....");
  105237. $A.apiAjax({
  105238. url: 'users/searchinfo',
  105239. data: {
  105240. where: where,
  105241. take: 30
  105242. },
  105243. beforeSend: function beforeSend() {
  105244. _this5.spinShow = true;
  105245. },
  105246. complete: function complete() {
  105247. _this5.spinShow = false;
  105248. _this5.noDataText = _this5.$L("没有相关的数据");
  105249. },
  105250. error: function error() {
  105251. _this5.noDataText = _this5.$L("数据加载失败!");
  105252. },
  105253. success: function success(res) {
  105254. if (typeof callback === "function" && callback(res) === false) {
  105255. return;
  105256. }
  105257. if (res.ret === 1) {
  105258. _this5.userLists = res.data;
  105259. _this5.userLists.forEach(function (item) {
  105260. if (_this5.multiple) {
  105261. if (_this5.existMultipleDisabled(item.username)) {
  105262. item._disabled = true;
  105263. }
  105264. } else {
  105265. if (item.username == _this5.userName) {
  105266. item._highlight = true;
  105267. }
  105268. }
  105269. });
  105270. _this5.searchShow = true;
  105271. } else {
  105272. _this5.$Message.warning(res.msg);
  105273. _this5.emptyAll();
  105274. }
  105275. }
  105276. });
  105277. },
  105278. userChange: function userChange(item) {
  105279. if (this.multiple) {
  105280. if (this.existMultipleDisabled(item.username)) {
  105281. return;
  105282. }
  105283. var tempLists = this.multipleLists.filter(function (_ref) {
  105284. var username = _ref.username;
  105285. return username == item.username;
  105286. });
  105287. if (tempLists.length > 0) {
  105288. this.multipleLists = this.multipleLists.filter(function (_ref2) {
  105289. var username = _ref2.username;
  105290. return username != item.username;
  105291. });
  105292. } else {
  105293. this.addMultipleLists(item);
  105294. }
  105295. } else {
  105296. this.userName = item.username;
  105297. this.seleName = item.nickname || item.username;
  105298. this.nickName = item.nickname || item.username;
  105299. this.nickName__ = item.nickname || item.username;
  105300. this.skipSearch = true;
  105301. this.searchShow = false;
  105302. this.$emit('input', this.userName);
  105303. this.$emit('change', item);
  105304. }
  105305. },
  105306. userSelect: function userSelect() {
  105307. var _this6 = this;
  105308. if (this.multiple) {
  105309. (function () {
  105310. var lists = _this6.$refs.myTable.objData,
  105311. item = void 0,
  105312. inThe = void 0;
  105313. for (var index in lists) {
  105314. if (lists.hasOwnProperty(index)) {
  105315. item = lists[index];
  105316. inThe = _this6.multipleLists.find(function (_ref3) {
  105317. var username = _ref3.username;
  105318. return username == item.username;
  105319. });
  105320. if (item._isChecked) {
  105321. !inThe && _this6.multipleLists.push(item);
  105322. } else {
  105323. inThe && (_this6.multipleLists = _this6.multipleLists.filter(function (_ref4) {
  105324. var username = _ref4.username;
  105325. return username != item.username;
  105326. }));
  105327. }
  105328. }
  105329. }
  105330. })();
  105331. }
  105332. },
  105333. handleClose: function handleClose(e) {
  105334. if (this.multiple && $A(e.target).parents('.user-id-input-table').length > 0) {
  105335. return;
  105336. }
  105337. if (this.searchShow === true) {
  105338. this.searchShow = false;
  105339. }
  105340. },
  105341. existMultipleDisabled: function existMultipleDisabled(username) {
  105342. return this.multipleDisabled && $A.strExists(',' + this.multipleDisabled + ',', ',' + username + ',');
  105343. },
  105344. addMultipleLists: function addMultipleLists(item) {
  105345. var inThe = this.multipleLists.find(function (_ref5) {
  105346. var username = _ref5.username;
  105347. return username == item.username;
  105348. });
  105349. if (!inThe) {
  105350. this.multipleLists.push(item);
  105351. }
  105352. },
  105353. updateMultipleLists: function updateMultipleLists() {
  105354. var _this7 = this;
  105355. this.$nextTick(function () {
  105356. var lists = _this7.$refs.myTable.objData,
  105357. item = void 0,
  105358. inThe = void 0;
  105359. for (var index in lists) {
  105360. if (lists.hasOwnProperty(index)) {
  105361. item = lists[index];
  105362. inThe = _this7.multipleLists.find(function (_ref6) {
  105363. var username = _ref6.username;
  105364. return username == item.username;
  105365. });
  105366. _this7.$set(item, "_isChecked", !!inThe);
  105367. }
  105368. }
  105369. });
  105370. },
  105371. emitMultipleLists: function emitMultipleLists() {
  105372. var val = '';
  105373. this.multipleLists.forEach(function (tmp) {
  105374. if (val) {
  105375. val += ",";
  105376. }
  105377. val += tmp.username;
  105378. });
  105379. this.$emit('input', val);
  105380. },
  105381. formatMultipleLists: function formatMultipleLists(val) {
  105382. var arr = (val + ",").split(",");
  105383. var narr = [];
  105384. arr.forEach(function (uname) {
  105385. if (uname) {
  105386. var inn = false;
  105387. narr.some(function (tmp) {
  105388. if (tmp.username == uname) {
  105389. return inn = true;
  105390. }
  105391. });
  105392. if (!inn) {
  105393. narr.push({
  105394. username: uname
  105395. });
  105396. }
  105397. }
  105398. });
  105399. return narr;
  105400. },
  105401. onConfirm: function onConfirm(e) {
  105402. this.searchShow = false;
  105403. this.$emit('on-confirm', e);
  105404. }
  105405. },
  105406. mounted: function mounted() {
  105407. this.updatePopper();
  105408. //
  105409. if (this.multiple) {
  105410. this.multipleLists = this.formatMultipleLists(this.value);
  105411. } else if ($A.count(this.value) > 0) {
  105412. this.userName = this.value;
  105413. }
  105414. }
  105415. });
  105416. /***/ }),
  105417. /* 215 */
  105418. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105419. "use strict";
  105420. /* harmony default export */ __webpack_exports__["a"] = ({
  105421. bind: function bind(el, binding, vnode) {
  105422. function documentHandler(e) {
  105423. if (el.contains(e.target)) {
  105424. return false;
  105425. }
  105426. if (binding.expression) {
  105427. binding.value(e);
  105428. }
  105429. }
  105430. el.__vueClickOutside__ = documentHandler;
  105431. document.addEventListener('click', documentHandler);
  105432. },
  105433. update: function update() {},
  105434. unbind: function unbind(el, binding) {
  105435. document.removeEventListener('click', el.__vueClickOutside__);
  105436. delete el.__vueClickOutside__;
  105437. }
  105438. });
  105439. /***/ }),
  105440. /* 216 */
  105441. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105442. "use strict";
  105443. // Thanks to: https://github.com/airyland/vux/blob/v2/src/directives/transfer-dom/index.js
  105444. // Thanks to: https://github.com/calebroseland/vue-dom-portal
  105445. /**
  105446. * Get target DOM Node
  105447. * @param {(Node|string|Boolean)} [node=document.body] DOM Node, CSS selector, or Boolean
  105448. * @return {Node} The target that the el will be appended to
  105449. */
  105450. function getTarget(node) {
  105451. if (node === void 0) {
  105452. node = document.body;
  105453. }
  105454. if (node === true) {
  105455. return document.body;
  105456. }
  105457. return node instanceof window.Node ? node : document.querySelector(node);
  105458. }
  105459. var directive = {
  105460. inserted: function inserted(el, _ref, vnode) {
  105461. var value = _ref.value;
  105462. if (el.dataset && el.dataset.transfer !== 'true') return false;
  105463. el.className = el.className ? el.className + ' v-transfer-dom' : 'v-transfer-dom';
  105464. var parentNode = el.parentNode;
  105465. if (!parentNode) return;
  105466. var home = document.createComment('');
  105467. var hasMovedOut = false;
  105468. if (value !== false) {
  105469. parentNode.replaceChild(home, el); // moving out, el is no longer in the document
  105470. getTarget(value).appendChild(el); // moving into new place
  105471. hasMovedOut = true;
  105472. }
  105473. if (!el.__transferDomData) {
  105474. el.__transferDomData = {
  105475. parentNode: parentNode,
  105476. home: home,
  105477. target: getTarget(value),
  105478. hasMovedOut: hasMovedOut
  105479. };
  105480. }
  105481. },
  105482. componentUpdated: function componentUpdated(el, _ref2) {
  105483. var value = _ref2.value;
  105484. if (el.dataset && el.dataset.transfer !== 'true') return false;
  105485. // need to make sure children are done updating (vs. `update`)
  105486. var ref$1 = el.__transferDomData;
  105487. if (!ref$1) return;
  105488. // homes.get(el)
  105489. var parentNode = ref$1.parentNode;
  105490. var home = ref$1.home;
  105491. var hasMovedOut = ref$1.hasMovedOut; // recall where home is
  105492. if (!hasMovedOut && value) {
  105493. // remove from document and leave placeholder
  105494. parentNode.replaceChild(home, el);
  105495. // append to target
  105496. getTarget(value).appendChild(el);
  105497. el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: true, target: getTarget(value) });
  105498. } else if (hasMovedOut && value === false) {
  105499. // previously moved, coming back home
  105500. parentNode.replaceChild(el, home);
  105501. el.__transferDomData = Object.assign({}, el.__transferDomData, { hasMovedOut: false, target: getTarget(value) });
  105502. } else if (value) {
  105503. // already moved, going somewhere else
  105504. getTarget(value).appendChild(el);
  105505. }
  105506. },
  105507. unbind: function unbind(el) {
  105508. if (el.dataset && el.dataset.transfer !== 'true') return false;
  105509. el.className = el.className.replace('v-transfer-dom', '');
  105510. var ref$1 = el.__transferDomData;
  105511. if (!ref$1) return;
  105512. if (el.__transferDomData.hasMovedOut === true) {
  105513. el.__transferDomData.parentNode && el.__transferDomData.parentNode.appendChild(el);
  105514. }
  105515. el.__transferDomData = null;
  105516. }
  105517. };
  105518. /* harmony default export */ __webpack_exports__["a"] = (directive);
  105519. /***/ }),
  105520. /* 217 */
  105521. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105522. "use strict";
  105523. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  105524. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  105525. /**
  105526. * https://github.com/freeze-component/vue-popper
  105527. * */
  105528. var isServer = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer;
  105529. var Popper = isServer ? function () {} : __webpack_require__(218); // eslint-disable-line
  105530. /* harmony default export */ __webpack_exports__["a"] = ({
  105531. props: {
  105532. placement: {
  105533. type: String,
  105534. default: 'bottom'
  105535. },
  105536. boundariesPadding: {
  105537. type: Number,
  105538. default: 5
  105539. },
  105540. reference: Object,
  105541. popper: Object,
  105542. offset: {
  105543. default: 0
  105544. },
  105545. transition: String,
  105546. options: {
  105547. type: Object,
  105548. default: function _default() {
  105549. return {
  105550. modifiers: {
  105551. computeStyle: {
  105552. gpuAcceleration: false
  105553. },
  105554. preventOverflow: {
  105555. boundariesElement: 'window'
  105556. }
  105557. }
  105558. };
  105559. }
  105560. }
  105561. },
  105562. data: function data() {
  105563. return {
  105564. visible: false
  105565. };
  105566. },
  105567. watch: {
  105568. visible: function visible(val) {
  105569. if (val) {
  105570. if (this.handleIndexIncrease) this.handleIndexIncrease(); // just use for Poptip
  105571. this.updatePopper();
  105572. this.$emit('on-popper-show');
  105573. } else {
  105574. this.$emit('on-popper-hide');
  105575. }
  105576. }
  105577. },
  105578. methods: {
  105579. createPopper: function createPopper() {
  105580. var _this = this;
  105581. if (isServer) return;
  105582. if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) {
  105583. return;
  105584. }
  105585. var options = this.options;
  105586. var popper = this.popper || this.$refs.popper;
  105587. var reference = this.reference || this.$refs.reference;
  105588. if (!popper || !reference) return;
  105589. if (this.popperJS && this.popperJS.hasOwnProperty('destroy')) {
  105590. this.popperJS.destroy();
  105591. }
  105592. options.placement = this.placement;
  105593. if (!options.modifiers.offset) {
  105594. options.modifiers.offset = {};
  105595. }
  105596. options.modifiers.offset.offset = this.offset;
  105597. options.onCreate = function () {
  105598. _this.$nextTick(_this.updatePopper);
  105599. _this.$emit('created', _this);
  105600. };
  105601. this.popperJS = new Popper(reference, popper, options);
  105602. },
  105603. updatePopper: function updatePopper() {
  105604. if (isServer) return;
  105605. this.popperJS ? this.popperJS.update() : this.createPopper();
  105606. },
  105607. doDestroy: function doDestroy() {
  105608. if (isServer) return;
  105609. if (this.visible) return;
  105610. this.popperJS.destroy();
  105611. this.popperJS = null;
  105612. }
  105613. },
  105614. updated: function updated() {
  105615. var _this2 = this;
  105616. this.$nextTick(function () {
  105617. return _this2.updatePopper();
  105618. });
  105619. },
  105620. beforeDestroy: function beforeDestroy() {
  105621. if (isServer) return;
  105622. if (this.popperJS) {
  105623. this.popperJS.destroy();
  105624. }
  105625. }
  105626. });
  105627. /***/ }),
  105628. /* 218 */
  105629. /***/ (function(module, exports, __webpack_require__) {
  105630. /* WEBPACK VAR INJECTION */(function(global) {/**!
  105631. * @fileOverview Kickass library to create and place poppers near their reference elements.
  105632. * @version 1.16.1
  105633. * @license
  105634. * Copyright (c) 2016 Federico Zivolo and contributors
  105635. *
  105636. * Permission is hereby granted, free of charge, to any person obtaining a copy
  105637. * of this software and associated documentation files (the "Software"), to deal
  105638. * in the Software without restriction, including without limitation the rights
  105639. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  105640. * copies of the Software, and to permit persons to whom the Software is
  105641. * furnished to do so, subject to the following conditions:
  105642. *
  105643. * The above copyright notice and this permission notice shall be included in all
  105644. * copies or substantial portions of the Software.
  105645. *
  105646. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  105647. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  105648. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  105649. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  105650. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  105651. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  105652. * SOFTWARE.
  105653. */
  105654. (function (global, factory) {
  105655. true ? module.exports = factory() :
  105656. typeof define === 'function' && define.amd ? define(factory) :
  105657. (global.Popper = factory());
  105658. }(this, (function () { 'use strict';
  105659. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  105660. var timeoutDuration = function () {
  105661. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  105662. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  105663. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  105664. return 1;
  105665. }
  105666. }
  105667. return 0;
  105668. }();
  105669. function microtaskDebounce(fn) {
  105670. var called = false;
  105671. return function () {
  105672. if (called) {
  105673. return;
  105674. }
  105675. called = true;
  105676. window.Promise.resolve().then(function () {
  105677. called = false;
  105678. fn();
  105679. });
  105680. };
  105681. }
  105682. function taskDebounce(fn) {
  105683. var scheduled = false;
  105684. return function () {
  105685. if (!scheduled) {
  105686. scheduled = true;
  105687. setTimeout(function () {
  105688. scheduled = false;
  105689. fn();
  105690. }, timeoutDuration);
  105691. }
  105692. };
  105693. }
  105694. var supportsMicroTasks = isBrowser && window.Promise;
  105695. /**
  105696. * Create a debounced version of a method, that's asynchronously deferred
  105697. * but called in the minimum time possible.
  105698. *
  105699. * @method
  105700. * @memberof Popper.Utils
  105701. * @argument {Function} fn
  105702. * @returns {Function}
  105703. */
  105704. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  105705. /**
  105706. * Check if the given variable is a function
  105707. * @method
  105708. * @memberof Popper.Utils
  105709. * @argument {Any} functionToCheck - variable to check
  105710. * @returns {Boolean} answer to: is a function?
  105711. */
  105712. function isFunction(functionToCheck) {
  105713. var getType = {};
  105714. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  105715. }
  105716. /**
  105717. * Get CSS computed property of the given element
  105718. * @method
  105719. * @memberof Popper.Utils
  105720. * @argument {Eement} element
  105721. * @argument {String} property
  105722. */
  105723. function getStyleComputedProperty(element, property) {
  105724. if (element.nodeType !== 1) {
  105725. return [];
  105726. }
  105727. // NOTE: 1 DOM access here
  105728. var window = element.ownerDocument.defaultView;
  105729. var css = window.getComputedStyle(element, null);
  105730. return property ? css[property] : css;
  105731. }
  105732. /**
  105733. * Returns the parentNode or the host of the element
  105734. * @method
  105735. * @memberof Popper.Utils
  105736. * @argument {Element} element
  105737. * @returns {Element} parent
  105738. */
  105739. function getParentNode(element) {
  105740. if (element.nodeName === 'HTML') {
  105741. return element;
  105742. }
  105743. return element.parentNode || element.host;
  105744. }
  105745. /**
  105746. * Returns the scrolling parent of the given element
  105747. * @method
  105748. * @memberof Popper.Utils
  105749. * @argument {Element} element
  105750. * @returns {Element} scroll parent
  105751. */
  105752. function getScrollParent(element) {
  105753. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  105754. if (!element) {
  105755. return document.body;
  105756. }
  105757. switch (element.nodeName) {
  105758. case 'HTML':
  105759. case 'BODY':
  105760. return element.ownerDocument.body;
  105761. case '#document':
  105762. return element.body;
  105763. }
  105764. // Firefox want us to check `-x` and `-y` variations as well
  105765. var _getStyleComputedProp = getStyleComputedProperty(element),
  105766. overflow = _getStyleComputedProp.overflow,
  105767. overflowX = _getStyleComputedProp.overflowX,
  105768. overflowY = _getStyleComputedProp.overflowY;
  105769. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  105770. return element;
  105771. }
  105772. return getScrollParent(getParentNode(element));
  105773. }
  105774. /**
  105775. * Returns the reference node of the reference object, or the reference object itself.
  105776. * @method
  105777. * @memberof Popper.Utils
  105778. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  105779. * @returns {Element} parent
  105780. */
  105781. function getReferenceNode(reference) {
  105782. return reference && reference.referenceNode ? reference.referenceNode : reference;
  105783. }
  105784. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  105785. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  105786. /**
  105787. * Determines if the browser is Internet Explorer
  105788. * @method
  105789. * @memberof Popper.Utils
  105790. * @param {Number} version to check
  105791. * @returns {Boolean} isIE
  105792. */
  105793. function isIE(version) {
  105794. if (version === 11) {
  105795. return isIE11;
  105796. }
  105797. if (version === 10) {
  105798. return isIE10;
  105799. }
  105800. return isIE11 || isIE10;
  105801. }
  105802. /**
  105803. * Returns the offset parent of the given element
  105804. * @method
  105805. * @memberof Popper.Utils
  105806. * @argument {Element} element
  105807. * @returns {Element} offset parent
  105808. */
  105809. function getOffsetParent(element) {
  105810. if (!element) {
  105811. return document.documentElement;
  105812. }
  105813. var noOffsetParent = isIE(10) ? document.body : null;
  105814. // NOTE: 1 DOM access here
  105815. var offsetParent = element.offsetParent || null;
  105816. // Skip hidden elements which don't have an offsetParent
  105817. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  105818. offsetParent = (element = element.nextElementSibling).offsetParent;
  105819. }
  105820. var nodeName = offsetParent && offsetParent.nodeName;
  105821. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  105822. return element ? element.ownerDocument.documentElement : document.documentElement;
  105823. }
  105824. // .offsetParent will return the closest TH, TD or TABLE in case
  105825. // no offsetParent is present, I hate this job...
  105826. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  105827. return getOffsetParent(offsetParent);
  105828. }
  105829. return offsetParent;
  105830. }
  105831. function isOffsetContainer(element) {
  105832. var nodeName = element.nodeName;
  105833. if (nodeName === 'BODY') {
  105834. return false;
  105835. }
  105836. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  105837. }
  105838. /**
  105839. * Finds the root node (document, shadowDOM root) of the given element
  105840. * @method
  105841. * @memberof Popper.Utils
  105842. * @argument {Element} node
  105843. * @returns {Element} root node
  105844. */
  105845. function getRoot(node) {
  105846. if (node.parentNode !== null) {
  105847. return getRoot(node.parentNode);
  105848. }
  105849. return node;
  105850. }
  105851. /**
  105852. * Finds the offset parent common to the two provided nodes
  105853. * @method
  105854. * @memberof Popper.Utils
  105855. * @argument {Element} element1
  105856. * @argument {Element} element2
  105857. * @returns {Element} common offset parent
  105858. */
  105859. function findCommonOffsetParent(element1, element2) {
  105860. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  105861. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  105862. return document.documentElement;
  105863. }
  105864. // Here we make sure to give as "start" the element that comes first in the DOM
  105865. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  105866. var start = order ? element1 : element2;
  105867. var end = order ? element2 : element1;
  105868. // Get common ancestor container
  105869. var range = document.createRange();
  105870. range.setStart(start, 0);
  105871. range.setEnd(end, 0);
  105872. var commonAncestorContainer = range.commonAncestorContainer;
  105873. // Both nodes are inside #document
  105874. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  105875. if (isOffsetContainer(commonAncestorContainer)) {
  105876. return commonAncestorContainer;
  105877. }
  105878. return getOffsetParent(commonAncestorContainer);
  105879. }
  105880. // one of the nodes is inside shadowDOM, find which one
  105881. var element1root = getRoot(element1);
  105882. if (element1root.host) {
  105883. return findCommonOffsetParent(element1root.host, element2);
  105884. } else {
  105885. return findCommonOffsetParent(element1, getRoot(element2).host);
  105886. }
  105887. }
  105888. /**
  105889. * Gets the scroll value of the given element in the given side (top and left)
  105890. * @method
  105891. * @memberof Popper.Utils
  105892. * @argument {Element} element
  105893. * @argument {String} side `top` or `left`
  105894. * @returns {number} amount of scrolled pixels
  105895. */
  105896. function getScroll(element) {
  105897. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  105898. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  105899. var nodeName = element.nodeName;
  105900. if (nodeName === 'BODY' || nodeName === 'HTML') {
  105901. var html = element.ownerDocument.documentElement;
  105902. var scrollingElement = element.ownerDocument.scrollingElement || html;
  105903. return scrollingElement[upperSide];
  105904. }
  105905. return element[upperSide];
  105906. }
  105907. /*
  105908. * Sum or subtract the element scroll values (left and top) from a given rect object
  105909. * @method
  105910. * @memberof Popper.Utils
  105911. * @param {Object} rect - Rect object you want to change
  105912. * @param {HTMLElement} element - The element from the function reads the scroll values
  105913. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  105914. * @return {Object} rect - The modifier rect object
  105915. */
  105916. function includeScroll(rect, element) {
  105917. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  105918. var scrollTop = getScroll(element, 'top');
  105919. var scrollLeft = getScroll(element, 'left');
  105920. var modifier = subtract ? -1 : 1;
  105921. rect.top += scrollTop * modifier;
  105922. rect.bottom += scrollTop * modifier;
  105923. rect.left += scrollLeft * modifier;
  105924. rect.right += scrollLeft * modifier;
  105925. return rect;
  105926. }
  105927. /*
  105928. * Helper to detect borders of a given element
  105929. * @method
  105930. * @memberof Popper.Utils
  105931. * @param {CSSStyleDeclaration} styles
  105932. * Result of `getStyleComputedProperty` on the given element
  105933. * @param {String} axis - `x` or `y`
  105934. * @return {number} borders - The borders size of the given axis
  105935. */
  105936. function getBordersSize(styles, axis) {
  105937. var sideA = axis === 'x' ? 'Left' : 'Top';
  105938. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  105939. return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
  105940. }
  105941. function getSize(axis, body, html, computedStyle) {
  105942. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  105943. }
  105944. function getWindowSizes(document) {
  105945. var body = document.body;
  105946. var html = document.documentElement;
  105947. var computedStyle = isIE(10) && getComputedStyle(html);
  105948. return {
  105949. height: getSize('Height', body, html, computedStyle),
  105950. width: getSize('Width', body, html, computedStyle)
  105951. };
  105952. }
  105953. var classCallCheck = function (instance, Constructor) {
  105954. if (!(instance instanceof Constructor)) {
  105955. throw new TypeError("Cannot call a class as a function");
  105956. }
  105957. };
  105958. var createClass = function () {
  105959. function defineProperties(target, props) {
  105960. for (var i = 0; i < props.length; i++) {
  105961. var descriptor = props[i];
  105962. descriptor.enumerable = descriptor.enumerable || false;
  105963. descriptor.configurable = true;
  105964. if ("value" in descriptor) descriptor.writable = true;
  105965. Object.defineProperty(target, descriptor.key, descriptor);
  105966. }
  105967. }
  105968. return function (Constructor, protoProps, staticProps) {
  105969. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  105970. if (staticProps) defineProperties(Constructor, staticProps);
  105971. return Constructor;
  105972. };
  105973. }();
  105974. var defineProperty = function (obj, key, value) {
  105975. if (key in obj) {
  105976. Object.defineProperty(obj, key, {
  105977. value: value,
  105978. enumerable: true,
  105979. configurable: true,
  105980. writable: true
  105981. });
  105982. } else {
  105983. obj[key] = value;
  105984. }
  105985. return obj;
  105986. };
  105987. var _extends = Object.assign || function (target) {
  105988. for (var i = 1; i < arguments.length; i++) {
  105989. var source = arguments[i];
  105990. for (var key in source) {
  105991. if (Object.prototype.hasOwnProperty.call(source, key)) {
  105992. target[key] = source[key];
  105993. }
  105994. }
  105995. }
  105996. return target;
  105997. };
  105998. /**
  105999. * Given element offsets, generate an output similar to getBoundingClientRect
  106000. * @method
  106001. * @memberof Popper.Utils
  106002. * @argument {Object} offsets
  106003. * @returns {Object} ClientRect like output
  106004. */
  106005. function getClientRect(offsets) {
  106006. return _extends({}, offsets, {
  106007. right: offsets.left + offsets.width,
  106008. bottom: offsets.top + offsets.height
  106009. });
  106010. }
  106011. /**
  106012. * Get bounding client rect of given element
  106013. * @method
  106014. * @memberof Popper.Utils
  106015. * @param {HTMLElement} element
  106016. * @return {Object} client rect
  106017. */
  106018. function getBoundingClientRect(element) {
  106019. var rect = {};
  106020. // IE10 10 FIX: Please, don't ask, the element isn't
  106021. // considered in DOM in some circumstances...
  106022. // This isn't reproducible in IE10 compatibility mode of IE11
  106023. try {
  106024. if (isIE(10)) {
  106025. rect = element.getBoundingClientRect();
  106026. var scrollTop = getScroll(element, 'top');
  106027. var scrollLeft = getScroll(element, 'left');
  106028. rect.top += scrollTop;
  106029. rect.left += scrollLeft;
  106030. rect.bottom += scrollTop;
  106031. rect.right += scrollLeft;
  106032. } else {
  106033. rect = element.getBoundingClientRect();
  106034. }
  106035. } catch (e) {}
  106036. var result = {
  106037. left: rect.left,
  106038. top: rect.top,
  106039. width: rect.right - rect.left,
  106040. height: rect.bottom - rect.top
  106041. };
  106042. // subtract scrollbar size from sizes
  106043. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  106044. var width = sizes.width || element.clientWidth || result.width;
  106045. var height = sizes.height || element.clientHeight || result.height;
  106046. var horizScrollbar = element.offsetWidth - width;
  106047. var vertScrollbar = element.offsetHeight - height;
  106048. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  106049. // we make this check conditional for performance reasons
  106050. if (horizScrollbar || vertScrollbar) {
  106051. var styles = getStyleComputedProperty(element);
  106052. horizScrollbar -= getBordersSize(styles, 'x');
  106053. vertScrollbar -= getBordersSize(styles, 'y');
  106054. result.width -= horizScrollbar;
  106055. result.height -= vertScrollbar;
  106056. }
  106057. return getClientRect(result);
  106058. }
  106059. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  106060. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  106061. var isIE10 = isIE(10);
  106062. var isHTML = parent.nodeName === 'HTML';
  106063. var childrenRect = getBoundingClientRect(children);
  106064. var parentRect = getBoundingClientRect(parent);
  106065. var scrollParent = getScrollParent(children);
  106066. var styles = getStyleComputedProperty(parent);
  106067. var borderTopWidth = parseFloat(styles.borderTopWidth);
  106068. var borderLeftWidth = parseFloat(styles.borderLeftWidth);
  106069. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  106070. if (fixedPosition && isHTML) {
  106071. parentRect.top = Math.max(parentRect.top, 0);
  106072. parentRect.left = Math.max(parentRect.left, 0);
  106073. }
  106074. var offsets = getClientRect({
  106075. top: childrenRect.top - parentRect.top - borderTopWidth,
  106076. left: childrenRect.left - parentRect.left - borderLeftWidth,
  106077. width: childrenRect.width,
  106078. height: childrenRect.height
  106079. });
  106080. offsets.marginTop = 0;
  106081. offsets.marginLeft = 0;
  106082. // Subtract margins of documentElement in case it's being used as parent
  106083. // we do this only on HTML because it's the only element that behaves
  106084. // differently when margins are applied to it. The margins are included in
  106085. // the box of the documentElement, in the other cases not.
  106086. if (!isIE10 && isHTML) {
  106087. var marginTop = parseFloat(styles.marginTop);
  106088. var marginLeft = parseFloat(styles.marginLeft);
  106089. offsets.top -= borderTopWidth - marginTop;
  106090. offsets.bottom -= borderTopWidth - marginTop;
  106091. offsets.left -= borderLeftWidth - marginLeft;
  106092. offsets.right -= borderLeftWidth - marginLeft;
  106093. // Attach marginTop and marginLeft because in some circumstances we may need them
  106094. offsets.marginTop = marginTop;
  106095. offsets.marginLeft = marginLeft;
  106096. }
  106097. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  106098. offsets = includeScroll(offsets, parent);
  106099. }
  106100. return offsets;
  106101. }
  106102. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  106103. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  106104. var html = element.ownerDocument.documentElement;
  106105. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  106106. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  106107. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  106108. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  106109. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  106110. var offset = {
  106111. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  106112. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  106113. width: width,
  106114. height: height
  106115. };
  106116. return getClientRect(offset);
  106117. }
  106118. /**
  106119. * Check if the given element is fixed or is inside a fixed parent
  106120. * @method
  106121. * @memberof Popper.Utils
  106122. * @argument {Element} element
  106123. * @argument {Element} customContainer
  106124. * @returns {Boolean} answer to "isFixed?"
  106125. */
  106126. function isFixed(element) {
  106127. var nodeName = element.nodeName;
  106128. if (nodeName === 'BODY' || nodeName === 'HTML') {
  106129. return false;
  106130. }
  106131. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  106132. return true;
  106133. }
  106134. var parentNode = getParentNode(element);
  106135. if (!parentNode) {
  106136. return false;
  106137. }
  106138. return isFixed(parentNode);
  106139. }
  106140. /**
  106141. * Finds the first parent of an element that has a transformed property defined
  106142. * @method
  106143. * @memberof Popper.Utils
  106144. * @argument {Element} element
  106145. * @returns {Element} first transformed parent or documentElement
  106146. */
  106147. function getFixedPositionOffsetParent(element) {
  106148. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  106149. if (!element || !element.parentElement || isIE()) {
  106150. return document.documentElement;
  106151. }
  106152. var el = element.parentElement;
  106153. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  106154. el = el.parentElement;
  106155. }
  106156. return el || document.documentElement;
  106157. }
  106158. /**
  106159. * Computed the boundaries limits and return them
  106160. * @method
  106161. * @memberof Popper.Utils
  106162. * @param {HTMLElement} popper
  106163. * @param {HTMLElement} reference
  106164. * @param {number} padding
  106165. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  106166. * @param {Boolean} fixedPosition - Is in fixed position mode
  106167. * @returns {Object} Coordinates of the boundaries
  106168. */
  106169. function getBoundaries(popper, reference, padding, boundariesElement) {
  106170. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  106171. // NOTE: 1 DOM access here
  106172. var boundaries = { top: 0, left: 0 };
  106173. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  106174. // Handle viewport case
  106175. if (boundariesElement === 'viewport') {
  106176. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  106177. } else {
  106178. // Handle other cases based on DOM element used as boundaries
  106179. var boundariesNode = void 0;
  106180. if (boundariesElement === 'scrollParent') {
  106181. boundariesNode = getScrollParent(getParentNode(reference));
  106182. if (boundariesNode.nodeName === 'BODY') {
  106183. boundariesNode = popper.ownerDocument.documentElement;
  106184. }
  106185. } else if (boundariesElement === 'window') {
  106186. boundariesNode = popper.ownerDocument.documentElement;
  106187. } else {
  106188. boundariesNode = boundariesElement;
  106189. }
  106190. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  106191. // In case of HTML, we need a different computation
  106192. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  106193. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  106194. height = _getWindowSizes.height,
  106195. width = _getWindowSizes.width;
  106196. boundaries.top += offsets.top - offsets.marginTop;
  106197. boundaries.bottom = height + offsets.top;
  106198. boundaries.left += offsets.left - offsets.marginLeft;
  106199. boundaries.right = width + offsets.left;
  106200. } else {
  106201. // for all the other DOM elements, this one is good
  106202. boundaries = offsets;
  106203. }
  106204. }
  106205. // Add paddings
  106206. padding = padding || 0;
  106207. var isPaddingNumber = typeof padding === 'number';
  106208. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  106209. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  106210. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  106211. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  106212. return boundaries;
  106213. }
  106214. function getArea(_ref) {
  106215. var width = _ref.width,
  106216. height = _ref.height;
  106217. return width * height;
  106218. }
  106219. /**
  106220. * Utility used to transform the `auto` placement to the placement with more
  106221. * available space.
  106222. * @method
  106223. * @memberof Popper.Utils
  106224. * @argument {Object} data - The data object generated by update method
  106225. * @argument {Object} options - Modifiers configuration and options
  106226. * @returns {Object} The data object, properly modified
  106227. */
  106228. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  106229. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  106230. if (placement.indexOf('auto') === -1) {
  106231. return placement;
  106232. }
  106233. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  106234. var rects = {
  106235. top: {
  106236. width: boundaries.width,
  106237. height: refRect.top - boundaries.top
  106238. },
  106239. right: {
  106240. width: boundaries.right - refRect.right,
  106241. height: boundaries.height
  106242. },
  106243. bottom: {
  106244. width: boundaries.width,
  106245. height: boundaries.bottom - refRect.bottom
  106246. },
  106247. left: {
  106248. width: refRect.left - boundaries.left,
  106249. height: boundaries.height
  106250. }
  106251. };
  106252. var sortedAreas = Object.keys(rects).map(function (key) {
  106253. return _extends({
  106254. key: key
  106255. }, rects[key], {
  106256. area: getArea(rects[key])
  106257. });
  106258. }).sort(function (a, b) {
  106259. return b.area - a.area;
  106260. });
  106261. var filteredAreas = sortedAreas.filter(function (_ref2) {
  106262. var width = _ref2.width,
  106263. height = _ref2.height;
  106264. return width >= popper.clientWidth && height >= popper.clientHeight;
  106265. });
  106266. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  106267. var variation = placement.split('-')[1];
  106268. return computedPlacement + (variation ? '-' + variation : '');
  106269. }
  106270. /**
  106271. * Get offsets to the reference element
  106272. * @method
  106273. * @memberof Popper.Utils
  106274. * @param {Object} state
  106275. * @param {Element} popper - the popper element
  106276. * @param {Element} reference - the reference element (the popper will be relative to this)
  106277. * @param {Element} fixedPosition - is in fixed position mode
  106278. * @returns {Object} An object containing the offsets which will be applied to the popper
  106279. */
  106280. function getReferenceOffsets(state, popper, reference) {
  106281. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  106282. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  106283. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  106284. }
  106285. /**
  106286. * Get the outer sizes of the given element (offset size + margins)
  106287. * @method
  106288. * @memberof Popper.Utils
  106289. * @argument {Element} element
  106290. * @returns {Object} object containing width and height properties
  106291. */
  106292. function getOuterSizes(element) {
  106293. var window = element.ownerDocument.defaultView;
  106294. var styles = window.getComputedStyle(element);
  106295. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  106296. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  106297. var result = {
  106298. width: element.offsetWidth + y,
  106299. height: element.offsetHeight + x
  106300. };
  106301. return result;
  106302. }
  106303. /**
  106304. * Get the opposite placement of the given one
  106305. * @method
  106306. * @memberof Popper.Utils
  106307. * @argument {String} placement
  106308. * @returns {String} flipped placement
  106309. */
  106310. function getOppositePlacement(placement) {
  106311. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  106312. return placement.replace(/left|right|bottom|top/g, function (matched) {
  106313. return hash[matched];
  106314. });
  106315. }
  106316. /**
  106317. * Get offsets to the popper
  106318. * @method
  106319. * @memberof Popper.Utils
  106320. * @param {Object} position - CSS position the Popper will get applied
  106321. * @param {HTMLElement} popper - the popper element
  106322. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  106323. * @param {String} placement - one of the valid placement options
  106324. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  106325. */
  106326. function getPopperOffsets(popper, referenceOffsets, placement) {
  106327. placement = placement.split('-')[0];
  106328. // Get popper node sizes
  106329. var popperRect = getOuterSizes(popper);
  106330. // Add position, width and height to our offsets object
  106331. var popperOffsets = {
  106332. width: popperRect.width,
  106333. height: popperRect.height
  106334. };
  106335. // depending by the popper placement we have to compute its offsets slightly differently
  106336. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  106337. var mainSide = isHoriz ? 'top' : 'left';
  106338. var secondarySide = isHoriz ? 'left' : 'top';
  106339. var measurement = isHoriz ? 'height' : 'width';
  106340. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  106341. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  106342. if (placement === secondarySide) {
  106343. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  106344. } else {
  106345. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  106346. }
  106347. return popperOffsets;
  106348. }
  106349. /**
  106350. * Mimics the `find` method of Array
  106351. * @method
  106352. * @memberof Popper.Utils
  106353. * @argument {Array} arr
  106354. * @argument prop
  106355. * @argument value
  106356. * @returns index or -1
  106357. */
  106358. function find(arr, check) {
  106359. // use native find if supported
  106360. if (Array.prototype.find) {
  106361. return arr.find(check);
  106362. }
  106363. // use `filter` to obtain the same behavior of `find`
  106364. return arr.filter(check)[0];
  106365. }
  106366. /**
  106367. * Return the index of the matching object
  106368. * @method
  106369. * @memberof Popper.Utils
  106370. * @argument {Array} arr
  106371. * @argument prop
  106372. * @argument value
  106373. * @returns index or -1
  106374. */
  106375. function findIndex(arr, prop, value) {
  106376. // use native findIndex if supported
  106377. if (Array.prototype.findIndex) {
  106378. return arr.findIndex(function (cur) {
  106379. return cur[prop] === value;
  106380. });
  106381. }
  106382. // use `find` + `indexOf` if `findIndex` isn't supported
  106383. var match = find(arr, function (obj) {
  106384. return obj[prop] === value;
  106385. });
  106386. return arr.indexOf(match);
  106387. }
  106388. /**
  106389. * Loop trough the list of modifiers and run them in order,
  106390. * each of them will then edit the data object.
  106391. * @method
  106392. * @memberof Popper.Utils
  106393. * @param {dataObject} data
  106394. * @param {Array} modifiers
  106395. * @param {String} ends - Optional modifier name used as stopper
  106396. * @returns {dataObject}
  106397. */
  106398. function runModifiers(modifiers, data, ends) {
  106399. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  106400. modifiersToRun.forEach(function (modifier) {
  106401. if (modifier['function']) {
  106402. // eslint-disable-line dot-notation
  106403. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  106404. }
  106405. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  106406. if (modifier.enabled && isFunction(fn)) {
  106407. // Add properties to offsets to make them a complete clientRect object
  106408. // we do this before each modifier to make sure the previous one doesn't
  106409. // mess with these values
  106410. data.offsets.popper = getClientRect(data.offsets.popper);
  106411. data.offsets.reference = getClientRect(data.offsets.reference);
  106412. data = fn(data, modifier);
  106413. }
  106414. });
  106415. return data;
  106416. }
  106417. /**
  106418. * Updates the position of the popper, computing the new offsets and applying
  106419. * the new style.<br />
  106420. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  106421. * @method
  106422. * @memberof Popper
  106423. */
  106424. function update() {
  106425. // if popper is destroyed, don't perform any further update
  106426. if (this.state.isDestroyed) {
  106427. return;
  106428. }
  106429. var data = {
  106430. instance: this,
  106431. styles: {},
  106432. arrowStyles: {},
  106433. attributes: {},
  106434. flipped: false,
  106435. offsets: {}
  106436. };
  106437. // compute reference element offsets
  106438. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  106439. // compute auto placement, store placement inside the data object,
  106440. // modifiers will be able to edit `placement` if needed
  106441. // and refer to originalPlacement to know the original value
  106442. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  106443. // store the computed placement inside `originalPlacement`
  106444. data.originalPlacement = data.placement;
  106445. data.positionFixed = this.options.positionFixed;
  106446. // compute the popper offsets
  106447. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  106448. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  106449. // run the modifiers
  106450. data = runModifiers(this.modifiers, data);
  106451. // the first `update` will call `onCreate` callback
  106452. // the other ones will call `onUpdate` callback
  106453. if (!this.state.isCreated) {
  106454. this.state.isCreated = true;
  106455. this.options.onCreate(data);
  106456. } else {
  106457. this.options.onUpdate(data);
  106458. }
  106459. }
  106460. /**
  106461. * Helper used to know if the given modifier is enabled.
  106462. * @method
  106463. * @memberof Popper.Utils
  106464. * @returns {Boolean}
  106465. */
  106466. function isModifierEnabled(modifiers, modifierName) {
  106467. return modifiers.some(function (_ref) {
  106468. var name = _ref.name,
  106469. enabled = _ref.enabled;
  106470. return enabled && name === modifierName;
  106471. });
  106472. }
  106473. /**
  106474. * Get the prefixed supported property name
  106475. * @method
  106476. * @memberof Popper.Utils
  106477. * @argument {String} property (camelCase)
  106478. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  106479. */
  106480. function getSupportedPropertyName(property) {
  106481. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  106482. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  106483. for (var i = 0; i < prefixes.length; i++) {
  106484. var prefix = prefixes[i];
  106485. var toCheck = prefix ? '' + prefix + upperProp : property;
  106486. if (typeof document.body.style[toCheck] !== 'undefined') {
  106487. return toCheck;
  106488. }
  106489. }
  106490. return null;
  106491. }
  106492. /**
  106493. * Destroys the popper.
  106494. * @method
  106495. * @memberof Popper
  106496. */
  106497. function destroy() {
  106498. this.state.isDestroyed = true;
  106499. // touch DOM only if `applyStyle` modifier is enabled
  106500. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  106501. this.popper.removeAttribute('x-placement');
  106502. this.popper.style.position = '';
  106503. this.popper.style.top = '';
  106504. this.popper.style.left = '';
  106505. this.popper.style.right = '';
  106506. this.popper.style.bottom = '';
  106507. this.popper.style.willChange = '';
  106508. this.popper.style[getSupportedPropertyName('transform')] = '';
  106509. }
  106510. this.disableEventListeners();
  106511. // remove the popper if user explicitly asked for the deletion on destroy
  106512. // do not use `remove` because IE11 doesn't support it
  106513. if (this.options.removeOnDestroy) {
  106514. this.popper.parentNode.removeChild(this.popper);
  106515. }
  106516. return this;
  106517. }
  106518. /**
  106519. * Get the window associated with the element
  106520. * @argument {Element} element
  106521. * @returns {Window}
  106522. */
  106523. function getWindow(element) {
  106524. var ownerDocument = element.ownerDocument;
  106525. return ownerDocument ? ownerDocument.defaultView : window;
  106526. }
  106527. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  106528. var isBody = scrollParent.nodeName === 'BODY';
  106529. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  106530. target.addEventListener(event, callback, { passive: true });
  106531. if (!isBody) {
  106532. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  106533. }
  106534. scrollParents.push(target);
  106535. }
  106536. /**
  106537. * Setup needed event listeners used to update the popper position
  106538. * @method
  106539. * @memberof Popper.Utils
  106540. * @private
  106541. */
  106542. function setupEventListeners(reference, options, state, updateBound) {
  106543. // Resize event listener on window
  106544. state.updateBound = updateBound;
  106545. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  106546. // Scroll event listener on scroll parents
  106547. var scrollElement = getScrollParent(reference);
  106548. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  106549. state.scrollElement = scrollElement;
  106550. state.eventsEnabled = true;
  106551. return state;
  106552. }
  106553. /**
  106554. * It will add resize/scroll events and start recalculating
  106555. * position of the popper element when they are triggered.
  106556. * @method
  106557. * @memberof Popper
  106558. */
  106559. function enableEventListeners() {
  106560. if (!this.state.eventsEnabled) {
  106561. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  106562. }
  106563. }
  106564. /**
  106565. * Remove event listeners used to update the popper position
  106566. * @method
  106567. * @memberof Popper.Utils
  106568. * @private
  106569. */
  106570. function removeEventListeners(reference, state) {
  106571. // Remove resize event listener on window
  106572. getWindow(reference).removeEventListener('resize', state.updateBound);
  106573. // Remove scroll event listener on scroll parents
  106574. state.scrollParents.forEach(function (target) {
  106575. target.removeEventListener('scroll', state.updateBound);
  106576. });
  106577. // Reset state
  106578. state.updateBound = null;
  106579. state.scrollParents = [];
  106580. state.scrollElement = null;
  106581. state.eventsEnabled = false;
  106582. return state;
  106583. }
  106584. /**
  106585. * It will remove resize/scroll events and won't recalculate popper position
  106586. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  106587. * unless you call `update` method manually.
  106588. * @method
  106589. * @memberof Popper
  106590. */
  106591. function disableEventListeners() {
  106592. if (this.state.eventsEnabled) {
  106593. cancelAnimationFrame(this.scheduleUpdate);
  106594. this.state = removeEventListeners(this.reference, this.state);
  106595. }
  106596. }
  106597. /**
  106598. * Tells if a given input is a number
  106599. * @method
  106600. * @memberof Popper.Utils
  106601. * @param {*} input to check
  106602. * @return {Boolean}
  106603. */
  106604. function isNumeric(n) {
  106605. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  106606. }
  106607. /**
  106608. * Set the style to the given popper
  106609. * @method
  106610. * @memberof Popper.Utils
  106611. * @argument {Element} element - Element to apply the style to
  106612. * @argument {Object} styles
  106613. * Object with a list of properties and values which will be applied to the element
  106614. */
  106615. function setStyles(element, styles) {
  106616. Object.keys(styles).forEach(function (prop) {
  106617. var unit = '';
  106618. // add unit if the value is numeric and is one of the following
  106619. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  106620. unit = 'px';
  106621. }
  106622. element.style[prop] = styles[prop] + unit;
  106623. });
  106624. }
  106625. /**
  106626. * Set the attributes to the given popper
  106627. * @method
  106628. * @memberof Popper.Utils
  106629. * @argument {Element} element - Element to apply the attributes to
  106630. * @argument {Object} styles
  106631. * Object with a list of properties and values which will be applied to the element
  106632. */
  106633. function setAttributes(element, attributes) {
  106634. Object.keys(attributes).forEach(function (prop) {
  106635. var value = attributes[prop];
  106636. if (value !== false) {
  106637. element.setAttribute(prop, attributes[prop]);
  106638. } else {
  106639. element.removeAttribute(prop);
  106640. }
  106641. });
  106642. }
  106643. /**
  106644. * @function
  106645. * @memberof Modifiers
  106646. * @argument {Object} data - The data object generated by `update` method
  106647. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  106648. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  106649. * @argument {Object} options - Modifiers configuration and options
  106650. * @returns {Object} The same data object
  106651. */
  106652. function applyStyle(data) {
  106653. // any property present in `data.styles` will be applied to the popper,
  106654. // in this way we can make the 3rd party modifiers add custom styles to it
  106655. // Be aware, modifiers could override the properties defined in the previous
  106656. // lines of this modifier!
  106657. setStyles(data.instance.popper, data.styles);
  106658. // any property present in `data.attributes` will be applied to the popper,
  106659. // they will be set as HTML attributes of the element
  106660. setAttributes(data.instance.popper, data.attributes);
  106661. // if arrowElement is defined and arrowStyles has some properties
  106662. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  106663. setStyles(data.arrowElement, data.arrowStyles);
  106664. }
  106665. return data;
  106666. }
  106667. /**
  106668. * Set the x-placement attribute before everything else because it could be used
  106669. * to add margins to the popper margins needs to be calculated to get the
  106670. * correct popper offsets.
  106671. * @method
  106672. * @memberof Popper.modifiers
  106673. * @param {HTMLElement} reference - The reference element used to position the popper
  106674. * @param {HTMLElement} popper - The HTML element used as popper
  106675. * @param {Object} options - Popper.js options
  106676. */
  106677. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  106678. // compute reference element offsets
  106679. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  106680. // compute auto placement, store placement inside the data object,
  106681. // modifiers will be able to edit `placement` if needed
  106682. // and refer to originalPlacement to know the original value
  106683. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  106684. popper.setAttribute('x-placement', placement);
  106685. // Apply `position` to popper before anything else because
  106686. // without the position applied we can't guarantee correct computations
  106687. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  106688. return options;
  106689. }
  106690. /**
  106691. * @function
  106692. * @memberof Popper.Utils
  106693. * @argument {Object} data - The data object generated by `update` method
  106694. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  106695. * @returns {Object} The popper's position offsets rounded
  106696. *
  106697. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  106698. * good as it can be within reason.
  106699. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  106700. *
  106701. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  106702. * as well on High DPI screens).
  106703. *
  106704. * Firefox prefers no rounding for positioning and does not have blurriness on
  106705. * high DPI screens.
  106706. *
  106707. * Only horizontal placement and left/right values need to be considered.
  106708. */
  106709. function getRoundedOffsets(data, shouldRound) {
  106710. var _data$offsets = data.offsets,
  106711. popper = _data$offsets.popper,
  106712. reference = _data$offsets.reference;
  106713. var round = Math.round,
  106714. floor = Math.floor;
  106715. var noRound = function noRound(v) {
  106716. return v;
  106717. };
  106718. var referenceWidth = round(reference.width);
  106719. var popperWidth = round(popper.width);
  106720. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  106721. var isVariation = data.placement.indexOf('-') !== -1;
  106722. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  106723. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  106724. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  106725. var verticalToInteger = !shouldRound ? noRound : round;
  106726. return {
  106727. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  106728. top: verticalToInteger(popper.top),
  106729. bottom: verticalToInteger(popper.bottom),
  106730. right: horizontalToInteger(popper.right)
  106731. };
  106732. }
  106733. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  106734. /**
  106735. * @function
  106736. * @memberof Modifiers
  106737. * @argument {Object} data - The data object generated by `update` method
  106738. * @argument {Object} options - Modifiers configuration and options
  106739. * @returns {Object} The data object, properly modified
  106740. */
  106741. function computeStyle(data, options) {
  106742. var x = options.x,
  106743. y = options.y;
  106744. var popper = data.offsets.popper;
  106745. // Remove this legacy support in Popper.js v2
  106746. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  106747. return modifier.name === 'applyStyle';
  106748. }).gpuAcceleration;
  106749. if (legacyGpuAccelerationOption !== undefined) {
  106750. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  106751. }
  106752. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  106753. var offsetParent = getOffsetParent(data.instance.popper);
  106754. var offsetParentRect = getBoundingClientRect(offsetParent);
  106755. // Styles
  106756. var styles = {
  106757. position: popper.position
  106758. };
  106759. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  106760. var sideA = x === 'bottom' ? 'top' : 'bottom';
  106761. var sideB = y === 'right' ? 'left' : 'right';
  106762. // if gpuAcceleration is set to `true` and transform is supported,
  106763. // we use `translate3d` to apply the position to the popper we
  106764. // automatically use the supported prefixed version if needed
  106765. var prefixedProperty = getSupportedPropertyName('transform');
  106766. // now, let's make a step back and look at this code closely (wtf?)
  106767. // If the content of the popper grows once it's been positioned, it
  106768. // may happen that the popper gets misplaced because of the new content
  106769. // overflowing its reference element
  106770. // To avoid this problem, we provide two options (x and y), which allow
  106771. // the consumer to define the offset origin.
  106772. // If we position a popper on top of a reference element, we can set
  106773. // `x` to `top` to make the popper grow towards its top instead of
  106774. // its bottom.
  106775. var left = void 0,
  106776. top = void 0;
  106777. if (sideA === 'bottom') {
  106778. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  106779. // and not the bottom of the html element
  106780. if (offsetParent.nodeName === 'HTML') {
  106781. top = -offsetParent.clientHeight + offsets.bottom;
  106782. } else {
  106783. top = -offsetParentRect.height + offsets.bottom;
  106784. }
  106785. } else {
  106786. top = offsets.top;
  106787. }
  106788. if (sideB === 'right') {
  106789. if (offsetParent.nodeName === 'HTML') {
  106790. left = -offsetParent.clientWidth + offsets.right;
  106791. } else {
  106792. left = -offsetParentRect.width + offsets.right;
  106793. }
  106794. } else {
  106795. left = offsets.left;
  106796. }
  106797. if (gpuAcceleration && prefixedProperty) {
  106798. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  106799. styles[sideA] = 0;
  106800. styles[sideB] = 0;
  106801. styles.willChange = 'transform';
  106802. } else {
  106803. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  106804. var invertTop = sideA === 'bottom' ? -1 : 1;
  106805. var invertLeft = sideB === 'right' ? -1 : 1;
  106806. styles[sideA] = top * invertTop;
  106807. styles[sideB] = left * invertLeft;
  106808. styles.willChange = sideA + ', ' + sideB;
  106809. }
  106810. // Attributes
  106811. var attributes = {
  106812. 'x-placement': data.placement
  106813. };
  106814. // Update `data` attributes, styles and arrowStyles
  106815. data.attributes = _extends({}, attributes, data.attributes);
  106816. data.styles = _extends({}, styles, data.styles);
  106817. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  106818. return data;
  106819. }
  106820. /**
  106821. * Helper used to know if the given modifier depends from another one.<br />
  106822. * It checks if the needed modifier is listed and enabled.
  106823. * @method
  106824. * @memberof Popper.Utils
  106825. * @param {Array} modifiers - list of modifiers
  106826. * @param {String} requestingName - name of requesting modifier
  106827. * @param {String} requestedName - name of requested modifier
  106828. * @returns {Boolean}
  106829. */
  106830. function isModifierRequired(modifiers, requestingName, requestedName) {
  106831. var requesting = find(modifiers, function (_ref) {
  106832. var name = _ref.name;
  106833. return name === requestingName;
  106834. });
  106835. var isRequired = !!requesting && modifiers.some(function (modifier) {
  106836. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  106837. });
  106838. if (!isRequired) {
  106839. var _requesting = '`' + requestingName + '`';
  106840. var requested = '`' + requestedName + '`';
  106841. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  106842. }
  106843. return isRequired;
  106844. }
  106845. /**
  106846. * @function
  106847. * @memberof Modifiers
  106848. * @argument {Object} data - The data object generated by update method
  106849. * @argument {Object} options - Modifiers configuration and options
  106850. * @returns {Object} The data object, properly modified
  106851. */
  106852. function arrow(data, options) {
  106853. var _data$offsets$arrow;
  106854. // arrow depends on keepTogether in order to work
  106855. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  106856. return data;
  106857. }
  106858. var arrowElement = options.element;
  106859. // if arrowElement is a string, suppose it's a CSS selector
  106860. if (typeof arrowElement === 'string') {
  106861. arrowElement = data.instance.popper.querySelector(arrowElement);
  106862. // if arrowElement is not found, don't run the modifier
  106863. if (!arrowElement) {
  106864. return data;
  106865. }
  106866. } else {
  106867. // if the arrowElement isn't a query selector we must check that the
  106868. // provided DOM node is child of its popper node
  106869. if (!data.instance.popper.contains(arrowElement)) {
  106870. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  106871. return data;
  106872. }
  106873. }
  106874. var placement = data.placement.split('-')[0];
  106875. var _data$offsets = data.offsets,
  106876. popper = _data$offsets.popper,
  106877. reference = _data$offsets.reference;
  106878. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  106879. var len = isVertical ? 'height' : 'width';
  106880. var sideCapitalized = isVertical ? 'Top' : 'Left';
  106881. var side = sideCapitalized.toLowerCase();
  106882. var altSide = isVertical ? 'left' : 'top';
  106883. var opSide = isVertical ? 'bottom' : 'right';
  106884. var arrowElementSize = getOuterSizes(arrowElement)[len];
  106885. //
  106886. // extends keepTogether behavior making sure the popper and its
  106887. // reference have enough pixels in conjunction
  106888. //
  106889. // top/left side
  106890. if (reference[opSide] - arrowElementSize < popper[side]) {
  106891. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  106892. }
  106893. // bottom/right side
  106894. if (reference[side] + arrowElementSize > popper[opSide]) {
  106895. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  106896. }
  106897. data.offsets.popper = getClientRect(data.offsets.popper);
  106898. // compute center of the popper
  106899. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  106900. // Compute the sideValue using the updated popper offsets
  106901. // take popper margin in account because we don't have this info available
  106902. var css = getStyleComputedProperty(data.instance.popper);
  106903. var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  106904. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  106905. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  106906. // prevent arrowElement from being placed not contiguously to its popper
  106907. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  106908. data.arrowElement = arrowElement;
  106909. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  106910. return data;
  106911. }
  106912. /**
  106913. * Get the opposite placement variation of the given one
  106914. * @method
  106915. * @memberof Popper.Utils
  106916. * @argument {String} placement variation
  106917. * @returns {String} flipped placement variation
  106918. */
  106919. function getOppositeVariation(variation) {
  106920. if (variation === 'end') {
  106921. return 'start';
  106922. } else if (variation === 'start') {
  106923. return 'end';
  106924. }
  106925. return variation;
  106926. }
  106927. /**
  106928. * List of accepted placements to use as values of the `placement` option.<br />
  106929. * Valid placements are:
  106930. * - `auto`
  106931. * - `top`
  106932. * - `right`
  106933. * - `bottom`
  106934. * - `left`
  106935. *
  106936. * Each placement can have a variation from this list:
  106937. * - `-start`
  106938. * - `-end`
  106939. *
  106940. * Variations are interpreted easily if you think of them as the left to right
  106941. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  106942. * is right.<br />
  106943. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  106944. *
  106945. * Some valid examples are:
  106946. * - `top-end` (on top of reference, right aligned)
  106947. * - `right-start` (on right of reference, top aligned)
  106948. * - `bottom` (on bottom, centered)
  106949. * - `auto-end` (on the side with more space available, alignment depends by placement)
  106950. *
  106951. * @static
  106952. * @type {Array}
  106953. * @enum {String}
  106954. * @readonly
  106955. * @method placements
  106956. * @memberof Popper
  106957. */
  106958. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  106959. // Get rid of `auto` `auto-start` and `auto-end`
  106960. var validPlacements = placements.slice(3);
  106961. /**
  106962. * Given an initial placement, returns all the subsequent placements
  106963. * clockwise (or counter-clockwise).
  106964. *
  106965. * @method
  106966. * @memberof Popper.Utils
  106967. * @argument {String} placement - A valid placement (it accepts variations)
  106968. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  106969. * @returns {Array} placements including their variations
  106970. */
  106971. function clockwise(placement) {
  106972. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  106973. var index = validPlacements.indexOf(placement);
  106974. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  106975. return counter ? arr.reverse() : arr;
  106976. }
  106977. var BEHAVIORS = {
  106978. FLIP: 'flip',
  106979. CLOCKWISE: 'clockwise',
  106980. COUNTERCLOCKWISE: 'counterclockwise'
  106981. };
  106982. /**
  106983. * @function
  106984. * @memberof Modifiers
  106985. * @argument {Object} data - The data object generated by update method
  106986. * @argument {Object} options - Modifiers configuration and options
  106987. * @returns {Object} The data object, properly modified
  106988. */
  106989. function flip(data, options) {
  106990. // if `inner` modifier is enabled, we can't use the `flip` modifier
  106991. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  106992. return data;
  106993. }
  106994. if (data.flipped && data.placement === data.originalPlacement) {
  106995. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  106996. return data;
  106997. }
  106998. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  106999. var placement = data.placement.split('-')[0];
  107000. var placementOpposite = getOppositePlacement(placement);
  107001. var variation = data.placement.split('-')[1] || '';
  107002. var flipOrder = [];
  107003. switch (options.behavior) {
  107004. case BEHAVIORS.FLIP:
  107005. flipOrder = [placement, placementOpposite];
  107006. break;
  107007. case BEHAVIORS.CLOCKWISE:
  107008. flipOrder = clockwise(placement);
  107009. break;
  107010. case BEHAVIORS.COUNTERCLOCKWISE:
  107011. flipOrder = clockwise(placement, true);
  107012. break;
  107013. default:
  107014. flipOrder = options.behavior;
  107015. }
  107016. flipOrder.forEach(function (step, index) {
  107017. if (placement !== step || flipOrder.length === index + 1) {
  107018. return data;
  107019. }
  107020. placement = data.placement.split('-')[0];
  107021. placementOpposite = getOppositePlacement(placement);
  107022. var popperOffsets = data.offsets.popper;
  107023. var refOffsets = data.offsets.reference;
  107024. // using floor because the reference offsets may contain decimals we are not going to consider here
  107025. var floor = Math.floor;
  107026. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  107027. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  107028. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  107029. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  107030. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  107031. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  107032. // flip the variation if required
  107033. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  107034. // flips variation if reference element overflows boundaries
  107035. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  107036. // flips variation if popper content overflows boundaries
  107037. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  107038. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  107039. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  107040. // this boolean to detect any flip loop
  107041. data.flipped = true;
  107042. if (overlapsRef || overflowsBoundaries) {
  107043. placement = flipOrder[index + 1];
  107044. }
  107045. if (flippedVariation) {
  107046. variation = getOppositeVariation(variation);
  107047. }
  107048. data.placement = placement + (variation ? '-' + variation : '');
  107049. // this object contains `position`, we want to preserve it along with
  107050. // any additional property we may add in the future
  107051. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  107052. data = runModifiers(data.instance.modifiers, data, 'flip');
  107053. }
  107054. });
  107055. return data;
  107056. }
  107057. /**
  107058. * @function
  107059. * @memberof Modifiers
  107060. * @argument {Object} data - The data object generated by update method
  107061. * @argument {Object} options - Modifiers configuration and options
  107062. * @returns {Object} The data object, properly modified
  107063. */
  107064. function keepTogether(data) {
  107065. var _data$offsets = data.offsets,
  107066. popper = _data$offsets.popper,
  107067. reference = _data$offsets.reference;
  107068. var placement = data.placement.split('-')[0];
  107069. var floor = Math.floor;
  107070. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  107071. var side = isVertical ? 'right' : 'bottom';
  107072. var opSide = isVertical ? 'left' : 'top';
  107073. var measurement = isVertical ? 'width' : 'height';
  107074. if (popper[side] < floor(reference[opSide])) {
  107075. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  107076. }
  107077. if (popper[opSide] > floor(reference[side])) {
  107078. data.offsets.popper[opSide] = floor(reference[side]);
  107079. }
  107080. return data;
  107081. }
  107082. /**
  107083. * Converts a string containing value + unit into a px value number
  107084. * @function
  107085. * @memberof {modifiers~offset}
  107086. * @private
  107087. * @argument {String} str - Value + unit string
  107088. * @argument {String} measurement - `height` or `width`
  107089. * @argument {Object} popperOffsets
  107090. * @argument {Object} referenceOffsets
  107091. * @returns {Number|String}
  107092. * Value in pixels, or original string if no values were extracted
  107093. */
  107094. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  107095. // separate value from unit
  107096. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  107097. var value = +split[1];
  107098. var unit = split[2];
  107099. // If it's not a number it's an operator, I guess
  107100. if (!value) {
  107101. return str;
  107102. }
  107103. if (unit.indexOf('%') === 0) {
  107104. var element = void 0;
  107105. switch (unit) {
  107106. case '%p':
  107107. element = popperOffsets;
  107108. break;
  107109. case '%':
  107110. case '%r':
  107111. default:
  107112. element = referenceOffsets;
  107113. }
  107114. var rect = getClientRect(element);
  107115. return rect[measurement] / 100 * value;
  107116. } else if (unit === 'vh' || unit === 'vw') {
  107117. // if is a vh or vw, we calculate the size based on the viewport
  107118. var size = void 0;
  107119. if (unit === 'vh') {
  107120. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  107121. } else {
  107122. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  107123. }
  107124. return size / 100 * value;
  107125. } else {
  107126. // if is an explicit pixel unit, we get rid of the unit and keep the value
  107127. // if is an implicit unit, it's px, and we return just the value
  107128. return value;
  107129. }
  107130. }
  107131. /**
  107132. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  107133. * @function
  107134. * @memberof {modifiers~offset}
  107135. * @private
  107136. * @argument {String} offset
  107137. * @argument {Object} popperOffsets
  107138. * @argument {Object} referenceOffsets
  107139. * @argument {String} basePlacement
  107140. * @returns {Array} a two cells array with x and y offsets in numbers
  107141. */
  107142. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  107143. var offsets = [0, 0];
  107144. // Use height if placement is left or right and index is 0 otherwise use width
  107145. // in this way the first offset will use an axis and the second one
  107146. // will use the other one
  107147. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  107148. // Split the offset string to obtain a list of values and operands
  107149. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  107150. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  107151. return frag.trim();
  107152. });
  107153. // Detect if the offset string contains a pair of values or a single one
  107154. // they could be separated by comma or space
  107155. var divider = fragments.indexOf(find(fragments, function (frag) {
  107156. return frag.search(/,|\s/) !== -1;
  107157. }));
  107158. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  107159. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  107160. }
  107161. // If divider is found, we divide the list of values and operands to divide
  107162. // them by ofset X and Y.
  107163. var splitRegex = /\s*,\s*|\s+/;
  107164. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  107165. // Convert the values with units to absolute pixels to allow our computations
  107166. ops = ops.map(function (op, index) {
  107167. // Most of the units rely on the orientation of the popper
  107168. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  107169. var mergeWithPrevious = false;
  107170. return op
  107171. // This aggregates any `+` or `-` sign that aren't considered operators
  107172. // e.g.: 10 + +5 => [10, +, +5]
  107173. .reduce(function (a, b) {
  107174. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  107175. a[a.length - 1] = b;
  107176. mergeWithPrevious = true;
  107177. return a;
  107178. } else if (mergeWithPrevious) {
  107179. a[a.length - 1] += b;
  107180. mergeWithPrevious = false;
  107181. return a;
  107182. } else {
  107183. return a.concat(b);
  107184. }
  107185. }, [])
  107186. // Here we convert the string values into number values (in px)
  107187. .map(function (str) {
  107188. return toValue(str, measurement, popperOffsets, referenceOffsets);
  107189. });
  107190. });
  107191. // Loop trough the offsets arrays and execute the operations
  107192. ops.forEach(function (op, index) {
  107193. op.forEach(function (frag, index2) {
  107194. if (isNumeric(frag)) {
  107195. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  107196. }
  107197. });
  107198. });
  107199. return offsets;
  107200. }
  107201. /**
  107202. * @function
  107203. * @memberof Modifiers
  107204. * @argument {Object} data - The data object generated by update method
  107205. * @argument {Object} options - Modifiers configuration and options
  107206. * @argument {Number|String} options.offset=0
  107207. * The offset value as described in the modifier description
  107208. * @returns {Object} The data object, properly modified
  107209. */
  107210. function offset(data, _ref) {
  107211. var offset = _ref.offset;
  107212. var placement = data.placement,
  107213. _data$offsets = data.offsets,
  107214. popper = _data$offsets.popper,
  107215. reference = _data$offsets.reference;
  107216. var basePlacement = placement.split('-')[0];
  107217. var offsets = void 0;
  107218. if (isNumeric(+offset)) {
  107219. offsets = [+offset, 0];
  107220. } else {
  107221. offsets = parseOffset(offset, popper, reference, basePlacement);
  107222. }
  107223. if (basePlacement === 'left') {
  107224. popper.top += offsets[0];
  107225. popper.left -= offsets[1];
  107226. } else if (basePlacement === 'right') {
  107227. popper.top += offsets[0];
  107228. popper.left += offsets[1];
  107229. } else if (basePlacement === 'top') {
  107230. popper.left += offsets[0];
  107231. popper.top -= offsets[1];
  107232. } else if (basePlacement === 'bottom') {
  107233. popper.left += offsets[0];
  107234. popper.top += offsets[1];
  107235. }
  107236. data.popper = popper;
  107237. return data;
  107238. }
  107239. /**
  107240. * @function
  107241. * @memberof Modifiers
  107242. * @argument {Object} data - The data object generated by `update` method
  107243. * @argument {Object} options - Modifiers configuration and options
  107244. * @returns {Object} The data object, properly modified
  107245. */
  107246. function preventOverflow(data, options) {
  107247. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  107248. // If offsetParent is the reference element, we really want to
  107249. // go one step up and use the next offsetParent as reference to
  107250. // avoid to make this modifier completely useless and look like broken
  107251. if (data.instance.reference === boundariesElement) {
  107252. boundariesElement = getOffsetParent(boundariesElement);
  107253. }
  107254. // NOTE: DOM access here
  107255. // resets the popper's position so that the document size can be calculated excluding
  107256. // the size of the popper element itself
  107257. var transformProp = getSupportedPropertyName('transform');
  107258. var popperStyles = data.instance.popper.style; // assignment to help minification
  107259. var top = popperStyles.top,
  107260. left = popperStyles.left,
  107261. transform = popperStyles[transformProp];
  107262. popperStyles.top = '';
  107263. popperStyles.left = '';
  107264. popperStyles[transformProp] = '';
  107265. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  107266. // NOTE: DOM access here
  107267. // restores the original style properties after the offsets have been computed
  107268. popperStyles.top = top;
  107269. popperStyles.left = left;
  107270. popperStyles[transformProp] = transform;
  107271. options.boundaries = boundaries;
  107272. var order = options.priority;
  107273. var popper = data.offsets.popper;
  107274. var check = {
  107275. primary: function primary(placement) {
  107276. var value = popper[placement];
  107277. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  107278. value = Math.max(popper[placement], boundaries[placement]);
  107279. }
  107280. return defineProperty({}, placement, value);
  107281. },
  107282. secondary: function secondary(placement) {
  107283. var mainSide = placement === 'right' ? 'left' : 'top';
  107284. var value = popper[mainSide];
  107285. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  107286. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  107287. }
  107288. return defineProperty({}, mainSide, value);
  107289. }
  107290. };
  107291. order.forEach(function (placement) {
  107292. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  107293. popper = _extends({}, popper, check[side](placement));
  107294. });
  107295. data.offsets.popper = popper;
  107296. return data;
  107297. }
  107298. /**
  107299. * @function
  107300. * @memberof Modifiers
  107301. * @argument {Object} data - The data object generated by `update` method
  107302. * @argument {Object} options - Modifiers configuration and options
  107303. * @returns {Object} The data object, properly modified
  107304. */
  107305. function shift(data) {
  107306. var placement = data.placement;
  107307. var basePlacement = placement.split('-')[0];
  107308. var shiftvariation = placement.split('-')[1];
  107309. // if shift shiftvariation is specified, run the modifier
  107310. if (shiftvariation) {
  107311. var _data$offsets = data.offsets,
  107312. reference = _data$offsets.reference,
  107313. popper = _data$offsets.popper;
  107314. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  107315. var side = isVertical ? 'left' : 'top';
  107316. var measurement = isVertical ? 'width' : 'height';
  107317. var shiftOffsets = {
  107318. start: defineProperty({}, side, reference[side]),
  107319. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  107320. };
  107321. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  107322. }
  107323. return data;
  107324. }
  107325. /**
  107326. * @function
  107327. * @memberof Modifiers
  107328. * @argument {Object} data - The data object generated by update method
  107329. * @argument {Object} options - Modifiers configuration and options
  107330. * @returns {Object} The data object, properly modified
  107331. */
  107332. function hide(data) {
  107333. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  107334. return data;
  107335. }
  107336. var refRect = data.offsets.reference;
  107337. var bound = find(data.instance.modifiers, function (modifier) {
  107338. return modifier.name === 'preventOverflow';
  107339. }).boundaries;
  107340. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  107341. // Avoid unnecessary DOM access if visibility hasn't changed
  107342. if (data.hide === true) {
  107343. return data;
  107344. }
  107345. data.hide = true;
  107346. data.attributes['x-out-of-boundaries'] = '';
  107347. } else {
  107348. // Avoid unnecessary DOM access if visibility hasn't changed
  107349. if (data.hide === false) {
  107350. return data;
  107351. }
  107352. data.hide = false;
  107353. data.attributes['x-out-of-boundaries'] = false;
  107354. }
  107355. return data;
  107356. }
  107357. /**
  107358. * @function
  107359. * @memberof Modifiers
  107360. * @argument {Object} data - The data object generated by `update` method
  107361. * @argument {Object} options - Modifiers configuration and options
  107362. * @returns {Object} The data object, properly modified
  107363. */
  107364. function inner(data) {
  107365. var placement = data.placement;
  107366. var basePlacement = placement.split('-')[0];
  107367. var _data$offsets = data.offsets,
  107368. popper = _data$offsets.popper,
  107369. reference = _data$offsets.reference;
  107370. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  107371. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  107372. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  107373. data.placement = getOppositePlacement(placement);
  107374. data.offsets.popper = getClientRect(popper);
  107375. return data;
  107376. }
  107377. /**
  107378. * Modifier function, each modifier can have a function of this type assigned
  107379. * to its `fn` property.<br />
  107380. * These functions will be called on each update, this means that you must
  107381. * make sure they are performant enough to avoid performance bottlenecks.
  107382. *
  107383. * @function ModifierFn
  107384. * @argument {dataObject} data - The data object generated by `update` method
  107385. * @argument {Object} options - Modifiers configuration and options
  107386. * @returns {dataObject} The data object, properly modified
  107387. */
  107388. /**
  107389. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  107390. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  107391. * needed by the library.
  107392. *
  107393. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  107394. * All the other properties are configurations that could be tweaked.
  107395. * @namespace modifiers
  107396. */
  107397. var modifiers = {
  107398. /**
  107399. * Modifier used to shift the popper on the start or end of its reference
  107400. * element.<br />
  107401. * It will read the variation of the `placement` property.<br />
  107402. * It can be one either `-end` or `-start`.
  107403. * @memberof modifiers
  107404. * @inner
  107405. */
  107406. shift: {
  107407. /** @prop {number} order=100 - Index used to define the order of execution */
  107408. order: 100,
  107409. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107410. enabled: true,
  107411. /** @prop {ModifierFn} */
  107412. fn: shift
  107413. },
  107414. /**
  107415. * The `offset` modifier can shift your popper on both its axis.
  107416. *
  107417. * It accepts the following units:
  107418. * - `px` or unit-less, interpreted as pixels
  107419. * - `%` or `%r`, percentage relative to the length of the reference element
  107420. * - `%p`, percentage relative to the length of the popper element
  107421. * - `vw`, CSS viewport width unit
  107422. * - `vh`, CSS viewport height unit
  107423. *
  107424. * For length is intended the main axis relative to the placement of the popper.<br />
  107425. * This means that if the placement is `top` or `bottom`, the length will be the
  107426. * `width`. In case of `left` or `right`, it will be the `height`.
  107427. *
  107428. * You can provide a single value (as `Number` or `String`), or a pair of values
  107429. * as `String` divided by a comma or one (or more) white spaces.<br />
  107430. * The latter is a deprecated method because it leads to confusion and will be
  107431. * removed in v2.<br />
  107432. * Additionally, it accepts additions and subtractions between different units.
  107433. * Note that multiplications and divisions aren't supported.
  107434. *
  107435. * Valid examples are:
  107436. * ```
  107437. * 10
  107438. * '10%'
  107439. * '10, 10'
  107440. * '10%, 10'
  107441. * '10 + 10%'
  107442. * '10 - 5vh + 3%'
  107443. * '-10px + 5vh, 5px - 6%'
  107444. * ```
  107445. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  107446. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  107447. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  107448. *
  107449. * @memberof modifiers
  107450. * @inner
  107451. */
  107452. offset: {
  107453. /** @prop {number} order=200 - Index used to define the order of execution */
  107454. order: 200,
  107455. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107456. enabled: true,
  107457. /** @prop {ModifierFn} */
  107458. fn: offset,
  107459. /** @prop {Number|String} offset=0
  107460. * The offset value as described in the modifier description
  107461. */
  107462. offset: 0
  107463. },
  107464. /**
  107465. * Modifier used to prevent the popper from being positioned outside the boundary.
  107466. *
  107467. * A scenario exists where the reference itself is not within the boundaries.<br />
  107468. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  107469. * In this case we need to decide whether the popper should either:
  107470. *
  107471. * - detach from the reference and remain "trapped" in the boundaries, or
  107472. * - if it should ignore the boundary and "escape with its reference"
  107473. *
  107474. * When `escapeWithReference` is set to`true` and reference is completely
  107475. * outside its boundaries, the popper will overflow (or completely leave)
  107476. * the boundaries in order to remain attached to the edge of the reference.
  107477. *
  107478. * @memberof modifiers
  107479. * @inner
  107480. */
  107481. preventOverflow: {
  107482. /** @prop {number} order=300 - Index used to define the order of execution */
  107483. order: 300,
  107484. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107485. enabled: true,
  107486. /** @prop {ModifierFn} */
  107487. fn: preventOverflow,
  107488. /**
  107489. * @prop {Array} [priority=['left','right','top','bottom']]
  107490. * Popper will try to prevent overflow following these priorities by default,
  107491. * then, it could overflow on the left and on top of the `boundariesElement`
  107492. */
  107493. priority: ['left', 'right', 'top', 'bottom'],
  107494. /**
  107495. * @prop {number} padding=5
  107496. * Amount of pixel used to define a minimum distance between the boundaries
  107497. * and the popper. This makes sure the popper always has a little padding
  107498. * between the edges of its container
  107499. */
  107500. padding: 5,
  107501. /**
  107502. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  107503. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  107504. * `viewport` or any DOM element.
  107505. */
  107506. boundariesElement: 'scrollParent'
  107507. },
  107508. /**
  107509. * Modifier used to make sure the reference and its popper stay near each other
  107510. * without leaving any gap between the two. Especially useful when the arrow is
  107511. * enabled and you want to ensure that it points to its reference element.
  107512. * It cares only about the first axis. You can still have poppers with margin
  107513. * between the popper and its reference element.
  107514. * @memberof modifiers
  107515. * @inner
  107516. */
  107517. keepTogether: {
  107518. /** @prop {number} order=400 - Index used to define the order of execution */
  107519. order: 400,
  107520. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107521. enabled: true,
  107522. /** @prop {ModifierFn} */
  107523. fn: keepTogether
  107524. },
  107525. /**
  107526. * This modifier is used to move the `arrowElement` of the popper to make
  107527. * sure it is positioned between the reference element and its popper element.
  107528. * It will read the outer size of the `arrowElement` node to detect how many
  107529. * pixels of conjunction are needed.
  107530. *
  107531. * It has no effect if no `arrowElement` is provided.
  107532. * @memberof modifiers
  107533. * @inner
  107534. */
  107535. arrow: {
  107536. /** @prop {number} order=500 - Index used to define the order of execution */
  107537. order: 500,
  107538. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107539. enabled: true,
  107540. /** @prop {ModifierFn} */
  107541. fn: arrow,
  107542. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  107543. element: '[x-arrow]'
  107544. },
  107545. /**
  107546. * Modifier used to flip the popper's placement when it starts to overlap its
  107547. * reference element.
  107548. *
  107549. * Requires the `preventOverflow` modifier before it in order to work.
  107550. *
  107551. * **NOTE:** this modifier will interrupt the current update cycle and will
  107552. * restart it if it detects the need to flip the placement.
  107553. * @memberof modifiers
  107554. * @inner
  107555. */
  107556. flip: {
  107557. /** @prop {number} order=600 - Index used to define the order of execution */
  107558. order: 600,
  107559. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107560. enabled: true,
  107561. /** @prop {ModifierFn} */
  107562. fn: flip,
  107563. /**
  107564. * @prop {String|Array} behavior='flip'
  107565. * The behavior used to change the popper's placement. It can be one of
  107566. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  107567. * placements (with optional variations)
  107568. */
  107569. behavior: 'flip',
  107570. /**
  107571. * @prop {number} padding=5
  107572. * The popper will flip if it hits the edges of the `boundariesElement`
  107573. */
  107574. padding: 5,
  107575. /**
  107576. * @prop {String|HTMLElement} boundariesElement='viewport'
  107577. * The element which will define the boundaries of the popper position.
  107578. * The popper will never be placed outside of the defined boundaries
  107579. * (except if `keepTogether` is enabled)
  107580. */
  107581. boundariesElement: 'viewport',
  107582. /**
  107583. * @prop {Boolean} flipVariations=false
  107584. * The popper will switch placement variation between `-start` and `-end` when
  107585. * the reference element overlaps its boundaries.
  107586. *
  107587. * The original placement should have a set variation.
  107588. */
  107589. flipVariations: false,
  107590. /**
  107591. * @prop {Boolean} flipVariationsByContent=false
  107592. * The popper will switch placement variation between `-start` and `-end` when
  107593. * the popper element overlaps its reference boundaries.
  107594. *
  107595. * The original placement should have a set variation.
  107596. */
  107597. flipVariationsByContent: false
  107598. },
  107599. /**
  107600. * Modifier used to make the popper flow toward the inner of the reference element.
  107601. * By default, when this modifier is disabled, the popper will be placed outside
  107602. * the reference element.
  107603. * @memberof modifiers
  107604. * @inner
  107605. */
  107606. inner: {
  107607. /** @prop {number} order=700 - Index used to define the order of execution */
  107608. order: 700,
  107609. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  107610. enabled: false,
  107611. /** @prop {ModifierFn} */
  107612. fn: inner
  107613. },
  107614. /**
  107615. * Modifier used to hide the popper when its reference element is outside of the
  107616. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  107617. * be used to hide with a CSS selector the popper when its reference is
  107618. * out of boundaries.
  107619. *
  107620. * Requires the `preventOverflow` modifier before it in order to work.
  107621. * @memberof modifiers
  107622. * @inner
  107623. */
  107624. hide: {
  107625. /** @prop {number} order=800 - Index used to define the order of execution */
  107626. order: 800,
  107627. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107628. enabled: true,
  107629. /** @prop {ModifierFn} */
  107630. fn: hide
  107631. },
  107632. /**
  107633. * Computes the style that will be applied to the popper element to gets
  107634. * properly positioned.
  107635. *
  107636. * Note that this modifier will not touch the DOM, it just prepares the styles
  107637. * so that `applyStyle` modifier can apply it. This separation is useful
  107638. * in case you need to replace `applyStyle` with a custom implementation.
  107639. *
  107640. * This modifier has `850` as `order` value to maintain backward compatibility
  107641. * with previous versions of Popper.js. Expect the modifiers ordering method
  107642. * to change in future major versions of the library.
  107643. *
  107644. * @memberof modifiers
  107645. * @inner
  107646. */
  107647. computeStyle: {
  107648. /** @prop {number} order=850 - Index used to define the order of execution */
  107649. order: 850,
  107650. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107651. enabled: true,
  107652. /** @prop {ModifierFn} */
  107653. fn: computeStyle,
  107654. /**
  107655. * @prop {Boolean} gpuAcceleration=true
  107656. * If true, it uses the CSS 3D transformation to position the popper.
  107657. * Otherwise, it will use the `top` and `left` properties
  107658. */
  107659. gpuAcceleration: true,
  107660. /**
  107661. * @prop {string} [x='bottom']
  107662. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  107663. * Change this if your popper should grow in a direction different from `bottom`
  107664. */
  107665. x: 'bottom',
  107666. /**
  107667. * @prop {string} [x='left']
  107668. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  107669. * Change this if your popper should grow in a direction different from `right`
  107670. */
  107671. y: 'right'
  107672. },
  107673. /**
  107674. * Applies the computed styles to the popper element.
  107675. *
  107676. * All the DOM manipulations are limited to this modifier. This is useful in case
  107677. * you want to integrate Popper.js inside a framework or view library and you
  107678. * want to delegate all the DOM manipulations to it.
  107679. *
  107680. * Note that if you disable this modifier, you must make sure the popper element
  107681. * has its position set to `absolute` before Popper.js can do its work!
  107682. *
  107683. * Just disable this modifier and define your own to achieve the desired effect.
  107684. *
  107685. * @memberof modifiers
  107686. * @inner
  107687. */
  107688. applyStyle: {
  107689. /** @prop {number} order=900 - Index used to define the order of execution */
  107690. order: 900,
  107691. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  107692. enabled: true,
  107693. /** @prop {ModifierFn} */
  107694. fn: applyStyle,
  107695. /** @prop {Function} */
  107696. onLoad: applyStyleOnLoad,
  107697. /**
  107698. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  107699. * @prop {Boolean} gpuAcceleration=true
  107700. * If true, it uses the CSS 3D transformation to position the popper.
  107701. * Otherwise, it will use the `top` and `left` properties
  107702. */
  107703. gpuAcceleration: undefined
  107704. }
  107705. };
  107706. /**
  107707. * The `dataObject` is an object containing all the information used by Popper.js.
  107708. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  107709. * @name dataObject
  107710. * @property {Object} data.instance The Popper.js instance
  107711. * @property {String} data.placement Placement applied to popper
  107712. * @property {String} data.originalPlacement Placement originally defined on init
  107713. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  107714. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  107715. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  107716. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  107717. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  107718. * @property {Object} data.boundaries Offsets of the popper boundaries
  107719. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  107720. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  107721. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  107722. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  107723. */
  107724. /**
  107725. * Default options provided to Popper.js constructor.<br />
  107726. * These can be overridden using the `options` argument of Popper.js.<br />
  107727. * To override an option, simply pass an object with the same
  107728. * structure of the `options` object, as the 3rd argument. For example:
  107729. * ```
  107730. * new Popper(ref, pop, {
  107731. * modifiers: {
  107732. * preventOverflow: { enabled: false }
  107733. * }
  107734. * })
  107735. * ```
  107736. * @type {Object}
  107737. * @static
  107738. * @memberof Popper
  107739. */
  107740. var Defaults = {
  107741. /**
  107742. * Popper's placement.
  107743. * @prop {Popper.placements} placement='bottom'
  107744. */
  107745. placement: 'bottom',
  107746. /**
  107747. * Set this to true if you want popper to position it self in 'fixed' mode
  107748. * @prop {Boolean} positionFixed=false
  107749. */
  107750. positionFixed: false,
  107751. /**
  107752. * Whether events (resize, scroll) are initially enabled.
  107753. * @prop {Boolean} eventsEnabled=true
  107754. */
  107755. eventsEnabled: true,
  107756. /**
  107757. * Set to true if you want to automatically remove the popper when
  107758. * you call the `destroy` method.
  107759. * @prop {Boolean} removeOnDestroy=false
  107760. */
  107761. removeOnDestroy: false,
  107762. /**
  107763. * Callback called when the popper is created.<br />
  107764. * By default, it is set to no-op.<br />
  107765. * Access Popper.js instance with `data.instance`.
  107766. * @prop {onCreate}
  107767. */
  107768. onCreate: function onCreate() {},
  107769. /**
  107770. * Callback called when the popper is updated. This callback is not called
  107771. * on the initialization/creation of the popper, but only on subsequent
  107772. * updates.<br />
  107773. * By default, it is set to no-op.<br />
  107774. * Access Popper.js instance with `data.instance`.
  107775. * @prop {onUpdate}
  107776. */
  107777. onUpdate: function onUpdate() {},
  107778. /**
  107779. * List of modifiers used to modify the offsets before they are applied to the popper.
  107780. * They provide most of the functionalities of Popper.js.
  107781. * @prop {modifiers}
  107782. */
  107783. modifiers: modifiers
  107784. };
  107785. /**
  107786. * @callback onCreate
  107787. * @param {dataObject} data
  107788. */
  107789. /**
  107790. * @callback onUpdate
  107791. * @param {dataObject} data
  107792. */
  107793. // Utils
  107794. // Methods
  107795. var Popper = function () {
  107796. /**
  107797. * Creates a new Popper.js instance.
  107798. * @class Popper
  107799. * @param {Element|referenceObject} reference - The reference element used to position the popper
  107800. * @param {Element} popper - The HTML / XML element used as the popper
  107801. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  107802. * @return {Object} instance - The generated Popper.js instance
  107803. */
  107804. function Popper(reference, popper) {
  107805. var _this = this;
  107806. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  107807. classCallCheck(this, Popper);
  107808. this.scheduleUpdate = function () {
  107809. return requestAnimationFrame(_this.update);
  107810. };
  107811. // make update() debounced, so that it only runs at most once-per-tick
  107812. this.update = debounce(this.update.bind(this));
  107813. // with {} we create a new object with the options inside it
  107814. this.options = _extends({}, Popper.Defaults, options);
  107815. // init state
  107816. this.state = {
  107817. isDestroyed: false,
  107818. isCreated: false,
  107819. scrollParents: []
  107820. };
  107821. // get reference and popper elements (allow jQuery wrappers)
  107822. this.reference = reference && reference.jquery ? reference[0] : reference;
  107823. this.popper = popper && popper.jquery ? popper[0] : popper;
  107824. // Deep merge modifiers options
  107825. this.options.modifiers = {};
  107826. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  107827. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  107828. });
  107829. // Refactoring modifiers' list (Object => Array)
  107830. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  107831. return _extends({
  107832. name: name
  107833. }, _this.options.modifiers[name]);
  107834. })
  107835. // sort the modifiers by order
  107836. .sort(function (a, b) {
  107837. return a.order - b.order;
  107838. });
  107839. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  107840. // such code is executed in the same order of its modifier
  107841. // they could add new properties to their options configuration
  107842. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  107843. this.modifiers.forEach(function (modifierOptions) {
  107844. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  107845. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  107846. }
  107847. });
  107848. // fire the first update to position the popper in the right place
  107849. this.update();
  107850. var eventsEnabled = this.options.eventsEnabled;
  107851. if (eventsEnabled) {
  107852. // setup event listeners, they will take care of update the position in specific situations
  107853. this.enableEventListeners();
  107854. }
  107855. this.state.eventsEnabled = eventsEnabled;
  107856. }
  107857. // We can't use class properties because they don't get listed in the
  107858. // class prototype and break stuff like Sinon stubs
  107859. createClass(Popper, [{
  107860. key: 'update',
  107861. value: function update$$1() {
  107862. return update.call(this);
  107863. }
  107864. }, {
  107865. key: 'destroy',
  107866. value: function destroy$$1() {
  107867. return destroy.call(this);
  107868. }
  107869. }, {
  107870. key: 'enableEventListeners',
  107871. value: function enableEventListeners$$1() {
  107872. return enableEventListeners.call(this);
  107873. }
  107874. }, {
  107875. key: 'disableEventListeners',
  107876. value: function disableEventListeners$$1() {
  107877. return disableEventListeners.call(this);
  107878. }
  107879. /**
  107880. * Schedules an update. It will run on the next UI update available.
  107881. * @method scheduleUpdate
  107882. * @memberof Popper
  107883. */
  107884. /**
  107885. * Collection of utilities useful when writing custom modifiers.
  107886. * Starting from version 1.7, this method is available only if you
  107887. * include `popper-utils.js` before `popper.js`.
  107888. *
  107889. * **DEPRECATION**: This way to access PopperUtils is deprecated
  107890. * and will be removed in v2! Use the PopperUtils module directly instead.
  107891. * Due to the high instability of the methods contained in Utils, we can't
  107892. * guarantee them to follow semver. Use them at your own risk!
  107893. * @static
  107894. * @private
  107895. * @type {Object}
  107896. * @deprecated since version 1.8
  107897. * @member Utils
  107898. * @memberof Popper
  107899. */
  107900. }]);
  107901. return Popper;
  107902. }();
  107903. /**
  107904. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  107905. * and lets you use it as replacement of a real DOM node.<br />
  107906. * You can use this method to position a popper relatively to a set of coordinates
  107907. * in case you don't have a DOM node to use as reference.
  107908. *
  107909. * ```
  107910. * new Popper(referenceObject, popperNode);
  107911. * ```
  107912. *
  107913. * NB: This feature isn't supported in Internet Explorer 10.
  107914. * @name referenceObject
  107915. * @property {Function} data.getBoundingClientRect
  107916. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  107917. * @property {number} data.clientWidth
  107918. * An ES6 getter that will return the width of the virtual reference element.
  107919. * @property {number} data.clientHeight
  107920. * An ES6 getter that will return the height of the virtual reference element.
  107921. */
  107922. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  107923. Popper.placements = placements;
  107924. Popper.Defaults = Defaults;
  107925. return Popper;
  107926. })));
  107927. //# sourceMappingURL=popper.js.map
  107928. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(6)))
  107929. /***/ }),
  107930. /* 219 */
  107931. /***/ (function(module, exports, __webpack_require__) {
  107932. var render = function() {
  107933. var _vm = this
  107934. var _h = _vm.$createElement
  107935. var _c = _vm._self._c || _h
  107936. return _c(
  107937. "div",
  107938. {
  107939. directives: [
  107940. {
  107941. name: "clickoutside",
  107942. rawName: "v-clickoutside",
  107943. value: _vm.handleClose,
  107944. expression: "handleClose"
  107945. }
  107946. ],
  107947. on: { click: _vm.handleClose }
  107948. },
  107949. [
  107950. _vm.multipleLists.length > 0
  107951. ? _c(
  107952. "div",
  107953. { staticClass: "user-id-multiple" },
  107954. _vm._l(_vm.multipleLists, function(item, index) {
  107955. return _c(
  107956. "div",
  107957. { key: index, staticClass: "user-id-multiple-item" },
  107958. [
  107959. _c(
  107960. "Tag",
  107961. {
  107962. attrs: {
  107963. closable: !_vm.existMultipleDisabled(item.username)
  107964. },
  107965. on: {
  107966. "on-close": function($event) {
  107967. return _vm.multipleLists.splice(index, 1)
  107968. }
  107969. }
  107970. },
  107971. [
  107972. _c("UserView", {
  107973. attrs: { username: item.username, showimg: "" }
  107974. })
  107975. ],
  107976. 1
  107977. )
  107978. ],
  107979. 1
  107980. )
  107981. }),
  107982. 0
  107983. )
  107984. : _vm._e(),
  107985. _vm._v(" "),
  107986. _c(
  107987. "div",
  107988. { ref: "reference", staticClass: "user-id-input" },
  107989. [
  107990. _c(
  107991. "Input",
  107992. {
  107993. attrs: {
  107994. placeholder: _vm.placeholder,
  107995. disabled: _vm.disabled,
  107996. icon: "md-search"
  107997. },
  107998. on: {
  107999. "on-click": _vm.searchEnter,
  108000. "on-enter": _vm.searchEnter,
  108001. "on-blur": function($event) {
  108002. return _vm.searchEnter(true)
  108003. },
  108004. "on-change": _vm.inputChange
  108005. },
  108006. model: {
  108007. value: _vm.nickName,
  108008. callback: function($$v) {
  108009. _vm.nickName = $$v
  108010. },
  108011. expression: "nickName"
  108012. }
  108013. },
  108014. [
  108015. _vm.$slots.prepend !== undefined
  108016. ? _c(
  108017. "div",
  108018. { attrs: { slot: "prepend" }, slot: "prepend" },
  108019. [_vm._t("prepend")],
  108020. 2
  108021. )
  108022. : _vm._e(),
  108023. _vm._v(" "),
  108024. _vm.$slots.append !== undefined
  108025. ? _c(
  108026. "div",
  108027. { attrs: { slot: "append" }, slot: "append" },
  108028. [_vm._t("append")],
  108029. 2
  108030. )
  108031. : _vm._e()
  108032. ]
  108033. ),
  108034. _vm._v(" "),
  108035. _vm.userName
  108036. ? _c("div", { staticClass: "user-id-subtitle" }, [
  108037. _vm._v(_vm._s(_vm.$L("用户名")) + ": " + _vm._s(_vm.userName))
  108038. ])
  108039. : _vm._e(),
  108040. _vm._v(" "),
  108041. _vm.spinShow
  108042. ? _c("div", { staticClass: "user-id-spin" }, [
  108043. _c("div", [_c("w-loading")], 1)
  108044. ])
  108045. : _vm._e()
  108046. ],
  108047. 1
  108048. ),
  108049. _vm._v(" "),
  108050. _c("transition", { attrs: { name: "fade" } }, [
  108051. _c(
  108052. "div",
  108053. {
  108054. directives: [
  108055. {
  108056. name: "show",
  108057. rawName: "v-show",
  108058. value: !_vm.disabled && _vm.visible,
  108059. expression: "!disabled && visible"
  108060. },
  108061. { name: "transfer-dom", rawName: "v-transfer-dom" }
  108062. ],
  108063. ref: "popper",
  108064. staticClass: "user-id-input-body",
  108065. attrs: { "data-transfer": _vm.transfer }
  108066. },
  108067. [
  108068. _c(
  108069. "div",
  108070. { staticClass: "user-id-input-table" },
  108071. [
  108072. _vm.searchShow
  108073. ? _c("Table", {
  108074. ref: "myTable",
  108075. staticClass: "tableSelection",
  108076. style: _vm.tableStyle,
  108077. attrs: {
  108078. "highlight-row": "",
  108079. size: "small",
  108080. columns: _vm.columns,
  108081. data: _vm.userLists,
  108082. "no-data-text": _vm.noDataText
  108083. },
  108084. on: {
  108085. "on-row-click": _vm.userChange,
  108086. "on-selection-change": _vm.userSelect
  108087. }
  108088. })
  108089. : _vm._e(),
  108090. _vm._v(" "),
  108091. _vm.isConfirm && _vm.searchShow
  108092. ? _c(
  108093. "div",
  108094. { staticClass: "user-id-input-bottom" },
  108095. [
  108096. _c(
  108097. "Button",
  108098. {
  108099. attrs: { type: "default", size: "small" },
  108100. on: {
  108101. click: function($event) {
  108102. _vm.visible = false
  108103. }
  108104. }
  108105. },
  108106. [_vm._v(_vm._s(_vm.$L("取消")))]
  108107. ),
  108108. _vm._v(" "),
  108109. _c(
  108110. "Button",
  108111. {
  108112. attrs: { type: "primary", size: "small" },
  108113. on: { click: _vm.onConfirm }
  108114. },
  108115. [_vm._v(_vm._s(_vm.$L("确定")))]
  108116. )
  108117. ],
  108118. 1
  108119. )
  108120. : _vm._e()
  108121. ],
  108122. 1
  108123. )
  108124. ]
  108125. )
  108126. ])
  108127. ],
  108128. 1
  108129. )
  108130. }
  108131. var staticRenderFns = []
  108132. render._withStripped = true
  108133. module.exports = { render: render, staticRenderFns: staticRenderFns }
  108134. if (false) {
  108135. module.hot.accept()
  108136. if (module.hot.data) {
  108137. require("vue-hot-reload-api") .rerender("data-v-453021ba", module.exports)
  108138. }
  108139. }
  108140. /***/ }),
  108141. /* 220 */
  108142. /***/ (function(module, exports, __webpack_require__) {
  108143. var disposed = false
  108144. function injectStyle (ssrContext) {
  108145. if (disposed) return
  108146. __webpack_require__(221)
  108147. __webpack_require__(223)
  108148. }
  108149. var normalizeComponent = __webpack_require__(2)
  108150. /* script */
  108151. var __vue_script__ = __webpack_require__(225)
  108152. /* template */
  108153. var __vue_template__ = __webpack_require__(226)
  108154. /* template functional */
  108155. var __vue_template_functional__ = false
  108156. /* styles */
  108157. var __vue_styles__ = injectStyle
  108158. /* scopeId */
  108159. var __vue_scopeId__ = "data-v-6f741b65"
  108160. /* moduleIdentifier (server only) */
  108161. var __vue_module_identifier__ = null
  108162. var Component = normalizeComponent(
  108163. __vue_script__,
  108164. __vue_template__,
  108165. __vue_template_functional__,
  108166. __vue_styles__,
  108167. __vue_scopeId__,
  108168. __vue_module_identifier__
  108169. )
  108170. Component.options.__file = "resources/assets/js/main/components/UserView.vue"
  108171. /* hot reload */
  108172. if (false) {(function () {
  108173. var hotAPI = require("vue-hot-reload-api")
  108174. hotAPI.install(require("vue"), false)
  108175. if (!hotAPI.compatible) return
  108176. module.hot.accept()
  108177. if (!module.hot.data) {
  108178. hotAPI.createRecord("data-v-6f741b65", Component.options)
  108179. } else {
  108180. hotAPI.reload("data-v-6f741b65", Component.options)
  108181. }
  108182. module.hot.dispose(function (data) {
  108183. disposed = true
  108184. })
  108185. })()}
  108186. module.exports = Component.exports
  108187. /***/ }),
  108188. /* 221 */
  108189. /***/ (function(module, exports, __webpack_require__) {
  108190. // style-loader: Adds some css to the DOM by adding a <style> tag
  108191. // load the styles
  108192. var content = __webpack_require__(222);
  108193. if(typeof content === 'string') content = [[module.i, content, '']];
  108194. if(content.locals) module.exports = content.locals;
  108195. // add the styles to the DOM
  108196. var update = __webpack_require__(1)("1b76010a", content, false, {});
  108197. // Hot Module Replacement
  108198. if(false) {
  108199. // When the styles change, update the <style> tags
  108200. if(!content.locals) {
  108201. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserView.vue", function() {
  108202. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserView.vue");
  108203. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  108204. update(newContent);
  108205. });
  108206. }
  108207. // When the module is disposed, remove the <style> tags
  108208. module.hot.dispose(function() { update(); });
  108209. }
  108210. /***/ }),
  108211. /* 222 */
  108212. /***/ (function(module, exports, __webpack_require__) {
  108213. exports = module.exports = __webpack_require__(0)(false);
  108214. // imports
  108215. // module
  108216. exports.push([module.i, "\n.user-view-inline .ivu-tooltip {\n max-width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.user-view-inline .ivu-tooltip .ivu-tooltip-rel {\n max-width: 100%;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.user-view-inline .ivu-tooltip .ivu-tooltip-rel .user-view-info .user-view-img .usertext-container-text {\n -webkit-transform: scale(0.86);\n transform: scale(0.86);\n}\n", ""]);
  108217. // exports
  108218. /***/ }),
  108219. /* 223 */
  108220. /***/ (function(module, exports, __webpack_require__) {
  108221. // style-loader: Adds some css to the DOM by adding a <style> tag
  108222. // load the styles
  108223. var content = __webpack_require__(224);
  108224. if(typeof content === 'string') content = [[module.i, content, '']];
  108225. if(content.locals) module.exports = content.locals;
  108226. // add the styles to the DOM
  108227. var update = __webpack_require__(1)("62f3f1a0", content, false, {});
  108228. // Hot Module Replacement
  108229. if(false) {
  108230. // When the styles change, update the <style> tags
  108231. if(!content.locals) {
  108232. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserView.vue", function() {
  108233. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6f741b65\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./UserView.vue");
  108234. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  108235. update(newContent);
  108236. });
  108237. }
  108238. // When the module is disposed, remove the <style> tags
  108239. module.hot.dispose(function() { update(); });
  108240. }
  108241. /***/ }),
  108242. /* 224 */
  108243. /***/ (function(module, exports, __webpack_require__) {
  108244. exports = module.exports = __webpack_require__(0)(false);
  108245. // imports
  108246. // module
  108247. exports.push([module.i, "\n.user-view-inline[data-v-6f741b65] {\n display: inline-block;\n max-width: 100%;\n}\n.user-view-inline .user-view-info[data-v-6f741b65] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.user-view-inline .user-view-info .user-view-img[data-v-6f741b65] {\n width: 16px;\n height: 16px;\n font-size: 12px;\n line-height: 16px;\n border-radius: 50%;\n margin-right: 3px;\n}\n.user-view-inline .user-view-info .user-view-title[data-v-6f741b65] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n line-height: 1.2;\n}\n", ""]);
  108248. // exports
  108249. /***/ }),
  108250. /* 225 */
  108251. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108252. "use strict";
  108253. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  108254. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  108255. //
  108256. //
  108257. //
  108258. //
  108259. //
  108260. //
  108261. //
  108262. //
  108263. //
  108264. //
  108265. //
  108266. //
  108267. //
  108268. //
  108269. //
  108270. //
  108271. //
  108272. //
  108273. //
  108274. //
  108275. //
  108276. //
  108277. //
  108278. //
  108279. //
  108280. //
  108281. //
  108282. //
  108283. //
  108284. //
  108285. //
  108286. //
  108287. //
  108288. //
  108289. //
  108290. //
  108291. //
  108292. //
  108293. //
  108294. //
  108295. //
  108296. //
  108297. //
  108298. //
  108299. //
  108300. //
  108301. //
  108302. //
  108303. //
  108304. //
  108305. //
  108306. //
  108307. //
  108308. //
  108309. //
  108310. //
  108311. //
  108312. //
  108313. //
  108314. //
  108315. //
  108316. //
  108317. //
  108318. //
  108319. //
  108320. //
  108321. //
  108322. //
  108323. /* harmony default export */ __webpack_exports__["default"] = ({
  108324. name: 'UserView',
  108325. props: {
  108326. username: {
  108327. default: ''
  108328. },
  108329. delay: {
  108330. type: Number,
  108331. default: 600
  108332. },
  108333. transfer: {
  108334. type: Boolean,
  108335. default: true
  108336. },
  108337. placement: {
  108338. default: 'bottom'
  108339. },
  108340. showimg: {
  108341. type: Boolean,
  108342. default: false
  108343. },
  108344. imgsize: {},
  108345. imgfontsize: {},
  108346. showname: {
  108347. type: Boolean,
  108348. default: true
  108349. },
  108350. info: {
  108351. default: null
  108352. }
  108353. },
  108354. data: function data() {
  108355. return {
  108356. loadIng: true,
  108357. nickname: null,
  108358. userimg: '',
  108359. profession: ''
  108360. };
  108361. },
  108362. mounted: function mounted() {
  108363. this.getUserData(300);
  108364. },
  108365. watch: {
  108366. username: function username() {
  108367. this.getUserData(300);
  108368. },
  108369. info: {
  108370. handler: function handler() {
  108371. this.upInfo();
  108372. },
  108373. deep: true
  108374. }
  108375. },
  108376. computed: {
  108377. userInfo: function userInfo() {
  108378. var username = this.username,
  108379. nickname = this.nickname,
  108380. userimg = this.userimg;
  108381. return { username: username, nickname: nickname, userimg: userimg };
  108382. },
  108383. imgStyle: function imgStyle() {
  108384. var imgsize = this.imgsize,
  108385. imgfontsize = this.imgfontsize;
  108386. var myStyle = {};
  108387. if (imgsize) {
  108388. var size = /^\d+$/.test(imgsize) ? imgsize + 'px' : imgsize;
  108389. myStyle.width = size;
  108390. myStyle.height = size;
  108391. myStyle.lineHeight = size;
  108392. }
  108393. if (imgfontsize) {
  108394. myStyle.fontSize = /^\d+$/.test(imgfontsize) ? imgfontsize + 'px' : imgfontsize;
  108395. }
  108396. return myStyle;
  108397. }
  108398. },
  108399. methods: {
  108400. isJson: function isJson(obj) {
  108401. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
  108402. },
  108403. upInfo: function upInfo() {
  108404. if (this.isJson(this.info)) {
  108405. this.$set(this.info, 'nickname', this.nickname);
  108406. this.$set(this.info, 'userimg', this.userimg);
  108407. }
  108408. },
  108409. getUserData: function getUserData(cacheTime) {
  108410. var _this = this;
  108411. $A.getUserBasic(this.username, function (data, success) {
  108412. if (success) {
  108413. _this.nickname = data.nickname;
  108414. _this.userimg = data.userimg;
  108415. _this.profession = data.profession;
  108416. } else {
  108417. _this.nickname = '';
  108418. _this.userimg = '';
  108419. _this.profession = '';
  108420. }
  108421. _this.loadIng = false;
  108422. _this.$emit("on-result", data);
  108423. _this.upInfo();
  108424. }, cacheTime);
  108425. }
  108426. }
  108427. });
  108428. /***/ }),
  108429. /* 226 */
  108430. /***/ (function(module, exports, __webpack_require__) {
  108431. var render = function() {
  108432. var _vm = this
  108433. var _h = _vm.$createElement
  108434. var _c = _vm._self._c || _h
  108435. return _c(
  108436. "div",
  108437. { staticClass: "user-view-inline" },
  108438. [
  108439. _c(
  108440. "Tooltip",
  108441. {
  108442. attrs: {
  108443. disabled: _vm.loadIng,
  108444. delay: _vm.delay,
  108445. transfer: _vm.transfer,
  108446. placement: _vm.placement,
  108447. maxWidth: "auto"
  108448. },
  108449. on: {
  108450. "on-popper-show": function($event) {
  108451. return _vm.getUserData(30)
  108452. }
  108453. }
  108454. },
  108455. [
  108456. _c(
  108457. "div",
  108458. { staticClass: "user-view-info" },
  108459. [
  108460. _vm.showimg
  108461. ? _c("UserImg", {
  108462. staticClass: "user-view-img",
  108463. style: _vm.imgStyle,
  108464. attrs: { info: _vm.userInfo }
  108465. })
  108466. : _vm._e(),
  108467. _vm._v(" "),
  108468. _vm.showname
  108469. ? _c("div", { staticClass: "user-view-name" }, [
  108470. _vm._v(_vm._s(_vm.nickname || _vm.username))
  108471. ])
  108472. : _vm._e()
  108473. ],
  108474. 1
  108475. ),
  108476. _vm._v(" "),
  108477. _c(
  108478. "div",
  108479. {
  108480. staticStyle: { "white-space": "normal" },
  108481. attrs: { slot: "content" },
  108482. slot: "content"
  108483. },
  108484. [
  108485. !_vm.showname
  108486. ? _c("div", [
  108487. _vm._v(
  108488. _vm._s(_vm.$L("昵称")) +
  108489. ": " +
  108490. _vm._s(_vm.nickname || "-")
  108491. )
  108492. ])
  108493. : _vm._e(),
  108494. _vm._v(" "),
  108495. _c("div", [
  108496. _vm._v(_vm._s(_vm.$L("用户名")) + ": " + _vm._s(_vm.username))
  108497. ]),
  108498. _vm._v(" "),
  108499. _c("div", [
  108500. _vm._v(
  108501. _vm._s(_vm.$L("职位/职称")) +
  108502. ": " +
  108503. _vm._s(_vm.profession || "-")
  108504. )
  108505. ])
  108506. ]
  108507. )
  108508. ]
  108509. )
  108510. ],
  108511. 1
  108512. )
  108513. }
  108514. var staticRenderFns = []
  108515. render._withStripped = true
  108516. module.exports = { render: render, staticRenderFns: staticRenderFns }
  108517. if (false) {
  108518. module.hot.accept()
  108519. if (module.hot.data) {
  108520. require("vue-hot-reload-api") .rerender("data-v-6f741b65", module.exports)
  108521. }
  108522. }
  108523. /***/ }),
  108524. /* 227 */
  108525. /***/ (function(module, exports, __webpack_require__) {
  108526. var disposed = false
  108527. function injectStyle (ssrContext) {
  108528. if (disposed) return
  108529. __webpack_require__(228)
  108530. }
  108531. var normalizeComponent = __webpack_require__(2)
  108532. /* script */
  108533. var __vue_script__ = __webpack_require__(230)
  108534. /* template */
  108535. var __vue_template__ = __webpack_require__(231)
  108536. /* template functional */
  108537. var __vue_template_functional__ = false
  108538. /* styles */
  108539. var __vue_styles__ = injectStyle
  108540. /* scopeId */
  108541. var __vue_scopeId__ = "data-v-6b3af333"
  108542. /* moduleIdentifier (server only) */
  108543. var __vue_module_identifier__ = null
  108544. var Component = normalizeComponent(
  108545. __vue_script__,
  108546. __vue_template__,
  108547. __vue_template_functional__,
  108548. __vue_styles__,
  108549. __vue_scopeId__,
  108550. __vue_module_identifier__
  108551. )
  108552. Component.options.__file = "resources/assets/js/main/components/UserImg.vue"
  108553. /* hot reload */
  108554. if (false) {(function () {
  108555. var hotAPI = require("vue-hot-reload-api")
  108556. hotAPI.install(require("vue"), false)
  108557. if (!hotAPI.compatible) return
  108558. module.hot.accept()
  108559. if (!module.hot.data) {
  108560. hotAPI.createRecord("data-v-6b3af333", Component.options)
  108561. } else {
  108562. hotAPI.reload("data-v-6b3af333", Component.options)
  108563. }
  108564. module.hot.dispose(function (data) {
  108565. disposed = true
  108566. })
  108567. })()}
  108568. module.exports = Component.exports
  108569. /***/ }),
  108570. /* 228 */
  108571. /***/ (function(module, exports, __webpack_require__) {
  108572. // style-loader: Adds some css to the DOM by adding a <style> tag
  108573. // load the styles
  108574. var content = __webpack_require__(229);
  108575. if(typeof content === 'string') content = [[module.i, content, '']];
  108576. if(content.locals) module.exports = content.locals;
  108577. // add the styles to the DOM
  108578. var update = __webpack_require__(1)("33f5f999", content, false, {});
  108579. // Hot Module Replacement
  108580. if(false) {
  108581. // When the styles change, update the <style> tags
  108582. if(!content.locals) {
  108583. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6b3af333\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserImg.vue", function() {
  108584. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-6b3af333\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UserImg.vue");
  108585. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  108586. update(newContent);
  108587. });
  108588. }
  108589. // When the module is disposed, remove the <style> tags
  108590. module.hot.dispose(function() { update(); });
  108591. }
  108592. /***/ }),
  108593. /* 229 */
  108594. /***/ (function(module, exports, __webpack_require__) {
  108595. exports = module.exports = __webpack_require__(0)(false);
  108596. // imports
  108597. // module
  108598. exports.push([module.i, "\n.userimg-container[data-v-6b3af333] {\n display: inline-block;\n max-width: 100%;\n max-height: 100%;\n position: relative;\n overflow: hidden;\n}\n.userimg-container.usering-scale[data-v-6b3af333] {\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n -webkit-transform: scale(1);\n transform: scale(1);\n}\n.userimg-container.usering-scale[data-v-6b3af333]:hover {\n z-index: 1;\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n}\n.userimg-container .userimg-container-img[data-v-6b3af333] {\n width: 100%;\n height: 100%;\n display: table;\n}\n.userimg-container .userimg-container-box[data-v-6b3af333] {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n font-weight: 400;\n color: #ffffff;\n}\n.userimg-container .userimg-container-box .usertext-container-text[data-v-6b3af333] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n overflow: hidden;\n white-space: nowrap;\n}\n", ""]);
  108599. // exports
  108600. /***/ }),
  108601. /* 230 */
  108602. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108603. "use strict";
  108604. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  108605. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  108606. //
  108607. //
  108608. //
  108609. //
  108610. //
  108611. //
  108612. //
  108613. //
  108614. //
  108615. //
  108616. //
  108617. //
  108618. //
  108619. //
  108620. //
  108621. //
  108622. //
  108623. //
  108624. //
  108625. //
  108626. //
  108627. //
  108628. //
  108629. //
  108630. //
  108631. //
  108632. //
  108633. //
  108634. //
  108635. //
  108636. //
  108637. //
  108638. //
  108639. //
  108640. //
  108641. //
  108642. //
  108643. //
  108644. //
  108645. //
  108646. //
  108647. //
  108648. //
  108649. //
  108650. //
  108651. //
  108652. //
  108653. //
  108654. //
  108655. //
  108656. //
  108657. //
  108658. //
  108659. //
  108660. /* harmony default export */ __webpack_exports__["default"] = ({
  108661. name: 'UserImg',
  108662. props: {
  108663. info: {
  108664. default: {} //{username, nickname, userimg}
  108665. },
  108666. size: {},
  108667. scale: {
  108668. type: Boolean,
  108669. default: false
  108670. },
  108671. twoWords: {
  108672. type: Boolean,
  108673. default: false
  108674. },
  108675. showTitle: {
  108676. type: Boolean,
  108677. default: false
  108678. }
  108679. },
  108680. data: function data() {
  108681. return {
  108682. imgError: false,
  108683. againUrl: ''
  108684. };
  108685. },
  108686. computed: {
  108687. textStyle: function textStyle() {
  108688. var style = {
  108689. backgroundColor: '#A0D7F1'
  108690. };
  108691. var size = this.size;
  108692. if (size) {
  108693. style.fontSize = /^\d+$/.test(size) ? size + 'px' : size;
  108694. }
  108695. var username = this.info.username;
  108696. if (username) {
  108697. var bgColor = '';
  108698. for (var i = 0; i < username.length; i++) {
  108699. bgColor += parseInt(username[i].charCodeAt(0), 10).toString(16);
  108700. }
  108701. style.backgroundColor = '#' + bgColor.slice(1, 4);
  108702. }
  108703. return style;
  108704. },
  108705. nameStyle: function nameStyle() {
  108706. var style = {};
  108707. if (this.twoWords) {
  108708. if ((this.userName + "").length >= 2) {
  108709. style.transform = 'scale(0.68)';
  108710. }
  108711. }
  108712. return style;
  108713. },
  108714. userName: function userName() {
  108715. if (!this.isJson(this.info)) {
  108716. return '';
  108717. }
  108718. var name = this.info.send_username || this.info.username;
  108719. if (this.info.nickname && !this.isEmojiPrefix(this.info.nickname)) {
  108720. name = this.info.nickname;
  108721. }
  108722. if (this.twoWords) {
  108723. if (this.allChina(name) && $A.count(name) == 3) {
  108724. return name.substring(1, 3).toLocaleUpperCase();
  108725. } else {
  108726. return (name + " ").substring(0, 2).toLocaleUpperCase();
  108727. }
  108728. } else {
  108729. return (name + " ").substring(0, 1).toLocaleUpperCase();
  108730. }
  108731. },
  108732. fullName: function fullName() {
  108733. if (!this.isJson(this.info)) {
  108734. return '';
  108735. }
  108736. var name = this.info.send_username || this.info.username;
  108737. if (this.info.nickname && !this.isEmojiPrefix(this.info.nickname)) {
  108738. name = this.info.nickname;
  108739. }
  108740. return name;
  108741. },
  108742. userImg: function userImg() {
  108743. if (!this.isJson(this.info)) {
  108744. return '';
  108745. }
  108746. if (this.againUrl) {
  108747. return this.againUrl;
  108748. }
  108749. return this.info.send_userimg || this.info.userimg;
  108750. }
  108751. },
  108752. methods: {
  108753. isJson: function isJson(obj) {
  108754. return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) == "object" && Object.prototype.toString.call(obj).toLowerCase() == "[object object]" && typeof obj.length == "undefined";
  108755. },
  108756. isShowImg: function isShowImg(url) {
  108757. return !!(url && !$A.rightExists(url, 'images/other/avatar.png'));
  108758. },
  108759. isEmojiPrefix: function isEmojiPrefix(text) {
  108760. return (/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(text)
  108761. );
  108762. },
  108763. allChina: function allChina(str) {
  108764. if (/^[\u4e00-\u9fa5]+$/.test(str)) {
  108765. return true; //全是中文
  108766. } else {
  108767. return false;
  108768. }
  108769. },
  108770. loadError: function loadError() {
  108771. if (!this.againUrl) {
  108772. if ($A.rightExists(this.userImg, 'images/other/system-message.png')) {
  108773. this.againUrl = $A.fillUrl('images/other/system-message.png');
  108774. return;
  108775. } else if ($A.rightExists(this.userImg, 'images/other/group.png')) {
  108776. this.againUrl = $A.fillUrl('images/other/group.png');
  108777. return;
  108778. }
  108779. }
  108780. this.imgError = true;
  108781. },
  108782. onClick: function onClick(e) {
  108783. this.$emit('click', e);
  108784. }
  108785. }
  108786. });
  108787. /***/ }),
  108788. /* 231 */
  108789. /***/ (function(module, exports, __webpack_require__) {
  108790. var render = function() {
  108791. var _vm = this
  108792. var _h = _vm.$createElement
  108793. var _c = _vm._self._c || _h
  108794. return _c(
  108795. "div",
  108796. {
  108797. staticClass: "userimg-container",
  108798. class: { "usering-scale": _vm.scale },
  108799. attrs: { title: _vm.showTitle ? _vm.fullName : "" },
  108800. on: { click: _vm.onClick }
  108801. },
  108802. [
  108803. this.isJson(_vm.info)
  108804. ? [
  108805. _vm.isShowImg(_vm.userImg) && !_vm.imgError
  108806. ? _c("img", {
  108807. staticClass: "userimg-container-img",
  108808. attrs: { src: _vm.userImg },
  108809. on: { error: _vm.loadError }
  108810. })
  108811. : _c(
  108812. "div",
  108813. {
  108814. staticClass: "userimg-container-box",
  108815. style: _vm.textStyle
  108816. },
  108817. [
  108818. _c(
  108819. "div",
  108820. {
  108821. staticClass: "usertext-container-text",
  108822. style: _vm.nameStyle
  108823. },
  108824. [_vm._v(_vm._s(_vm.userName))]
  108825. )
  108826. ]
  108827. )
  108828. ]
  108829. : _vm._e()
  108830. ],
  108831. 2
  108832. )
  108833. }
  108834. var staticRenderFns = []
  108835. render._withStripped = true
  108836. module.exports = { render: render, staticRenderFns: staticRenderFns }
  108837. if (false) {
  108838. module.hot.accept()
  108839. if (module.hot.data) {
  108840. require("vue-hot-reload-api") .rerender("data-v-6b3af333", module.exports)
  108841. }
  108842. }
  108843. /***/ }),
  108844. /* 232 */
  108845. /***/ (function(module, exports, __webpack_require__) {
  108846. var disposed = false
  108847. function injectStyle (ssrContext) {
  108848. if (disposed) return
  108849. __webpack_require__(233)
  108850. }
  108851. var normalizeComponent = __webpack_require__(2)
  108852. /* script */
  108853. var __vue_script__ = __webpack_require__(235)
  108854. /* template */
  108855. var __vue_template__ = __webpack_require__(236)
  108856. /* template functional */
  108857. var __vue_template_functional__ = false
  108858. /* styles */
  108859. var __vue_styles__ = injectStyle
  108860. /* scopeId */
  108861. var __vue_scopeId__ = "data-v-3f1dd09a"
  108862. /* moduleIdentifier (server only) */
  108863. var __vue_module_identifier__ = null
  108864. var Component = normalizeComponent(
  108865. __vue_script__,
  108866. __vue_template__,
  108867. __vue_template_functional__,
  108868. __vue_styles__,
  108869. __vue_scopeId__,
  108870. __vue_module_identifier__
  108871. )
  108872. Component.options.__file = "resources/assets/js/main/components/WLoading.vue"
  108873. /* hot reload */
  108874. if (false) {(function () {
  108875. var hotAPI = require("vue-hot-reload-api")
  108876. hotAPI.install(require("vue"), false)
  108877. if (!hotAPI.compatible) return
  108878. module.hot.accept()
  108879. if (!module.hot.data) {
  108880. hotAPI.createRecord("data-v-3f1dd09a", Component.options)
  108881. } else {
  108882. hotAPI.reload("data-v-3f1dd09a", Component.options)
  108883. }
  108884. module.hot.dispose(function (data) {
  108885. disposed = true
  108886. })
  108887. })()}
  108888. module.exports = Component.exports
  108889. /***/ }),
  108890. /* 233 */
  108891. /***/ (function(module, exports, __webpack_require__) {
  108892. // style-loader: Adds some css to the DOM by adding a <style> tag
  108893. // load the styles
  108894. var content = __webpack_require__(234);
  108895. if(typeof content === 'string') content = [[module.i, content, '']];
  108896. if(content.locals) module.exports = content.locals;
  108897. // add the styles to the DOM
  108898. var update = __webpack_require__(1)("6e0ddf92", content, false, {});
  108899. // Hot Module Replacement
  108900. if(false) {
  108901. // When the styles change, update the <style> tags
  108902. if(!content.locals) {
  108903. module.hot.accept("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f1dd09a\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WLoading.vue", function() {
  108904. var newContent = require("!!../../../../../node_modules/css-loader/index.js!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-3f1dd09a\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./WLoading.vue");
  108905. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  108906. update(newContent);
  108907. });
  108908. }
  108909. // When the module is disposed, remove the <style> tags
  108910. module.hot.dispose(function() { update(); });
  108911. }
  108912. /***/ }),
  108913. /* 234 */
  108914. /***/ (function(module, exports, __webpack_require__) {
  108915. exports = module.exports = __webpack_require__(0)(false);
  108916. // imports
  108917. // module
  108918. exports.push([module.i, "\n.w-loading[data-v-3f1dd09a] {\n -webkit-animation: rotate-data-v-3f1dd09a 2s linear infinite;\n animation: rotate-data-v-3f1dd09a 2s linear infinite;\n -webkit-transform-origin: center center;\n transform-origin: center center;\n width: 30px;\n height: 30px;\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n overflow: hidden;\n}\n.w-loading .w-path[data-v-3f1dd09a] {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n -webkit-animation: dash-data-v-3f1dd09a 1.5s ease-in-out infinite,color-data-v-3f1dd09a 6s ease-in-out infinite;\n animation: dash-data-v-3f1dd09a 1.5s ease-in-out infinite,color-data-v-3f1dd09a 6s ease-in-out infinite;\n stroke-linecap: round;\n}\n@-webkit-keyframes rotate-data-v-3f1dd09a {\nto {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n}\n}\n@keyframes rotate-data-v-3f1dd09a {\nto {\n -webkit-transform: rotate(1turn);\n transform: rotate(1turn);\n}\n}\n@-webkit-keyframes dash-data-v-3f1dd09a {\n0% {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -35;\n}\nto {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -124;\n}\n}\n@keyframes dash-data-v-3f1dd09a {\n0% {\n stroke-dasharray: 1,200;\n stroke-dashoffset: 0;\n}\n50% {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -35;\n}\nto {\n stroke-dasharray: 89,200;\n stroke-dashoffset: -124;\n}\n}\n@-webkit-keyframes color-data-v-3f1dd09a {\n0%, to {\n stroke: #d62d20;\n}\n40% {\n stroke: #0057e7;\n}\n66% {\n stroke: #008744;\n}\n80%, 90% {\n stroke: #ffa700;\n}\n}\n@keyframes color-data-v-3f1dd09a {\n0%, to {\n stroke: #d62d20;\n}\n40% {\n stroke: #0057e7;\n}\n66% {\n stroke: #008744;\n}\n80%, 90% {\n stroke: #ffa700;\n}\n}\n", ""]);
  108919. // exports
  108920. /***/ }),
  108921. /* 235 */
  108922. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  108923. "use strict";
  108924. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  108925. //
  108926. //
  108927. //
  108928. //
  108929. //
  108930. //
  108931. //
  108932. //
  108933. //
  108934. //
  108935. //
  108936. //
  108937. //
  108938. //
  108939. //
  108940. //
  108941. //
  108942. //
  108943. //
  108944. //
  108945. //
  108946. //
  108947. //
  108948. //
  108949. //
  108950. //
  108951. //
  108952. //
  108953. //
  108954. //
  108955. //
  108956. //
  108957. //
  108958. //
  108959. //
  108960. //
  108961. //
  108962. //
  108963. //
  108964. //
  108965. //
  108966. //
  108967. //
  108968. //
  108969. //
  108970. //
  108971. //
  108972. //
  108973. //
  108974. //
  108975. //
  108976. //
  108977. //
  108978. //
  108979. //
  108980. //
  108981. //
  108982. //
  108983. //
  108984. //
  108985. //
  108986. //
  108987. //
  108988. //
  108989. //
  108990. //
  108991. //
  108992. //
  108993. //
  108994. //
  108995. //
  108996. //
  108997. //
  108998. //
  108999. //
  109000. //
  109001. //
  109002. //
  109003. //
  109004. //
  109005. //
  109006. //
  109007. //
  109008. //
  109009. //
  109010. //
  109011. //
  109012. //
  109013. //
  109014. //
  109015. //
  109016. //
  109017. //
  109018. //
  109019. //
  109020. //
  109021. //
  109022. //
  109023. //
  109024. //
  109025. //
  109026. //
  109027. //
  109028. /* harmony default export */ __webpack_exports__["default"] = ({
  109029. name: 'WLoading'
  109030. });
  109031. /***/ }),
  109032. /* 236 */
  109033. /***/ (function(module, exports, __webpack_require__) {
  109034. var render = function() {
  109035. var _vm = this
  109036. var _h = _vm.$createElement
  109037. var _c = _vm._self._c || _h
  109038. return _c(
  109039. "svg",
  109040. { staticClass: "w-loading", attrs: { viewBox: "25 25 50 50" } },
  109041. [
  109042. _c("circle", {
  109043. staticClass: "w-path",
  109044. attrs: {
  109045. cx: "50",
  109046. cy: "50",
  109047. r: "20",
  109048. fill: "none",
  109049. "stroke-width": "5",
  109050. "stroke-miterlimit": "10"
  109051. }
  109052. })
  109053. ]
  109054. )
  109055. }
  109056. var staticRenderFns = []
  109057. render._withStripped = true
  109058. module.exports = { render: render, staticRenderFns: staticRenderFns }
  109059. if (false) {
  109060. module.hot.accept()
  109061. if (module.hot.data) {
  109062. require("vue-hot-reload-api") .rerender("data-v-3f1dd09a", module.exports)
  109063. }
  109064. }
  109065. /***/ }),
  109066. /* 237 */
  109067. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109068. "use strict";
  109069. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  109070. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  109071. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue__ = __webpack_require__(238);
  109072. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__detail_vue__);
  109073. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  109074. function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
  109075. function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); }
  109076. var detailElement = function detailElement(taskid) {
  109077. var detail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  109078. var cloneData = function cloneData(myObj) {
  109079. if ((typeof myObj === 'undefined' ? 'undefined' : _typeof(myObj)) !== 'object') return myObj;
  109080. if (myObj === null) return myObj;
  109081. //
  109082. if (typeof myObj.length === 'number') {
  109083. var _myObj = _toArray(myObj),
  109084. myNewObj = _myObj.slice(0);
  109085. return myNewObj;
  109086. } else {
  109087. var _myNewObj = _objectWithoutProperties(myObj, []);
  109088. return _myNewObj;
  109089. }
  109090. };
  109091. var isArray = function isArray(myObj) {
  109092. return Object.prototype.toString.call(myObj) == '[object Array]';
  109093. };
  109094. return new Promise(function () {
  109095. var custom = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.extend(__WEBPACK_IMPORTED_MODULE_1__detail_vue___default.a);
  109096. if ((typeof taskid === 'undefined' ? 'undefined' : _typeof(taskid)) === 'object' && taskid !== null) {
  109097. detail = cloneData(taskid);
  109098. taskid = parseInt(taskid.id);
  109099. if (isNaN(taskid)) {
  109100. taskid = 0;
  109101. }
  109102. }
  109103. if ((typeof detail === 'undefined' ? 'undefined' : _typeof(detail)) !== 'object' || detail === null) {
  109104. detail = {};
  109105. }
  109106. if (typeof taskid === "number") {
  109107. detail.taskid = taskid;
  109108. }
  109109. if (!isArray(detail.subtask)) {
  109110. detail.subtask = [];
  109111. }
  109112. var data = {
  109113. taskid: taskid,
  109114. detail: detail
  109115. };
  109116. var instance = new custom({
  109117. data: data
  109118. });
  109119. instance.$mount();
  109120. document.body.appendChild(instance.$el);
  109121. });
  109122. };
  109123. /* harmony default export */ __webpack_exports__["a"] = (detailElement);
  109124. /***/ }),
  109125. /* 238 */
  109126. /***/ (function(module, exports, __webpack_require__) {
  109127. var disposed = false
  109128. function injectStyle (ssrContext) {
  109129. if (disposed) return
  109130. __webpack_require__(239)
  109131. __webpack_require__(241)
  109132. }
  109133. var normalizeComponent = __webpack_require__(2)
  109134. /* script */
  109135. var __vue_script__ = __webpack_require__(243)
  109136. /* template */
  109137. var __vue_template__ = __webpack_require__(281)
  109138. /* template functional */
  109139. var __vue_template_functional__ = false
  109140. /* styles */
  109141. var __vue_styles__ = injectStyle
  109142. /* scopeId */
  109143. var __vue_scopeId__ = "data-v-57fd86f0"
  109144. /* moduleIdentifier (server only) */
  109145. var __vue_module_identifier__ = null
  109146. var Component = normalizeComponent(
  109147. __vue_script__,
  109148. __vue_template__,
  109149. __vue_template_functional__,
  109150. __vue_styles__,
  109151. __vue_scopeId__,
  109152. __vue_module_identifier__
  109153. )
  109154. Component.options.__file = "resources/assets/js/main/components/project/task/detail/detail.vue"
  109155. /* hot reload */
  109156. if (false) {(function () {
  109157. var hotAPI = require("vue-hot-reload-api")
  109158. hotAPI.install(require("vue"), false)
  109159. if (!hotAPI.compatible) return
  109160. module.hot.accept()
  109161. if (!module.hot.data) {
  109162. hotAPI.createRecord("data-v-57fd86f0", Component.options)
  109163. } else {
  109164. hotAPI.reload("data-v-57fd86f0", Component.options)
  109165. }
  109166. module.hot.dispose(function (data) {
  109167. disposed = true
  109168. })
  109169. })()}
  109170. module.exports = Component.exports
  109171. /***/ }),
  109172. /* 239 */
  109173. /***/ (function(module, exports, __webpack_require__) {
  109174. // style-loader: Adds some css to the DOM by adding a <style> tag
  109175. // load the styles
  109176. var content = __webpack_require__(240);
  109177. if(typeof content === 'string') content = [[module.i, content, '']];
  109178. if(content.locals) module.exports = content.locals;
  109179. // add the styles to the DOM
  109180. var update = __webpack_require__(1)("4d2f9578", content, false, {});
  109181. // Hot Module Replacement
  109182. if(false) {
  109183. // When the styles change, update the <style> tags
  109184. if(!content.locals) {
  109185. module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./detail.vue", function() {
  109186. var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./detail.vue");
  109187. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  109188. update(newContent);
  109189. });
  109190. }
  109191. // When the module is disposed, remove the <style> tags
  109192. module.hot.dispose(function() { update(); });
  109193. }
  109194. /***/ }),
  109195. /* 240 */
  109196. /***/ (function(module, exports, __webpack_require__) {
  109197. exports = module.exports = __webpack_require__(0)(false);
  109198. // imports
  109199. // module
  109200. exports.push([module.i, "\n.project-task-detail-window .detail-title-box .detail-title-input textarea {\n margin: -7px 0 3px -2px;\n font-size: 20px;\n font-weight: 600;\n border: 2px solid #ffffff;\n padding: 2px;\n cursor: pointer;\n color: #172b4d;\n background: #ffffff;\n width: 100%;\n border-radius: 3px;\n resize: none;\n}\n.project-task-detail-window .detail-subtask-input {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n border: 0;\n background: #ffffff;\n margin-left: 2px;\n border-bottom: 1px solid #f6f6f6;\n}\n.project-task-detail-window .detail-subtask-input textarea {\n border: 0;\n -webkit-box-shadow: none;\n box-shadow: none;\n outline: none;\n resize: none;\n min-height: auto;\n padding-left: 0;\n padding-right: 0;\n}\n.project-task-detail-window .detail-subtask-input textarea:focus {\n color: #333333;\n}\n.project-task-detail-window .detail-subtask-input.subtask-complete textarea {\n text-decoration: line-through;\n color: #999;\n}\n", ""]);
  109201. // exports
  109202. /***/ }),
  109203. /* 241 */
  109204. /***/ (function(module, exports, __webpack_require__) {
  109205. // style-loader: Adds some css to the DOM by adding a <style> tag
  109206. // load the styles
  109207. var content = __webpack_require__(242);
  109208. if(typeof content === 'string') content = [[module.i, content, '']];
  109209. if(content.locals) module.exports = content.locals;
  109210. // add the styles to the DOM
  109211. var update = __webpack_require__(1)("4f5f86a8", content, false, {});
  109212. // Hot Module Replacement
  109213. if(false) {
  109214. // When the styles change, update the <style> tags
  109215. if(!content.locals) {
  109216. module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./detail.vue", function() {
  109217. var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-57fd86f0\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./detail.vue");
  109218. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  109219. update(newContent);
  109220. });
  109221. }
  109222. // When the module is disposed, remove the <style> tags
  109223. module.hot.dispose(function() { update(); });
  109224. }
  109225. /***/ }),
  109226. /* 242 */
  109227. /***/ (function(module, exports, __webpack_require__) {
  109228. exports = module.exports = __webpack_require__(0)(false);
  109229. // imports
  109230. // module
  109231. exports.push([module.i, "\n.project-task-detail-window[data-v-57fd86f0] {\n position: fixed;\n z-index: 1001;\n top: 0;\n left: 0;\n height: 100%;\n width: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n -webkit-transition: all .3s;\n transition: all .3s;\n opacity: 0;\n pointer-events: unset;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.project-task-detail-window.task-detail-show[data-v-57fd86f0] {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-bg[data-v-57fd86f0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: -1;\n}\n.project-task-detail-window .task-detail-main[data-v-57fd86f0] {\n position: relative;\n z-index: 1;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n width: 92%;\n max-width: 800px;\n max-height: 92%;\n background: #ffffff;\n overflow: visible;\n border-radius: 4px;\n padding: 10px 20px 2px;\n -webkit-transform: translateZ(0);\n transform: translateZ(0);\n}\n.project-task-detail-window .task-detail-main .detail-left[data-v-57fd86f0] {\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1;\n padding: 0 8px;\n overflow: auto;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2[data-v-57fd86f0] {\n color: #172b4d;\n font-size: 16px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n line-height: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong[data-v-57fd86f0] {\n font-size: 14px;\n font-weight: normal;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong.link[data-v-57fd86f0] {\n cursor: pointer;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 strong.active[data-v-57fd86f0] {\n font-size: 16px;\n font-weight: bold;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 em[data-v-57fd86f0] {\n margin: 0 9px;\n width: 1px;\n height: 10px;\n background: #cccccc;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n right: 12px;\n top: 50%;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button:hover .detail-button-batch[data-v-57fd86f0] {\n display: inline-block;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-btn[data-v-57fd86f0],\n .project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0] {\n font-size: 12px;\n opacity: 0.9;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n margin-left: 5px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-btn[data-v-57fd86f0]:hover,\n .project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0]:hover {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-h2 .detail-button .detail-button-batch[data-v-57fd86f0] {\n display: none;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0] {\n position: relative;\n padding-left: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0]:before {\n font-family: zenicon;\n font-size: 20px;\n color: #42526e;\n font-weight: 600;\n position: absolute;\n top: 0;\n left: 0;\n width: 26px;\n height: 26px;\n line-height: 26px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box[data-v-57fd86f0] {\n margin-top: 12px;\n margin-bottom: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box[data-v-57fd86f0]:before {\n content: \"\\E740\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle[data-v-57fd86f0] {\n padding-top: 3px;\n font-size: 12px;\n color: #606266;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle .project-title[data-v-57fd86f0] {\n cursor: pointer;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-title-box .subtitle .project-title[data-v-57fd86f0]:hover {\n color: #57a3f3;\n text-decoration: underline;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-desc-box[data-v-57fd86f0]:before {\n content: \"\\E75E\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box[data-v-57fd86f0] {\n margin-bottom: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li[data-v-57fd86f0] {\n color: #606266;\n font-size: 14px;\n line-height: 32px;\n word-break: break-all;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li[data-v-57fd86f0]:before {\n font-weight: normal;\n color: #606266;\n font-size: 14px;\n padding-left: 4px;\n line-height: 32px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-time[data-v-57fd86f0]:before {\n content: \"\\E706\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username[data-v-57fd86f0]:before {\n content: \"\\E903\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-no[data-v-57fd86f0] {\n display: inline-block;\n color: #888888;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-button[data-v-57fd86f0] {\n font-size: 12px;\n margin-left: 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-username .uname-text[data-v-57fd86f0] {\n line-height: 24px;\n color: #666666;\n font-size: 12px;\n margin-left: 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower[data-v-57fd86f0]:before {\n content: \"\\E90D\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower .ivu-tag[data-v-57fd86f0] {\n padding: 0 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-follower .user-view-inline[data-v-57fd86f0] {\n height: 20px;\n line-height: 20px;\n vertical-align: top;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-level[data-v-57fd86f0]:before {\n content: \"\\E725\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li.text-status[data-v-57fd86f0]:before {\n content: \"\\E6AF\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > span[data-v-57fd86f0] {\n white-space: nowrap;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em[data-v-57fd86f0] {\n margin-left: 4px;\n padding-top: 5px;\n line-height: 22px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p1[data-v-57fd86f0] {\n color: #ed3f14;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p2[data-v-57fd86f0] {\n color: #ff9900;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p3[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.p4[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.complete[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.complete .completedate[data-v-57fd86f0] {\n font-size: 12px;\n padding-left: 4px;\n opacity: 0.6;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.overdue[data-v-57fd86f0],\n .project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em > em.overdue[data-v-57fd86f0] {\n color: #ff0000;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-text-box li > em.unfinished[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-file-box[data-v-57fd86f0]:before {\n content: \"\\E8B9\";\n font-size: 16px;\n padding-left: 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-icon[data-v-57fd86f0]:before {\n content: \"\\E819\";\n font-size: 16px;\n padding-left: 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box[data-v-57fd86f0] {\n padding: 12px;\n margin-bottom: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-progress[data-v-57fd86f0] {\n margin: 2px 0 6px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n margin: 0 2px 0 -6px;\n padding-top: 4px;\n padding-left: 8px;\n position: relative;\n background-color: #ffffff;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item:hover .detail-subtask-right[data-v-57fd86f0] {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right[data-v-57fd86f0] {\n opacity: 0;\n position: absolute;\n top: 50%;\n right: 0;\n padding: 0 6px;\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%);\n background: #ffffff;\n border-radius: 3px 0 0 3px;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n cursor: pointer;\n -webkit-box-shadow: -3px 0px 3px 0px rgba(45, 45, 45, 0.1);\n box-shadow: -3px 0px 3px 0px rgba(45, 45, 45, 0.1);\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right .detail-subtask-ricon[data-v-57fd86f0] {\n display: inline-block;\n opacity: 0.9;\n width: 18px;\n height: 26px;\n line-height: 26px;\n font-size: 16px;\n text-align: center;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-item .detail-subtask-right .detail-subtask-ricon[data-v-57fd86f0]:hover {\n opacity: 1;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-subtask-box .detail-subtask-none[data-v-57fd86f0] {\n color: #666666;\n padding: 0 12px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-comment-box[data-v-57fd86f0]:before {\n content: \"\\E753\";\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-footer-box[data-v-57fd86f0] {\n border-top: 1px solid #e5e5e5;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n padding-top: 20px;\n padding-bottom: 16px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-footer-box .comment-input[data-v-57fd86f0] {\n margin-right: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-right[data-v-57fd86f0] {\n margin: 38px 0 6px;\n padding-left: 12px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.project-task-detail-window .task-detail-main .detail-right .block[data-v-57fd86f0] {\n display: block;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p1[data-v-57fd86f0] {\n color: #ed3f14;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p2[data-v-57fd86f0] {\n color: #ff9900;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p3[data-v-57fd86f0] {\n color: #19be6b;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .p4[data-v-57fd86f0] {\n color: #666666;\n}\n.project-task-detail-window .task-detail-main .detail-right .block .checkmark[data-v-57fd86f0] {\n margin-left: 8px;\n margin-right: -8px;\n}\n.project-task-detail-window .task-detail-main .detail-right .btn[data-v-57fd86f0] {\n display: block;\n width: 118px;\n text-align: left;\n margin-top: 8px;\n padding-left: 10px;\n padding-right: 10px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.project-task-detail-window .task-detail-main .detail-complete[data-v-57fd86f0] {\n display: inline-block;\n pointer-events: none;\n position: absolute;\n top: 6px;\n right: 23%;\n font-size: 72px;\n color: #19be6b;\n opacity: 0.2;\n z-index: 1;\n}\n.project-task-detail-window .task-detail-main .detail-menu[data-v-57fd86f0] {\n display: none;\n position: absolute;\n top: 10px;\n right: 64px;\n text-align: right;\n width: auto;\n height: 38px;\n z-index: 5;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.project-task-detail-window .task-detail-main .detail-cancel[data-v-57fd86f0] {\n position: absolute;\n top: 10px;\n right: 20px;\n text-align: right;\n width: auto;\n height: 38px;\n z-index: 5;\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0] {\n display: inline-block;\n width: 38px;\n height: 38px;\n cursor: pointer;\n border-radius: 50%;\n -webkit-transform: scale(0.92);\n transform: scale(0.92);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:after, .project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:before {\n position: absolute;\n content: \"\";\n top: 50%;\n left: 50%;\n width: 2px;\n height: 20px;\n background-color: #EE2321;\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n -webkit-transition: all .2s;\n transition: all .2s;\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:before {\n position: absolute;\n -webkit-transform: translate(-50%, -50%) rotate(-45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(-45deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:after, .project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:before {\n background-color: #ff0000;\n -webkit-transform: translate(-50%, -50%) rotate(135deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(135deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-cancel em[data-v-57fd86f0]:hover:before {\n background-color: #ff0000;\n -webkit-transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n transform: translate(-50%, -50%) rotate(45deg) scale(0.6, 1);\n}\n.project-task-detail-window .task-detail-main .detail-drag-over[data-v-57fd86f0] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 6;\n background-color: rgba(255, 255, 255, 0.78);\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n border-radius: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-drag-over[data-v-57fd86f0]:before {\n content: \"\";\n position: absolute;\n top: 16px;\n left: 16px;\n right: 16px;\n bottom: 16px;\n border: 2px dashed #7b7b7b;\n border-radius: 12px;\n}\n.project-task-detail-window .task-detail-main .detail-drag-over .detail-drag-text[data-v-57fd86f0] {\n padding: 12px;\n font-size: 18px;\n color: #666666;\n}\n@media (max-width: 768px) {\n.project-task-detail-window .task-detail-main[data-v-57fd86f0] {\n padding: 10px 12px 2px;\n}\n.project-task-detail-window .task-detail-main .detail-left[data-v-57fd86f0] {\n margin-top: 32px;\n}\n.project-task-detail-window .task-detail-main .detail-left .detail-icon[data-v-57fd86f0] {\n padding-left: 22px;\n}\n.project-task-detail-window .task-detail-main .detail-right[data-v-57fd86f0] {\n -webkit-transform: translate(200%, 0);\n transform: translate(200%, 0);\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n padding: 48px 18px;\n background: #ffffff;\n -webkit-box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);\n box-shadow: 0 1px 6px 0 rgba(32, 33, 36, 0.28);\n z-index: 4;\n -webkit-transition: all 0.3s;\n transition: all 0.3s;\n border-top-right-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.project-task-detail-window .task-detail-main .detail-right.open-menu[data-v-57fd86f0] {\n -webkit-transform: translate(0, 0);\n transform: translate(0, 0);\n}\n.project-task-detail-window .task-detail-main .detail-menu[data-v-57fd86f0] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n}\n}\n", ""]);
  109232. // exports
  109233. /***/ }),
  109234. /* 243 */
  109235. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  109236. "use strict";
  109237. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  109238. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logs__ = __webpack_require__(59);
  109239. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__logs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__logs__);
  109240. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__files__ = __webpack_require__(58);
  109241. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__files___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__files__);
  109242. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuedraggable__ = __webpack_require__(51);
  109243. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vuedraggable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vuedraggable__);
  109244. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep__ = __webpack_require__(244);
  109245. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep__);
  109246. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WInput__ = __webpack_require__(269);
  109247. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__iview_WInput___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__iview_WInput__);
  109248. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DescEditor__ = __webpack_require__(274);
  109249. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__DescEditor___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__DescEditor__);
  109250. //
  109251. //
  109252. //
  109253. //
  109254. //
  109255. //
  109256. //
  109257. //
  109258. //
  109259. //
  109260. //
  109261. //
  109262. //
  109263. //
  109264. //
  109265. //
  109266. //
  109267. //
  109268. //
  109269. //
  109270. //
  109271. //
  109272. //
  109273. //
  109274. //
  109275. //
  109276. //
  109277. //
  109278. //
  109279. //
  109280. //
  109281. //
  109282. //
  109283. //
  109284. //
  109285. //
  109286. //
  109287. //
  109288. //
  109289. //
  109290. //
  109291. //
  109292. //
  109293. //
  109294. //
  109295. //
  109296. //
  109297. //
  109298. //
  109299. //
  109300. //
  109301. //
  109302. //
  109303. //
  109304. //
  109305. //
  109306. //
  109307. //
  109308. //
  109309. //
  109310. //
  109311. //
  109312. //
  109313. //
  109314. //
  109315. //
  109316. //
  109317. //
  109318. //
  109319. //
  109320. //
  109321. //
  109322. //
  109323. //
  109324. //
  109325. //
  109326. //
  109327. //
  109328. //
  109329. //
  109330. //
  109331. //
  109332. //
  109333. //
  109334. //
  109335. //
  109336. //
  109337. //
  109338. //
  109339. //
  109340. //
  109341. //
  109342. //
  109343. //
  109344. //
  109345. //
  109346. //
  109347. //
  109348. //
  109349. //
  109350. //
  109351. //
  109352. //
  109353. //
  109354. //
  109355. //
  109356. //
  109357. //
  109358. //
  109359. //
  109360. //
  109361. //
  109362. //
  109363. //
  109364. //
  109365. //
  109366. //
  109367. //
  109368. //
  109369. //
  109370. //
  109371. //
  109372. //
  109373. //
  109374. //
  109375. //
  109376. //
  109377. //
  109378. //
  109379. //
  109380. //
  109381. //
  109382. //
  109383. //
  109384. //
  109385. //
  109386. //
  109387. //
  109388. //
  109389. //
  109390. //
  109391. //
  109392. //
  109393. //
  109394. //
  109395. //
  109396. //
  109397. //
  109398. //
  109399. //
  109400. //
  109401. //
  109402. //
  109403. //
  109404. //
  109405. //
  109406. //
  109407. //
  109408. //
  109409. //
  109410. //
  109411. //
  109412. //
  109413. //
  109414. //
  109415. //
  109416. //
  109417. //
  109418. //
  109419. //
  109420. //
  109421. //
  109422. //
  109423. //
  109424. //
  109425. //
  109426. //
  109427. //
  109428. //
  109429. //
  109430. //
  109431. //
  109432. //
  109433. //
  109434. //
  109435. //
  109436. //
  109437. //
  109438. //
  109439. //
  109440. //
  109441. //
  109442. //
  109443. //
  109444. //
  109445. //
  109446. //
  109447. //
  109448. //
  109449. //
  109450. //
  109451. //
  109452. //
  109453. //
  109454. //
  109455. //
  109456. //
  109457. //
  109458. //
  109459. //
  109460. //
  109461. //
  109462. //
  109463. //
  109464. //
  109465. //
  109466. //
  109467. //
  109468. //
  109469. //
  109470. //
  109471. //
  109472. //
  109473. //
  109474. //
  109475. //
  109476. //
  109477. //
  109478. //
  109479. //
  109480. //
  109481. //
  109482. //
  109483. //
  109484. //
  109485. //
  109486. //
  109487. //
  109488. //
  109489. //
  109490. //
  109491. //
  109492. //
  109493. //
  109494. /* harmony default export */ __webpack_exports__["default"] = ({
  109495. components: { DescEditor: __WEBPACK_IMPORTED_MODULE_5__DescEditor___default.a, WInput: __WEBPACK_IMPORTED_MODULE_4__iview_WInput___default.a, ProjectTaskFiles: __WEBPACK_IMPORTED_MODULE_1__files___default.a, ProjectTaskLogs: __WEBPACK_IMPORTED_MODULE_0__logs___default.a, draggable: __WEBPACK_IMPORTED_MODULE_2_vuedraggable___default.a },
  109496. data: function data() {
  109497. return {
  109498. taskid: 0,
  109499. detail: {},
  109500. detailDragOver: false,
  109501. visible: false,
  109502. subwinVisible: 0,
  109503. urlProjectid: 0,
  109504. bakData: {},
  109505. loadData: {},
  109506. loadRand: {},
  109507. commentText: '',
  109508. logType: '评论',
  109509. timeValue: [],
  109510. timeOptions: {},
  109511. openMenu: false,
  109512. isAdmin: false,
  109513. linkData: []
  109514. };
  109515. },
  109516. beforeCreate: function beforeCreate() {
  109517. var doms = document.querySelectorAll('.project-task-detail-window');
  109518. for (var i = 0; i < doms.length; ++i) {
  109519. if (doms[i].parentNode != null) doms[i].parentNode.removeChild(doms[i]);
  109520. }
  109521. },
  109522. mounted: function mounted() {
  109523. var _this = this;
  109524. var match = (window.location.pathname + "").match(/\/project\/panel\/(\d+)$/i);
  109525. this.urlProjectid = match ? match[1] : 0;
  109526. //
  109527. this.$nextTick(function () {
  109528. var dom = _this.$el;
  109529. if (parseInt(_this.taskid) === 0) {
  109530. if (dom.parentNode != null) dom.parentNode.removeChild(dom);
  109531. return;
  109532. }
  109533. //
  109534. dom.addEventListener('transitionend', function () {
  109535. if (dom !== null && dom.parentNode !== null && !_this.visible) {
  109536. dom.parentNode.removeChild(dom);
  109537. }
  109538. }, false);
  109539. //
  109540. setTimeout(function () {
  109541. _this.visible = true;
  109542. }, 0);
  109543. });
  109544. this.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail);
  109545. this.getTaskDetail("mounted");
  109546. //
  109547. $A.setOnTaskInfoListener('components/project/task/detail', function (act, detail) {
  109548. if (detail.id != _this.taskid) {
  109549. return;
  109550. }
  109551. if (detail.__modifyUsername == _this.usrName) {
  109552. return;
  109553. }
  109554. _this.getTaskDetail("setOnTaskInfoListener");
  109555. }, true);
  109556. },
  109557. watch: {
  109558. taskid: function taskid() {
  109559. this.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail);
  109560. this.getTaskDetail("watch");
  109561. }
  109562. },
  109563. computed: {
  109564. subtaskProgress: function subtaskProgress() {
  109565. var countLists = this.detail.subtask;
  109566. if (countLists.length === 0) {
  109567. return 0;
  109568. }
  109569. var completeLists = countLists.filter(function (item) {
  109570. return item.status == 'complete';
  109571. });
  109572. return parseFloat((completeLists.length / countLists.length * 100).toFixed(2));
  109573. }
  109574. },
  109575. methods: {
  109576. php_time: function php_time(time) {
  109577. var now = new Date(time * 1000);
  109578. var year = now.getFullYear();
  109579. var month = now.getMonth() + 1;
  109580. var date = now.getDate();
  109581. var hour = now.getHours();
  109582. var minute = now.getMinutes();
  109583. var second = now.getSeconds();
  109584. return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
  109585. },
  109586. initLanguage: function initLanguage() {
  109587. this.isAdmin = $A.identity('admin');
  109588. var lastSecond = function lastSecond(e) {
  109589. return new Date($A.formatDate("Y-m-d 23:59:29", Math.round(e / 1000)));
  109590. };
  109591. this.timeOptions = {
  109592. shortcuts: [{
  109593. text: this.$L('今天'),
  109594. value: function value() {
  109595. return [new Date(), lastSecond(new Date().getTime())];
  109596. }
  109597. }, {
  109598. text: this.$L('明天'),
  109599. value: function value() {
  109600. var e = new Date();
  109601. e.setDate(e.getDate() + 1);
  109602. return [new Date(), lastSecond(e.getTime())];
  109603. }
  109604. }, {
  109605. text: this.$L('本周'),
  109606. value: function value() {
  109607. return [$A.getData('今天', true), lastSecond($A.getData('本周结束2', true))];
  109608. }
  109609. }, {
  109610. text: this.$L('本月'),
  109611. value: function value() {
  109612. return [$A.getData('今天', true), lastSecond($A.getData('本月结束', true))];
  109613. }
  109614. }, {
  109615. text: this.$L('3天'),
  109616. value: function value() {
  109617. var e = new Date();
  109618. e.setDate(e.getDate() + 3);
  109619. return [new Date(), lastSecond(e.getTime())];
  109620. }
  109621. }, {
  109622. text: this.$L('5天'),
  109623. value: function value() {
  109624. var e = new Date();
  109625. e.setDate(e.getDate() + 5);
  109626. return [new Date(), lastSecond(e.getTime())];
  109627. }
  109628. }, {
  109629. text: this.$L('7天'),
  109630. value: function value() {
  109631. var e = new Date();
  109632. e.setDate(e.getDate() + 7);
  109633. return [new Date(), lastSecond(e.getTime())];
  109634. }
  109635. }]
  109636. };
  109637. },
  109638. levelFormt: function levelFormt(p) {
  109639. switch (parseInt(p)) {
  109640. case 1:
  109641. return this.$L("重要且紧急") + " (P1)";
  109642. case 2:
  109643. return this.$L("重要不紧急") + " (P2)";
  109644. case 3:
  109645. return this.$L("紧急不重要") + " (P3)";
  109646. case 4:
  109647. return this.$L("不重要不紧急") + " (P4)";
  109648. }
  109649. },
  109650. titleKeydown: function titleKeydown(e) {
  109651. if (e.keyCode == 13) {
  109652. e.preventDefault();
  109653. e.target.blur();
  109654. }
  109655. },
  109656. descKeydown: function descKeydown(e) {
  109657. if (e.keyCode == 13) {
  109658. if (e.shiftKey) {
  109659. return;
  109660. }
  109661. e.preventDefault();
  109662. e.target.blur();
  109663. }
  109664. },
  109665. commentKeydown: function commentKeydown(e) {
  109666. if (e.keyCode == 13) {
  109667. if (e.shiftKey) {
  109668. return;
  109669. }
  109670. e.preventDefault();
  109671. this.handleTask('comment');
  109672. }
  109673. },
  109674. commentDragOver: function commentDragOver(show) {
  109675. var _this2 = this;
  109676. var random = this.__detailDragOver = $A.randomString(8);
  109677. if (!show) {
  109678. setTimeout(function () {
  109679. if (random === _this2.__detailDragOver) {
  109680. _this2.detailDragOver = show;
  109681. }
  109682. }, 150);
  109683. } else {
  109684. this.detailDragOver = show;
  109685. }
  109686. },
  109687. commentPasteDrag: function commentPasteDrag(e, type) {
  109688. var _this3 = this;
  109689. this.detailDragOver = false;
  109690. var files = type === 'drag' ? e.dataTransfer.files : e.clipboardData.files;
  109691. var postFiles = Array.prototype.slice.call(files);
  109692. if (postFiles.length > 0) {
  109693. e.preventDefault();
  109694. postFiles.forEach(function (file) {
  109695. _this3.$refs.projectUpload.upload(file);
  109696. });
  109697. }
  109698. },
  109699. subtaskKeydown: function subtaskKeydown(subindex, e) {
  109700. if (e.keyCode == 13) {
  109701. if (e.shiftKey) {
  109702. return;
  109703. }
  109704. e.preventDefault();
  109705. this.handleTask('subtaskEnter', subindex);
  109706. }
  109707. },
  109708. followerLength: function followerLength(follower) {
  109709. if (follower instanceof Array) {
  109710. return follower.length;
  109711. } else {
  109712. return 0;
  109713. }
  109714. },
  109715. followerToStr: function followerToStr(follower) {
  109716. if (follower instanceof Array) {
  109717. return follower.join(",");
  109718. } else {
  109719. return '';
  109720. }
  109721. },
  109722. haveAttention: function haveAttention(follower) {
  109723. var _this4 = this;
  109724. if (follower instanceof Array) {
  109725. return follower.filter(function (uname) {
  109726. return uname == _this4.usrName;
  109727. }).length > 0;
  109728. } else {
  109729. return 0;
  109730. }
  109731. },
  109732. getTaskDetail: function getTaskDetail() {
  109733. var _this5 = this;
  109734. var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  109735. $A.apiAjax({
  109736. url: 'project/task/detail',
  109737. data: {
  109738. taskid: this.taskid
  109739. },
  109740. error: function error() {
  109741. alert(_this5.$L('网络繁忙,请稍后再试!'));
  109742. _this5.visible = false;
  109743. },
  109744. success: function success(res) {
  109745. if (res.ret === 1) {
  109746. _this5.detail = Object.assign(_this5.detail, res.data);
  109747. _this5.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this5.detail);
  109748. _this5.$nextTick(function () {
  109749. _this5.$refs.titleInput.resizeTextarea();
  109750. _this5.detail.subtask.forEach(function (temp, index) {
  109751. _this5.$refs['subtaskInput_' + index][0].resizeTextarea();
  109752. });
  109753. });
  109754. } else {
  109755. _this5.$Modal.error({
  109756. title: _this5.$L('温馨提示'),
  109757. content: res.msg,
  109758. onOk: function onOk() {
  109759. _this5.visible = false;
  109760. }
  109761. });
  109762. }
  109763. }
  109764. });
  109765. },
  109766. subtaskBatchAdd: function subtaskBatchAdd() {
  109767. var _this6 = this;
  109768. this.inputValue = "";
  109769. this.$Modal.confirm({
  109770. width: 560,
  109771. render: function render(h) {
  109772. return h('div', [h('div', {
  109773. style: {
  109774. fontSize: '16px',
  109775. fontWeight: '500',
  109776. marginBottom: '20px'
  109777. }
  109778. }, _this6.$L('批量添加子任务')), h('Input', {
  109779. props: {
  109780. type: 'textarea',
  109781. rows: 4,
  109782. autosize: { minRows: 4, maxRows: 30 },
  109783. value: _this6.inputValue,
  109784. placeholder: _this6.$L('使用换行添加多个子任务')
  109785. },
  109786. on: {
  109787. input: function input(val) {
  109788. _this6.inputValue = val;
  109789. }
  109790. }
  109791. })]);
  109792. },
  109793. loading: true,
  109794. onOk: function onOk() {
  109795. if (_this6.inputValue) {
  109796. var tempArray = _this6.inputValue.split(/\n/);
  109797. tempArray.forEach(function (detail) {
  109798. detail = detail.trim();
  109799. detail && _this6.detail.subtask.push({
  109800. time: Math.round(new Date().getTime() / 1000),
  109801. status: 'unfinished',
  109802. detail: detail,
  109803. stip: ''
  109804. });
  109805. });
  109806. _this6.handleTask('subtask', function () {
  109807. _this6.$Modal.remove();
  109808. }, 'all');
  109809. } else {
  109810. _this6.$Modal.remove();
  109811. }
  109812. }
  109813. });
  109814. },
  109815. handleUsernameShow: function handleUsernameShow() {
  109816. this.$set(this.detail, 'newusername', '');
  109817. },
  109818. handleAttentionShow: function handleAttentionShow() {
  109819. this.$set(this.detail, 'attentionLists', this.followerToStr(this.detail.follower));
  109820. },
  109821. handleBgClose: function handleBgClose() {
  109822. if (this.subwinVisible > 0) {
  109823. return;
  109824. }
  109825. this.visible = false;
  109826. },
  109827. handleSubwinToggle: function handleSubwinToggle(visible) {
  109828. if (visible) {
  109829. this.subwinVisible++;
  109830. } else {
  109831. this.subwinVisible--;
  109832. }
  109833. },
  109834. handleTask: function handleTask(act, eve, type) {
  109835. var _this7 = this;
  109836. var ajaxData = {
  109837. act: act,
  109838. taskid: this.taskid,
  109839. type: typeof type === 'undefined' ? '' : type
  109840. };
  109841. var ajaxCallback = function ajaxCallback() {};
  109842. //
  109843. switch (act) {
  109844. case 'title':
  109845. if (this.detail[act] == this.bakData[act]) {
  109846. return;
  109847. }
  109848. if (act == 'title' && !this.detail[act]) {
  109849. this.$set(this.detail, act, this.bakData[act]);
  109850. return;
  109851. }
  109852. ajaxData.content = this.detail[act];
  109853. ajaxCallback = function ajaxCallback(res) {
  109854. if (res !== 1) {
  109855. _this7.$set(_this7.detail, act, _this7.bakData[act]);
  109856. }
  109857. };
  109858. break;
  109859. case 'desc':
  109860. this.logType == '日志' && this.$refs.log.getLists(true, true);
  109861. return;
  109862. case 'subtaskAdd':
  109863. if (!$A.isArray(this.detail.subtask)) {
  109864. this.detail.subtask = [];
  109865. }
  109866. this.detail.subtask.push({
  109867. time: Math.round(new Date().getTime() / 1000),
  109868. status: 'unfinished',
  109869. detail: '',
  109870. stip: ''
  109871. });
  109872. this.$nextTick(function () {
  109873. _this7.$refs['subtaskInput_' + (_this7.detail.subtask.length - 1)][0].focus();
  109874. });
  109875. return;
  109876. case 'subtaskDelete':
  109877. //this.detail.subtask.splice(eve, 1);
  109878. //console.log(type)
  109879. this.handleTask('subtaskBlur', eve, type);
  109880. return;
  109881. case 'subtaskEnter':
  109882. if (!$A.isArray(this.detail.subtask)) {
  109883. this.detail.subtask = [];
  109884. }
  109885. if (eve + 1 >= this.detail.subtask.length) {
  109886. this.handleTask('subtaskAdd');
  109887. return;
  109888. }
  109889. this.$refs['subtaskInput_' + (eve + 1)][0].focus();
  109890. return;
  109891. case 'subtaskBlur':
  109892. this.handleTask('subtask', eve, type);
  109893. return;
  109894. case 'subtaskLink':
  109895. this.handleTask('subtask', eve, type);
  109896. return;
  109897. case 'subtask':
  109898. if (type === 'all') {
  109899. //批量
  109900. var tempArray = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail[act]);
  109901. while (tempArray.length > 0 && tempArray[tempArray.length - 1].detail == '') {
  109902. tempArray.splice(tempArray.length - 1, 1);
  109903. }
  109904. if ($A.jsonStringify(tempArray) === $A.jsonStringify(this.bakData[act])) {
  109905. return;
  109906. }
  109907. ajaxData.content = tempArray;
  109908. } else {
  109909. //单个任务
  109910. if (this.detail.subtask[eve].detail == "" && type == 'detail') {
  109911. return;
  109912. }
  109913. if (this.detail.subtask[eve].uname == "" && type == 'uname') {
  109914. return;
  109915. }
  109916. ajaxData.content = [this.detail.subtask[eve]];
  109917. }
  109918. ajaxCallback = function ajaxCallback(res) {
  109919. if (res !== 1) {
  109920. _this7.$set(_this7.detail, act, __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.bakData[act]));
  109921. }
  109922. typeof eve === "function" && eve(res);
  109923. };
  109924. break;
  109925. case 'fileupload':
  109926. this.$refs.projectUpload.uploadHandleClick();
  109927. return;
  109928. case 'filechange':
  109929. var filenum = $A.runNum(this.detail.filenum);
  109930. switch (eve) {
  109931. case 'up':
  109932. this.$set(this.detail, 'filenum', filenum + 1);
  109933. break;
  109934. case 'error':
  109935. case 'delete':
  109936. this.$set(this.detail, 'filenum', filenum - 1);
  109937. break;
  109938. }
  109939. if (eve == 'add' || eve == 'delete') {
  109940. this.logType == '日志' && this.$refs.log.getLists(true, true);
  109941. $A.triggerTaskInfoChange(ajaxData.taskid);
  109942. }
  109943. return;
  109944. case 'claimb':
  109945. this.$Modal.confirm({
  109946. title: this.$L('认领任务'),
  109947. content: this.$L('你确定认领任务“%”吗?', this.detail.title),
  109948. onOk: function onOk() {
  109949. _this7.handleTask('claim', eve);
  109950. }
  109951. });
  109952. return;
  109953. case 'claim':
  109954. case 'reassign':
  109955. case 'complete':
  109956. case 'unfinished':
  109957. case 'archived':
  109958. case 'unarchived':
  109959. break;
  109960. case 'archived2':
  109961. ajaxData.act = 'complete';
  109962. ajaxCallback = function ajaxCallback(res) {
  109963. if (res === 1 && !_this7.detail.archived) {
  109964. _this7.handleTask('archived');
  109965. return false;
  109966. }
  109967. };
  109968. break;
  109969. case 'level-1':
  109970. case 'level-2':
  109971. case 'level-3':
  109972. case 'level-4':
  109973. ajaxData.act = 'level';
  109974. ajaxData.content = act.substring(6);
  109975. break;
  109976. case 'usernameb':
  109977. if (!eve.username) {
  109978. return;
  109979. }
  109980. this.$Modal.confirm({
  109981. title: this.$L('修改负责人'),
  109982. content: this.$L('你确定修改负责人设置为“%”吗?', eve.nickname || eve.username),
  109983. onOk: function onOk() {
  109984. _this7.handleTask('username', eve);
  109985. }
  109986. });
  109987. return;
  109988. case 'username':
  109989. if (!eve.username) {
  109990. return;
  109991. }
  109992. ajaxData.content = eve.username;
  109993. break;
  109994. case 'inittime':
  109995. if (this.detail.startdate > 0 && this.detail.enddate > 0) {
  109996. this.timeValue = [$A.formatDate("Y-m-d H:i", this.detail.startdate), $A.formatDate("Y-m-d H:i", this.detail.enddate)];
  109997. } else {
  109998. this.timeValue = [];
  109999. }
  110000. return;
  110001. case 'plannedtimeb':
  110002. var temp = $A.date2string(this.timeValue, "Y-m-d H:i");
  110003. if (!temp[0] || !temp[1]) {
  110004. this.$Modal.error({ title: this.$L('温馨提示'), content: this.$L('请选择一个有效时间!') });
  110005. return;
  110006. }
  110007. this.$Modal.confirm({
  110008. title: this.$L('修改计划时间'),
  110009. content: this.$L('你确定将任务计划时间设置为“%”吗?', temp[0] + "~" + temp[1]),
  110010. onOk: function onOk() {
  110011. _this7.handleTask('plannedtime');
  110012. }
  110013. });
  110014. return;
  110015. case 'plannedtime':
  110016. this.timeValue = $A.date2string(this.timeValue, "Y-m-d H:i");
  110017. ajaxData.content = this.timeValue[0] + "," + this.timeValue[1];
  110018. this.$refs.timeRef.handleClose();
  110019. break;
  110020. case 'unplannedtimeb':
  110021. this.$Modal.confirm({
  110022. title: this.$L('取消计划时间'),
  110023. content: this.$L('你确定将任务计划时间取消吗?'),
  110024. onOk: function onOk() {
  110025. _this7.handleTask('unplannedtime');
  110026. }
  110027. });
  110028. return;
  110029. case 'unplannedtime':
  110030. this.$refs.timeRef.handleClose();
  110031. break;
  110032. case 'attentiona':
  110033. ajaxData.act = "attention";
  110034. ajaxData.content = this.usrName;
  110035. break;
  110036. case 'attention':
  110037. if (!this.detail.attentionLists) {
  110038. return;
  110039. }
  110040. ajaxData.mode = eve ? 'clean' : '';
  110041. ajaxData.content = this.detail.attentionLists;
  110042. this.$refs.attentionRef.handleClose();
  110043. break;
  110044. case 'unattention':
  110045. ajaxData.content = eve.username;
  110046. if (eve.uisynch === true) {
  110047. var bakFollower = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(this.detail.follower);
  110048. this.$set(this.detail, 'follower', this.detail.follower.filter(function (uname) {
  110049. return uname != eve;
  110050. }));
  110051. ajaxCallback = function ajaxCallback(res) {
  110052. if (res !== 1) {
  110053. _this7.$set(_this7.detail, 'follower', bakFollower);
  110054. }
  110055. };
  110056. }
  110057. break;
  110058. case 'deleteb':
  110059. this.$Modal.confirm({
  110060. title: this.$L('删除提示'),
  110061. content: this.$L('您确定要删除此任务吗?'),
  110062. onOk: function onOk() {
  110063. _this7.handleTask('delete');
  110064. }
  110065. });
  110066. return;
  110067. case 'delete':
  110068. ajaxCallback = function ajaxCallback(res) {
  110069. if (res === 1) {
  110070. _this7.$Modal.info({
  110071. title: _this7.$L('温馨提示'),
  110072. content: _this7.$L('任务已删除,点击确定关闭窗口。'),
  110073. onOk: function onOk() {
  110074. _this7.visible = false;
  110075. }
  110076. });
  110077. return false;
  110078. }
  110079. };
  110080. break;
  110081. case 'comment':
  110082. if (!this.commentText) {
  110083. return;
  110084. }
  110085. ajaxData.content = this.commentText;
  110086. ajaxCallback = function ajaxCallback(res) {
  110087. if (res === 1) {
  110088. _this7.commentText = "";
  110089. _this7.logType == '评论' && _this7.$refs.log.getLists(true, true);
  110090. }
  110091. };
  110092. break;
  110093. default:
  110094. {
  110095. return;
  110096. }
  110097. }
  110098. //
  110099. var loadRand = $A.randomString(6);
  110100. this.$set(this.loadRand, ajaxData.act, loadRand);
  110101. this.$set(this.loadData, ajaxData.act, true);
  110102. var runTime = Math.round(new Date().getTime());
  110103. $A.apiAjax({
  110104. url: 'project/task/edit',
  110105. method: 'post',
  110106. data: ajaxData,
  110107. complete: function complete() {
  110108. if (_this7.loadRand[ajaxData.act] !== loadRand) {
  110109. return;
  110110. }
  110111. _this7.$set(_this7.loadData, ajaxData.act, false);
  110112. },
  110113. error: function error() {
  110114. if (_this7.loadRand[ajaxData.act] !== loadRand) {
  110115. return;
  110116. }
  110117. ajaxCallback(-1);
  110118. alert(_this7.$L('网络繁忙,请稍后再试!'));
  110119. },
  110120. success: function success(res) {
  110121. if (_this7.loadRand[ajaxData.act] !== loadRand) {
  110122. return;
  110123. }
  110124. runTime = Math.round(new Date().getTime()) - runTime;
  110125. if (res.ret === 1) {
  110126. var _tempArray = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.detail.subtask);
  110127. _this7.detail = res.data;
  110128. _this7.bakData = __WEBPACK_IMPORTED_MODULE_3_lodash_cloneDeep___default()(_this7.detail);
  110129. while (_tempArray.length > 0 && _tempArray[_tempArray.length - 1].detail == '') {
  110130. _tempArray.splice(_tempArray.length - 1, 1);
  110131. _this7.detail.subtask.push({
  110132. uname: '',
  110133. time: Math.round(new Date().getTime() / 1000),
  110134. status: 'unfinished',
  110135. detail: '',
  110136. stip: ''
  110137. });
  110138. }
  110139. $A.triggerTaskInfoListener(ajaxData.act, res.data);
  110140. $A.triggerTaskInfoChange(ajaxData.taskid);
  110141. setTimeout(function () {
  110142. if (ajaxCallback(1) !== false) {
  110143. _this7.logType == '日志' && _this7.$refs.log.getLists(true, true);
  110144. _this7.$Message.success(res.msg);
  110145. }
  110146. }, Math.max(0, 350 - runTime));
  110147. //$A.triggerTaskDing(ajaxData);
  110148. } else {
  110149. setTimeout(function () {
  110150. ajaxCallback(0);
  110151. _this7.$Modal.error({ title: _this7.$L('温馨提示'), content: res.msg });
  110152. }, Math.max(0, 350 - runTime));
  110153. }
  110154. }
  110155. });
  110156. },
  110157. openProject: function openProject(projectid) {
  110158. try {
  110159. this.visible = false;
  110160. $A.app.$router.push({
  110161. name: 'project-panel',
  110162. params: { projectid: projectid, statistics: '', other: {} }
  110163. });
  110164. } catch (e) {
  110165. this.visible = true;
  110166. }
  110167. },
  110168. linkLoadData: function linkLoadData(item, callback) {}
  110169. }
  110170. });
  110171. /***/ }),
  110172. /* 244 */
  110173. /***/ (function(module, exports, __webpack_require__) {
  110174. var baseClone = __webpack_require__(245);
  110175. /** Used to compose bitmasks for cloning. */
  110176. var CLONE_DEEP_FLAG = 1,
  110177. CLONE_SYMBOLS_FLAG = 4;
  110178. /**
  110179. * This method is like `_.clone` except that it recursively clones `value`.
  110180. *
  110181. * @static
  110182. * @memberOf _
  110183. * @since 1.0.0
  110184. * @category Lang
  110185. * @param {*} value The value to recursively clone.
  110186. * @returns {*} Returns the deep cloned value.
  110187. * @see _.clone
  110188. * @example
  110189. *
  110190. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  110191. *
  110192. * var deep = _.cloneDeep(objects);
  110193. * console.log(deep[0] === objects[0]);
  110194. * // => false
  110195. */
  110196. function cloneDeep(value) {
  110197. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  110198. }
  110199. module.exports = cloneDeep;
  110200. /***/ }),
  110201. /* 245 */
  110202. /***/ (function(module, exports, __webpack_require__) {
  110203. var Stack = __webpack_require__(55),
  110204. arrayEach = __webpack_require__(246),
  110205. assignValue = __webpack_require__(45),
  110206. baseAssign = __webpack_require__(248),
  110207. baseAssignIn = __webpack_require__(249),
  110208. cloneBuffer = __webpack_require__(252),
  110209. copyArray = __webpack_require__(253),
  110210. copySymbols = __webpack_require__(254),
  110211. copySymbolsIn = __webpack_require__(255),
  110212. getAllKeys = __webpack_require__(61),
  110213. getAllKeysIn = __webpack_require__(256),
  110214. getTag = __webpack_require__(21),
  110215. initCloneArray = __webpack_require__(257),
  110216. initCloneByTag = __webpack_require__(258),
  110217. initCloneObject = __webpack_require__(263),
  110218. isArray = __webpack_require__(16),
  110219. isBuffer = __webpack_require__(34),
  110220. isMap = __webpack_require__(265),
  110221. isObject = __webpack_require__(9),
  110222. isSet = __webpack_require__(267),
  110223. keys = __webpack_require__(19),
  110224. keysIn = __webpack_require__(28);
  110225. /** Used to compose bitmasks for cloning. */
  110226. var CLONE_DEEP_FLAG = 1,
  110227. CLONE_FLAT_FLAG = 2,
  110228. CLONE_SYMBOLS_FLAG = 4;
  110229. /** `Object#toString` result references. */
  110230. var argsTag = '[object Arguments]',
  110231. arrayTag = '[object Array]',
  110232. boolTag = '[object Boolean]',
  110233. dateTag = '[object Date]',
  110234. errorTag = '[object Error]',
  110235. funcTag = '[object Function]',
  110236. genTag = '[object GeneratorFunction]',
  110237. mapTag = '[object Map]',
  110238. numberTag = '[object Number]',
  110239. objectTag = '[object Object]',
  110240. regexpTag = '[object RegExp]',
  110241. setTag = '[object Set]',
  110242. stringTag = '[object String]',
  110243. symbolTag = '[object Symbol]',
  110244. weakMapTag = '[object WeakMap]';
  110245. var arrayBufferTag = '[object ArrayBuffer]',
  110246. dataViewTag = '[object DataView]',
  110247. float32Tag = '[object Float32Array]',
  110248. float64Tag = '[object Float64Array]',
  110249. int8Tag = '[object Int8Array]',
  110250. int16Tag = '[object Int16Array]',
  110251. int32Tag = '[object Int32Array]',
  110252. uint8Tag = '[object Uint8Array]',
  110253. uint8ClampedTag = '[object Uint8ClampedArray]',
  110254. uint16Tag = '[object Uint16Array]',
  110255. uint32Tag = '[object Uint32Array]';
  110256. /** Used to identify `toStringTag` values supported by `_.clone`. */
  110257. var cloneableTags = {};
  110258. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  110259. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  110260. cloneableTags[boolTag] = cloneableTags[dateTag] =
  110261. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  110262. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  110263. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  110264. cloneableTags[numberTag] = cloneableTags[objectTag] =
  110265. cloneableTags[regexpTag] = cloneableTags[setTag] =
  110266. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  110267. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  110268. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  110269. cloneableTags[errorTag] = cloneableTags[funcTag] =
  110270. cloneableTags[weakMapTag] = false;
  110271. /**
  110272. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  110273. * traversed objects.
  110274. *
  110275. * @private
  110276. * @param {*} value The value to clone.
  110277. * @param {boolean} bitmask The bitmask flags.
  110278. * 1 - Deep clone
  110279. * 2 - Flatten inherited properties
  110280. * 4 - Clone symbols
  110281. * @param {Function} [customizer] The function to customize cloning.
  110282. * @param {string} [key] The key of `value`.
  110283. * @param {Object} [object] The parent object of `value`.
  110284. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  110285. * @returns {*} Returns the cloned value.
  110286. */
  110287. function baseClone(value, bitmask, customizer, key, object, stack) {
  110288. var result,
  110289. isDeep = bitmask & CLONE_DEEP_FLAG,
  110290. isFlat = bitmask & CLONE_FLAT_FLAG,
  110291. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  110292. if (customizer) {
  110293. result = object ? customizer(value, key, object, stack) : customizer(value);
  110294. }
  110295. if (result !== undefined) {
  110296. return result;
  110297. }
  110298. if (!isObject(value)) {
  110299. return value;
  110300. }
  110301. var isArr = isArray(value);
  110302. if (isArr) {
  110303. result = initCloneArray(value);
  110304. if (!isDeep) {
  110305. return copyArray(value, result);
  110306. }
  110307. } else {
  110308. var tag = getTag(value),
  110309. isFunc = tag == funcTag || tag == genTag;
  110310. if (isBuffer(value)) {
  110311. return cloneBuffer(value, isDeep);
  110312. }
  110313. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  110314. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  110315. if (!isDeep) {
  110316. return isFlat
  110317. ? copySymbolsIn(value, baseAssignIn(result, value))
  110318. : copySymbols(value, baseAssign(result, value));
  110319. }
  110320. } else {
  110321. if (!cloneableTags[tag]) {
  110322. return object ? value : {};
  110323. }
  110324. result = initCloneByTag(value, tag, isDeep);
  110325. }
  110326. }
  110327. // Check for circular references and return its corresponding clone.
  110328. stack || (stack = new Stack);
  110329. var stacked = stack.get(value);
  110330. if (stacked) {
  110331. return stacked;
  110332. }
  110333. stack.set(value, result);
  110334. if (isSet(value)) {
  110335. value.forEach(function(subValue) {
  110336. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  110337. });
  110338. } else if (isMap(value)) {
  110339. value.forEach(function(subValue, key) {
  110340. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  110341. });
  110342. }
  110343. var keysFunc = isFull
  110344. ? (isFlat ? getAllKeysIn : getAllKeys)
  110345. : (isFlat ? keysIn : keys);
  110346. var props = isArr ? undefined : keysFunc(value);
  110347. arrayEach(props || value, function(subValue, key) {
  110348. if (props) {
  110349. key = subValue;
  110350. subValue = value[key];
  110351. }
  110352. // Recursively populate clone (susceptible to call stack limits).
  110353. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  110354. });
  110355. return result;
  110356. }
  110357. module.exports = baseClone;
  110358. /***/ }),
  110359. /* 246 */
  110360. /***/ (function(module, exports) {
  110361. /**
  110362. * A specialized version of `_.forEach` for arrays without support for
  110363. * iteratee shorthands.
  110364. *
  110365. * @private
  110366. * @param {Array} [array] The array to iterate over.
  110367. * @param {Function} iteratee The function invoked per iteration.
  110368. * @returns {Array} Returns `array`.
  110369. */
  110370. function arrayEach(array, iteratee) {
  110371. var index = -1,
  110372. length = array == null ? 0 : array.length;
  110373. while (++index < length) {
  110374. if (iteratee(array[index], index, array) === false) {
  110375. break;
  110376. }
  110377. }
  110378. return array;
  110379. }
  110380. module.exports = arrayEach;
  110381. /***/ }),
  110382. /* 247 */
  110383. /***/ (function(module, exports, __webpack_require__) {
  110384. var getNative = __webpack_require__(5);
  110385. var defineProperty = (function() {
  110386. try {
  110387. var func = getNative(Object, 'defineProperty');
  110388. func({}, '', {});
  110389. return func;
  110390. } catch (e) {}
  110391. }());
  110392. module.exports = defineProperty;
  110393. /***/ }),
  110394. /* 248 */
  110395. /***/ (function(module, exports, __webpack_require__) {
  110396. var copyObject = __webpack_require__(15),
  110397. keys = __webpack_require__(19);
  110398. /**
  110399. * The base implementation of `_.assign` without support for multiple sources
  110400. * or `customizer` functions.
  110401. *
  110402. * @private
  110403. * @param {Object} object The destination object.
  110404. * @param {Object} source The source object.
  110405. * @returns {Object} Returns `object`.
  110406. */
  110407. function baseAssign(object, source) {
  110408. return object && copyObject(source, keys(source), object);
  110409. }
  110410. module.exports = baseAssign;
  110411. /***/ }),
  110412. /* 249 */
  110413. /***/ (function(module, exports, __webpack_require__) {
  110414. var copyObject = __webpack_require__(15),
  110415. keysIn = __webpack_require__(28);
  110416. /**
  110417. * The base implementation of `_.assignIn` without support for multiple sources
  110418. * or `customizer` functions.
  110419. *
  110420. * @private
  110421. * @param {Object} object The destination object.
  110422. * @param {Object} source The source object.
  110423. * @returns {Object} Returns `object`.
  110424. */
  110425. function baseAssignIn(object, source) {
  110426. return object && copyObject(source, keysIn(source), object);
  110427. }
  110428. module.exports = baseAssignIn;
  110429. /***/ }),
  110430. /* 250 */
  110431. /***/ (function(module, exports, __webpack_require__) {
  110432. var isObject = __webpack_require__(9),
  110433. isPrototype = __webpack_require__(27),
  110434. nativeKeysIn = __webpack_require__(251);
  110435. /** Used for built-in method references. */
  110436. var objectProto = Object.prototype;
  110437. /** Used to check objects for own properties. */
  110438. var hasOwnProperty = objectProto.hasOwnProperty;
  110439. /**
  110440. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  110441. *
  110442. * @private
  110443. * @param {Object} object The object to query.
  110444. * @returns {Array} Returns the array of property names.
  110445. */
  110446. function baseKeysIn(object) {
  110447. if (!isObject(object)) {
  110448. return nativeKeysIn(object);
  110449. }
  110450. var isProto = isPrototype(object),
  110451. result = [];
  110452. for (var key in object) {
  110453. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  110454. result.push(key);
  110455. }
  110456. }
  110457. return result;
  110458. }
  110459. module.exports = baseKeysIn;
  110460. /***/ }),
  110461. /* 251 */
  110462. /***/ (function(module, exports) {
  110463. /**
  110464. * This function is like
  110465. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  110466. * except that it includes inherited enumerable properties.
  110467. *
  110468. * @private
  110469. * @param {Object} object The object to query.
  110470. * @returns {Array} Returns the array of property names.
  110471. */
  110472. function nativeKeysIn(object) {
  110473. var result = [];
  110474. if (object != null) {
  110475. for (var key in Object(object)) {
  110476. result.push(key);
  110477. }
  110478. }
  110479. return result;
  110480. }
  110481. module.exports = nativeKeysIn;
  110482. /***/ }),
  110483. /* 252 */
  110484. /***/ (function(module, exports, __webpack_require__) {
  110485. /* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(3);
  110486. /** Detect free variable `exports`. */
  110487. var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
  110488. /** Detect free variable `module`. */
  110489. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  110490. /** Detect the popular CommonJS extension `module.exports`. */
  110491. var moduleExports = freeModule && freeModule.exports === freeExports;
  110492. /** Built-in value references. */
  110493. var Buffer = moduleExports ? root.Buffer : undefined,
  110494. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
  110495. /**
  110496. * Creates a clone of `buffer`.
  110497. *
  110498. * @private
  110499. * @param {Buffer} buffer The buffer to clone.
  110500. * @param {boolean} [isDeep] Specify a deep clone.
  110501. * @returns {Buffer} Returns the cloned buffer.
  110502. */
  110503. function cloneBuffer(buffer, isDeep) {
  110504. if (isDeep) {
  110505. return buffer.slice();
  110506. }
  110507. var length = buffer.length,
  110508. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  110509. buffer.copy(result);
  110510. return result;
  110511. }
  110512. module.exports = cloneBuffer;
  110513. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module)))
  110514. /***/ }),
  110515. /* 253 */
  110516. /***/ (function(module, exports) {
  110517. /**
  110518. * Copies the values of `source` to `array`.
  110519. *
  110520. * @private
  110521. * @param {Array} source The array to copy values from.
  110522. * @param {Array} [array=[]] The array to copy values to.
  110523. * @returns {Array} Returns `array`.
  110524. */
  110525. function copyArray(source, array) {
  110526. var index = -1,
  110527. length = source.length;
  110528. array || (array = Array(length));
  110529. while (++index < length) {
  110530. array[index] = source[index];
  110531. }
  110532. return array;
  110533. }
  110534. module.exports = copyArray;
  110535. /***/ }),
  110536. /* 254 */
  110537. /***/ (function(module, exports, __webpack_require__) {
  110538. var copyObject = __webpack_require__(15),
  110539. getSymbols = __webpack_require__(24);
  110540. /**
  110541. * Copies own symbols of `source` to `object`.
  110542. *
  110543. * @private
  110544. * @param {Object} source The object to copy symbols from.
  110545. * @param {Object} [object={}] The object to copy symbols to.
  110546. * @returns {Object} Returns `object`.
  110547. */
  110548. function copySymbols(source, object) {
  110549. return copyObject(source, getSymbols(source), object);
  110550. }
  110551. module.exports = copySymbols;
  110552. /***/ }),
  110553. /* 255 */
  110554. /***/ (function(module, exports, __webpack_require__) {
  110555. var copyObject = __webpack_require__(15),
  110556. getSymbolsIn = __webpack_require__(47);
  110557. /**
  110558. * Copies own and inherited symbols of `source` to `object`.
  110559. *
  110560. * @private
  110561. * @param {Object} source The object to copy symbols from.
  110562. * @param {Object} [object={}] The object to copy symbols to.
  110563. * @returns {Object} Returns `object`.
  110564. */
  110565. function copySymbolsIn(source, object) {
  110566. return copyObject(source, getSymbolsIn(source), object);
  110567. }
  110568. module.exports = copySymbolsIn;
  110569. /***/ }),
  110570. /* 256 */
  110571. /***/ (function(module, exports, __webpack_require__) {
  110572. var baseGetAllKeys = __webpack_require__(40),
  110573. getSymbolsIn = __webpack_require__(47),
  110574. keysIn = __webpack_require__(28);
  110575. /**
  110576. * Creates an array of own and inherited enumerable property names and
  110577. * symbols of `object`.
  110578. *
  110579. * @private
  110580. * @param {Object} object The object to query.
  110581. * @returns {Array} Returns the array of property names and symbols.
  110582. */
  110583. function getAllKeysIn(object) {
  110584. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  110585. }
  110586. module.exports = getAllKeysIn;
  110587. /***/ }),
  110588. /* 257 */
  110589. /***/ (function(module, exports) {
  110590. /** Used for built-in method references. */
  110591. var objectProto = Object.prototype;
  110592. /** Used to check objects for own properties. */
  110593. var hasOwnProperty = objectProto.hasOwnProperty;
  110594. /**
  110595. * Initializes an array clone.
  110596. *
  110597. * @private
  110598. * @param {Array} array The array to clone.
  110599. * @returns {Array} Returns the initialized clone.
  110600. */
  110601. function initCloneArray(array) {
  110602. var length = array.length,
  110603. result = new array.constructor(length);
  110604. // Add properties assigned by `RegExp#exec`.
  110605. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  110606. result.index = array.index;
  110607. result.input = array.input;
  110608. }
  110609. return result;
  110610. }
  110611. module.exports = initCloneArray;
  110612. /***/ }),
  110613. /* 258 */
  110614. /***/ (function(module, exports, __webpack_require__) {
  110615. var cloneArrayBuffer = __webpack_require__(29),
  110616. cloneDataView = __webpack_require__(259),
  110617. cloneRegExp = __webpack_require__(260),
  110618. cloneSymbol = __webpack_require__(261),
  110619. cloneTypedArray = __webpack_require__(262);
  110620. /** `Object#toString` result references. */
  110621. var boolTag = '[object Boolean]',
  110622. dateTag = '[object Date]',
  110623. mapTag = '[object Map]',
  110624. numberTag = '[object Number]',
  110625. regexpTag = '[object RegExp]',
  110626. setTag = '[object Set]',
  110627. stringTag = '[object String]',
  110628. symbolTag = '[object Symbol]';
  110629. var arrayBufferTag = '[object ArrayBuffer]',
  110630. dataViewTag = '[object DataView]',
  110631. float32Tag = '[object Float32Array]',
  110632. float64Tag = '[object Float64Array]',
  110633. int8Tag = '[object Int8Array]',
  110634. int16Tag = '[object Int16Array]',
  110635. int32Tag = '[object Int32Array]',
  110636. uint8Tag = '[object Uint8Array]',
  110637. uint8ClampedTag = '[object Uint8ClampedArray]',
  110638. uint16Tag = '[object Uint16Array]',
  110639. uint32Tag = '[object Uint32Array]';
  110640. /**
  110641. * Initializes an object clone based on its `toStringTag`.
  110642. *
  110643. * **Note:** This function only supports cloning values with tags of
  110644. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  110645. *
  110646. * @private
  110647. * @param {Object} object The object to clone.
  110648. * @param {string} tag The `toStringTag` of the object to clone.
  110649. * @param {boolean} [isDeep] Specify a deep clone.
  110650. * @returns {Object} Returns the initialized clone.
  110651. */
  110652. function initCloneByTag(object, tag, isDeep) {
  110653. var Ctor = object.constructor;
  110654. switch (tag) {
  110655. case arrayBufferTag:
  110656. return cloneArrayBuffer(object);
  110657. case boolTag:
  110658. case dateTag:
  110659. return new Ctor(+object);
  110660. case dataViewTag:
  110661. return cloneDataView(object, isDeep);
  110662. case float32Tag: case float64Tag:
  110663. case int8Tag: case int16Tag: case int32Tag:
  110664. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  110665. return cloneTypedArray(object, isDeep);
  110666. case mapTag:
  110667. return new Ctor;
  110668. case numberTag:
  110669. case stringTag:
  110670. return new Ctor(object);
  110671. case regexpTag:
  110672. return cloneRegExp(object);
  110673. case setTag:
  110674. return new Ctor;
  110675. case symbolTag:
  110676. return cloneSymbol(object);
  110677. }
  110678. }
  110679. module.exports = initCloneByTag;
  110680. /***/ }),
  110681. /* 259 */
  110682. /***/ (function(module, exports, __webpack_require__) {
  110683. var cloneArrayBuffer = __webpack_require__(29);
  110684. /**
  110685. * Creates a clone of `dataView`.
  110686. *
  110687. * @private
  110688. * @param {Object} dataView The data view to clone.
  110689. * @param {boolean} [isDeep] Specify a deep clone.
  110690. * @returns {Object} Returns the cloned data view.
  110691. */
  110692. function cloneDataView(dataView, isDeep) {
  110693. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  110694. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  110695. }
  110696. module.exports = cloneDataView;
  110697. /***/ }),
  110698. /* 260 */
  110699. /***/ (function(module, exports) {
  110700. /** Used to match `RegExp` flags from their coerced string values. */
  110701. var reFlags = /\w*$/;
  110702. /**
  110703. * Creates a clone of `regexp`.
  110704. *
  110705. * @private
  110706. * @param {Object} regexp The regexp to clone.
  110707. * @returns {Object} Returns the cloned regexp.
  110708. */
  110709. function cloneRegExp(regexp) {
  110710. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  110711. result.lastIndex = regexp.lastIndex;
  110712. return result;
  110713. }
  110714. module.exports = cloneRegExp;
  110715. /***/ }),
  110716. /* 261 */
  110717. /***/ (function(module, exports, __webpack_require__) {
  110718. var Symbol = __webpack_require__(18);
  110719. /** Used to convert symbols to primitives and strings. */
  110720. var symbolProto = Symbol ? Symbol.prototype : undefined,
  110721. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
  110722. /**
  110723. * Creates a clone of the `symbol` object.
  110724. *
  110725. * @private
  110726. * @param {Object} symbol The symbol object to clone.
  110727. * @returns {Object} Returns the cloned symbol object.
  110728. */
  110729. function cloneSymbol(symbol) {
  110730. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  110731. }
  110732. module.exports = cloneSymbol;
  110733. /***/ }),
  110734. /* 262 */
  110735. /***/ (function(module, exports, __webpack_require__) {
  110736. var cloneArrayBuffer = __webpack_require__(29);
  110737. /**
  110738. * Creates a clone of `typedArray`.
  110739. *
  110740. * @private
  110741. * @param {Object} typedArray The typed array to clone.
  110742. * @param {boolean} [isDeep] Specify a deep clone.
  110743. * @returns {Object} Returns the cloned typed array.
  110744. */
  110745. function cloneTypedArray(typedArray, isDeep) {
  110746. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  110747. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  110748. }
  110749. module.exports = cloneTypedArray;
  110750. /***/ }),
  110751. /* 263 */
  110752. /***/ (function(module, exports, __webpack_require__) {
  110753. var baseCreate = __webpack_require__(264),
  110754. getPrototype = __webpack_require__(48),
  110755. isPrototype = __webpack_require__(27);
  110756. /**
  110757. * Initializes an object clone.
  110758. *
  110759. * @private
  110760. * @param {Object} object The object to clone.
  110761. * @returns {Object} Returns the initialized clone.
  110762. */
  110763. function initCloneObject(object) {
  110764. return (typeof object.constructor == 'function' && !isPrototype(object))
  110765. ? baseCreate(getPrototype(object))
  110766. : {};
  110767. }
  110768. module.exports = initCloneObject;
  110769. /***/ }),
  110770. /* 264 */
  110771. /***/ (function(module, exports, __webpack_require__) {
  110772. var isObject = __webpack_require__(9);
  110773. /** Built-in value references. */
  110774. var objectCreate = Object.create;
  110775. /**
  110776. * The base implementation of `_.create` without support for assigning
  110777. * properties to the created object.
  110778. *
  110779. * @private
  110780. * @param {Object} proto The object to inherit from.
  110781. * @returns {Object} Returns the new object.
  110782. */
  110783. var baseCreate = (function() {
  110784. function object() {}
  110785. return function(proto) {
  110786. if (!isObject(proto)) {
  110787. return {};
  110788. }
  110789. if (objectCreate) {
  110790. return objectCreate(proto);
  110791. }
  110792. object.prototype = proto;
  110793. var result = new object;
  110794. object.prototype = undefined;
  110795. return result;
  110796. };
  110797. }());
  110798. module.exports = baseCreate;
  110799. /***/ }),
  110800. /* 265 */
  110801. /***/ (function(module, exports, __webpack_require__) {
  110802. var baseIsMap = __webpack_require__(266),
  110803. baseUnary = __webpack_require__(20),
  110804. nodeUtil = __webpack_require__(26);
  110805. /* Node.js helper references. */
  110806. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  110807. /**
  110808. * Checks if `value` is classified as a `Map` object.
  110809. *
  110810. * @static
  110811. * @memberOf _
  110812. * @since 4.3.0
  110813. * @category Lang
  110814. * @param {*} value The value to check.
  110815. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  110816. * @example
  110817. *
  110818. * _.isMap(new Map);
  110819. * // => true
  110820. *
  110821. * _.isMap(new WeakMap);
  110822. * // => false
  110823. */
  110824. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  110825. module.exports = isMap;
  110826. /***/ }),
  110827. /* 266 */
  110828. /***/ (function(module, exports, __webpack_require__) {
  110829. var getTag = __webpack_require__(21),
  110830. isObjectLike = __webpack_require__(8);
  110831. /** `Object#toString` result references. */
  110832. var mapTag = '[object Map]';
  110833. /**
  110834. * The base implementation of `_.isMap` without Node.js optimizations.
  110835. *
  110836. * @private
  110837. * @param {*} value The value to check.
  110838. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  110839. */
  110840. function baseIsMap(value) {
  110841. return isObjectLike(value) && getTag(value) == mapTag;
  110842. }
  110843. module.exports = baseIsMap;
  110844. /***/ }),
  110845. /* 267 */
  110846. /***/ (function(module, exports, __webpack_require__) {
  110847. var baseIsSet = __webpack_require__(268),
  110848. baseUnary = __webpack_require__(20),
  110849. nodeUtil = __webpack_require__(26);
  110850. /* Node.js helper references. */
  110851. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  110852. /**
  110853. * Checks if `value` is classified as a `Set` object.
  110854. *
  110855. * @static
  110856. * @memberOf _
  110857. * @since 4.3.0
  110858. * @category Lang
  110859. * @param {*} value The value to check.
  110860. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  110861. * @example
  110862. *
  110863. * _.isSet(new Set);
  110864. * // => true
  110865. *
  110866. * _.isSet(new WeakSet);
  110867. * // => false
  110868. */
  110869. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  110870. module.exports = isSet;
  110871. /***/ }),
  110872. /* 268 */
  110873. /***/ (function(module, exports, __webpack_require__) {
  110874. var getTag = __webpack_require__(21),
  110875. isObjectLike = __webpack_require__(8);
  110876. /** `Object#toString` result references. */
  110877. var setTag = '[object Set]';
  110878. /**
  110879. * The base implementation of `_.isSet` without Node.js optimizations.
  110880. *
  110881. * @private
  110882. * @param {*} value The value to check.
  110883. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  110884. */
  110885. function baseIsSet(value) {
  110886. return isObjectLike(value) && getTag(value) == setTag;
  110887. }
  110888. module.exports = baseIsSet;
  110889. /***/ }),
  110890. /* 269 */
  110891. /***/ (function(module, exports, __webpack_require__) {
  110892. var disposed = false
  110893. var normalizeComponent = __webpack_require__(2)
  110894. /* script */
  110895. var __vue_script__ = __webpack_require__(270)
  110896. /* template */
  110897. var __vue_template__ = __webpack_require__(273)
  110898. /* template functional */
  110899. var __vue_template_functional__ = false
  110900. /* styles */
  110901. var __vue_styles__ = null
  110902. /* scopeId */
  110903. var __vue_scopeId__ = null
  110904. /* moduleIdentifier (server only) */
  110905. var __vue_module_identifier__ = null
  110906. var Component = normalizeComponent(
  110907. __vue_script__,
  110908. __vue_template__,
  110909. __vue_template_functional__,
  110910. __vue_styles__,
  110911. __vue_scopeId__,
  110912. __vue_module_identifier__
  110913. )
  110914. Component.options.__file = "resources/assets/js/main/components/iview/WInput.vue"
  110915. /* hot reload */
  110916. if (false) {(function () {
  110917. var hotAPI = require("vue-hot-reload-api")
  110918. hotAPI.install(require("vue"), false)
  110919. if (!hotAPI.compatible) return
  110920. module.hot.accept()
  110921. if (!module.hot.data) {
  110922. hotAPI.createRecord("data-v-2cdade09", Component.options)
  110923. } else {
  110924. hotAPI.reload("data-v-2cdade09", Component.options)
  110925. }
  110926. module.hot.dispose(function (data) {
  110927. disposed = true
  110928. })
  110929. })()}
  110930. module.exports = Component.exports
  110931. /***/ }),
  110932. /* 270 */
  110933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  110934. "use strict";
  110935. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  110936. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__ = __webpack_require__(22);
  110937. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_calcTextareaHeight__ = __webpack_require__(271);
  110938. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_view_design_src_mixins_emitter__ = __webpack_require__(36);
  110939. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_form__ = __webpack_require__(272);
  110940. function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
  110941. //
  110942. //
  110943. //
  110944. //
  110945. //
  110946. //
  110947. //
  110948. //
  110949. //
  110950. //
  110951. //
  110952. //
  110953. //
  110954. //
  110955. //
  110956. //
  110957. //
  110958. //
  110959. //
  110960. //
  110961. //
  110962. //
  110963. //
  110964. //
  110965. //
  110966. //
  110967. //
  110968. //
  110969. //
  110970. //
  110971. //
  110972. //
  110973. //
  110974. //
  110975. //
  110976. //
  110977. //
  110978. //
  110979. //
  110980. //
  110981. //
  110982. //
  110983. //
  110984. //
  110985. //
  110986. //
  110987. //
  110988. //
  110989. //
  110990. //
  110991. //
  110992. //
  110993. //
  110994. //
  110995. //
  110996. //
  110997. //
  110998. //
  110999. //
  111000. //
  111001. //
  111002. //
  111003. //
  111004. //
  111005. //
  111006. //
  111007. //
  111008. //
  111009. //
  111010. //
  111011. //
  111012. //
  111013. //
  111014. //
  111015. //
  111016. //
  111017. //
  111018. //
  111019. //
  111020. //
  111021. //
  111022. //
  111023. //
  111024. var prefixCls = 'ivu-input';
  111025. /* harmony default export */ __webpack_exports__["default"] = ({
  111026. name: 'WInput',
  111027. mixins: [__WEBPACK_IMPORTED_MODULE_2_view_design_src_mixins_emitter__["a" /* default */], __WEBPACK_IMPORTED_MODULE_3_view_design_src_mixins_form__["a" /* default */]],
  111028. props: {
  111029. type: {
  111030. validator: function validator(value) {
  111031. return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['text', 'textarea', 'password', 'url', 'email', 'date', 'number', 'tel']);
  111032. },
  111033. default: 'text'
  111034. },
  111035. value: {
  111036. type: [String, Number],
  111037. default: ''
  111038. },
  111039. size: {
  111040. validator: function validator(value) {
  111041. return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['small', 'large', 'default']);
  111042. },
  111043. default: function _default() {
  111044. return !this.$IVIEW || this.$IVIEW.size === '' ? 'default' : this.$IVIEW.size;
  111045. }
  111046. },
  111047. placeholder: {
  111048. type: String,
  111049. default: ''
  111050. },
  111051. maxlength: {
  111052. type: [String, Number]
  111053. },
  111054. disabled: {
  111055. type: Boolean,
  111056. default: false
  111057. },
  111058. icon: String,
  111059. autosize: {
  111060. type: [Boolean, Object],
  111061. default: false
  111062. },
  111063. rows: {
  111064. type: Number,
  111065. default: 2
  111066. },
  111067. readonly: {
  111068. type: Boolean,
  111069. default: false
  111070. },
  111071. name: {
  111072. type: String
  111073. },
  111074. number: {
  111075. type: Boolean,
  111076. default: false
  111077. },
  111078. autofocus: {
  111079. type: Boolean,
  111080. default: false
  111081. },
  111082. spellcheck: {
  111083. type: Boolean,
  111084. default: false
  111085. },
  111086. autocomplete: {
  111087. type: String,
  111088. default: 'off'
  111089. },
  111090. clearable: {
  111091. type: Boolean,
  111092. default: false
  111093. },
  111094. elementId: {
  111095. type: String
  111096. },
  111097. wrap: {
  111098. validator: function validator(value) {
  111099. return Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["e" /* oneOf */])(value, ['hard', 'soft']);
  111100. },
  111101. default: 'soft'
  111102. },
  111103. prefix: {
  111104. type: String,
  111105. default: ''
  111106. },
  111107. suffix: {
  111108. type: String,
  111109. default: ''
  111110. },
  111111. search: {
  111112. type: Boolean,
  111113. default: false
  111114. },
  111115. enterButton: {
  111116. type: [Boolean, String],
  111117. default: false
  111118. },
  111119. // 4.0.0
  111120. showWordLimit: {
  111121. type: Boolean,
  111122. default: false
  111123. },
  111124. // 4.0.0
  111125. password: {
  111126. type: Boolean,
  111127. default: false
  111128. }
  111129. },
  111130. data: function data() {
  111131. return {
  111132. currentValue: this.value,
  111133. prefixCls: prefixCls,
  111134. slotReady: false,
  111135. textareaStyles: {},
  111136. isOnComposition: false,
  111137. showPassword: false
  111138. };
  111139. },
  111140. computed: {
  111141. currentType: function currentType() {
  111142. var type = this.type;
  111143. if (type === 'password' && this.password && this.showPassword) type = 'text';
  111144. return type;
  111145. },
  111146. prepend: function prepend() {
  111147. var state = false;
  111148. if (this.type !== 'textarea') state = this.$slots.prepend !== undefined;
  111149. return state;
  111150. },
  111151. append: function append() {
  111152. var state = false;
  111153. if (this.type !== 'textarea') state = this.$slots.append !== undefined;
  111154. return state;
  111155. },
  111156. showPrefix: function showPrefix() {
  111157. var state = false;
  111158. if (this.type !== 'textarea') state = this.prefix !== '' || this.$slots.prefix !== undefined;
  111159. return state;
  111160. },
  111161. showSuffix: function showSuffix() {
  111162. var state = false;
  111163. if (this.type !== 'textarea') state = this.suffix !== '' || this.$slots.suffix !== undefined;
  111164. return state;
  111165. },
  111166. wrapClasses: function wrapClasses() {
  111167. var _ref;
  111168. return [prefixCls + '-wrapper', (_ref = {}, _defineProperty(_ref, prefixCls + '-wrapper-' + this.size, !!this.size), _defineProperty(_ref, prefixCls + '-type-' + this.type, this.type), _defineProperty(_ref, prefixCls + '-group', this.prepend || this.append || this.search && this.enterButton), _defineProperty(_ref, prefixCls + '-group-' + this.size, (this.prepend || this.append || this.search && this.enterButton) && !!this.size), _defineProperty(_ref, prefixCls + '-group-with-prepend', this.prepend), _defineProperty(_ref, prefixCls + '-group-with-append', this.append || this.search && this.enterButton), _defineProperty(_ref, prefixCls + '-hide-icon', this.append), _defineProperty(_ref, prefixCls + '-with-search', this.search && this.enterButton), _ref)];
  111169. },
  111170. inputClasses: function inputClasses() {
  111171. var _ref2;
  111172. return ['' + prefixCls, (_ref2 = {}, _defineProperty(_ref2, prefixCls + '-' + this.size, !!this.size), _defineProperty(_ref2, prefixCls + '-disabled', this.itemDisabled), _defineProperty(_ref2, prefixCls + '-with-prefix', this.showPrefix), _defineProperty(_ref2, prefixCls + '-with-suffix', this.showSuffix || this.search && this.enterButton === false), _ref2)];
  111173. },
  111174. textareaClasses: function textareaClasses() {
  111175. return ['' + prefixCls, _defineProperty({}, prefixCls + '-disabled', this.itemDisabled)];
  111176. },
  111177. upperLimit: function upperLimit() {
  111178. return this.maxlength;
  111179. },
  111180. textLength: function textLength() {
  111181. if (typeof this.value === 'number') {
  111182. return String(this.value).length;
  111183. }
  111184. return (this.value || '').length;
  111185. }
  111186. },
  111187. methods: {
  111188. handleEnter: function handleEnter(event) {
  111189. this.$emit('on-enter', event);
  111190. if (this.search) this.$emit('on-search', this.currentValue);
  111191. },
  111192. handleKeydown: function handleKeydown(event) {
  111193. this.$emit('on-keydown', event);
  111194. },
  111195. handleKeypress: function handleKeypress(event) {
  111196. this.$emit('on-keypress', event);
  111197. },
  111198. handleKeyup: function handleKeyup(event) {
  111199. this.$emit('on-keyup', event);
  111200. },
  111201. handleIconClick: function handleIconClick(event) {
  111202. this.$emit('on-click', event);
  111203. },
  111204. handleFocus: function handleFocus(event) {
  111205. this.$emit('on-focus', event);
  111206. },
  111207. handleBlur: function handleBlur(event) {
  111208. this.$emit('on-blur', event);
  111209. if (!Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["b" /* findComponentUpward */])(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
  111210. this.dispatch('FormItem', 'on-form-blur', this.currentValue);
  111211. }
  111212. },
  111213. handleComposition: function handleComposition(event) {
  111214. if (event.type === 'compositionstart') {
  111215. this.isOnComposition = true;
  111216. }
  111217. if (event.type === 'compositionend') {
  111218. this.isOnComposition = false;
  111219. this.handleInput(event);
  111220. }
  111221. },
  111222. handleInput: function handleInput(event) {
  111223. if (this.isOnComposition) return;
  111224. var value = event.target.value;
  111225. if (this.number && value !== '') value = Number.isNaN(Number(value)) ? value : Number(value);
  111226. this.$emit('input', value);
  111227. this.setCurrentValue(value);
  111228. this.$emit('on-change', event);
  111229. },
  111230. handleChange: function handleChange(event) {
  111231. this.$emit('on-input-change', event);
  111232. },
  111233. handlePaste: function handlePaste(event) {
  111234. this.$emit('on-input-paste', event);
  111235. },
  111236. setCurrentValue: function setCurrentValue(value) {
  111237. var _this = this;
  111238. if (value === this.currentValue) return;
  111239. this.$nextTick(function () {
  111240. _this.resizeTextarea();
  111241. });
  111242. this.currentValue = value;
  111243. if (!Object(__WEBPACK_IMPORTED_MODULE_0_view_design_src_utils_assist__["b" /* findComponentUpward */])(this, ['DatePicker', 'TimePicker', 'Cascader', 'Search'])) {
  111244. this.dispatch('FormItem', 'on-form-change', value);
  111245. }
  111246. },
  111247. resizeTextarea: function resizeTextarea() {
  111248. var autosize = this.autosize;
  111249. if (!autosize || this.type !== 'textarea') {
  111250. return false;
  111251. }
  111252. var minRows = autosize.minRows;
  111253. var maxRows = autosize.maxRows;
  111254. this.textareaStyles = Object(__WEBPACK_IMPORTED_MODULE_1_view_design_src_utils_calcTextareaHeight__["a" /* default */])(this.$refs.textarea, minRows, maxRows);
  111255. },
  111256. focus: function focus() {
  111257. if (this.type === 'textarea') {
  111258. this.$refs.textarea.focus();
  111259. } else {
  111260. this.$refs.input.focus();
  111261. }
  111262. },
  111263. blur: function blur() {
  111264. if (this.type === 'textarea') {
  111265. this.$refs.textarea.blur();
  111266. } else {
  111267. this.$refs.input.blur();
  111268. }
  111269. },
  111270. handleClear: function handleClear() {
  111271. var e = { target: { value: '' } };
  111272. this.$emit('input', '');
  111273. this.setCurrentValue('');
  111274. this.$emit('on-change', e);
  111275. this.$emit('on-clear');
  111276. },
  111277. handleSearch: function handleSearch() {
  111278. if (this.itemDisabled) return false;
  111279. this.$refs.input.focus();
  111280. this.$emit('on-search', this.currentValue);
  111281. },
  111282. handleToggleShowPassword: function handleToggleShowPassword() {
  111283. var _this2 = this;
  111284. if (this.itemDisabled) return false;
  111285. this.showPassword = !this.showPassword;
  111286. this.focus();
  111287. var len = this.currentValue.length;
  111288. setTimeout(function () {
  111289. _this2.$refs.input.setSelectionRange(len, len);
  111290. }, 0);
  111291. }
  111292. },
  111293. watch: {
  111294. value: function value(val) {
  111295. this.setCurrentValue(val);
  111296. }
  111297. },
  111298. mounted: function mounted() {
  111299. this.slotReady = true;
  111300. this.resizeTextarea();
  111301. }
  111302. });
  111303. /***/ }),
  111304. /* 271 */
  111305. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111306. "use strict";
  111307. /* harmony export (immutable) */ __webpack_exports__["a"] = calcTextareaHeight;
  111308. // Thanks to
  111309. // https://github.com/andreypopp/react-textarea-autosize/
  111310. // let hiddenTextarea;
  111311. //
  111312. // const HIDDEN_STYLE = `
  111313. // height:0 !important;
  111314. // min-height:0 !important;
  111315. // max-height:none !important;
  111316. // visibility:hidden !important;
  111317. // overflow:hidden !important;
  111318. // position:absolute !important;
  111319. // z-index:-1000 !important;
  111320. // top:0 !important;
  111321. // right:0 !important
  111322. // `;
  111323. //
  111324. // const CONTEXT_STYLE = [
  111325. // 'letter-spacing',
  111326. // 'line-height',
  111327. // 'padding-top',
  111328. // 'padding-bottom',
  111329. // 'font-family',
  111330. // 'font-weight',
  111331. // 'font-size',
  111332. // 'text-rendering',
  111333. // 'text-transform',
  111334. // 'width',
  111335. // 'text-indent',
  111336. // 'padding-left',
  111337. // 'padding-right',
  111338. // 'border-width',
  111339. // 'box-sizing'
  111340. // ];
  111341. //
  111342. // function calculateNodeStyling(node) {
  111343. // const style = window.getComputedStyle(node);
  111344. //
  111345. // const boxSizing = style.getPropertyValue('box-sizing');
  111346. //
  111347. // const paddingSize = (
  111348. // parseFloat(style.getPropertyValue('padding-bottom')) +
  111349. // parseFloat(style.getPropertyValue('padding-top'))
  111350. // );
  111351. //
  111352. // const borderSize = (
  111353. // parseFloat(style.getPropertyValue('border-bottom-width')) +
  111354. // parseFloat(style.getPropertyValue('border-top-width'))
  111355. // );
  111356. //
  111357. // const contextStyle = CONTEXT_STYLE
  111358. // .map(name => `${name}:${style.getPropertyValue(name)}`)
  111359. // .join(';');
  111360. //
  111361. // return {contextStyle, paddingSize, borderSize, boxSizing};
  111362. // }
  111363. //
  111364. // export default function calcTextareaHeight(targetNode, minRows = null, maxRows = null) {
  111365. // if (!hiddenTextarea) {
  111366. // hiddenTextarea = document.createElement('textarea');
  111367. // document.body.appendChild(hiddenTextarea);
  111368. // }
  111369. //
  111370. // let {
  111371. // paddingSize,
  111372. // borderSize,
  111373. // boxSizing,
  111374. // contextStyle
  111375. // } = calculateNodeStyling(targetNode);
  111376. //
  111377. // hiddenTextarea.setAttribute('style', `${contextStyle};${HIDDEN_STYLE}`);
  111378. // hiddenTextarea.value = targetNode.value || targetNode.placeholder || '';
  111379. //
  111380. // let height = hiddenTextarea.scrollHeight;
  111381. // let minHeight = -Infinity;
  111382. // let maxHeight = Infinity;
  111383. // let overflowY;
  111384. //
  111385. // if (boxSizing === 'border-box') {
  111386. // height = height + borderSize;
  111387. // } else if (boxSizing === 'content-box') {
  111388. // height = height - paddingSize;
  111389. // }
  111390. //
  111391. // hiddenTextarea.value = '';
  111392. // let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  111393. //
  111394. // if (minRows !== null) {
  111395. // minHeight = singleRowHeight * minRows;
  111396. // if (boxSizing === 'border-box') {
  111397. // minHeight = minHeight + paddingSize + borderSize;
  111398. // }
  111399. // height = Math.max(minHeight, height);
  111400. // }
  111401. // if (maxRows !== null) {
  111402. // maxHeight = singleRowHeight * maxRows;
  111403. // if (boxSizing === 'border-box') {
  111404. // maxHeight = maxHeight + paddingSize + borderSize;
  111405. // }
  111406. // overflowY = height > maxHeight ? '' : 'hidden';
  111407. // height = Math.min(maxHeight, height);
  111408. // }
  111409. //
  111410. // if (!maxRows) {
  111411. // overflowY = 'hidden';
  111412. // }
  111413. //
  111414. // return {
  111415. // height: `${height}px`,
  111416. // minHeight: `${minHeight}px`,
  111417. // maxHeight: `${maxHeight}px`,
  111418. // overflowY
  111419. // };
  111420. // }
  111421. const HIDDEN_TEXTAREA_STYLE = `
  111422. min-height:0 !important;
  111423. max-height:none !important;
  111424. height:0 !important;
  111425. visibility:hidden !important;
  111426. overflow:hidden !important;
  111427. position:absolute !important;
  111428. z-index:-1000 !important;
  111429. top:0 !important;
  111430. right:0 !important
  111431. `;
  111432. const SIZING_STYLE = [
  111433. 'letter-spacing',
  111434. 'line-height',
  111435. 'padding-top',
  111436. 'padding-bottom',
  111437. 'font-family',
  111438. 'font-weight',
  111439. 'font-size',
  111440. 'text-rendering',
  111441. 'text-transform',
  111442. 'width',
  111443. 'text-indent',
  111444. 'padding-left',
  111445. 'padding-right',
  111446. 'border-width',
  111447. 'box-sizing',
  111448. ];
  111449. let computedStyleCache = {};
  111450. let hiddenTextarea;
  111451. function calculateNodeStyling(node, useCache = false) {
  111452. const nodeRef = (
  111453. node.getAttribute('id') ||
  111454. node.getAttribute('data-reactid') ||
  111455. node.getAttribute('name'));
  111456. if (useCache && computedStyleCache[nodeRef]) {
  111457. return computedStyleCache[nodeRef];
  111458. }
  111459. const style = window.getComputedStyle(node);
  111460. const boxSizing = (
  111461. style.getPropertyValue('box-sizing') ||
  111462. style.getPropertyValue('-moz-box-sizing') ||
  111463. style.getPropertyValue('-webkit-box-sizing')
  111464. );
  111465. const paddingSize = (
  111466. parseFloat(style.getPropertyValue('padding-bottom')) +
  111467. parseFloat(style.getPropertyValue('padding-top'))
  111468. );
  111469. const borderSize = (
  111470. parseFloat(style.getPropertyValue('border-bottom-width')) +
  111471. parseFloat(style.getPropertyValue('border-top-width'))
  111472. );
  111473. const sizingStyle = SIZING_STYLE
  111474. .map(name => `${name}:${style.getPropertyValue(name)}`)
  111475. .join(';');
  111476. const nodeInfo = {
  111477. sizingStyle,
  111478. paddingSize,
  111479. borderSize,
  111480. boxSizing,
  111481. };
  111482. if (useCache && nodeRef) {
  111483. computedStyleCache[nodeRef] = nodeInfo;
  111484. }
  111485. return nodeInfo;
  111486. }
  111487. function calcTextareaHeight(uiTextNode, minRows = null, maxRows = null, useCache = false) {
  111488. if (!hiddenTextarea) {
  111489. hiddenTextarea = document.createElement('textarea');
  111490. document.body.appendChild(hiddenTextarea);
  111491. }
  111492. // Fix wrap="off" issue
  111493. // https://github.com/ant-design/ant-design/issues/6577
  111494. if (uiTextNode.getAttribute('wrap')) {
  111495. hiddenTextarea.setAttribute('wrap', uiTextNode.getAttribute('wrap'));
  111496. } else {
  111497. hiddenTextarea.removeAttribute('wrap');
  111498. }
  111499. // Copy all CSS properties that have an impact on the height of the content in
  111500. // the textbox
  111501. let {
  111502. paddingSize, borderSize,
  111503. boxSizing, sizingStyle,
  111504. } = calculateNodeStyling(uiTextNode, useCache);
  111505. // Need to have the overflow attribute to hide the scrollbar otherwise
  111506. // text-lines will not calculated properly as the shadow will technically be
  111507. // narrower for content
  111508. hiddenTextarea.setAttribute('style', `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`);
  111509. hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
  111510. let minHeight = Number.MIN_SAFE_INTEGER;
  111511. let maxHeight = Number.MAX_SAFE_INTEGER;
  111512. let height = hiddenTextarea.scrollHeight;
  111513. let overflowY;
  111514. if (boxSizing === 'border-box') {
  111515. // border-box: add border, since height = content + padding + border
  111516. height = height + borderSize;
  111517. } else if (boxSizing === 'content-box') {
  111518. // remove padding, since height = content
  111519. height = height - paddingSize;
  111520. }
  111521. if (minRows !== null || maxRows !== null) {
  111522. // measure height of a textarea with a single row
  111523. hiddenTextarea.value = ' ';
  111524. let singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  111525. if (minRows !== null) {
  111526. minHeight = singleRowHeight * minRows;
  111527. if (boxSizing === 'border-box') {
  111528. minHeight = minHeight + paddingSize + borderSize;
  111529. }
  111530. height = Math.max(minHeight, height);
  111531. }
  111532. if (maxRows !== null) {
  111533. maxHeight = singleRowHeight * maxRows;
  111534. if (boxSizing === 'border-box') {
  111535. maxHeight = maxHeight + paddingSize + borderSize;
  111536. }
  111537. overflowY = height > maxHeight ? '' : 'hidden';
  111538. height = Math.min(maxHeight, height);
  111539. }
  111540. }
  111541. // Remove scroll bar flash when autosize without maxRows
  111542. if (!maxRows) {
  111543. overflowY = 'hidden';
  111544. }
  111545. return {
  111546. height: `${height}px`,
  111547. minHeight: `${minHeight}px`,
  111548. maxHeight: `${maxHeight}px`,
  111549. overflowY
  111550. };
  111551. }
  111552. /***/ }),
  111553. /* 272 */
  111554. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111555. "use strict";
  111556. /* harmony default export */ __webpack_exports__["a"] = ({
  111557. inject: {
  111558. FormInstance: {
  111559. default: ''
  111560. }
  111561. },
  111562. computed: {
  111563. itemDisabled () {
  111564. let state = this.disabled;
  111565. if (!state && this.FormInstance) state = this.FormInstance.disabled;
  111566. return state;
  111567. }
  111568. }
  111569. });
  111570. /***/ }),
  111571. /* 273 */
  111572. /***/ (function(module, exports, __webpack_require__) {
  111573. var render = function() {
  111574. var _vm = this
  111575. var _h = _vm.$createElement
  111576. var _c = _vm._self._c || _h
  111577. return _c(
  111578. "div",
  111579. { class: _vm.wrapClasses },
  111580. [
  111581. _vm.type !== "textarea"
  111582. ? [
  111583. _vm.prepend
  111584. ? _c(
  111585. "div",
  111586. {
  111587. directives: [
  111588. {
  111589. name: "show",
  111590. rawName: "v-show",
  111591. value: _vm.slotReady,
  111592. expression: "slotReady"
  111593. }
  111594. ],
  111595. class: [_vm.prefixCls + "-group-prepend"]
  111596. },
  111597. [_vm._t("prepend")],
  111598. 2
  111599. )
  111600. : _vm._e(),
  111601. _vm._v(" "),
  111602. _vm.clearable && _vm.currentValue && !_vm.itemDisabled
  111603. ? _c("i", {
  111604. staticClass: "ivu-icon",
  111605. class: [
  111606. "ivu-icon-ios-close-circle",
  111607. _vm.prefixCls + "-icon",
  111608. _vm.prefixCls + "-icon-clear",
  111609. _vm.prefixCls + "-icon-normal"
  111610. ],
  111611. on: { click: _vm.handleClear }
  111612. })
  111613. : _vm.icon
  111614. ? _c("i", {
  111615. staticClass: "ivu-icon",
  111616. class: [
  111617. "ivu-icon-" + _vm.icon,
  111618. _vm.prefixCls + "-icon",
  111619. _vm.prefixCls + "-icon-normal"
  111620. ],
  111621. on: { click: _vm.handleIconClick }
  111622. })
  111623. : _vm.search && _vm.enterButton === false
  111624. ? _c("i", {
  111625. staticClass: "ivu-icon ivu-icon-ios-search",
  111626. class: [
  111627. _vm.prefixCls + "-icon",
  111628. _vm.prefixCls + "-icon-normal",
  111629. _vm.prefixCls + "-search-icon"
  111630. ],
  111631. on: { click: _vm.handleSearch }
  111632. })
  111633. : _vm.showSuffix
  111634. ? _c(
  111635. "span",
  111636. { staticClass: "ivu-input-suffix" },
  111637. [
  111638. _vm._t("suffix", function() {
  111639. return [
  111640. _vm.suffix
  111641. ? _c("i", {
  111642. staticClass: "ivu-icon",
  111643. class: ["ivu-icon-" + _vm.suffix]
  111644. })
  111645. : _vm._e()
  111646. ]
  111647. })
  111648. ],
  111649. 2
  111650. )
  111651. : _vm.showWordLimit
  111652. ? _c("span", { staticClass: "ivu-input-word-count" }, [
  111653. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  111654. ])
  111655. : _vm.password
  111656. ? _c(
  111657. "span",
  111658. {
  111659. staticClass: "ivu-input-suffix",
  111660. on: { click: _vm.handleToggleShowPassword }
  111661. },
  111662. [
  111663. _vm.showPassword
  111664. ? _c("i", {
  111665. staticClass: "ivu-icon ivu-icon-ios-eye-off-outline"
  111666. })
  111667. : _c("i", {
  111668. staticClass: "ivu-icon ivu-icon-ios-eye-outline"
  111669. })
  111670. ]
  111671. )
  111672. : _vm._e(),
  111673. _vm._v(" "),
  111674. _c("transition", { attrs: { name: "fade" } }, [
  111675. !_vm.icon
  111676. ? _c("i", {
  111677. staticClass: "ivu-icon ivu-icon-ios-loading ivu-load-loop",
  111678. class: [
  111679. _vm.prefixCls + "-icon",
  111680. _vm.prefixCls + "-icon-validate"
  111681. ]
  111682. })
  111683. : _vm._e()
  111684. ]),
  111685. _vm._v(" "),
  111686. _c("input", {
  111687. ref: "input",
  111688. class: _vm.inputClasses,
  111689. attrs: {
  111690. id: _vm.elementId,
  111691. autocomplete: _vm.autocomplete,
  111692. spellcheck: _vm.spellcheck,
  111693. type: _vm.currentType,
  111694. placeholder: _vm.placeholder,
  111695. disabled: _vm.itemDisabled,
  111696. maxlength: _vm.maxlength,
  111697. readonly: _vm.readonly,
  111698. name: _vm.name,
  111699. number: _vm.number,
  111700. autofocus: _vm.autofocus
  111701. },
  111702. domProps: { value: _vm.currentValue },
  111703. on: {
  111704. keyup: [
  111705. function($event) {
  111706. if (
  111707. !$event.type.indexOf("key") &&
  111708. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  111709. ) {
  111710. return null
  111711. }
  111712. return _vm.handleEnter.apply(null, arguments)
  111713. },
  111714. _vm.handleKeyup
  111715. ],
  111716. keypress: _vm.handleKeypress,
  111717. keydown: _vm.handleKeydown,
  111718. focus: _vm.handleFocus,
  111719. blur: _vm.handleBlur,
  111720. compositionstart: _vm.handleComposition,
  111721. compositionupdate: _vm.handleComposition,
  111722. compositionend: _vm.handleComposition,
  111723. input: _vm.handleInput,
  111724. change: _vm.handleChange,
  111725. paste: _vm.handlePaste
  111726. }
  111727. }),
  111728. _vm._v(" "),
  111729. _vm.append
  111730. ? _c(
  111731. "div",
  111732. {
  111733. directives: [
  111734. {
  111735. name: "show",
  111736. rawName: "v-show",
  111737. value: _vm.slotReady,
  111738. expression: "slotReady"
  111739. }
  111740. ],
  111741. class: [_vm.prefixCls + "-group-append"]
  111742. },
  111743. [_vm._t("append")],
  111744. 2
  111745. )
  111746. : _vm.search && _vm.enterButton
  111747. ? _c(
  111748. "div",
  111749. {
  111750. class: [
  111751. _vm.prefixCls + "-group-append",
  111752. _vm.prefixCls + "-search"
  111753. ],
  111754. on: { click: _vm.handleSearch }
  111755. },
  111756. [
  111757. _vm.enterButton === true
  111758. ? _c("i", { staticClass: "ivu-icon ivu-icon-ios-search" })
  111759. : [_vm._v(_vm._s(_vm.enterButton))]
  111760. ],
  111761. 2
  111762. )
  111763. : _vm.showPrefix
  111764. ? _c(
  111765. "span",
  111766. { staticClass: "ivu-input-prefix" },
  111767. [
  111768. _vm._t("prefix", function() {
  111769. return [
  111770. _vm.prefix
  111771. ? _c("i", {
  111772. staticClass: "ivu-icon",
  111773. class: ["ivu-icon-" + _vm.prefix]
  111774. })
  111775. : _vm._e()
  111776. ]
  111777. })
  111778. ],
  111779. 2
  111780. )
  111781. : _vm._e()
  111782. ]
  111783. : [
  111784. _c("textarea", {
  111785. ref: "textarea",
  111786. class: _vm.textareaClasses,
  111787. style: _vm.textareaStyles,
  111788. attrs: {
  111789. id: _vm.elementId,
  111790. wrap: _vm.wrap,
  111791. autocomplete: _vm.autocomplete,
  111792. spellcheck: _vm.spellcheck,
  111793. placeholder: _vm.placeholder,
  111794. disabled: _vm.itemDisabled,
  111795. rows: _vm.rows,
  111796. maxlength: _vm.maxlength,
  111797. readonly: _vm.readonly,
  111798. name: _vm.name,
  111799. autofocus: _vm.autofocus
  111800. },
  111801. domProps: { value: _vm.currentValue },
  111802. on: {
  111803. keyup: [
  111804. function($event) {
  111805. if (
  111806. !$event.type.indexOf("key") &&
  111807. _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")
  111808. ) {
  111809. return null
  111810. }
  111811. return _vm.handleEnter.apply(null, arguments)
  111812. },
  111813. _vm.handleKeyup
  111814. ],
  111815. keypress: _vm.handleKeypress,
  111816. keydown: _vm.handleKeydown,
  111817. focus: _vm.handleFocus,
  111818. blur: _vm.handleBlur,
  111819. compositionstart: _vm.handleComposition,
  111820. compositionupdate: _vm.handleComposition,
  111821. compositionend: _vm.handleComposition,
  111822. input: _vm.handleInput,
  111823. paste: _vm.handlePaste
  111824. }
  111825. }),
  111826. _vm._v(" "),
  111827. _vm.showWordLimit
  111828. ? _c("span", { staticClass: "ivu-input-word-count" }, [
  111829. _vm._v(_vm._s(_vm.textLength) + "/" + _vm._s(_vm.upperLimit))
  111830. ])
  111831. : _vm._e()
  111832. ]
  111833. ],
  111834. 2
  111835. )
  111836. }
  111837. var staticRenderFns = []
  111838. render._withStripped = true
  111839. module.exports = { render: render, staticRenderFns: staticRenderFns }
  111840. if (false) {
  111841. module.hot.accept()
  111842. if (module.hot.data) {
  111843. require("vue-hot-reload-api") .rerender("data-v-2cdade09", module.exports)
  111844. }
  111845. }
  111846. /***/ }),
  111847. /* 274 */
  111848. /***/ (function(module, exports, __webpack_require__) {
  111849. var disposed = false
  111850. function injectStyle (ssrContext) {
  111851. if (disposed) return
  111852. __webpack_require__(275)
  111853. __webpack_require__(277)
  111854. }
  111855. var normalizeComponent = __webpack_require__(2)
  111856. /* script */
  111857. var __vue_script__ = __webpack_require__(279)
  111858. /* template */
  111859. var __vue_template__ = __webpack_require__(280)
  111860. /* template functional */
  111861. var __vue_template_functional__ = false
  111862. /* styles */
  111863. var __vue_styles__ = injectStyle
  111864. /* scopeId */
  111865. var __vue_scopeId__ = "data-v-32dd27c6"
  111866. /* moduleIdentifier (server only) */
  111867. var __vue_module_identifier__ = null
  111868. var Component = normalizeComponent(
  111869. __vue_script__,
  111870. __vue_template__,
  111871. __vue_template_functional__,
  111872. __vue_styles__,
  111873. __vue_scopeId__,
  111874. __vue_module_identifier__
  111875. )
  111876. Component.options.__file = "resources/assets/js/main/components/project/task/detail/DescEditor.vue"
  111877. /* hot reload */
  111878. if (false) {(function () {
  111879. var hotAPI = require("vue-hot-reload-api")
  111880. hotAPI.install(require("vue"), false)
  111881. if (!hotAPI.compatible) return
  111882. module.hot.accept()
  111883. if (!module.hot.data) {
  111884. hotAPI.createRecord("data-v-32dd27c6", Component.options)
  111885. } else {
  111886. hotAPI.reload("data-v-32dd27c6", Component.options)
  111887. }
  111888. module.hot.dispose(function (data) {
  111889. disposed = true
  111890. })
  111891. })()}
  111892. module.exports = Component.exports
  111893. /***/ }),
  111894. /* 275 */
  111895. /***/ (function(module, exports, __webpack_require__) {
  111896. // style-loader: Adds some css to the DOM by adding a <style> tag
  111897. // load the styles
  111898. var content = __webpack_require__(276);
  111899. if(typeof content === 'string') content = [[module.i, content, '']];
  111900. if(content.locals) module.exports = content.locals;
  111901. // add the styles to the DOM
  111902. var update = __webpack_require__(1)("250b4972", content, false, {});
  111903. // Hot Module Replacement
  111904. if(false) {
  111905. // When the styles change, update the <style> tags
  111906. if(!content.locals) {
  111907. module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DescEditor.vue", function() {
  111908. var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":false,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DescEditor.vue");
  111909. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  111910. update(newContent);
  111911. });
  111912. }
  111913. // When the module is disposed, remove the <style> tags
  111914. module.hot.dispose(function() { update(); });
  111915. }
  111916. /***/ }),
  111917. /* 276 */
  111918. /***/ (function(module, exports, __webpack_require__) {
  111919. exports = module.exports = __webpack_require__(0)(false);
  111920. // imports
  111921. // module
  111922. exports.push([module.i, "\n.desc-editor-box .desc-editor-content img {\n max-width: 100%;\n max-height: 100%;\n}\n.desc-editor-box .desc-editor-content:before {\n left: 8px !important;\n color: #cccccc !important;\n}\n.desc-editor-transfer {\n background-color: #ffffff;\n}\n.desc-editor-transfer .tox-toolbar > div:last-child > button:last-child {\n margin-right: 64px;\n}\n.desc-editor-transfer .ivu-modal-header {\n display: none;\n}\n.desc-editor-transfer .ivu-modal-close {\n top: 7px;\n z-index: 2;\n}\n.desc-editor-transfer .desc-editor-transfer-body {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body textarea {\n opacity: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body .tox-tinymce {\n border: 0;\n}\n.desc-editor-transfer .desc-editor-transfer-body .tox-tinymce .tox-statusbar span.tox-statusbar__branding a {\n display: none;\n}\n", ""]);
  111923. // exports
  111924. /***/ }),
  111925. /* 277 */
  111926. /***/ (function(module, exports, __webpack_require__) {
  111927. // style-loader: Adds some css to the DOM by adding a <style> tag
  111928. // load the styles
  111929. var content = __webpack_require__(278);
  111930. if(typeof content === 'string') content = [[module.i, content, '']];
  111931. if(content.locals) module.exports = content.locals;
  111932. // add the styles to the DOM
  111933. var update = __webpack_require__(1)("7fc5d739", content, false, {});
  111934. // Hot Module Replacement
  111935. if(false) {
  111936. // When the styles change, update the <style> tags
  111937. if(!content.locals) {
  111938. module.hot.accept("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./DescEditor.vue", function() {
  111939. var newContent = require("!!../../../../../../../../node_modules/css-loader/index.js!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\"vue\":true,\"id\":\"data-v-32dd27c6\",\"scoped\":true,\"hasInlineConfig\":true}!../../../../../../../../node_modules/sass-loader/lib/loader.js!../../../../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=1!./DescEditor.vue");
  111940. if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
  111941. update(newContent);
  111942. });
  111943. }
  111944. // When the module is disposed, remove the <style> tags
  111945. module.hot.dispose(function() { update(); });
  111946. }
  111947. /***/ }),
  111948. /* 278 */
  111949. /***/ (function(module, exports, __webpack_require__) {
  111950. exports = module.exports = __webpack_require__(0)(false);
  111951. // imports
  111952. // module
  111953. exports.push([module.i, "\n.desc-editor-box[data-v-32dd27c6] {\n position: relative;\n}\n.desc-editor-box:hover .desc-editor-tool .tool-button[data-v-32dd27c6] {\n opacity: 0.9;\n}\n.desc-editor-box:hover .desc-editor-tool .tool-button[data-v-32dd27c6]:hover {\n opacity: 1;\n}\n.desc-editor-box .desc-editor-tool[data-v-32dd27c6] {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n top: 5px;\n right: 5px;\n z-index: 2;\n}\n.desc-editor-box .desc-editor-tool .tool-button[data-v-32dd27c6] {\n font-size: 12px;\n opacity: 0;\n -webkit-transition: all 0.2s;\n transition: all 0.2s;\n margin-left: 5px;\n background-color: #ffffff;\n}\n.desc-editor-box .desc-editor-load[data-v-32dd27c6] {\n position: absolute;\n right: 5px;\n bottom: 5px;\n z-index: 2;\n width: 16px;\n height: 16px;\n}\n.desc-editor-content[data-v-32dd27c6] {\n position: relative;\n margin: 10px 0 6px;\n border: 2px solid transparent;\n padding: 5px 8px;\n color: #172b4d;\n line-height: 1.5;\n border-radius: 4px;\n min-height: 56px;\n max-height: 182px;\n background: rgba(9, 30, 66, 0.04);\n overflow: auto;\n}\n.desc-editor-content[data-v-32dd27c6]:focus {\n -webkit-box-shadow: 0 0 0 2px rgba(45, 140, 240, 0.2);\n box-shadow: 0 0 0 2px rgba(45, 140, 240, 0.2);\n}\n.desc-editor-upload[data-v-32dd27c6] {\n display: none;\n width: 0;\n height: 0;\n overflow: hidden;\n}\n", ""]);
  111954. // exports
  111955. /***/ }),
  111956. /* 279 */
  111957. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  111958. "use strict";
  111959. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  111960. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__ = __webpack_require__(53);
  111961. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce__);
  111962. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload__ = __webpack_require__(17);
  111963. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__ImgUpload__);
  111964. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  111965. //
  111966. //
  111967. //
  111968. //
  111969. //
  111970. //
  111971. //
  111972. //
  111973. //
  111974. //
  111975. //
  111976. //
  111977. //
  111978. //
  111979. //
  111980. //
  111981. //
  111982. //
  111983. //
  111984. //
  111985. //
  111986. //
  111987. //
  111988. //
  111989. //
  111990. //
  111991. //
  111992. //
  111993. //
  111994. //
  111995. //
  111996. //
  111997. //
  111998. //
  111999. //
  112000. //
  112001. //
  112002. //
  112003. //
  112004. //
  112005. //
  112006. //
  112007. //
  112008. //
  112009. //
  112010. //
  112011. //
  112012. //
  112013. //
  112014. //
  112015. //
  112016. //
  112017. //
  112018. //
  112019. //
  112020. //
  112021. //
  112022. //
  112023. //
  112024. //
  112025. //
  112026. //
  112027. //
  112028. //
  112029. //
  112030. //
  112031. //
  112032. //
  112033. //
  112034. //
  112035. //
  112036. //
  112037. //
  112038. //
  112039. //
  112040. //
  112041. //
  112042. //
  112043. //
  112044. //
  112045. //
  112046. //
  112047. //
  112048. //
  112049. //
  112050. //
  112051. //
  112052. //
  112053. //
  112054. //
  112055. //
  112056. //
  112057. //
  112058. //
  112059. //
  112060. //
  112061. //
  112062. //
  112063. //
  112064. //
  112065. //
  112066. //
  112067. //
  112068. //
  112069. //
  112070. //
  112071. //
  112072. //
  112073. //
  112074. //
  112075. //
  112076. //
  112077. //
  112078. //
  112079. //
  112080. //
  112081. //
  112082. //
  112083. //
  112084. //
  112085. //
  112086. //
  112087. //
  112088. //
  112089. //
  112090. //
  112091. //
  112092. //
  112093. //
  112094. //
  112095. //
  112096. //
  112097. //
  112098. //
  112099. //
  112100. //
  112101. //
  112102. //
  112103. //
  112104. //
  112105. //
  112106. //
  112107. //
  112108. //
  112109. //
  112110. //
  112111. //
  112112. //
  112113. //
  112114. //
  112115. //
  112116. //
  112117. //
  112118. //
  112119. //
  112120. //
  112121. //
  112122. //
  112123. /* harmony default export */ __webpack_exports__["default"] = ({
  112124. name: 'DescEditor',
  112125. components: { ImgUpload: __WEBPACK_IMPORTED_MODULE_1__ImgUpload___default.a },
  112126. props: {
  112127. taskid: {
  112128. default: ''
  112129. },
  112130. desc: {
  112131. default: ''
  112132. },
  112133. placeholder: {
  112134. type: String,
  112135. default: ''
  112136. }
  112137. },
  112138. data: function data() {
  112139. return {
  112140. loadIng: 0,
  112141. uploadIng: 0,
  112142. id: "tinymce_" + Math.round(Math.random() * 10000),
  112143. content: '',
  112144. submitContent: '',
  112145. editor: null,
  112146. editorT: null,
  112147. cTinyMce: null,
  112148. checkerTimeout: null,
  112149. isTyping: false,
  112150. transfer: false
  112151. };
  112152. },
  112153. mounted: function mounted() {
  112154. var _this = this;
  112155. this.loadData(function (val) {
  112156. _this.submitContent = val;
  112157. _this.content = val;
  112158. _this.init();
  112159. });
  112160. },
  112161. beforeDestroy: function beforeDestroy() {
  112162. if (this.editor !== null) {
  112163. this.editor.destroy();
  112164. }
  112165. if (this.editorT !== null) {
  112166. this.editorT.destroy();
  112167. }
  112168. },
  112169. watch: {
  112170. desc: function desc() {
  112171. var _this2 = this;
  112172. this.loadData(function (val) {
  112173. _this2.submitContent = val;
  112174. _this2.content = val;
  112175. _this2.getEditor().setContent(val);
  112176. });
  112177. }
  112178. },
  112179. methods: {
  112180. loadData: function loadData(callback) {
  112181. var _this3 = this;
  112182. this.loadIng++;
  112183. $A.apiAjax({
  112184. url: 'project/task/desc',
  112185. data: {
  112186. taskid: this.taskid
  112187. },
  112188. complete: function complete() {
  112189. _this3.loadIng--;
  112190. },
  112191. success: function success(res) {
  112192. if (res.ret === 1) {
  112193. callback(res.data.desc);
  112194. } else {
  112195. callback('');
  112196. }
  112197. }
  112198. });
  112199. },
  112200. init: function init() {
  112201. var _this4 = this;
  112202. this.$nextTick(function () {
  112203. __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this4.options(false));
  112204. });
  112205. },
  112206. initTransfer: function initTransfer() {
  112207. var _this5 = this;
  112208. this.$nextTick(function () {
  112209. __WEBPACK_IMPORTED_MODULE_0_tinymce_tinymce___default.a.init(_this5.options(true));
  112210. });
  112211. },
  112212. options: function options(isFull) {
  112213. var _this6 = this;
  112214. var toolbar = void 0;
  112215. if (isFull) {
  112216. toolbar = 'undo redo | styleselect | uploadImages | bold italic underline forecolor backcolor | alignleft aligncenter alignright | outdent indent | link image emoticons media codesample | preview screenload';
  112217. } else {
  112218. toolbar = false;
  112219. }
  112220. return {
  112221. selector: (isFull ? '#T_' : '#') + this.id,
  112222. base_url: $A.serverUrl('js/build'),
  112223. auto_focus: false,
  112224. language: "zh_CN",
  112225. toolbar: toolbar,
  112226. plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak imagetools', 'searchreplace visualblocks code', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons paste textcolor colorpicker imagetools codesample'],
  112227. save_onsavecallback: function save_onsavecallback(e) {
  112228. _this6.handleBlur(e);
  112229. },
  112230. menubar: isFull,
  112231. inline: !isFull,
  112232. inline_boundaries: false,
  112233. paste_data_images: true,
  112234. menu: {
  112235. view: {
  112236. title: 'View',
  112237. items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen screenload | showcomments'
  112238. },
  112239. insert: {
  112240. title: "Insert",
  112241. items: "image link media addcomment pageembed template codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor toc | insertdatetime | uploadImages browseImages"
  112242. }
  112243. },
  112244. codesample_languages: [{ text: "HTML/VUE/XML", value: "markup" }, { text: "JavaScript", value: "javascript" }, { text: "CSS", value: "css" }, { text: "PHP", value: "php" }, { text: "Ruby", value: "ruby" }, { text: "Python", value: "python" }, { text: "Java", value: "java" }, { text: "C", value: "c" }, { text: "C#", value: "csharp" }, { text: "C++", value: "cpp" }],
  112245. height: isFull ? '100%' : $A.rightExists(this.height, '%') ? this.height : $A.runNum(this.height) || 360,
  112246. resize: !isFull,
  112247. convert_urls: false,
  112248. toolbar_mode: 'sliding',
  112249. toolbar_drawer: 'floating',
  112250. setup: function setup(editor) {
  112251. editor.ui.registry.addMenuButton('uploadImages', {
  112252. text: _this6.$L('图片'),
  112253. tooltip: _this6.$L('上传/浏览 图片'),
  112254. fetch: function fetch(callback) {
  112255. var items = [{
  112256. type: 'menuitem',
  112257. text: _this6.$L('上传图片'),
  112258. onAction: function onAction() {
  112259. _this6.$refs.myUpload.handleClick();
  112260. }
  112261. }, {
  112262. type: 'menuitem',
  112263. text: _this6.$L('浏览图片'),
  112264. onAction: function onAction() {
  112265. _this6.$refs.myUpload.browsePicture();
  112266. }
  112267. }];
  112268. callback(items);
  112269. }
  112270. });
  112271. editor.ui.registry.addMenuItem('uploadImages', {
  112272. text: _this6.$L('上传图片'),
  112273. onAction: function onAction() {
  112274. _this6.$refs.myUpload.handleClick();
  112275. }
  112276. });
  112277. editor.ui.registry.addMenuItem('browseImages', {
  112278. text: _this6.$L('浏览图片'),
  112279. onAction: function onAction() {
  112280. _this6.$refs.myUpload.browsePicture();
  112281. }
  112282. });
  112283. if (isFull) {
  112284. editor.ui.registry.addButton('screenload', {
  112285. icon: 'fullscreen',
  112286. tooltip: _this6.$L('退出全屏'),
  112287. onAction: function onAction() {
  112288. _this6.closeFull();
  112289. }
  112290. });
  112291. editor.ui.registry.addMenuItem('screenload', {
  112292. text: _this6.$L('退出全屏'),
  112293. onAction: function onAction() {
  112294. _this6.closeFull();
  112295. }
  112296. });
  112297. editor.on('Init', function (e) {
  112298. _this6.editorT = editor;
  112299. _this6.editorT.setContent(_this6.content);
  112300. });
  112301. } else {
  112302. editor.ui.registry.addButton('screenload', {
  112303. icon: 'fullscreen',
  112304. tooltip: _this6.$L('全屏'),
  112305. onAction: function onAction() {
  112306. _this6.openFull();
  112307. }
  112308. });
  112309. editor.ui.registry.addMenuItem('screenload', {
  112310. text: _this6.$L('全屏'),
  112311. onAction: function onAction() {
  112312. _this6.openFull();
  112313. }
  112314. });
  112315. editor.on('Init', function (e) {
  112316. _this6.editor = editor;
  112317. _this6.editor.setContent(_this6.content);
  112318. _this6.$emit('editorInit', _this6.editor);
  112319. });
  112320. editor.on('KeyUp', function (e) {
  112321. if (_this6.editor !== null) {
  112322. _this6.submitNewContent();
  112323. }
  112324. });
  112325. editor.on('Change', function (e) {
  112326. if (_this6.editor !== null) {
  112327. if (_this6.getContent() !== _this6.value) {
  112328. _this6.submitNewContent();
  112329. }
  112330. _this6.$emit('editorChange', e);
  112331. }
  112332. });
  112333. }
  112334. }
  112335. };
  112336. },
  112337. openFull: function openFull() {
  112338. this.content = this.getContent();
  112339. this.transfer = true;
  112340. this.initTransfer();
  112341. },
  112342. closeFull: function closeFull() {
  112343. this.content = this.getContent();
  112344. this.editor.setContent(this.content);
  112345. this.transfer = false;
  112346. if (this.editorT != null) {
  112347. this.editorT.destroy();
  112348. this.editorT = null;
  112349. }
  112350. },
  112351. transferChange: function transferChange(visible) {
  112352. if (!visible) {
  112353. this.$refs.myTextarea.focus();
  112354. if (this.editorT != null) {
  112355. this.content = this.editorT.getContent();
  112356. this.editor.setContent(this.content);
  112357. this.editorT.destroy();
  112358. this.editorT = null;
  112359. }
  112360. }
  112361. },
  112362. getEditor: function getEditor() {
  112363. return this.transfer ? this.editorT : this.editor;
  112364. },
  112365. getContent: function getContent() {
  112366. if (this.getEditor() === null) {
  112367. return "";
  112368. }
  112369. return this.getEditor().getContent();
  112370. },
  112371. submitNewContent: function submitNewContent() {
  112372. var _this7 = this;
  112373. this.isTyping = true;
  112374. if (this.checkerTimeout !== null) {
  112375. clearTimeout(this.checkerTimeout);
  112376. }
  112377. this.checkerTimeout = setTimeout(function () {
  112378. _this7.isTyping = false;
  112379. }, 300);
  112380. },
  112381. insertContent: function insertContent(content) {
  112382. if (this.getEditor() !== null) {
  112383. this.getEditor().insertContent(content);
  112384. } else {
  112385. this.content += content;
  112386. }
  112387. },
  112388. insertImage: function insertImage(src) {
  112389. this.insertContent('<img src="' + src + '">');
  112390. },
  112391. editorImage: function editorImage(lists) {
  112392. for (var i = 0; i < lists.length; i++) {
  112393. var item = lists[i];
  112394. if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object' && typeof item.url === "string") {
  112395. this.insertImage(item.url);
  112396. }
  112397. }
  112398. },
  112399. handleBlur: function handleBlur() {
  112400. var _this8 = this;
  112401. this.loadIng++;
  112402. setTimeout(function () {
  112403. _this8.handleSave();
  112404. _this8.loadIng--;
  112405. }, 300);
  112406. },
  112407. handleSave: function handleSave() {
  112408. var _this9 = this;
  112409. if (this.transfer) {
  112410. return;
  112411. }
  112412. if (this.submitContent != this.getContent()) {
  112413. var bakContent = this.submitContent;
  112414. this.submitContent = this.getContent();
  112415. //
  112416. this.loadIng++;
  112417. $A.apiAjax({
  112418. url: 'project/task/edit',
  112419. method: 'post',
  112420. data: {
  112421. act: 'desc',
  112422. taskid: this.taskid,
  112423. content: this.submitContent
  112424. },
  112425. complete: function complete() {
  112426. _this9.loadIng--;
  112427. },
  112428. error: function error() {
  112429. _this9.getEditor().setContent(bakContent);
  112430. alert(_this9.$L('网络繁忙,请稍后再试!'));
  112431. },
  112432. success: function success(res) {
  112433. if (res.ret === 1) {
  112434. $A.triggerTaskInfoListener('desc', res.data);
  112435. $A.triggerTaskInfoChange(_this9.taskid);
  112436. _this9.$Message.success(res.msg);
  112437. _this9.$emit('save-success');
  112438. } else {
  112439. _this9.$Modal.error({ title: _this9.$L('温馨提示'), content: res.msg });
  112440. _this9.getEditor().setContent(bakContent);
  112441. }
  112442. }
  112443. });
  112444. }
  112445. }
  112446. }
  112447. });
  112448. /***/ }),
  112449. /* 280 */
  112450. /***/ (function(module, exports, __webpack_require__) {
  112451. var render = function() {
  112452. var _vm = this
  112453. var _h = _vm.$createElement
  112454. var _c = _vm._self._c || _h
  112455. return _c(
  112456. "div",
  112457. [
  112458. _c(
  112459. "div",
  112460. { staticClass: "desc-editor-box" },
  112461. [
  112462. _c(
  112463. "div",
  112464. { staticClass: "desc-editor-tool" },
  112465. [
  112466. _c(
  112467. "Button",
  112468. {
  112469. staticClass: "tool-button",
  112470. attrs: { size: "small" },
  112471. on: { click: _vm.openFull }
  112472. },
  112473. [_vm._v(_vm._s(_vm.$L("全屏")))]
  112474. )
  112475. ],
  112476. 1
  112477. ),
  112478. _vm._v(" "),
  112479. _vm.loadIng > 0
  112480. ? _c(
  112481. "div",
  112482. { staticClass: "desc-editor-load" },
  112483. [_c("WLoading")],
  112484. 1
  112485. )
  112486. : _vm._e(),
  112487. _vm._v(" "),
  112488. _c("div", {
  112489. ref: "myTextarea",
  112490. staticClass: "desc-editor-content",
  112491. attrs: { id: _vm.id, placeholder: _vm.placeholder },
  112492. domProps: { innerHTML: _vm._s(_vm.content) },
  112493. on: { blur: _vm.handleBlur }
  112494. }),
  112495. _vm._v(" "),
  112496. _c("ImgUpload", {
  112497. ref: "myUpload",
  112498. staticClass: "desc-editor-upload",
  112499. attrs: { type: "callback", uploadIng: _vm.uploadIng, num: "50" },
  112500. on: {
  112501. "update:uploadIng": function($event) {
  112502. _vm.uploadIng = $event
  112503. },
  112504. "update:upload-ing": function($event) {
  112505. _vm.uploadIng = $event
  112506. },
  112507. "on-callback": _vm.editorImage
  112508. }
  112509. })
  112510. ],
  112511. 1
  112512. ),
  112513. _vm._v(" "),
  112514. _vm.uploadIng > 0
  112515. ? _c(
  112516. "Spin",
  112517. { attrs: { fix: "" } },
  112518. [
  112519. _c("Icon", {
  112520. staticClass: "upload-control-spin-icon-load",
  112521. attrs: { type: "ios-loading" }
  112522. }),
  112523. _vm._v(" "),
  112524. _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
  112525. ],
  112526. 1
  112527. )
  112528. : _vm._e(),
  112529. _vm._v(" "),
  112530. _c(
  112531. "Modal",
  112532. {
  112533. staticClass: "desc-editor-transfer",
  112534. attrs: { "footer-hide": "", fullscreen: "", transfer: "" },
  112535. on: { "on-visible-change": _vm.transferChange },
  112536. model: {
  112537. value: _vm.transfer,
  112538. callback: function($$v) {
  112539. _vm.transfer = $$v
  112540. },
  112541. expression: "transfer"
  112542. }
  112543. },
  112544. [
  112545. _c(
  112546. "div",
  112547. { attrs: { slot: "close" }, slot: "close" },
  112548. [
  112549. _c("Button", { attrs: { type: "primary", size: "small" } }, [
  112550. _vm._v(_vm._s(_vm.$L("完成")))
  112551. ])
  112552. ],
  112553. 1
  112554. ),
  112555. _vm._v(" "),
  112556. _c("div", { staticClass: "desc-editor-transfer-body" }, [
  112557. _c(
  112558. "textarea",
  112559. { attrs: { id: "T_" + _vm.id, placeholder: _vm.placeholder } },
  112560. [_vm._v(_vm._s(_vm.content))]
  112561. )
  112562. ]),
  112563. _vm._v(" "),
  112564. _vm.uploadIng > 0
  112565. ? _c(
  112566. "Spin",
  112567. { attrs: { fix: "" } },
  112568. [
  112569. _c("Icon", {
  112570. staticClass: "upload-control-spin-icon-load",
  112571. attrs: { type: "ios-loading" }
  112572. }),
  112573. _vm._v(" "),
  112574. _c("div", [_vm._v(_vm._s(_vm.$L("正在上传文件...")))])
  112575. ],
  112576. 1
  112577. )
  112578. : _vm._e()
  112579. ],
  112580. 1
  112581. )
  112582. ],
  112583. 1
  112584. )
  112585. }
  112586. var staticRenderFns = []
  112587. render._withStripped = true
  112588. module.exports = { render: render, staticRenderFns: staticRenderFns }
  112589. if (false) {
  112590. module.hot.accept()
  112591. if (module.hot.data) {
  112592. require("vue-hot-reload-api") .rerender("data-v-32dd27c6", module.exports)
  112593. }
  112594. }
  112595. /***/ }),
  112596. /* 281 */
  112597. /***/ (function(module, exports, __webpack_require__) {
  112598. var render = function() {
  112599. var _vm = this
  112600. var _h = _vm.$createElement
  112601. var _c = _vm._self._c || _h
  112602. return _vm.detail.isassign !== true
  112603. ? _c(
  112604. "div",
  112605. {
  112606. staticClass: "project-task-detail-window",
  112607. class: { "task-detail-show": _vm.visible }
  112608. },
  112609. [
  112610. _c("div", {
  112611. staticClass: "task-detail-bg",
  112612. on: { click: _vm.handleBgClose }
  112613. }),
  112614. _vm._v(" "),
  112615. _c(
  112616. "div",
  112617. {
  112618. staticClass: "task-detail-main",
  112619. on: {
  112620. drop: function($event) {
  112621. $event.preventDefault()
  112622. return _vm.commentPasteDrag($event, "drag")
  112623. },
  112624. dragover: function($event) {
  112625. $event.preventDefault()
  112626. return _vm.commentDragOver(true)
  112627. },
  112628. dragleave: function($event) {
  112629. $event.preventDefault()
  112630. return _vm.commentDragOver(false)
  112631. }
  112632. }
  112633. },
  112634. [
  112635. _c("div", { staticClass: "detail-left" }, [
  112636. _c(
  112637. "div",
  112638. { staticClass: "detail-title-box detail-icon" },
  112639. [
  112640. _c("Input", {
  112641. ref: "titleInput",
  112642. staticClass: "detail-title-input",
  112643. attrs: {
  112644. disabled: !!_vm.loadData.title,
  112645. type: "textarea",
  112646. rows: 1,
  112647. autosize: { minRows: 1, maxRows: 5 },
  112648. maxlength: "60"
  112649. },
  112650. on: {
  112651. "on-keydown": _vm.titleKeydown,
  112652. "on-blur": function($event) {
  112653. return _vm.handleTask("title")
  112654. }
  112655. },
  112656. model: {
  112657. value: _vm.detail.title,
  112658. callback: function($$v) {
  112659. _vm.$set(_vm.detail, "title", $$v)
  112660. },
  112661. expression: "detail.title"
  112662. }
  112663. }),
  112664. _vm._v(" "),
  112665. _vm.detail.projectTitle &&
  112666. _vm.urlProjectid != _vm.detail.projectid
  112667. ? _c("div", { staticClass: "subtitle" }, [
  112668. _vm._v(
  112669. "\n " +
  112670. _vm._s(_vm.$L("所属项目:")) +
  112671. "\n "
  112672. ),
  112673. _c(
  112674. "span",
  112675. {
  112676. staticClass: "project-title",
  112677. on: {
  112678. click: function($event) {
  112679. return _vm.openProject(_vm.detail.projectid)
  112680. }
  112681. }
  112682. },
  112683. [_vm._v(_vm._s(_vm.detail.projectTitle))]
  112684. )
  112685. ])
  112686. : _vm._e(),
  112687. _vm._v(" "),
  112688. _c("div", { staticClass: "subtitle" }, [
  112689. _c(
  112690. "span",
  112691. { staticClass: "z-nick" },
  112692. [
  112693. _c("UserView", {
  112694. attrs: { username: _vm.detail.createuser }
  112695. })
  112696. ],
  112697. 1
  112698. ),
  112699. _vm._v(
  112700. "\n " +
  112701. _vm._s(_vm.$L("创建于:")) +
  112702. "\n "
  112703. ),
  112704. _c("span", [
  112705. _vm._v(
  112706. _vm._s(
  112707. _vm.$A.formatDate("Y-m-d H:i:s", _vm.detail.indate)
  112708. )
  112709. )
  112710. ])
  112711. ])
  112712. ],
  112713. 1
  112714. ),
  112715. _vm._v(" "),
  112716. _c(
  112717. "div",
  112718. { staticClass: "detail-desc-box detail-icon" },
  112719. [
  112720. _c("div", { staticClass: "detail-h2" }, [
  112721. _c("strong", { staticClass: "active" }, [
  112722. _vm._v(_vm._s(_vm.$L("描述")))
  112723. ])
  112724. ]),
  112725. _vm._v(" "),
  112726. _c("DescEditor", {
  112727. attrs: {
  112728. taskid: _vm.detail.id,
  112729. desc: _vm.detail.desc,
  112730. placeholder: _vm.$L("添加详细描述...")
  112731. },
  112732. on: {
  112733. "save-success": function($event) {
  112734. return _vm.handleTask("desc")
  112735. }
  112736. }
  112737. })
  112738. ],
  112739. 1
  112740. ),
  112741. _vm._v(" "),
  112742. _c("ul", { staticClass: "detail-text-box" }, [
  112743. _vm.detail.startdate > 0 && _vm.detail.enddate > 0
  112744. ? _c("li", { staticClass: "text-time detail-icon" }, [
  112745. _c("span", [_vm._v(_vm._s(_vm.$L("计划时间:")))]),
  112746. _vm._v(" "),
  112747. _c("em", [
  112748. _vm._v(
  112749. "\n " +
  112750. _vm._s(
  112751. _vm.$A.formatDate(
  112752. "Y-m-d H:i",
  112753. _vm.detail.startdate
  112754. )
  112755. ) +
  112756. " " +
  112757. _vm._s(_vm.$L("至")) +
  112758. " " +
  112759. _vm._s(
  112760. _vm.$A.formatDate(
  112761. "Y-m-d H:i",
  112762. _vm.detail.enddate
  112763. )
  112764. ) +
  112765. "\n "
  112766. ),
  112767. _vm.detail.overdue
  112768. ? _c("em", { staticClass: "overdue" }, [
  112769. _vm._v("[" + _vm._s(_vm.$L("已超期")) + "]")
  112770. ])
  112771. : _vm._e()
  112772. ])
  112773. ])
  112774. : _vm._e(),
  112775. _vm._v(" "),
  112776. _c(
  112777. "li",
  112778. { staticClass: "text-username detail-icon" },
  112779. [
  112780. _c("span", [_vm._v(_vm._s(_vm.$L("负责人:")))]),
  112781. _vm._v(" "),
  112782. typeof _vm.detail.username !== "undefined"
  112783. ? [
  112784. _vm.detail.username
  112785. ? _c(
  112786. "em",
  112787. [
  112788. _c("UserView", {
  112789. attrs: {
  112790. username: _vm.detail.username,
  112791. showimg: ""
  112792. }
  112793. })
  112794. ],
  112795. 1
  112796. )
  112797. : _c(
  112798. "em",
  112799. [
  112800. _c("div", { staticClass: "uname-no" }, [
  112801. _vm._v(_vm._s(_vm.$L("暂无负责人")))
  112802. ]),
  112803. _vm._v(" "),
  112804. _c(
  112805. "Button",
  112806. {
  112807. staticClass: "uname-button",
  112808. attrs: {
  112809. loading: !!_vm.loadData.claim,
  112810. type: "primary",
  112811. size: "small"
  112812. },
  112813. on: {
  112814. click: function($event) {
  112815. return _vm.handleTask("claimb")
  112816. }
  112817. }
  112818. },
  112819. [_vm._v(_vm._s(_vm.$L("认领任务")))]
  112820. )
  112821. ],
  112822. 1
  112823. ),
  112824. _vm._v(" "),
  112825. _vm.detail.type == "assign" && !_vm.detail.reassign
  112826. ? _c(
  112827. "em",
  112828. [
  112829. _vm.detail.username == _vm.usrName
  112830. ? _c(
  112831. "Button",
  112832. {
  112833. staticClass: "uname-button",
  112834. attrs: {
  112835. type: "success",
  112836. size: "small"
  112837. },
  112838. on: {
  112839. click: function($event) {
  112840. return _vm.handleTask(
  112841. "reassign"
  112842. )
  112843. }
  112844. }
  112845. },
  112846. [_vm._v(_vm._s(_vm.$L("确认接收")))]
  112847. )
  112848. : _c(
  112849. "div",
  112850. { staticClass: "uname-text" },
  112851. [
  112852. _vm._v(
  112853. "[" +
  112854. _vm._s(_vm.$L("等待确认")) +
  112855. "]"
  112856. )
  112857. ]
  112858. )
  112859. ],
  112860. 1
  112861. )
  112862. : _vm._e()
  112863. ]
  112864. : _vm._e()
  112865. ],
  112866. 2
  112867. ),
  112868. _vm._v(" "),
  112869. _vm.followerLength(_vm.detail.follower) > 0
  112870. ? _c("li", { staticClass: "text-follower detail-icon" }, [
  112871. _c("span", [_vm._v(_vm._s(_vm.$L("关注者:")))]),
  112872. _vm._v(" "),
  112873. _c(
  112874. "em",
  112875. _vm._l(_vm.detail.follower, function(fname, findex) {
  112876. return _c(
  112877. "Tag",
  112878. {
  112879. key: findex,
  112880. attrs: { closable: "" },
  112881. on: {
  112882. "on-close": function($event) {
  112883. return _vm.handleTask("unattention", {
  112884. username: fname,
  112885. uisynch: true
  112886. })
  112887. }
  112888. }
  112889. },
  112890. [
  112891. _c("UserView", {
  112892. attrs: { username: fname, showimg: "" }
  112893. })
  112894. ],
  112895. 1
  112896. )
  112897. }),
  112898. 1
  112899. )
  112900. ])
  112901. : _vm._e(),
  112902. _vm._v(" "),
  112903. _c("li", { staticClass: "text-level detail-icon" }, [
  112904. _c("span", [_vm._v(_vm._s(_vm.$L("优先级:")))]),
  112905. _vm._v(" "),
  112906. _c("em", { class: "p" + _vm.detail.level }, [
  112907. _vm._v(_vm._s(_vm.levelFormt(_vm.detail.level)))
  112908. ])
  112909. ]),
  112910. _vm._v(" "),
  112911. _c("li", { staticClass: "text-status detail-icon" }, [
  112912. _c("span", [_vm._v(_vm._s(_vm.$L("任务状态:")))]),
  112913. _vm._v(" "),
  112914. _vm.detail.complete
  112915. ? _c("em", { staticClass: "complete" }, [
  112916. _vm._v(_vm._s(_vm.$L("已完成"))),
  112917. _c("span", { staticClass: "completedate" }, [
  112918. _vm._v(
  112919. "(" +
  112920. _vm._s(
  112921. _vm.$A.formatDate(
  112922. "Y-m-d H:i",
  112923. _vm.detail.completedate
  112924. )
  112925. ) +
  112926. ")"
  112927. )
  112928. ])
  112929. ])
  112930. : _c("em", { staticClass: "unfinished" }, [
  112931. _vm._v(_vm._s(_vm.$L("未完成")))
  112932. ])
  112933. ])
  112934. ]),
  112935. _vm._v(" "),
  112936. _c(
  112937. "div",
  112938. { staticClass: "detail-h2 detail-subtask-icon detail-icon" },
  112939. [
  112940. _c("strong", { staticClass: "active" }, [
  112941. _vm._v(_vm._s(_vm.$L("子任务")))
  112942. ]),
  112943. _vm._v(" "),
  112944. _c(
  112945. "div",
  112946. { staticClass: "detail-button" },
  112947. [
  112948. _c(
  112949. "Button",
  112950. {
  112951. staticClass: "detail-button-batch",
  112952. attrs: { size: "small" },
  112953. on: { click: _vm.subtaskBatchAdd }
  112954. },
  112955. [_vm._v(_vm._s(_vm.$L("批量添加子任务")))]
  112956. ),
  112957. _vm._v(" "),
  112958. _c(
  112959. "Button",
  112960. {
  112961. staticClass: "detail-button-btn",
  112962. attrs: { size: "small" },
  112963. on: {
  112964. click: function($event) {
  112965. return _vm.handleTask("subtaskAdd")
  112966. }
  112967. }
  112968. },
  112969. [_vm._v(_vm._s(_vm.$L("添加子任务")))]
  112970. )
  112971. ],
  112972. 1
  112973. )
  112974. ]
  112975. ),
  112976. _vm._v(" "),
  112977. _c("div", { staticClass: "detail-subtask-box" }, [
  112978. _vm.detail.subtask.length == 0
  112979. ? _c("div", { staticClass: "detail-subtask-none" }, [
  112980. _vm._v(_vm._s(_vm.$L("暂无子任务")))
  112981. ])
  112982. : _c(
  112983. "div",
  112984. [
  112985. _c("Progress", {
  112986. staticClass: "detail-subtask-progress",
  112987. attrs: {
  112988. percent: _vm.subtaskProgress,
  112989. "stroke-width": 5,
  112990. status: "active"
  112991. }
  112992. }),
  112993. _vm._v(" "),
  112994. _c(
  112995. "draggable",
  112996. {
  112997. attrs: {
  112998. draggable: ".detail-subtask-item",
  112999. animation: 150
  113000. },
  113001. model: {
  113002. value: _vm.detail.subtask,
  113003. callback: function($$v) {
  113004. _vm.$set(_vm.detail, "subtask", $$v)
  113005. },
  113006. expression: "detail.subtask"
  113007. }
  113008. },
  113009. _vm._l(_vm.detail.subtask, function(
  113010. subitem,
  113011. subindex
  113012. ) {
  113013. return _c(
  113014. "div",
  113015. {
  113016. key: subindex,
  113017. staticClass: "detail-subtask-item"
  113018. },
  113019. [
  113020. _c("Checkbox", {
  113021. attrs: {
  113022. "true-value": "complete",
  113023. "false-value": "unfinished"
  113024. },
  113025. on: {
  113026. "on-change": function($event) {
  113027. return _vm.handleTask(
  113028. "subtaskBlur",
  113029. subindex,
  113030. "status"
  113031. )
  113032. }
  113033. },
  113034. model: {
  113035. value: subitem.status,
  113036. callback: function($$v) {
  113037. _vm.$set(subitem, "status", $$v)
  113038. },
  113039. expression: "subitem.status"
  113040. }
  113041. }),
  113042. _vm._v(" "),
  113043. subitem.uname
  113044. ? _c("UserView", {
  113045. attrs: {
  113046. username: subitem.uname,
  113047. imgsize: "20",
  113048. imgfontsize: "14",
  113049. showname: false,
  113050. showimg: ""
  113051. }
  113052. })
  113053. : _vm._e(),
  113054. _vm._v(" "),
  113055. _c("Input", {
  113056. ref: "subtaskInput_" + subindex,
  113057. refInFor: true,
  113058. staticClass: "detail-subtask-input",
  113059. class: {
  113060. "subtask-complete":
  113061. subitem.status == "complete"
  113062. },
  113063. attrs: {
  113064. type: "textarea",
  113065. readonly: subitem.status == "complete",
  113066. rows: 1,
  113067. autosize: { minRows: 1, maxRows: 5 },
  113068. maxlength: "255",
  113069. placeholder: _vm.$L("子任务描述...")
  113070. },
  113071. on: {
  113072. "on-keydown": function($event) {
  113073. return _vm.subtaskKeydown(
  113074. subindex,
  113075. $event
  113076. )
  113077. },
  113078. "on-blur": function($event) {
  113079. return _vm.handleTask(
  113080. "subtaskBlur",
  113081. subindex,
  113082. "detail"
  113083. )
  113084. }
  113085. },
  113086. model: {
  113087. value: subitem.detail,
  113088. callback: function($$v) {
  113089. _vm.$set(subitem, "detail", $$v)
  113090. },
  113091. expression: "subitem.detail"
  113092. }
  113093. }),
  113094. _vm._v(" "),
  113095. _c("div", [
  113096. _vm._v(_vm._s(_vm.php_time(subitem.indate)))
  113097. ]),
  113098. _vm._v(" "),
  113099. _c(
  113100. "div",
  113101. {
  113102. staticClass: "detail-subtask-right",
  113103. style:
  113104. subitem.stip === "show"
  113105. ? { opacity: 1 }
  113106. : {}
  113107. },
  113108. [
  113109. _c(
  113110. "Poptip",
  113111. {
  113112. staticClass: "detail-subtask-ricon",
  113113. attrs: { transfer: "" },
  113114. on: {
  113115. "on-popper-show": function($event) {
  113116. return _vm.$set(
  113117. subitem,
  113118. "stip",
  113119. "show"
  113120. )
  113121. },
  113122. "on-popper-hide": function($event) {
  113123. ;[
  113124. _vm.$set(subitem, "stip", ""),
  113125. _vm.handleTask(
  113126. "subtaskBlur",
  113127. subindex,
  113128. "uname"
  113129. )
  113130. ]
  113131. }
  113132. }
  113133. },
  113134. [
  113135. _c("Icon", {
  113136. attrs: { type: "md-person" }
  113137. }),
  113138. _vm._v(" "),
  113139. _c(
  113140. "div",
  113141. {
  113142. attrs: { slot: "content" },
  113143. slot: "content"
  113144. },
  113145. [
  113146. _c(
  113147. "div",
  113148. {
  113149. staticStyle: {
  113150. width: "280px"
  113151. }
  113152. },
  113153. [
  113154. _vm._v(
  113155. "\n " +
  113156. _vm._s(
  113157. _vm.$L("子任务负责人")
  113158. ) +
  113159. "\n "
  113160. ),
  113161. _c("UserInput", {
  113162. staticStyle: {
  113163. margin: "5px 0 3px"
  113164. },
  113165. attrs: {
  113166. projectid:
  113167. _vm.detail.projectid,
  113168. transfer: false,
  113169. placeholder: _vm.$L(
  113170. "输入关键词搜索"
  113171. )
  113172. },
  113173. model: {
  113174. value: subitem.uname,
  113175. callback: function($$v) {
  113176. _vm.$set(
  113177. subitem,
  113178. "uname",
  113179. $$v
  113180. )
  113181. },
  113182. expression:
  113183. "subitem.uname"
  113184. }
  113185. })
  113186. ],
  113187. 1
  113188. )
  113189. ]
  113190. )
  113191. ],
  113192. 1
  113193. ),
  113194. _vm._v(" "),
  113195. subitem.uname != "" && _vm.isAdmin
  113196. ? _c(
  113197. "div",
  113198. {
  113199. staticClass:
  113200. "detail-subtask-ricon"
  113201. },
  113202. [
  113203. _c(
  113204. "Poptip",
  113205. {
  113206. staticClass:
  113207. "detail-subtask-ricon",
  113208. attrs: { transfer: "" },
  113209. on: {
  113210. "on-popper-show": function(
  113211. $event
  113212. ) {
  113213. return _vm.$set(
  113214. subitem,
  113215. "stip",
  113216. "show"
  113217. )
  113218. },
  113219. "on-popper-hide": function(
  113220. $event
  113221. ) {
  113222. ;[
  113223. _vm.$set(
  113224. subitem,
  113225. "stip",
  113226. ""
  113227. ),
  113228. _vm.handleTask(
  113229. "subtaskBlur",
  113230. subindex,
  113231. "uname"
  113232. )
  113233. ]
  113234. }
  113235. }
  113236. },
  113237. [
  113238. _c("Icon", {
  113239. attrs: { type: "md-link" }
  113240. }),
  113241. _vm._v(" "),
  113242. _c(
  113243. "div",
  113244. {
  113245. attrs: {
  113246. slot: "content"
  113247. },
  113248. slot: "content"
  113249. },
  113250. [
  113251. _c(
  113252. "div",
  113253. {
  113254. staticStyle: {
  113255. width: "280px"
  113256. }
  113257. },
  113258. [
  113259. _vm._v(
  113260. "\n " +
  113261. _vm._s(
  113262. _vm.$L(
  113263. "任务关联"
  113264. )
  113265. ) +
  113266. "\n "
  113267. ),
  113268. _c("Cascader", {
  113269. directives: [
  113270. {
  113271. name: "width",
  113272. rawName:
  113273. "v-width",
  113274. value: 200,
  113275. expression:
  113276. "200"
  113277. }
  113278. ],
  113279. attrs: {
  113280. data:
  113281. _vm.linkData,
  113282. "load-data":
  113283. _vm.linkLoadData
  113284. }
  113285. }),
  113286. _vm._v(" "),
  113287. _c(
  113288. "div",
  113289. {
  113290. staticClass:
  113291. "user-id-input-bottom"
  113292. },
  113293. [
  113294. _c(
  113295. "Button",
  113296. {
  113297. attrs: {
  113298. type:
  113299. "default",
  113300. size:
  113301. "small"
  113302. }
  113303. },
  113304. [
  113305. _vm._v(
  113306. _vm._s(
  113307. _vm.$L(
  113308. "取消"
  113309. )
  113310. )
  113311. )
  113312. ]
  113313. ),
  113314. _vm._v(" "),
  113315. _c(
  113316. "Button",
  113317. {
  113318. attrs: {
  113319. type:
  113320. "primary",
  113321. size:
  113322. "small"
  113323. }
  113324. },
  113325. [
  113326. _vm._v(
  113327. _vm._s(
  113328. _vm.$L(
  113329. "确定"
  113330. )
  113331. )
  113332. )
  113333. ]
  113334. )
  113335. ],
  113336. 1
  113337. )
  113338. ],
  113339. 1
  113340. )
  113341. ]
  113342. )
  113343. ],
  113344. 1
  113345. )
  113346. ],
  113347. 1
  113348. )
  113349. : _vm._e(),
  113350. _vm._v(" "),
  113351. subitem.detail == ""
  113352. ? _c(
  113353. "div",
  113354. {
  113355. staticClass:
  113356. "detail-subtask-ricon"
  113357. },
  113358. [
  113359. _c("Icon", {
  113360. attrs: { type: "md-trash" },
  113361. on: {
  113362. click: function($event) {
  113363. return _vm.handleTask(
  113364. "subtaskDelete",
  113365. subindex,
  113366. "delete"
  113367. )
  113368. }
  113369. }
  113370. })
  113371. ],
  113372. 1
  113373. )
  113374. : _c(
  113375. "Poptip",
  113376. {
  113377. staticClass:
  113378. "detail-subtask-ricon",
  113379. attrs: {
  113380. transfer: "",
  113381. confirm: "",
  113382. title: _vm.$L(
  113383. "你确定你要删除这个子任务吗?"
  113384. )
  113385. },
  113386. on: {
  113387. "on-ok": function($event) {
  113388. return _vm.handleTask(
  113389. "subtaskDelete",
  113390. subindex,
  113391. "delete"
  113392. )
  113393. },
  113394. "on-popper-show": function(
  113395. $event
  113396. ) {
  113397. return _vm.$set(
  113398. subitem,
  113399. "stip",
  113400. "show"
  113401. )
  113402. },
  113403. "on-popper-hide": function(
  113404. $event
  113405. ) {
  113406. return _vm.$set(
  113407. subitem,
  113408. "stip",
  113409. ""
  113410. )
  113411. }
  113412. }
  113413. },
  113414. [
  113415. _c("Icon", {
  113416. attrs: { type: "md-trash" }
  113417. })
  113418. ],
  113419. 1
  113420. )
  113421. ],
  113422. 1
  113423. )
  113424. ],
  113425. 1
  113426. )
  113427. }),
  113428. 0
  113429. )
  113430. ],
  113431. 1
  113432. )
  113433. ]),
  113434. _vm._v(" "),
  113435. _c(
  113436. "div",
  113437. {
  113438. style: "" + (_vm.detail.filenum > 0 ? "" : "display:none")
  113439. },
  113440. [
  113441. _c(
  113442. "div",
  113443. { staticClass: "detail-h2 detail-file-box detail-icon" },
  113444. [
  113445. _c("strong", { staticClass: "active" }, [
  113446. _vm._v(_vm._s(_vm.$L("附件")))
  113447. ]),
  113448. _vm._v(" "),
  113449. _c(
  113450. "div",
  113451. { staticClass: "detail-button" },
  113452. [
  113453. _c(
  113454. "Button",
  113455. {
  113456. staticClass: "detail-button-btn",
  113457. attrs: { size: "small" },
  113458. on: {
  113459. click: function($event) {
  113460. return _vm.handleTask("fileupload")
  113461. }
  113462. }
  113463. },
  113464. [_vm._v(_vm._s(_vm.$L("添加附件")))]
  113465. )
  113466. ],
  113467. 1
  113468. )
  113469. ]
  113470. ),
  113471. _vm._v(" "),
  113472. _c("project-task-files", {
  113473. ref: "projectUpload",
  113474. attrs: {
  113475. taskid: _vm.taskid,
  113476. projectid: _vm.detail.projectid,
  113477. simple: true
  113478. },
  113479. on: {
  113480. change: function($event) {
  113481. return _vm.handleTask("filechange", $event)
  113482. }
  113483. }
  113484. })
  113485. ],
  113486. 1
  113487. ),
  113488. _vm._v(" "),
  113489. _c(
  113490. "div",
  113491. { staticClass: "detail-h2 detail-comment-box detail-icon" },
  113492. [
  113493. _c(
  113494. "strong",
  113495. {
  113496. staticClass: "link",
  113497. class: { active: _vm.logType == "评论" },
  113498. on: {
  113499. click: function($event) {
  113500. _vm.logType = "评论"
  113501. }
  113502. }
  113503. },
  113504. [_vm._v(_vm._s(_vm.$L("评论")))]
  113505. ),
  113506. _c("em"),
  113507. _c(
  113508. "strong",
  113509. {
  113510. staticClass: "link",
  113511. class: { active: _vm.logType == "日志" },
  113512. on: {
  113513. click: function($event) {
  113514. _vm.logType = "日志"
  113515. }
  113516. }
  113517. },
  113518. [_vm._v(_vm._s(_vm.$L("操作记录")))]
  113519. )
  113520. ]
  113521. ),
  113522. _vm._v(" "),
  113523. _c(
  113524. "div",
  113525. { staticClass: "detail-log-box" },
  113526. [
  113527. _c("project-task-logs", {
  113528. ref: "log",
  113529. attrs: {
  113530. logtype: _vm.logType,
  113531. projectid: _vm.detail.projectid,
  113532. taskid: _vm.taskid,
  113533. pagesize: 5
  113534. }
  113535. })
  113536. ],
  113537. 1
  113538. ),
  113539. _vm._v(" "),
  113540. _c(
  113541. "div",
  113542. { staticClass: "detail-footer-box" },
  113543. [
  113544. _c("WInput", {
  113545. staticClass: "comment-input",
  113546. attrs: {
  113547. type: "textarea",
  113548. rows: 1,
  113549. autosize: { minRows: 1, maxRows: 3 },
  113550. maxlength: 255,
  113551. placeholder: _vm.$L(
  113552. "输入评论,Enter发表评论,Shift+Enter换行"
  113553. )
  113554. },
  113555. on: {
  113556. "on-keydown": _vm.commentKeydown,
  113557. "on-input-paste": _vm.commentPasteDrag
  113558. },
  113559. model: {
  113560. value: _vm.commentText,
  113561. callback: function($$v) {
  113562. _vm.commentText = $$v
  113563. },
  113564. expression: "commentText"
  113565. }
  113566. }),
  113567. _vm._v(" "),
  113568. _c(
  113569. "Button",
  113570. {
  113571. attrs: {
  113572. loading: !!_vm.loadData.comment,
  113573. disabled: !_vm.commentText,
  113574. type: "primary"
  113575. },
  113576. on: {
  113577. click: function($event) {
  113578. return _vm.handleTask("comment")
  113579. }
  113580. }
  113581. },
  113582. [_vm._v("评 论")]
  113583. )
  113584. ],
  113585. 1
  113586. )
  113587. ]),
  113588. _vm._v(" "),
  113589. _vm.detail.username
  113590. ? _c(
  113591. "div",
  113592. {
  113593. staticClass: "detail-right",
  113594. class: { "open-menu": _vm.openMenu }
  113595. },
  113596. [
  113597. _vm.detail.complete
  113598. ? _c(
  113599. "Button",
  113600. {
  113601. staticClass: "btn",
  113602. attrs: {
  113603. loading: !!_vm.loadData.unfinished,
  113604. icon: "md-checkmark-circle-outline"
  113605. },
  113606. on: {
  113607. click: function($event) {
  113608. return _vm.handleTask("unfinished")
  113609. }
  113610. }
  113611. },
  113612. [_vm._v(_vm._s(_vm.$L("标记未完成")))]
  113613. )
  113614. : _c(
  113615. "Button",
  113616. {
  113617. staticClass: "btn",
  113618. attrs: {
  113619. loading: !!_vm.loadData.complete,
  113620. icon: "md-radio-button-off"
  113621. },
  113622. on: {
  113623. click: function($event) {
  113624. return _vm.handleTask("complete")
  113625. }
  113626. }
  113627. },
  113628. [_vm._v(_vm._s(_vm.$L("标记已完成")))]
  113629. ),
  113630. _vm._v(" "),
  113631. _c(
  113632. "Dropdown",
  113633. {
  113634. staticClass: "block",
  113635. attrs: { trigger: "click" },
  113636. on: {
  113637. "on-click": _vm.handleTask,
  113638. "on-visible-change": _vm.handleSubwinToggle
  113639. }
  113640. },
  113641. [
  113642. _c(
  113643. "Button",
  113644. {
  113645. staticClass: "btn",
  113646. attrs: {
  113647. loading: !!_vm.loadData.level,
  113648. icon: "md-funnel"
  113649. }
  113650. },
  113651. [_vm._v(_vm._s(_vm.$L("优先级")))]
  113652. ),
  113653. _vm._v(" "),
  113654. _c(
  113655. "DropdownMenu",
  113656. { attrs: { slot: "list" }, slot: "list" },
  113657. _vm._l([1, 2, 3, 4], function(level) {
  113658. return _c(
  113659. "DropdownItem",
  113660. {
  113661. key: level,
  113662. class: "p" + level,
  113663. attrs: { name: "level-" + level }
  113664. },
  113665. [
  113666. _vm._v(_vm._s(_vm.levelFormt(level))),
  113667. _vm.detail.level == level
  113668. ? _c("Icon", {
  113669. staticClass: "checkmark",
  113670. attrs: { type: "md-checkmark" }
  113671. })
  113672. : _vm._e()
  113673. ],
  113674. 1
  113675. )
  113676. }),
  113677. 1
  113678. )
  113679. ],
  113680. 1
  113681. ),
  113682. _vm._v(" "),
  113683. _c(
  113684. "Poptip",
  113685. {
  113686. staticClass: "block",
  113687. attrs: { placement: "bottom", transfer: "" },
  113688. on: {
  113689. "on-popper-show": function($event) {
  113690. ;[
  113691. _vm.handleUsernameShow(),
  113692. _vm.handleSubwinToggle(true)
  113693. ]
  113694. },
  113695. "on-popper-hide": function($event) {
  113696. return _vm.handleSubwinToggle(false)
  113697. }
  113698. }
  113699. },
  113700. [
  113701. _c(
  113702. "Button",
  113703. {
  113704. staticClass: "btn",
  113705. attrs: {
  113706. loading: !!_vm.loadData.username,
  113707. icon: "md-person"
  113708. }
  113709. },
  113710. [_vm._v(_vm._s(_vm.$L("负责人")))]
  113711. ),
  113712. _vm._v(" "),
  113713. _c(
  113714. "div",
  113715. { attrs: { slot: "content" }, slot: "content" },
  113716. [
  113717. _c(
  113718. "div",
  113719. { staticStyle: { width: "280px" } },
  113720. [
  113721. _vm._v(
  113722. "\n " +
  113723. _vm._s(_vm.$L("选择负责人")) +
  113724. "\n "
  113725. ),
  113726. _c("UserInput", {
  113727. staticStyle: { margin: "5px 0 3px" },
  113728. attrs: {
  113729. projectid: _vm.detail.projectid,
  113730. nousername: _vm.detail.username,
  113731. transfer: false,
  113732. placeholder: _vm.$L("输入关键词搜索")
  113733. },
  113734. on: {
  113735. change: function($event) {
  113736. return _vm.handleTask(
  113737. "usernameb",
  113738. $event
  113739. )
  113740. }
  113741. },
  113742. model: {
  113743. value: _vm.detail.newusername,
  113744. callback: function($$v) {
  113745. _vm.$set(_vm.detail, "newusername", $$v)
  113746. },
  113747. expression: "detail.newusername"
  113748. }
  113749. })
  113750. ],
  113751. 1
  113752. )
  113753. ]
  113754. )
  113755. ],
  113756. 1
  113757. ),
  113758. _vm._v(" "),
  113759. _c(
  113760. "Poptip",
  113761. {
  113762. ref: "timeRef",
  113763. staticClass: "block",
  113764. attrs: { placement: "bottom", transfer: "" },
  113765. on: {
  113766. "on-popper-show": function($event) {
  113767. ;[
  113768. _vm.handleTask("inittime"),
  113769. _vm.handleSubwinToggle(true)
  113770. ]
  113771. },
  113772. "on-popper-hide": function($event) {
  113773. return _vm.handleSubwinToggle(false)
  113774. }
  113775. }
  113776. },
  113777. [
  113778. _c(
  113779. "Button",
  113780. {
  113781. staticClass: "btn",
  113782. attrs: {
  113783. loading:
  113784. !!_vm.loadData.plannedtime ||
  113785. !!_vm.loadData.unplannedtime,
  113786. icon: "md-calendar"
  113787. }
  113788. },
  113789. [_vm._v(_vm._s(_vm.$L("计划时间")))]
  113790. ),
  113791. _vm._v(" "),
  113792. _c(
  113793. "div",
  113794. { attrs: { slot: "content" }, slot: "content" },
  113795. [
  113796. _c(
  113797. "div",
  113798. { staticStyle: { width: "280px" } },
  113799. [
  113800. _vm._v(
  113801. "\n " +
  113802. _vm._s(_vm.$L("选择日期范围")) +
  113803. "\n "
  113804. ),
  113805. _c("Date-picker", {
  113806. staticStyle: {
  113807. display: "block",
  113808. margin: "5px 0 3px"
  113809. },
  113810. attrs: {
  113811. options: _vm.timeOptions,
  113812. placeholder: _vm.$L("日期范围"),
  113813. format: "yyyy-MM-dd HH:mm",
  113814. type: "datetimerange",
  113815. placement: "bottom"
  113816. },
  113817. on: {
  113818. "on-ok": function($event) {
  113819. return _vm.handleTask("plannedtimeb")
  113820. },
  113821. "on-clear": function($event) {
  113822. return _vm.handleTask("unplannedtimeb")
  113823. }
  113824. },
  113825. model: {
  113826. value: _vm.timeValue,
  113827. callback: function($$v) {
  113828. _vm.timeValue = $$v
  113829. },
  113830. expression: "timeValue"
  113831. }
  113832. })
  113833. ],
  113834. 1
  113835. )
  113836. ]
  113837. )
  113838. ],
  113839. 1
  113840. ),
  113841. _vm._v(" "),
  113842. _c(
  113843. "Button",
  113844. {
  113845. staticClass: "btn",
  113846. attrs: { icon: "md-attach" },
  113847. on: {
  113848. click: function($event) {
  113849. return _vm.handleTask("fileupload")
  113850. }
  113851. }
  113852. },
  113853. [_vm._v(_vm._s(_vm.$L("添加附件")))]
  113854. ),
  113855. _vm._v(" "),
  113856. _vm.detail.username == _vm.usrName
  113857. ? _c(
  113858. "Poptip",
  113859. {
  113860. ref: "attentionRef",
  113861. staticClass: "block",
  113862. attrs: { placement: "bottom", transfer: "" },
  113863. on: {
  113864. "on-popper-show": function($event) {
  113865. ;[
  113866. _vm.handleAttentionShow(),
  113867. _vm.handleSubwinToggle(true)
  113868. ]
  113869. },
  113870. "on-popper-hide": function($event) {
  113871. return _vm.handleSubwinToggle(false)
  113872. }
  113873. }
  113874. },
  113875. [
  113876. _c(
  113877. "Button",
  113878. {
  113879. staticClass: "btn",
  113880. attrs: {
  113881. loading: !!_vm.loadData.attention,
  113882. icon: "md-at"
  113883. }
  113884. },
  113885. [_vm._v(_vm._s(_vm.$L("关注人")))]
  113886. ),
  113887. _vm._v(" "),
  113888. _c(
  113889. "div",
  113890. { attrs: { slot: "content" }, slot: "content" },
  113891. [
  113892. _c(
  113893. "div",
  113894. { staticStyle: { width: "280px" } },
  113895. [
  113896. _vm._v(
  113897. "\n " +
  113898. _vm._s(_vm.$L("选择关注人")) +
  113899. "\n "
  113900. ),
  113901. _c("UserInput", {
  113902. staticStyle: { margin: "5px 0 3px" },
  113903. attrs: {
  113904. projectid: _vm.detail.projectid,
  113905. multiple: true,
  113906. transfer: false,
  113907. placeholder: _vm.$L("输入关键词搜索")
  113908. },
  113909. on: {
  113910. "on-confirm": function($event) {
  113911. return _vm.handleTask(
  113912. "attention",
  113913. true
  113914. )
  113915. }
  113916. },
  113917. model: {
  113918. value: _vm.detail.attentionLists,
  113919. callback: function($$v) {
  113920. _vm.$set(
  113921. _vm.detail,
  113922. "attentionLists",
  113923. $$v
  113924. )
  113925. },
  113926. expression: "detail.attentionLists"
  113927. }
  113928. })
  113929. ],
  113930. 1
  113931. )
  113932. ]
  113933. )
  113934. ],
  113935. 1
  113936. )
  113937. : _vm.haveAttention(_vm.detail.follower)
  113938. ? _c(
  113939. "Button",
  113940. {
  113941. staticClass: "btn",
  113942. attrs: {
  113943. loading: !!_vm.loadData.unattention,
  113944. icon: "md-at"
  113945. },
  113946. on: {
  113947. click: function($event) {
  113948. return _vm.handleTask("unattention", {
  113949. username: _vm.usrName
  113950. })
  113951. }
  113952. }
  113953. },
  113954. [_vm._v(_vm._s(_vm.$L("取消关注")))]
  113955. )
  113956. : _c(
  113957. "Button",
  113958. {
  113959. staticClass: "btn",
  113960. attrs: {
  113961. loading: !!_vm.loadData.attention,
  113962. icon: "md-at"
  113963. },
  113964. on: {
  113965. click: function($event) {
  113966. return _vm.handleTask("attentiona")
  113967. }
  113968. }
  113969. },
  113970. [_vm._v(_vm._s(_vm.$L("关注任务")))]
  113971. ),
  113972. _vm._v(" "),
  113973. !_vm.detail.archived
  113974. ? _c(
  113975. "Button",
  113976. {
  113977. staticClass: "btn",
  113978. attrs: {
  113979. loading: !!_vm.loadData.archived,
  113980. icon: "md-filing"
  113981. },
  113982. on: {
  113983. click: function($event) {
  113984. return _vm.handleTask("archived")
  113985. }
  113986. }
  113987. },
  113988. [_vm._v(_vm._s(_vm.$L("归档")))]
  113989. )
  113990. : _c(
  113991. "Button",
  113992. {
  113993. staticClass: "btn",
  113994. attrs: {
  113995. loading: !!_vm.loadData.unarchived,
  113996. icon: "md-filing"
  113997. },
  113998. on: {
  113999. click: function($event) {
  114000. return _vm.handleTask("unarchived")
  114001. }
  114002. }
  114003. },
  114004. [_vm._v(_vm._s(_vm.$L("取消归档")))]
  114005. ),
  114006. _vm._v(" "),
  114007. _c(
  114008. "Button",
  114009. {
  114010. staticClass: "btn",
  114011. attrs: {
  114012. loading: !!_vm.loadData.delete,
  114013. icon: "md-trash",
  114014. type: "error",
  114015. ghost: ""
  114016. },
  114017. on: {
  114018. click: function($event) {
  114019. return _vm.handleTask("deleteb")
  114020. }
  114021. }
  114022. },
  114023. [_vm._v(_vm._s(_vm.$L("删除")))]
  114024. )
  114025. ],
  114026. 1
  114027. )
  114028. : _vm._e(),
  114029. _vm._v(" "),
  114030. _vm.detail.complete
  114031. ? _c(
  114032. "div",
  114033. { staticClass: "detail-complete" },
  114034. [
  114035. _c("Icon", {
  114036. attrs: { type: "md-checkmark-circle-outline" }
  114037. })
  114038. ],
  114039. 1
  114040. )
  114041. : _vm._e(),
  114042. _vm._v(" "),
  114043. _c(
  114044. "div",
  114045. {
  114046. staticClass: "detail-menu",
  114047. on: {
  114048. click: function($event) {
  114049. _vm.openMenu = !_vm.openMenu
  114050. }
  114051. }
  114052. },
  114053. [_c("Icon", { attrs: { type: "md-menu", size: "24" } })],
  114054. 1
  114055. ),
  114056. _vm._v(" "),
  114057. _c("div", { staticClass: "detail-cancel" }, [
  114058. _c("em", {
  114059. on: {
  114060. click: function($event) {
  114061. _vm.visible = false
  114062. }
  114063. }
  114064. })
  114065. ]),
  114066. _vm._v(" "),
  114067. _vm.detailDragOver
  114068. ? _c("div", { staticClass: "detail-drag-over" }, [
  114069. _c("div", { staticClass: "detail-drag-text" }, [
  114070. _vm._v(
  114071. _vm._s(
  114072. _vm.$L("拖动到这里添加附件至 %", _vm.detail.title)
  114073. )
  114074. )
  114075. ])
  114076. ])
  114077. : _vm._e()
  114078. ]
  114079. )
  114080. ]
  114081. )
  114082. : _vm._e()
  114083. }
  114084. var staticRenderFns = []
  114085. render._withStripped = true
  114086. module.exports = { render: render, staticRenderFns: staticRenderFns }
  114087. if (false) {
  114088. module.hot.accept()
  114089. if (module.hot.data) {
  114090. require("vue-hot-reload-api") .rerender("data-v-57fd86f0", module.exports)
  114091. }
  114092. }
  114093. /***/ }),
  114094. /* 282 */
  114095. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114096. "use strict";
  114097. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(4);
  114098. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
  114099. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue__ = __webpack_require__(283);
  114100. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__detail_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__detail_vue__);
  114101. var detailElement = function detailElement(reportid, reporttitle) {
  114102. return new Promise(function () {
  114103. var custom = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.extend(__WEBPACK_IMPORTED_MODULE_1__detail_vue___default.a);
  114104. var instance = new custom({
  114105. data: {
  114106. reportid: reportid,
  114107. reporttitle: reporttitle
  114108. }
  114109. });
  114110. instance.$mount();
  114111. document.body.appendChild(instance.$el);
  114112. });
  114113. };
  114114. /* harmony default export */ __webpack_exports__["a"] = (detailElement);
  114115. /***/ }),
  114116. /* 283 */
  114117. /***/ (function(module, exports, __webpack_require__) {
  114118. var disposed = false
  114119. var normalizeComponent = __webpack_require__(2)
  114120. /* script */
  114121. var __vue_script__ = __webpack_require__(284)
  114122. /* template */
  114123. var __vue_template__ = __webpack_require__(285)
  114124. /* template functional */
  114125. var __vue_template_functional__ = false
  114126. /* styles */
  114127. var __vue_styles__ = null
  114128. /* scopeId */
  114129. var __vue_scopeId__ = null
  114130. /* moduleIdentifier (server only) */
  114131. var __vue_module_identifier__ = null
  114132. var Component = normalizeComponent(
  114133. __vue_script__,
  114134. __vue_template__,
  114135. __vue_template_functional__,
  114136. __vue_styles__,
  114137. __vue_scopeId__,
  114138. __vue_module_identifier__
  114139. )
  114140. Component.options.__file = "resources/assets/js/main/components/report/detail/detail.vue"
  114141. /* hot reload */
  114142. if (false) {(function () {
  114143. var hotAPI = require("vue-hot-reload-api")
  114144. hotAPI.install(require("vue"), false)
  114145. if (!hotAPI.compatible) return
  114146. module.hot.accept()
  114147. if (!module.hot.data) {
  114148. hotAPI.createRecord("data-v-5954d22e", Component.options)
  114149. } else {
  114150. hotAPI.reload("data-v-5954d22e", Component.options)
  114151. }
  114152. module.hot.dispose(function (data) {
  114153. disposed = true
  114154. })
  114155. })()}
  114156. module.exports = Component.exports
  114157. /***/ }),
  114158. /* 284 */
  114159. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  114160. "use strict";
  114161. Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
  114162. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__content__ = __webpack_require__(65);
  114163. /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__content___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__content__);
  114164. //
  114165. //
  114166. //
  114167. //
  114168. //
  114169. //
  114170. //
  114171. //
  114172. //
  114173. //
  114174. //
  114175. //
  114176. /* harmony default export */ __webpack_exports__["default"] = ({
  114177. components: { ReportContent: __WEBPACK_IMPORTED_MODULE_0__content___default.a },
  114178. data: function data() {
  114179. return {
  114180. reportid: 0,
  114181. reporttitle: '',
  114182. contentShow: false,
  114183. contentTitle: '',
  114184. contentText: ''
  114185. };
  114186. },
  114187. beforeCreate: function beforeCreate() {
  114188. var doms = document.querySelectorAll('.report-detail-window');
  114189. for (var i = 0; i < doms.length; ++i) {
  114190. if (doms[i].parentNode != null) doms[i].parentNode.removeChild(doms[i]);
  114191. }
  114192. },
  114193. mounted: function mounted() {
  114194. this.getDetail();
  114195. },
  114196. watch: {
  114197. reportid: function reportid() {
  114198. this.getDetail();
  114199. }
  114200. },
  114201. methods: {
  114202. getDetail: function getDetail() {
  114203. var _this = this;
  114204. this.contentShow = true;
  114205. this.contentTitle = this.reporttitle;
  114206. this.contentText = this.$L('详细内容加载中.....');
  114207. $A.apiAjax({
  114208. url: 'report/content?id=' + this.reportid,
  114209. error: function error() {
  114210. alert(_this.$L('网络繁忙,请稍后再试!'));
  114211. _this.contentShow = false;
  114212. },
  114213. success: function success(res) {
  114214. if (res.ret === 1) {
  114215. _this.contentText = res.data.content;
  114216. } else {
  114217. _this.contentShow = false;
  114218. _this.$Modal.error({ title: _this.$L('温馨提示'), content: res.msg });
  114219. }
  114220. }
  114221. });
  114222. }
  114223. }
  114224. });
  114225. /***/ }),
  114226. /* 285 */
  114227. /***/ (function(module, exports, __webpack_require__) {
  114228. var render = function() {
  114229. var _vm = this
  114230. var _h = _vm.$createElement
  114231. var _c = _vm._self._c || _h
  114232. return _c(
  114233. "Modal",
  114234. {
  114235. staticClass: "report-detail-window",
  114236. attrs: {
  114237. title: _vm.contentTitle,
  114238. width: "80%",
  114239. styles: { top: "35px", paddingBottom: "35px" },
  114240. footerHide: ""
  114241. },
  114242. model: {
  114243. value: _vm.contentShow,
  114244. callback: function($$v) {
  114245. _vm.contentShow = $$v
  114246. },
  114247. expression: "contentShow"
  114248. }
  114249. },
  114250. [_c("report-content", { attrs: { content: _vm.contentText } })],
  114251. 1
  114252. )
  114253. }
  114254. var staticRenderFns = []
  114255. render._withStripped = true
  114256. module.exports = { render: render, staticRenderFns: staticRenderFns }
  114257. if (false) {
  114258. module.hot.accept()
  114259. if (module.hot.data) {
  114260. require("vue-hot-reload-api") .rerender("data-v-5954d22e", module.exports)
  114261. }
  114262. }
  114263. /***/ }),
  114264. /* 286 */
  114265. /***/ (function(module, exports) {
  114266. // removed by extract-text-webpack-plugin
  114267. /***/ })
  114268. /******/ ]);